use of org.gradle.language.jvm.tasks.ProcessResources in project gradle by gradle.
the class JavaPlugin method configureArchivesAndComponent.
private void configureArchivesAndComponent(Project project, JavaPluginConvention pluginConvention) {
Jar jar = project.getTasks().create(JAR_TASK_NAME, Jar.class);
jar.setDescription("Assembles a jar archive containing the main classes.");
jar.setGroup(BasePlugin.BUILD_GROUP);
jar.from(pluginConvention.getSourceSets().getByName(SourceSet.MAIN_SOURCE_SET_NAME).getOutput());
ArchivePublishArtifact jarArtifact = new ArchivePublishArtifact(jar);
Configuration apiElementConfiguration = project.getConfigurations().getByName(API_ELEMENTS_CONFIGURATION_NAME);
Configuration runtimeConfiguration = project.getConfigurations().getByName(RUNTIME_CONFIGURATION_NAME);
Configuration runtimeElementsConfiguration = project.getConfigurations().getByName(RUNTIME_ELEMENTS_CONFIGURATION_NAME);
project.getExtensions().getByType(DefaultArtifactPublicationSet.class).addCandidate(jarArtifact);
JavaCompile javaCompile = (JavaCompile) project.getTasks().getByPath(COMPILE_JAVA_TASK_NAME);
ProcessResources processResources = (ProcessResources) project.getTasks().getByPath(PROCESS_RESOURCES_TASK_NAME);
addJar(apiElementConfiguration, jarArtifact);
addJar(runtimeConfiguration, jarArtifact);
addRuntimeVariants(runtimeElementsConfiguration, jarArtifact, javaCompile, processResources);
project.getComponents().add(objectFactory.newInstance(JavaLibrary.class, project.getConfigurations(), jarArtifact));
project.getComponents().add(objectFactory.newInstance(JavaLibraryPlatform.class, project.getConfigurations()));
}
use of org.gradle.language.jvm.tasks.ProcessResources 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