use of org.gradle.api.file.FileCopyDetails in project spring-boot by spring-projects.
the class BootArchiveSupport method createCopyAction.
CopyAction createCopyAction(Jar jar, LayerResolver layerResolver, String layerToolsLocation) {
File output = jar.getArchiveFile().get().getAsFile();
Manifest manifest = jar.getManifest();
boolean preserveFileTimestamps = jar.isPreserveFileTimestamps();
boolean includeDefaultLoader = isUsingDefaultLoader(jar);
Spec<FileTreeElement> requiresUnpack = this.requiresUnpack.getAsSpec();
Spec<FileTreeElement> exclusions = this.exclusions.getAsExcludeSpec();
LaunchScriptConfiguration launchScript = this.launchScript;
Spec<FileCopyDetails> librarySpec = this.librarySpec;
Function<FileCopyDetails, ZipCompression> compressionResolver = this.compressionResolver;
String encoding = jar.getMetadataCharset();
CopyAction action = new BootZipCopyAction(output, manifest, preserveFileTimestamps, includeDefaultLoader, layerToolsLocation, requiresUnpack, exclusions, launchScript, librarySpec, compressionResolver, encoding, layerResolver);
return jar.isReproducibleFileOrder() ? new ReproducibleOrderingCopyAction(action) : action;
}
use of org.gradle.api.file.FileCopyDetails in project webpieces by deanhiller.
the class TemplateCompilerPlugin method createProcessResourcesTask.
private void createProcessResourcesTask(SourceSet sourceSet, SourceDirectorySet resourceSet, Project project) {
TaskProvider<Copy> copyTemplatesTask = project.getTasks().register(sourceSet.getProcessResourcesTaskName() + "Templates", Copy.class, (resourcesTask) -> {
File fromDir = new File("src/" + sourceSet.getName() + "/java");
File toDir = new File(project.getBuildDir(), "resources/" + sourceSet.getName());
resourcesTask.from(fromDir).include("**/*.html", "**/*.tag", "**/*.json");
resourcesTask.into(toDir);
resourcesTask.eachFile(new Action<FileCopyDetails>() {
@Override
public void execute(FileCopyDetails fileCopyDetails) {
log.log(LogLevel.INFO, "copying file=" + fileCopyDetails.getPath() + " from=" + fileCopyDetails.getSourcePath());
}
});
resourcesTask.setDescription("Processes " + resourceSet + ".");
});
this.project.getTasks().named(sourceSet.getProcessResourcesTaskName(), (task) -> {
task.dependsOn(new Object[] { copyTemplatesTask });
});
}
Aggregations