Class JvmTarget

    • Field Detail

      • JAVA_COMPILER_EXTRA_ARGUMENTS

        protected static final java.lang.String JAVA_COMPILER_EXTRA_ARGUMENTS
        See Also:
        Constant Field Values
      • KOTLIN_COMPILER_PLUGINS

        protected static final java.lang.String KOTLIN_COMPILER_PLUGINS
        See Also:
        Constant Field Values
      • KOTLIN_COMPILER_EXTRA_ARGUMENTS

        protected static final java.lang.String KOTLIN_COMPILER_EXTRA_ARGUMENTS
        See Also:
        Constant Field Values
      • isKotlin

        protected final boolean isKotlin
    • Constructor Detail

      • JvmTarget

        public JvmTarget​(org.gradle.api.Project project,
                         java.lang.String name)
      • JvmTarget

        public JvmTarget​(org.gradle.api.Project project,
                         java.lang.String name,
                         java.lang.String aptConfigurationName,
                         java.lang.String testAptConfigurationName,
                         java.lang.String integrationTestAptConfigurationName)
    • Method Detail

      • getTestOptions

        public TestOptions getTestOptions()
        The test options
        Returns:
        The test options
      • getIntegrationTestOptions

        public TestOptions getIntegrationTestOptions()
      • getAptScopes

        public java.util.List<Scope> getAptScopes()
        Apt Scopes
      • getTestAptScopes

        public java.util.List<Scope> getTestAptScopes()
        Test Apt Scopes
      • getIntegrationTestAptScopes

        public java.util.List<Scope> getIntegrationTestAptScopes()
        Integration Test Apt Scopes
      • getApt

        public Scope getApt()
        Apt Scope Used to get the annotation processor deps of the target.
      • getTestApt

        public Scope getTestApt()
        Test Apt Scope
      • getIntegrationTestApt

        public Scope getIntegrationTestApt()
        Integration Test Apt Scope
      • getAptScopeForConfiguration

        protected Scope getAptScopeForConfiguration​(java.lang.String configurationName)
      • getAptScopeForConfiguration

        protected Scope getAptScopeForConfiguration​(org.gradle.api.artifacts.Configuration configuration)
      • getProvided

        public Scope getProvided()
        Provided Scope
      • getTestProvided

        public Scope getTestProvided()
        Test Provided Scope
      • getIntegrationTestProvided

        public Scope getIntegrationTestProvided()
        Integration Test Provided Scope
      • getApiExternalDeps

        public java.util.Set<OExternalDependency> getApiExternalDeps()
        api external deps
      • getApiTargetDeps

        public java.util.Set<Target> getApiTargetDeps()
        api target deps
      • getLint

        public Scope getLint()
        Lint Scope
      • getLintOptions

        @Nullable
        public com.android.builder.model.LintOptions getLintOptions()
      • getApPlugins

        public java.util.Set<JvmPlugin> getApPlugins()
        List of annotation processor classes. If annotation processor plugin is enabled returns the annotation processor's UID.
      • getTestApPlugins

        public java.util.Set<JvmPlugin> getTestApPlugins()
        List of test annotation processor classes. If annotation processor plugin is enabled returns the annotation processor's UID.
      • getIntegrationTestApPlugins

        public java.util.Set<JvmPlugin> getIntegrationTestApPlugins()
        List of integration test annotation processor classes. If annotation processor plugin is enabled returns the annotation processor's UID.
      • getMain

        public Scope getMain()
      • getTest

        public Scope getTest()
      • getIntegrationTest

        public Scope getIntegrationTest()
      • getSourceCompatibility

        public java.lang.String getSourceCompatibility()
      • getTargetCompatibility

        public java.lang.String getTargetCompatibility()
      • getMavenCoords

        public java.lang.String getMavenCoords()
      • hasApplication

        public boolean hasApplication()
      • getMainClass

        @Nullable
        public java.lang.String getMainClass()
      • getExcludes

        public java.util.Set<java.lang.String> getExcludes()
      • javaVersion

        public static java.lang.String javaVersion​(org.gradle.api.JavaVersion version)
      • getKotlinFriendPaths

        public java.util.Map<java.lang.String,​java.util.List<java.lang.String>> getKotlinFriendPaths​(boolean isTest)
        For Kotlin tests, a special extra friend-paths argument needs to be passed to read internal elements. See https://github.com/uber/okbuck/issues/709
        Parameters:
        isTest - is test target
        Returns:
        the list with all friend paths
      • getKotlinCompilerPlugins

        protected java.util.List<java.lang.String> getKotlinCompilerPlugins()
      • getKotlinCompilerOptions

        protected java.util.List<java.lang.String> getKotlinCompilerOptions()
      • getTargetDeps

        public java.util.Set<Target> getTargetDeps​(SourceSetType sourceSetType)
        Get implementation target deps. deps = (runtimeClasspath(api + implementation + runtimeOnly) intersection compileClasspath(api + implementation + compileOnly)) - api
        Returns:
        Target deps
      • getTargetExportedDeps

        public java.util.Set<Target> getTargetExportedDeps​(SourceSetType sourceSetType)
        Get api target deps. exportedDeps = api
        Returns:
        Target deps
      • getTargetAptDeps

        public java.util.Set<Target> getTargetAptDeps​(SourceSetType sourceSetType)
        Get apt target deps. exportedDeps = apt
        Returns:
        Target deps
      • getTargetProvidedDeps

        public java.util.Set<Target> getTargetProvidedDeps​(SourceSetType sourceSetType)
        Get compileOnly target deps. compileOnlyDeps = compileClasspath(api + implementation + compileOnly) - runtimeClasspath(api + implementation + runtimeOnly)
        Returns:
        CompileOnly Target deps
      • getExternalDeps

        public java.util.Set<OExternalDependency> getExternalDeps​(SourceSetType sourceSetType)
        Get implementation target deps. deps = (runtimeClasspath(api + implementation + runtimeOnly) intersection compileClasspath(api + implementation + compileOnly)) - api
        Returns:
        Target deps
      • getExternalExportedDeps

        public java.util.Set<OExternalDependency> getExternalExportedDeps​(SourceSetType sourceSetType)
        Get api target deps. exportedDeps = api
        Returns:
        Target deps
      • getExternalAptDeps

        public java.util.Set<OExternalDependency> getExternalAptDeps​(SourceSetType sourceSetType)
        Get apt target deps. exportedDeps = apt
        Returns:
        Target deps
      • getExternalProvidedDeps

        public java.util.Set<OExternalDependency> getExternalProvidedDeps​(SourceSetType sourceSetType)
        Get compileOnly target deps. compileOnlyDeps = compileClasspath(api + implementation + compileOnly) - runtimeClasspath(api + implementation + runtimeOnly)
        Returns:
        CompileOnly Target deps