public File file(Object path, PathValidation validation) { return fileResolver.resolve(path, validation); }
public File file(Object path) { return fileResolver.resolve(path); }
@Override protected RegularFile map(File file) { return new FixedFile(projectDir.fileResolver.resolve(file)); } };
@Override public RegularFile file(String path) { return new FixedFile(fileResolver.resolve(path)); }
public File mkdir(Object path) { File dir = fileResolver.resolve(path); if (dir.isFile()) { throw new InvalidUserDataException(String.format("Can't create directory. The path=%s points to an existing file.", path)); } GFileUtils.mkdirs(dir); return dir; }
@Override protected TaskOutputFilePropertySpec computeNext() { if (iterator.hasNext()) { Map.Entry<?, ?> entry = iterator.next(); Object key = entry.getKey(); if (key == null) { throw new IllegalArgumentException(String.format("Mapped output property '%s' has null key", getPropertyName())); } String id = key.toString(); File file = resolver.resolve(entry.getValue()); return new CacheableTaskOutputCompositeFilePropertyElementSpec(CompositeTaskOutputPropertySpec.this, "." + id, file); } return endOfData(); } };
@Override public Directory dir(String path) { File newDir = fileResolver.resolve(path); return new FixedDirectory(newDir, fileResolver.newResolver(newDir)); }
@Override public File getOutputFile() { Object unpackedOutput = DeferredUtil.unpack(path); if (unpackedOutput == null && isOptional()) { return null; } return resolver.resolve(path); }
@Override public void includeBuild(Object rootProject, Action<ConfigurableIncludedBuild> configuration) { File projectDir = getFileResolver().resolve(rootProject); ConfigurableIncludedBuild build = includedBuilds.get(projectDir); if (build == null) { build = getIncludedBuildFactory().createBuild(projectDir); includedBuilds.put(projectDir, build); } configuration.execute(build); }
@Override public void set(File dir) { File resolved = resolver.resolve(dir); set(new FixedDirectory(resolved, resolver.newResolver(resolved))); }