public boolean shouldCompile(final IProject project, final IResource source, final IResource beam) throws ErlModelException { boolean shouldCompile = beam == null; if (beam != null) { final IErlProject eprj = ErlModelManager.getErlangModel().findProject(project); if (eprj != null) { shouldCompile = shouldCompileModule(project, source, beam, shouldCompile, eprj); } } if (beam != null) { shouldCompile |= beam.getLocalTimeStamp() < source.getLocalTimeStamp(); } return shouldCompile; }
/** {@inheritDoc} */ public long getTimeStamp() { IResource resource = root.getResource(); if (resource != null && resource.exists()) { return resource.getLocalTimeStamp(); } else { return IResource.NULL_STAMP; } }
/** @since 2.9 */ protected Object getLastModified(IResource resource) throws CoreException { IPath location = resource.getLocation(); if (location != null) { return location.toFile().lastModified(); } long timestamp = resource.getLocalTimeStamp(); if (timestamp == IResource.NULL_STAMP) { return null; } return timestamp; }
private boolean shouldCompileModule( final IProject project, final IResource source, final IResource beam, boolean shouldCompile, final IErlProject eprj) throws ErlModelException { final IErlModule m = eprj.getModule(source.getName()); if (m != null) { final Collection<ErlangIncludeFile> incs = m.getIncludeFiles(); for (final ErlangIncludeFile ifile : incs) { final IResource rifile = findResourceByName(project, ifile.getFilename()); if (rifile != null && rifile.getLocalTimeStamp() > beam.getLocalTimeStamp()) { shouldCompile = true; break; } } } return shouldCompile; }
public long getTimestamp() { return resource.getLocalTimeStamp(); }