Class JavaPluginConvention

    • Constructor Detail

      • JavaPluginConvention

        public JavaPluginConvention()
    • Method Detail

      • sourceSets

        public abstract Object sourceSets​(Closure closure)
        Configures the source sets of this project.

        The given closure is executed to configure the SourceSetContainer. The SourceSetContainer is passed to the closure as its delegate.

        See the example below how SourceSet 'main' is accessed and how the SourceDirectorySet 'java' is configured to exclude some package from compilation.

         apply plugin: 'java'
        
         sourceSets {
           main {
             java {
               exclude 'some/unwanted/package/**'
             }
           }
         }
         
        Parameters:
        closure - The closure to execute.
        Returns:
        NamedDomainObjectContainer<org.gradle.api.tasks.SourceSet>
      • getDocsDir

        public abstract File getDocsDir()
        Returns a file pointing to the root directory supposed to be used for all docs.
      • getTestResultsDir

        public abstract File getTestResultsDir()
        Returns a file pointing to the root directory of the test results.
      • getTestReportDir

        public abstract File getTestReportDir()
        Returns a file pointing to the root directory to be used for reports.
      • getSourceCompatibility

        public abstract JavaVersion getSourceCompatibility()
        Returns the source compatibility used for compiling Java sources.
      • setSourceCompatibility

        public abstract void setSourceCompatibility​(Object value)
        Sets the source compatibility used for compiling Java sources.
        Parameters:
        value - The value for the source compatibility as defined by JavaVersion.toVersion(Object)
      • setSourceCompatibility

        public abstract void setSourceCompatibility​(JavaVersion value)
        Sets the source compatibility used for compiling Java sources.
        Parameters:
        value - The value for the source compatibility
      • getTargetCompatibility

        public abstract JavaVersion getTargetCompatibility()
        Returns the target compatibility used for compiling Java sources.
      • setTargetCompatibility

        public abstract void setTargetCompatibility​(Object value)
        Sets the target compatibility used for compiling Java sources.
        Parameters:
        value - The value for the target compatibility as defined by JavaVersion.toVersion(Object)
      • setTargetCompatibility

        public abstract void setTargetCompatibility​(JavaVersion value)
        Sets the target compatibility used for compiling Java sources.
        Parameters:
        value - The value for the target compatibility
      • manifest

        public abstract Manifest manifest()
        Creates a new instance of a Manifest.
      • manifest

        public abstract Manifest manifest​(Closure closure)
        Creates and configures a new instance of a Manifest. The given closure configures the new manifest instance before it is returned.
        Parameters:
        closure - The closure to use to configure the manifest.
      • manifest

        public abstract Manifest manifest​(Action<? super Manifest> action)
        Creates and configures a new instance of a Manifest.
        Parameters:
        action - The action to use to configure the manifest.
        Since:
        3.5
      • getDocsDirName

        public abstract String getDocsDirName()
        The name of the docs directory. Can be a name or a path relative to the build dir.
      • setDocsDirName

        public abstract void setDocsDirName​(String docsDirName)
      • getTestResultsDirName

        public abstract String getTestResultsDirName()
        The name of the test results directory. Can be a name or a path relative to the build dir.
      • setTestResultsDirName

        public abstract void setTestResultsDirName​(String testResultsDirName)
      • setTestReportDirName

        public abstract void setTestReportDirName​(String testReportDirName)
      • getSourceSets

        public abstract SourceSetContainer getSourceSets()
        The source sets container.
      • getProject

        public abstract org.gradle.api.internal.project.ProjectInternal getProject()