use of org.eclipse.xtext.resource.IResourceDescription.Delta in project xtext-eclipse by eclipse.
the class Bug486584Test method testFullBuildWhenClasspathChanged_2.
@Test
public void testFullBuildWhenClasspathChanged_2() throws CoreException, InterruptedException {
IJavaProject project = setupProject();
IFile libaryFile = copyAndGetXtendExampleJar(project);
IClasspathEntry libraryEntry = JavaCore.newLibraryEntry(libaryFile.getFullPath(), null, null);
addToClasspath(project, libraryEntry);
build();
assertFalse(getEvents().isEmpty());
getEvents().clear();
libaryFile.touch(null);
libaryFile.refreshLocal(IResource.DEPTH_INFINITE, null);
build();
assertEquals(1, getEvents().size());
Event singleEvent = getEvents().get(0);
ImmutableList<Delta> deltas = singleEvent.getDeltas();
assertEquals(1, deltas.size());
}
use of org.eclipse.xtext.resource.IResourceDescription.Delta in project xtext-eclipse by eclipse.
the class BuilderUtil method print.
public static String print(ImmutableList<Delta> deltas) {
int i = 1;
String buff = "Deltas : \n";
for (Delta delta : deltas) {
buff += "Delta " + i + "[" + delta.getUri() + "]: {\n";
buff += " old : " + toString(delta.getOld()) + "\n";
buff += " new : " + toString(delta.getNew()) + "\n";
buff += "}\n\n";
i++;
}
return buff;
}
use of org.eclipse.xtext.resource.IResourceDescription.Delta in project applause by applause.
the class AbstractBuildStrategy method build.
public void build(IProgressMonitor monitor) throws CoreException {
if (canBuildProject()) {
final IFolder folder = getPlatformProject().getFolder(getGeneratedSourcesFolderName());
// FIXME: maybe we should just create the folder if it's missing?!
if (!folder.exists())
return;
List<EObject> objects = new ArrayList<EObject>();
for (Delta d : context.getDeltas()) {
if (d.getNew() != null) {
for (IEObjectDescription desc : d.getNew().getExportedObjects()) {
EObject obj = context.getResourceSet().getEObject(desc.getEObjectURI(), true);
EcoreUtil2.resolveAll(context.getResourceSet());
objects.add(obj);
}
}
}
Iterable<Application> applicationObjects = Iterables.filter(objects, Application.class);
if (!Iterables.isEmpty(applicationObjects)) {
deletePreviouslyGeneratedFiles(monitor, folder);
}
for (Application app : applicationObjects) {
OutputImpl output = new OutputImpl();
Outlet outlet = createOutlet(folder);
configureOutlet(outlet);
output.addOutlet(outlet);
// IFolder rootFolder = (IFolder) getPlatformProject().getAdapter(IFolder.class);
// // IPath location = getPlatformProject().getFullPath();
// // IFolder rootFolder = ResourcesPlugin.getWorkspace().getRoot().getFolder(location);
// Outlet projectRootOutlet = createOutlet(rootFolder);
// projectRootOutlet.setName("ROOT");
// output.addOutlet(projectRootOutlet);
generate(app, output);
copyResources(app, getModelProject().getFolder("/Images"));
getPlatformProject().build(IncrementalProjectBuilder.CLEAN_BUILD, monitor);
return;
}
}
}
Aggregations