use of org.gradle.api.internal.file.FileOperations in project gradle by gradle.
the class AntGroovydoc method execute.
public void execute(final FileCollection source, File destDir, boolean use, boolean noTimestamp, boolean noVersionStamp, String windowTitle, String docTitle, String header, String footer, String overview, boolean includePrivate, final Set<Groovydoc.Link> links, final Iterable<File> groovyClasspath, Iterable<File> classpath, Project project) {
final File tmpDir = new File(project.getBuildDir(), "tmp/groovydoc");
FileOperations fileOperations = (ProjectInternal) project;
fileOperations.delete(tmpDir);
fileOperations.copy(new Action<CopySpec>() {
public void execute(CopySpec copySpec) {
copySpec.from(source).into(tmpDir);
}
});
List<File> combinedClasspath = ImmutableList.<File>builder().addAll(classpath).addAll(groovyClasspath).build();
VersionNumber version = VersionNumber.parse(getGroovyVersion(combinedClasspath));
final Map<String, Object> args = Maps.newLinkedHashMap();
args.put("sourcepath", tmpDir.toString());
args.put("destdir", destDir);
args.put("use", use);
if (isAtLeast(version, "2.4.6")) {
args.put("noTimestamp", noTimestamp);
args.put("noVersionStamp", noVersionStamp);
}
args.put("private", includePrivate);
putIfNotNull(args, "windowtitle", windowTitle);
putIfNotNull(args, "doctitle", docTitle);
putIfNotNull(args, "header", header);
putIfNotNull(args, "footer", footer);
if (overview != null) {
args.put("overview", overview);
}
invokeGroovydoc(links, combinedClasspath, args);
}
use of org.gradle.api.internal.file.FileOperations in project gradle by gradle.
the class PlayDistributionPlugin method createDistributions.
@Defaults
void createDistributions(@Path("distributions") PlayDistributionContainer distributions, @Path("binaries") ModelMap<PlayApplicationBinarySpecInternal> playBinaries, PlayPluginConfigurations configurations, ServiceRegistry serviceRegistry) {
FileOperations fileOperations = serviceRegistry.get(FileOperations.class);
Instantiator instantiator = serviceRegistry.get(Instantiator.class);
for (PlayApplicationBinarySpecInternal binary : playBinaries) {
PlayDistribution distribution = instantiator.newInstance(DefaultPlayDistribution.class, binary.getProjectScopedName(), fileOperations.copySpec(), binary);
distribution.setBaseName(binary.getProjectScopedName());
distributions.add(distribution);
}
}
Aggregations