Search in sources :

Example 1 with Incubating

use of org.gradle.api.Incubating in project gradle by gradle.

the class JavaCompile method getToolChain.

/**
     * Returns the tool chain that will be used to compile the Java source.
     *
     * @return The tool chain.
     */
@Nested
@Incubating
public JavaToolChain getToolChain() {
    if (getOptions().isFork()) {
        ForkOptions forkOptions = getOptions().getForkOptions();
        File javaHome = forkOptions.getJavaHome();
        if (javaHome != null) {
            return new JavaHomeBasedJavaToolChain(javaHome, getJavaCompilerFactory(), getExecActionFactory(), getJvmVersionDetector());
        }
    }
    return new CurrentJvmJavaToolChain(getJavaCompilerFactory(), getExecActionFactory());
}
Also used : CurrentJvmJavaToolChain(org.gradle.api.internal.tasks.CurrentJvmJavaToolChain) File(java.io.File) JavaHomeBasedJavaToolChain(org.gradle.api.internal.tasks.JavaHomeBasedJavaToolChain) Nested(org.gradle.api.tasks.Nested) Incubating(org.gradle.api.Incubating)

Example 2 with Incubating

use of org.gradle.api.Incubating in project gradle by gradle.

the class DependencyInsightReportTask method getRootComponentProperty.

/**
 * The root component of the dependency graph to be inspected.
 *
 * @since 7.5
 */
@Input
@Optional
@Incubating
public Property<ResolvedComponentResult> getRootComponentProperty() {
    Configuration configuration = getConfiguration();
    if (!rootComponentProperty.isPresent() && configuration != null && getDependencySpec() != null) {
        configurationName = configuration.getName();
        configurationDescription = configuration.toString();
        configurationAttributes = configuration.getAttributes();
        ResolvableDependenciesInternal incoming = (ResolvableDependenciesInternal) configuration.getIncoming();
        ResolutionResult result = incoming.getResolutionResult(errorHandler);
        rootComponentProperty.set(result.getRootComponent());
    }
    return rootComponentProperty;
}
Also used : ResolvableDependenciesInternal(org.gradle.api.internal.artifacts.configurations.ResolvableDependenciesInternal) Configuration(org.gradle.api.artifacts.Configuration) ResolutionResult(org.gradle.api.artifacts.result.ResolutionResult) Input(org.gradle.api.tasks.Input) UserInput(org.gradle.internal.logging.text.StyledTextOutput.Style.UserInput) Optional(org.gradle.api.tasks.Optional) Incubating(org.gradle.api.Incubating)

Aggregations

Incubating (org.gradle.api.Incubating)2 File (java.io.File)1 Configuration (org.gradle.api.artifacts.Configuration)1 ResolutionResult (org.gradle.api.artifacts.result.ResolutionResult)1 ResolvableDependenciesInternal (org.gradle.api.internal.artifacts.configurations.ResolvableDependenciesInternal)1 CurrentJvmJavaToolChain (org.gradle.api.internal.tasks.CurrentJvmJavaToolChain)1 JavaHomeBasedJavaToolChain (org.gradle.api.internal.tasks.JavaHomeBasedJavaToolChain)1 Input (org.gradle.api.tasks.Input)1 Nested (org.gradle.api.tasks.Nested)1 Optional (org.gradle.api.tasks.Optional)1 UserInput (org.gradle.internal.logging.text.StyledTextOutput.Style.UserInput)1