use of org.gradle.api.file.CopySpec 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.file.CopySpec in project gradle by gradle.
the class DefaultCopySpec method with.
@Override
public CopySpec with(CopySpec... copySpecs) {
for (CopySpec copySpec : copySpecs) {
CopySpecInternal copySpecInternal;
if (copySpec instanceof CopySpecSource) {
CopySpecSource copySpecSource = (CopySpecSource) copySpec;
copySpecInternal = copySpecSource.getRootSpec();
} else {
copySpecInternal = (CopySpecInternal) copySpec;
}
addChildSpec(copySpecInternal);
}
return this;
}
use of org.gradle.api.file.CopySpec in project gradle by gradle.
the class War method webInf.
/**
* Adds some content to the {@code WEB-INF} directory for this WAR archive.
*
* <p>The given action is executed to configure a {@link CopySpec}.
*
* @param configureAction The action to execute
* @return The newly created {@code CopySpec}.
* @since 3.5
*/
public CopySpec webInf(Action<? super CopySpec> configureAction) {
CopySpec webInf = getWebInf();
configureAction.execute(webInf);
return webInf;
}
use of org.gradle.api.file.CopySpec in project gradle by gradle.
the class JavaGradlePluginPlugin method configureDescriptorGeneration.
private void configureDescriptorGeneration(final Project project, final GradlePluginDevelopmentExtension extension) {
final GeneratePluginDescriptors generatePluginDescriptors = project.getTasks().create(GENERATE_PLUGIN_DESCRIPTORS_TASK_NAME, GeneratePluginDescriptors.class);
generatePluginDescriptors.setGroup(PLUGIN_DEVELOPMENT_GROUP);
generatePluginDescriptors.setDescription(GENERATE_PLUGIN_DESCRIPTORS_TASK_DESCRIPTION);
generatePluginDescriptors.conventionMapping("declarations", new Callable<List<PluginDeclaration>>() {
@Override
public List<PluginDeclaration> call() {
return Lists.newArrayList(extension.getPlugins());
}
});
generatePluginDescriptors.conventionMapping("outputDirectory", new Callable<File>() {
@Override
public File call() {
return new File(project.getBuildDir(), generatePluginDescriptors.getName());
}
});
Copy processResources = (Copy) project.getTasks().getByName(PROCESS_RESOURCES_TASK);
CopySpec copyPluginDescriptors = processResources.getRootSpec().addChild();
copyPluginDescriptors.into("META-INF/gradle-plugins");
copyPluginDescriptors.from(new Callable<File>() {
@Override
public File call() {
return generatePluginDescriptors.getOutputDirectory();
}
});
processResources.dependsOn(generatePluginDescriptors);
}
use of org.gradle.api.file.CopySpec in project gradle by gradle.
the class Jar method metaInf.
/**
* Adds content to this JAR archive's META-INF directory.
*
* <p>The given action is executed to configure a {@code CopySpec}.</p>
*
* @param configureAction The action.
* @return The created {@code CopySpec}
* @since 3.5
*/
public CopySpec metaInf(Action<? super CopySpec> configureAction) {
CopySpec metaInf = getMetaInf();
configureAction.execute(metaInf);
return metaInf;
}
Aggregations