Search in sources :

Example 1 with DefaultJavaPluginExtension

use of org.gradle.api.plugins.internal.DefaultJavaPluginExtension in project gradle by gradle.

the class JavaBasePlugin method addExtensions.

private DefaultJavaPluginExtension addExtensions(final ProjectInternal project) {
    DefaultToolchainSpec toolchainSpec = project.getObjects().newInstance(DefaultToolchainSpec.class);
    SourceSetContainer sourceSets = (SourceSetContainer) project.getExtensions().getByName("sourceSets");
    DefaultJavaPluginExtension javaPluginExtension = (DefaultJavaPluginExtension) project.getExtensions().create(JavaPluginExtension.class, "java", DefaultJavaPluginExtension.class, project, sourceSets, toolchainSpec, jvmPluginServices);
    project.getConvention().getPlugins().put("java", new DefaultJavaPluginConvention(project, javaPluginExtension));
    project.getExtensions().create(JavaToolchainService.class, "javaToolchains", DefaultJavaToolchainService.class, getJavaToolchainQueryService());
    return javaPluginExtension;
}
Also used : DefaultToolchainSpec(org.gradle.jvm.toolchain.internal.DefaultToolchainSpec) DefaultJavaPluginConvention(org.gradle.api.plugins.internal.DefaultJavaPluginConvention) DefaultJavaPluginExtension(org.gradle.api.plugins.internal.DefaultJavaPluginExtension) DefaultJavaPluginExtension(org.gradle.api.plugins.internal.DefaultJavaPluginExtension) SourceSetContainer(org.gradle.api.tasks.SourceSetContainer)

Example 2 with DefaultJavaPluginExtension

use of org.gradle.api.plugins.internal.DefaultJavaPluginExtension in project gradle by gradle.

the class JavaBasePlugin method apply.

@Override
public void apply(final Project project) {
    ProjectInternal projectInternal = (ProjectInternal) project;
    project.getPluginManager().apply(BasePlugin.class);
    project.getPluginManager().apply(JvmEcosystemPlugin.class);
    project.getPluginManager().apply(ReportingBasePlugin.class);
    DefaultJavaPluginExtension javaPluginExtension = addExtensions(projectInternal);
    configureSourceSetDefaults(project, javaPluginExtension);
    configureCompileDefaults(project, javaPluginExtension);
    configureJavaDoc(project, javaPluginExtension);
    configureTest(project, javaPluginExtension);
    configureBuildNeeded(project);
    configureBuildDependents(project);
}
Also used : ProjectInternal(org.gradle.api.internal.project.ProjectInternal) DefaultJavaPluginExtension(org.gradle.api.plugins.internal.DefaultJavaPluginExtension)

Aggregations

DefaultJavaPluginExtension (org.gradle.api.plugins.internal.DefaultJavaPluginExtension)2 ProjectInternal (org.gradle.api.internal.project.ProjectInternal)1 DefaultJavaPluginConvention (org.gradle.api.plugins.internal.DefaultJavaPluginConvention)1 SourceSetContainer (org.gradle.api.tasks.SourceSetContainer)1 DefaultToolchainSpec (org.gradle.jvm.toolchain.internal.DefaultToolchainSpec)1