use of org.eclipse.xtext.builder.impl.QueuedBuildData in project xtext-xtend by eclipse.
the class AbstractQueuedBuildDataTest method setUp.
@Override
public void setUp() throws Exception {
super.setUp();
JdtQueuedBuildData _jdtQueuedBuildData = new JdtQueuedBuildData();
this.queuedBuildDataContribution = _jdtQueuedBuildData;
QueuedBuildData _queuedBuildData = new QueuedBuildData(this.mapper, this.queuedBuildDataContribution);
this.queuedBuildData = _queuedBuildData;
JavaChangeQueueFiller _javaChangeQueueFiller = new JavaChangeQueueFiller(this.queuedBuildData, this.converter);
this.queueFiller = _javaChangeQueueFiller;
JavaCore.addElementChangedListener(this.queueFiller, ElementChangedEvent.POST_CHANGE);
}
use of org.eclipse.xtext.builder.impl.QueuedBuildData in project dsl-devkit by dsldevkit.
the class RebuildingXtextBuilder method doBuild.
/**
* Like the super implementation, except the build is not triggered if
* both toBeDeleted and toBeUpdated are empty. {@inheritDoc}
*/
@SuppressWarnings("nls")
@Override
protected void doBuild(final ToBeBuilt toBeBuilt, final IProgressMonitor monitor, final BuildType type) throws CoreException {
if (toBeBuilt.getToBeDeleted().size() != 0 || toBeBuilt.getToBeUpdated().size() != 0) {
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("Starting " + type.name() + " build:" + "\ndeleted(" + toBeBuilt.getToBeDeleted().size() + ")=" + toBeBuilt.getToBeDeleted().toString() + "\nupdated(" + toBeBuilt.getToBeUpdated().size() + ")=" + toBeBuilt.getToBeUpdated().toString());
}
// build + participant + rebuild
SubMonitor progress = SubMonitor.convert(monitor, 1 + 1 + 1);
ResourceSet resourceSet = getResourceSetProvider().get(getProject());
resourceSet.getLoadOptions().put(ResourceDescriptionsProvider.NAMED_BUILDER_SCOPE, Boolean.TRUE);
if (resourceSet instanceof ResourceSetImpl) {
((ResourceSetImpl) resourceSet).setURIResourceMap(Maps.<URI, Resource>newHashMap());
}
BuildData buildData = new BuildData(getProject().getName(), resourceSet, toBeBuilt, queuedBuildData);
ImmutableList<Delta> deltas = builderState.update(buildData, progress.newChild(1));
if (participant != null) {
final BuildContext buildContext = new BuildContext(this, resourceSet, deltas, type);
// remember the current workspace tree
final ElementTree oldTree = ((Workspace) ResourcesPlugin.getWorkspace()).getElementTree();
oldTree.immutable();
participant.build(buildContext, progress.newChild(1));
if (buildContext.isRebuildRequired() && rebuilds++ <= 2) {
final ElementTree newTree = ((Workspace) ResourcesPlugin.getWorkspace()).getElementTree();
newTree.immutable();
final ResourceDelta generatedDelta = ResourceDeltaFactory.computeDelta((Workspace) ResourcesPlugin.getWorkspace(), oldTree, newTree, getProject().getFullPath(), -1);
// rebuild the generated delta
ResourcesPlugin.getWorkspace().checkpoint(false);
incrementalBuild(generatedDelta, progress.newChild(1));
}
} else {
progress.worked(2);
}
resourceSet.getResources().clear();
resourceSet.eAdapters().clear();
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("Build done.");
}
} else if (LOGGER.isDebugEnabled()) {
LOGGER.debug("Ignoring empty " + type.name() + " build.");
}
}
use of org.eclipse.xtext.builder.impl.QueuedBuildData in project xtext-eclipse by eclipse.
the class Bug349445Test method testUpdate.
@Test
public void testUpdate() {
testMe.update(new BuildData(null, null, new ToBeBuilt(), new QueuedBuildData(null)), null);
assertEquals(1, loadCalled);
}
Aggregations