/** * Tells which source files should be reprocessed based on the * last modification date of target files. * @param logTo where to send (more or less) interesting output. * @param source array of resources bearing relative path and last * modification date. * @param mapper filename mapper indicating how to find the target * files. * @param targets object able to map as a resource a relative path * at <b>destination</b>. * @return array containing the source files which need to be * copied or processed, because the targets are out of date or do * not exist. */ public static Resource[] selectOutOfDateSources(final ProjectComponent logTo, final Resource[] source, final FileNameMapper mapper, final ResourceFactory targets) { return selectOutOfDateSources(logTo, source, mapper, targets, FILE_UTILS.getFileTimestampGranularity()); }
.of(ResourceUtils.selectOutOfDateSources(task, sourceResources, mapper, this, granularity)) .map(Resource::getName).toArray(String[]::new);
toCopy = ResourceUtils.selectOutOfDateSources(this, fromResources, mapper, name -> new FileResource(toDir, name), granularity);
private Resource[] selectOutOfDateResources(final Resource[] initial, final FileNameMapper mapper) { final Resource[] rs = selectFileResources(initial); Resource[] result = ResourceUtils.selectOutOfDateSources(this, rs, mapper, getZipScanner(), ZIP_FILE_TIMESTAMP_GRANULARITY); if (!doFilesonly) { final Union u = new Union(); u.addAll(Arrays.asList(selectDirectoryResources(initial))); final ResourceCollection rc = ResourceUtils.selectSources(this, u, mapper, getZipScanner(), MISSING_DIR_PROVIDER); if (!rc.isEmpty()) { final List<Resource> newer = new ArrayList<>(); newer.addAll(Arrays.asList(((Union) rc).listResources())); newer.addAll(Arrays.asList(result)); result = newer.toArray(result); } } return result; }
/** * Tells which source files should be reprocessed based on the * last modification date of target files. * @param logTo where to send (more or less) interesting output. * @param source array of resources bearing relative path and last * modification date. * @param mapper filename mapper indicating how to find the target * files. * @param targets object able to map as a resource a relative path * at <b>destination</b>. * @param granularity The number of milliseconds leeway to give * before deciding a target is out of date. * @return array containing the source files which need to be * copied or processed, because the targets are out of date or do * not exist. * @since Ant 1.6.2 */ public static Resource[] selectOutOfDateSources(final ProjectComponent logTo, final Resource[] source, final FileNameMapper mapper, final ResourceFactory targets, final long granularity) { final Union u = new Union(); u.addAll(Arrays.asList(source)); final ResourceCollection rc = selectOutOfDateSources(logTo, u, mapper, targets, granularity); return rc.size() == 0 ? new Resource[0] : ((Union) rc).listResources(); }
Resource[] r = sourceResources.listResources(); if (r.length > 0) { upToDate = ResourceUtils.selectOutOfDateSources( this, r, getMapper(), getProject()).length == 0;
.selectOutOfDateSources(this, srcResources, new IdentityMapper(), existingEntries