use of org.gradle.api.plugins.JavaPlugin in project spring-boot-data-geode by spring-projects.
the class MavenPublishConventionsPlugin method customizeJavaPlugin.
private void customizeJavaPlugin(Project 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.JavaPlugin in project spring-session by spring-projects.
the class ManagementConfigurationPlugin method apply.
@Override
public void apply(Project project) {
ConfigurationContainer configurations = project.getConfigurations();
configurations.create(MANAGEMENT_CONFIGURATION_NAME, (management) -> {
management.setVisible(false);
management.setCanBeConsumed(false);
management.setCanBeResolved(false);
PluginContainer plugins = project.getPlugins();
plugins.withType(JavaPlugin.class, (javaPlugin) -> {
configurations.getByName(JavaPlugin.COMPILE_CLASSPATH_CONFIGURATION_NAME).extendsFrom(management);
configurations.getByName(JavaPlugin.RUNTIME_CLASSPATH_CONFIGURATION_NAME).extendsFrom(management);
configurations.getByName(JavaPlugin.TEST_COMPILE_CLASSPATH_CONFIGURATION_NAME).extendsFrom(management);
configurations.getByName(JavaPlugin.TEST_RUNTIME_CLASSPATH_CONFIGURATION_NAME).extendsFrom(management);
});
plugins.withType(JavaTestFixturesPlugin.class, (javaTestFixturesPlugin) -> {
configurations.getByName("testFixturesCompileClasspath").extendsFrom(management);
configurations.getByName("testFixturesRuntimeClasspath").extendsFrom(management);
});
plugins.withType(MavenPublishPlugin.class, (mavenPublish) -> {
PublishingExtension publishing = project.getExtensions().getByType(PublishingExtension.class);
publishing.getPublications().withType(MavenPublication.class, (mavenPublication -> {
mavenPublication.versionMapping((versions) -> versions.allVariants(versionMapping -> versionMapping.fromResolutionResult()));
}));
});
plugins.withType(PropDepsPlugin.class, (propDepsPlugin -> {
configurations.getByName("optional").extendsFrom(management);
configurations.getByName("provided").extendsFrom(management);
}));
});
}
use of org.gradle.api.plugins.JavaPlugin in project native-build-tools by graalvm.
the class NativeImagePlugin method apply.
@Override
public void apply(Project project) {
Provider<NativeImageService> nativeImageServiceProvider = NativeImageService.registerOn(project);
logger = GraalVMLogger.of(project.getLogger());
DefaultGraalVmExtension graalExtension = (DefaultGraalVmExtension) registerGraalVMExtension(project);
graalExtension.getUseArgFile().convention(true);
project.getPlugins().withType(JavaPlugin.class, javaPlugin -> configureJavaProject(project, nativeImageServiceProvider, graalExtension));
project.afterEvaluate(p -> {
Map<String, Provider<Boolean>> agents = graalExtension.getAgentProperties();
graalExtension.getBinaries().all(options -> {
AgentConfiguration agentConfiguration = options.getAgent();
if (agentConfiguration.getInstrumentedTask().isPresent()) {
configureAgent(p, agents, graalExtension.getToolchainDetection().map(b -> !b), options, getExecOperations(), getFileOperations());
}
});
});
}
use of org.gradle.api.plugins.JavaPlugin in project spring-security by spring-projects.
the class ManagementConfigurationPlugin method apply.
@Override
public void apply(Project project) {
ConfigurationContainer configurations = project.getConfigurations();
configurations.create(MANAGEMENT_CONFIGURATION_NAME, (management) -> {
management.setVisible(false);
management.setCanBeConsumed(false);
management.setCanBeResolved(false);
PluginContainer plugins = project.getPlugins();
plugins.withType(JavaPlugin.class, (javaPlugin) -> {
configurations.getByName(JavaPlugin.COMPILE_CLASSPATH_CONFIGURATION_NAME).extendsFrom(management);
configurations.getByName(JavaPlugin.RUNTIME_CLASSPATH_CONFIGURATION_NAME).extendsFrom(management);
configurations.getByName(JavaPlugin.TEST_COMPILE_CLASSPATH_CONFIGURATION_NAME).extendsFrom(management);
configurations.getByName(JavaPlugin.TEST_RUNTIME_CLASSPATH_CONFIGURATION_NAME).extendsFrom(management);
});
plugins.withType(JavaTestFixturesPlugin.class, (javaTestFixturesPlugin) -> {
configurations.getByName("testFixturesCompileClasspath").extendsFrom(management);
configurations.getByName("testFixturesRuntimeClasspath").extendsFrom(management);
});
plugins.withType(MavenPublishPlugin.class, (mavenPublish) -> {
PublishingExtension publishing = project.getExtensions().getByType(PublishingExtension.class);
publishing.getPublications().withType(MavenPublication.class, (mavenPublication -> {
mavenPublication.versionMapping((versions) -> versions.allVariants(versionMapping -> versionMapping.fromResolutionResult()));
}));
});
plugins.withType(PropDepsPlugin.class, (propDepsPlugin -> {
configurations.getByName("optional").extendsFrom(management);
configurations.getByName("provided").extendsFrom(management);
}));
});
}
use of org.gradle.api.plugins.JavaPlugin in project spring-security by spring-projects.
the class MavenPublishingConventionsPlugin method customizeJavaPlugin.
private void customizeJavaPlugin(Project project) {
project.getPlugins().withType(JavaPlugin.class).all((javaPlugin) -> {
JavaPluginExtension extension = project.getExtensions().getByType(JavaPluginExtension.class);
extension.withJavadocJar();
extension.withSourcesJar();
});
}
Aggregations