Class GradleBuild

  • All Implemented Interfaces:
    java.lang.Comparable<Task>, org.gradle.api.internal.DynamicObjectAware, org.gradle.api.internal.IConventionAware, org.gradle.api.internal.TaskInternal, Named, ExtensionAware, Task, Configurable<Task>

    @DisableCachingByDefault(because="Child Gradle build will do its own caching")
    public abstract class GradleBuild
    extends org.gradle.api.internal.ConventionTask
    Executes a Gradle build.
    • Constructor Detail

      • GradleBuild

        public GradleBuild()
    • Method Detail

      • getStartParameter

        @Internal
        public StartParameter getStartParameter()
        Returns the full set of parameters that will be used to execute the build.
        Returns:
        the parameters. Never returns null.
      • setStartParameter

        public void setStartParameter​(StartParameter startParameter)
        Sets the full set of parameters that will be used to execute the build.
        Parameters:
        startParameter - the parameters. Should not be null.
      • getDir

        @Internal
        public java.io.File getDir()
        Returns the project directory for the build. Defaults to the project directory.
        Returns:
        The project directory. Never returns null.
      • setDir

        public void setDir​(java.io.File dir)
        Sets the project directory for the build.
        Parameters:
        dir - The project directory. Should not be null.
        Since:
        4.0
      • setDir

        public void setDir​(java.lang.Object dir)
        Sets the project directory for the build.
        Parameters:
        dir - The project directory. Should not be null.
      • getBuildFile

        @Nullable
        @Optional
        @PathSensitive(NAME_ONLY)
        @InputFile
        @Deprecated
        public java.io.File getBuildFile()
        Deprecated.
        Use getDir() instead to get the root of the nested build. This method will be removed in Gradle 9.0.
        Returns the build file that should be used for this build. Defaults to "build.gradle" in the project directory.
        Returns:
        The build file. May be null.
      • setBuildFile

        @Deprecated
        public void setBuildFile​(@Nullable
                                 java.io.File file)
        Deprecated.
        Use setDir(File) instead to set the root of the nested build. This method will be removed in Gradle 9.0.
        Sets the build file that should be used for this build.
        Parameters:
        file - The build file. May be null to use the default build file for the build.
        Since:
        4.0
      • setBuildFile

        @Deprecated
        public void setBuildFile​(@Nullable
                                 java.lang.Object file)
        Deprecated.
        Use setDir(Object) instead to set the root of the nested build. This method will be removed in Gradle 9.0.
        Sets the build file that should be used for this build.
        Parameters:
        file - The build file. May be null to use the default build file for the build.
      • getTasks

        @Input
        public java.util.List<java.lang.String> getTasks()
        Returns the tasks that should be executed for this build.
        Returns:
        The sequence. May be empty. Never returns null.
      • setTasks

        public void setTasks​(java.util.List<java.lang.String> tasks)
        Sets the tasks that should be executed for this build.
        Parameters:
        tasks - The task names. May be empty or null to use the default tasks for the build.
        Since:
        4.0
      • setTasks

        public void setTasks​(java.util.Collection<java.lang.String> tasks)
        Sets the tasks that should be executed for this build.
        Parameters:
        tasks - The task names. May be empty or null to use the default tasks for the build.
      • getBuildName

        @Internal
        public java.lang.String getBuildName()
        The build name to use for the nested build.

        If no value is specified, the name of the directory of the build will be used.

        Returns:
        the build name to use for the nested build (or null if the default is to be used)
        Since:
        6.0
      • setBuildName

        public void setBuildName​(java.lang.String buildName)
        Sets build name to use for the nested build.
        Parameters:
        buildName - the build name to use for the nested build
        Since:
        6.0