use of org.gradle.api.internal.artifacts.dsl.LazyPublishArtifact in project gradle by gradle.
the class DistributionPlugin method addArchiveTask.
private <T extends AbstractArchiveTask> void addArchiveTask(final Project project, String taskName, Class<T> type, final Distribution distribution) {
final TaskProvider<T> archiveTask = project.getTasks().register(taskName, type, task -> {
task.setDescription("Bundles the project as a distribution.");
task.setGroup(DISTRIBUTION_GROUP);
task.getArchiveBaseName().convention(distribution.getDistributionBaseName());
final CopySpec childSpec = project.copySpec();
childSpec.with(distribution.getContents());
childSpec.into((Callable<String>) () -> TextUtil.minus(task.getArchiveFileName().get(), "." + task.getArchiveExtension().get()));
task.with(childSpec);
});
PublishArtifact archiveArtifact = new LazyPublishArtifact(archiveTask, ((ProjectInternal) project).getFileResolver());
project.getExtensions().getByType(DefaultArtifactPublicationSet.class).addCandidate(archiveArtifact);
}
use of org.gradle.api.internal.artifacts.dsl.LazyPublishArtifact in project spring-boot by spring-projects.
the class JavaPluginAction method configureArtifactPublication.
@SuppressWarnings("deprecation")
private void configureArtifactPublication(TaskProvider<BootJar> bootJar) {
LazyPublishArtifact artifact = new LazyPublishArtifact(bootJar);
this.singlePublishedArtifact.addCandidate(artifact);
}
use of org.gradle.api.internal.artifacts.dsl.LazyPublishArtifact in project spring-boot by spring-projects.
the class WarPluginAction method configureArtifactPublication.
@SuppressWarnings("deprecation")
private void configureArtifactPublication(TaskProvider<BootWar> bootWar) {
LazyPublishArtifact artifact = new LazyPublishArtifact(bootWar);
this.singlePublishedArtifact.addCandidate(artifact);
}
use of org.gradle.api.internal.artifacts.dsl.LazyPublishArtifact in project gradle by gradle.
the class JavaPlugin method configureArchivesAndComponent.
private void configureArchivesAndComponent(Project project, final JavaPluginExtension pluginExtension) {
PublishArtifact jarArtifact = new LazyPublishArtifact(registerJarTaskFor(project, pluginExtension), ((ProjectInternal) project).getFileResolver());
Configuration apiElementConfiguration = project.getConfigurations().getByName(API_ELEMENTS_CONFIGURATION_NAME);
Configuration runtimeElementsConfiguration = project.getConfigurations().getByName(RUNTIME_ELEMENTS_CONFIGURATION_NAME);
project.getExtensions().getByType(DefaultArtifactPublicationSet.class).addCandidate(jarArtifact);
Provider<ProcessResources> processResources = project.getTasks().named(PROCESS_RESOURCES_TASK_NAME, ProcessResources.class);
addJar(apiElementConfiguration, jarArtifact);
addRuntimeVariants(runtimeElementsConfiguration, jarArtifact, mainSourceSetOf(pluginExtension), processResources);
registerSoftwareComponents(project);
}
Aggregations