Package: org.gradle.api.plugins.buildcomparison.gradle

## [Java] Class CompareGradleBuilds

- org.gradle.api.plugins.buildcomparison.gradle.CompareGradleBuilds

- All Implemented Interfaces and Traits:
    VerificationTask

      @Incubating
      public class CompareGradleBuilds
      extends DefaultTask

  Executes two Gradle builds (that can be the same build) with specified versions and compares the outcomes. Please see the “Comparing Builds” chapter of the Gradle User Guide for more information.

- - ### Field Summary

    Fields
    Modifiers | Name | Description
    --- | --- | ---
    `static List<String>` | `DEFAULT_TASKS` |

  - Inherited fields
    Fields inherited from class | Fields
    --- | ---
    `class DefaultTask` | `TASK_NAME, TASK_DESCRIPTION, TASK_GROUP, TASK_TYPE, TASK_DEPENDS_ON, TASK_OVERWRITE, TASK_ACTION`
    `class org.gradle.api.internal.AbstractTask` | `TASK_NAME, TASK_DESCRIPTION, TASK_GROUP, TASK_TYPE, TASK_DEPENDS_ON, TASK_OVERWRITE, TASK_ACTION`

  - ### Constructor Summary

    Constructors
    Constructor and description
    `CompareGradleBuilds ()`

  - ### Methods Summary

    Methods
    Type | Name and description
    --- | ---
    `protected org.gradle.internal.file.PathToFileResolver` | `getFileResolver()`
    `boolean` | `getIgnoreFailures()` Whether a comparison between non identical builds will fail the task execution.
    `protected org.gradle.internal.reflect.Instantiator` | `getInstantiator()`
    `protected org.gradle.logging.ProgressLoggerFactory` | `getProgressLoggerFactory()`
    `File` | `getReportDir()` The directory that will contain the HTML comparison report and any other report files.
    `GradleBuildInvocationSpec` | `getSourceBuild()` The specification of how to invoke the source build.
    `GradleBuildInvocationSpec` | `getTargetBuild()` The specification of how to invoke the target build.
    `void` | `setIgnoreFailures(boolean ignoreFailures)` Sets whether a comparison between non identical builds will fail the task execution.
    `void` | `setReportDir(Object reportDir)` Sets the directory that will contain the HTML comparison report and any other report files.
    `void` | `sourceBuild(Action<GradleBuildInvocationSpec> config)` Configures the source build.
    `void` | `targetBuild(Action<GradleBuildInvocationSpec> config)` Configures the target build.

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class DefaultTask` | `setProperty, toString, compareTo, compareTo, getName, getActions, setName, getState, getState, getPath, getExtensions, getLogger, execute, configure, configure, getDescription, leftShift, property, isEnabled, setEnabled, getOutputs, getOutputs, hasProperty, getConvention, setDescription, getGroup, setGroup, dependsOnTaskDidWork, getInputs, getTemporaryDir, mustRunAfter, setMustRunAfter, getMustRunAfter, finalizedBy, setFinalizedBy, getFinalizedBy, shouldRunAfter, setShouldRunAfter, getShouldRunAfter, getTaskDependencies, getTaskDependencies, getDependsOn, setDependsOn, dependsOn, onlyIf, onlyIf, setOnlyIf, setOnlyIf, setDidWork, getDidWork, doFirst, doFirst, doLast, doLast, deleteAllActions, getEnabled, getAnt, getLogging, getLogging, getProject, setActions, getStandardOutputCapture, getAsDynamicObject, setProject, prependParallelSafeAction, injectIntoNewInstance, getTaskActions, getOnlyIf, getImpliesSubProjects, setImpliesSubProjects, getExecuter, setExecuter, getTemporaryDirFactory, addValidator, getValidators, appendParallelSafeAction, isHasCustomActions, wait, wait, wait, equals, hashCode, getClass, notify, notifyAll`
    `class org.gradle.api.internal.AbstractTask` | `org.gradle.api.internal.AbstractTask#setProperty(java.lang.String, java.lang.Object), org.gradle.api.internal.AbstractTask#toString(), org.gradle.api.internal.AbstractTask#compareTo(java.lang.Object), org.gradle.api.internal.AbstractTask#compareTo(org.gradle.api.Task), org.gradle.api.internal.AbstractTask#getName(), org.gradle.api.internal.AbstractTask#getActions(), org.gradle.api.internal.AbstractTask#setName(java.lang.String), org.gradle.api.internal.AbstractTask#getState(), org.gradle.api.internal.AbstractTask#getState(), org.gradle.api.internal.AbstractTask#getPath(), org.gradle.api.internal.AbstractTask#getExtensions(), org.gradle.api.internal.AbstractTask#getLogger(), org.gradle.api.internal.AbstractTask#execute(), org.gradle.api.internal.AbstractTask#configure(groovy.lang.Closure), org.gradle.api.internal.AbstractTask#configure(groovy.lang.Closure), org.gradle.api.internal.AbstractTask#getDescription(), org.gradle.api.internal.AbstractTask#leftShift(groovy.lang.Closure), org.gradle.api.internal.AbstractTask#property(java.lang.String), org.gradle.api.internal.AbstractTask#isEnabled(), org.gradle.api.internal.AbstractTask#setEnabled(boolean), org.gradle.api.internal.AbstractTask#getOutputs(), org.gradle.api.internal.AbstractTask#getOutputs(), org.gradle.api.internal.AbstractTask#hasProperty(java.lang.String), org.gradle.api.internal.AbstractTask#getConvention(), org.gradle.api.internal.AbstractTask#setDescription(java.lang.String), org.gradle.api.internal.AbstractTask#getGroup(), org.gradle.api.internal.AbstractTask#setGroup(java.lang.String), org.gradle.api.internal.AbstractTask#dependsOnTaskDidWork(), org.gradle.api.internal.AbstractTask#getInputs(), org.gradle.api.internal.AbstractTask#getTemporaryDir(), org.gradle.api.internal.AbstractTask#mustRunAfter([Ljava.lang.Object;), org.gradle.api.internal.AbstractTask#setMustRunAfter(java.lang.Iterable), org.gradle.api.internal.AbstractTask#getMustRunAfter(), org.gradle.api.internal.AbstractTask#finalizedBy([Ljava.lang.Object;), org.gradle.api.internal.AbstractTask#setFinalizedBy(java.lang.Iterable), org.gradle.api.internal.AbstractTask#getFinalizedBy(), org.gradle.api.internal.AbstractTask#shouldRunAfter([Ljava.lang.Object;), org.gradle.api.internal.AbstractTask#setShouldRunAfter(java.lang.Iterable), org.gradle.api.internal.AbstractTask#getShouldRunAfter(), org.gradle.api.internal.AbstractTask#getTaskDependencies(), org.gradle.api.internal.AbstractTask#getTaskDependencies(), org.gradle.api.internal.AbstractTask#getDependsOn(), org.gradle.api.internal.AbstractTask#setDependsOn(java.lang.Iterable), org.gradle.api.internal.AbstractTask#dependsOn([Ljava.lang.Object;), org.gradle.api.internal.AbstractTask#onlyIf(org.gradle.api.specs.Spec), org.gradle.api.internal.AbstractTask#onlyIf(groovy.lang.Closure), org.gradle.api.internal.AbstractTask#setOnlyIf(org.gradle.api.specs.Spec), org.gradle.api.internal.AbstractTask#setOnlyIf(groovy.lang.Closure), org.gradle.api.internal.AbstractTask#setDidWork(boolean), org.gradle.api.internal.AbstractTask#getDidWork(), org.gradle.api.internal.AbstractTask#doFirst(groovy.lang.Closure), org.gradle.api.internal.AbstractTask#doFirst(org.gradle.api.Action), org.gradle.api.internal.AbstractTask#doLast(groovy.lang.Closure), org.gradle.api.internal.AbstractTask#doLast(org.gradle.api.Action), org.gradle.api.internal.AbstractTask#deleteAllActions(), org.gradle.api.internal.AbstractTask#getEnabled(), org.gradle.api.internal.AbstractTask#getAnt(), org.gradle.api.internal.AbstractTask#getLogging(), org.gradle.api.internal.AbstractTask#getLogging(), org.gradle.api.internal.AbstractTask#getProject(), org.gradle.api.internal.AbstractTask#setActions(java.util.List), org.gradle.api.internal.AbstractTask#getStandardOutputCapture(), org.gradle.api.internal.AbstractTask#getAsDynamicObject(), org.gradle.api.internal.AbstractTask#setProject(org.gradle.api.Project), org.gradle.api.internal.AbstractTask#prependParallelSafeAction(org.gradle.api.Action), org.gradle.api.internal.AbstractTask#injectIntoNewInstance(org.gradle.api.internal.project.ProjectInternal, java.lang.String, java.util.concurrent.Callable), org.gradle.api.internal.AbstractTask#getTaskActions(), org.gradle.api.internal.AbstractTask#getOnlyIf(), org.gradle.api.internal.AbstractTask#getImpliesSubProjects(), org.gradle.api.internal.AbstractTask#setImpliesSubProjects(boolean), org.gradle.api.internal.AbstractTask#getExecuter(), org.gradle.api.internal.AbstractTask#setExecuter(org.gradle.api.internal.tasks.TaskExecuter), org.gradle.api.internal.AbstractTask#getTemporaryDirFactory(), org.gradle.api.internal.AbstractTask#addValidator(org.gradle.api.internal.tasks.execution.TaskValidator), org.gradle.api.internal.AbstractTask#getValidators(), org.gradle.api.internal.AbstractTask#appendParallelSafeAction(org.gradle.api.Action), org.gradle.api.internal.AbstractTask#isHasCustomActions(), org.gradle.api.internal.AbstractTask#wait(long, int), org.gradle.api.internal.AbstractTask#wait(long), org.gradle.api.internal.AbstractTask#wait(), org.gradle.api.internal.AbstractTask#equals(java.lang.Object), org.gradle.api.internal.AbstractTask#hashCode(), org.gradle.api.internal.AbstractTask#getClass(), org.gradle.api.internal.AbstractTask#notify(), org.gradle.api.internal.AbstractTask#notifyAll()`

