use of org.gradle.api.plugins.JavaPluginExtension in project coffeenet-starter by coffeenet.
the class ConventionsPlugin method applyMavenConventions.
private void applyMavenConventions(Project project) {
// J-
// @formatter:off
project.getPlugins().withType(MavenPublishPlugin.class, (mavenPublish) -> {
PublishingExtension publishing = project.getExtensions().getByType(PublishingExtension.class);
publishing.getPublications().withType(MavenPublication.class).all((publication) -> {
customizePom(publication.getPom(), project);
});
});
project.getPlugins().withType(JavaPlugin.class).all((javaPlugin) -> {
JavaPluginExtension extension = project.getExtensions().getByType(JavaPluginExtension.class);
extension.withJavadocJar();
extension.withSourcesJar();
});
// @formatter:on
// J+
}
use of org.gradle.api.plugins.JavaPluginExtension in project spring-boot by spring-projects.
the class MavenPublishingConventions method apply.
void apply(Project project) {
project.getPlugins().withType(MavenPublishPlugin.class).all((mavenPublish) -> {
PublishingExtension publishing = project.getExtensions().getByType(PublishingExtension.class);
if (project.hasProperty("deploymentRepository")) {
publishing.getRepositories().maven((mavenRepository) -> {
mavenRepository.setUrl(project.property("deploymentRepository"));
mavenRepository.setName("deployment");
});
}
publishing.getPublications().withType(MavenPublication.class).all((mavenPublication) -> customizeMavenPublication(mavenPublication, project));
project.getPlugins().withType(JavaPlugin.class).all((javaPlugin) -> {
JavaPluginExtension extension = project.getExtensions().getByType(JavaPluginExtension.class);
extension.withJavadocJar();
extension.withSourcesJar();
});
});
}
use of org.gradle.api.plugins.JavaPluginExtension in project gradle by gradle.
the class JavaGradlePluginPlugin method createExtension.
private GradlePluginDevelopmentExtension createExtension(Project project) {
JavaPluginExtension javaPluginExtension = project.getExtensions().getByType(JavaPluginExtension.class);
SourceSet defaultPluginSourceSet = javaPluginExtension.getSourceSets().getByName(SourceSet.MAIN_SOURCE_SET_NAME);
SourceSet defaultTestSourceSet = javaPluginExtension.getSourceSets().getByName(SourceSet.TEST_SOURCE_SET_NAME);
return project.getExtensions().create(EXTENSION_NAME, GradlePluginDevelopmentExtension.class, project, defaultPluginSourceSet, defaultTestSourceSet);
}
use of org.gradle.api.plugins.JavaPluginExtension in project gradle by gradle.
the class ScalaBasePlugin method getToolchainTool.
private <T> Provider<T> getToolchainTool(Project project, BiFunction<JavaToolchainService, JavaToolchainSpec, Provider<T>> toolMapper) {
final JavaPluginExtension extension = extensionOf(project, JavaPluginExtension.class);
final JavaToolchainService service = extensionOf(project, JavaToolchainService.class);
return toolMapper.apply(service, extension.getToolchain());
}
use of org.gradle.api.plugins.JavaPluginExtension in project gradle by gradle.
the class EarPlugin method wireEarTaskConventionsWithJavaPluginApplied.
private void wireEarTaskConventionsWithJavaPluginApplied(final Project project, PluginContainer plugins) {
plugins.withType(JavaPlugin.class, javaPlugin -> {
final JavaPluginExtension javaPluginExtension = project.getExtensions().findByType(JavaPluginExtension.class);
project.getTasks().withType(Ear.class).configureEach(task -> {
task.dependsOn((Callable<FileCollection>) () -> mainSourceSetOf(javaPluginExtension).getRuntimeClasspath());
task.from((Callable<FileCollection>) () -> mainSourceSetOf(javaPluginExtension).getOutput());
});
});
}
Aggregations