- - ### Field Detail

    - #### public static final List<String> DEFAULT_TASKS

  - ### Constructor Detail

    - #### public CompareGradleBuilds()

  - ### Method Detail

    - #### @javax.inject.Inject protected org.gradle.internal.file.PathToFileResolver getFileResolver()

    - #### public boolean getIgnoreFailures()

      Whether a comparison between non identical builds will fail the task execution.

      Returns:
        True if a comparison between non identical builds will fail the task execution, otherwise false.

    - #### @javax.inject.Inject protected org.gradle.internal.reflect.Instantiator getInstantiator()

    - #### @javax.inject.Inject protected org.gradle.logging.ProgressLoggerFactory getProgressLoggerFactory()

    - #### @OutputDirectory public File getReportDir()

      The directory that will contain the HTML comparison report and any other report files.

      Returns:
        The directory that will contain the HTML comparison report and any other report files.

    - #### public GradleBuildInvocationSpec getSourceBuild()

      The specification of how to invoke the source build. Defaults to project.rootDir with the current Gradle version and the tasks “clean assemble”. The `projectDir` must be the project directory of the root project if this is a multi project build.

      Returns:
        The specification of how to invoke the source build.

    - #### public GradleBuildInvocationSpec getTargetBuild()

      The specification of how to invoke the target build. Defaults to project.rootDir with the current Gradle version and the tasks “clean assemble”. The `projectDir` must be the project directory of the root project if this is a multi project build.

      Returns:
        The specification of how to invoke the target build.

    - #### public void setIgnoreFailures(boolean ignoreFailures)

      Sets whether a comparison between non identical builds will fail the task execution.

      Parameters:
        `ignoreFailures` - false to fail the task on non identical builds, true to not fail the task. The default is false.

    - #### @SuppressWarnings("UnusedDeclaration") public void setReportDir(Object reportDir)

      Sets the directory that will contain the HTML comparison report and any other report files. The value will be evaluated by Project#file(Object) project.file().

      Parameters:
        `reportDir` - The directory that will contain the HTML comparison report and any other report files.

    - #### @SuppressWarnings("UnusedDeclaration") public void sourceBuild(Action<GradleBuildInvocationSpec> config)

      Configures the source build. A Groovy closure can be used as the action.

           sourceBuild {
             gradleVersion = "1.1"
           }

      Parameters:
        `config` - The configuration action.

    - #### @SuppressWarnings("UnusedDeclaration") public void targetBuild(Action<GradleBuildInvocationSpec> config)

      Configures the target build. A Groovy closure can be used as the action.

           targetBuild {
             gradleVersion = "1.1"
           }

      Parameters:
        `config` - The configuration action.