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` |

  - ### Constructor Summary

    Constructors
    Constructor and description
    `CompareGradleBuilds ()`

  - ### Methods Summary

    Methods
    Type | Name and description
    --- | ---
    `protected FileResolver` | `getFileResolver()`
    `boolean` | `getIgnoreFailures()` Whether a comparison between non identical builds will fail the task execution.
    `protected Instantiator` | `getInstantiator()`
    `protected 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.

- - ### Field Detail

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

  - ### Constructor Detail

    - #### public CompareGradleBuilds()

  - ### Method Detail

    - #### @Inject protected FileResolver 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.

    - #### @Inject protected Instantiator getInstantiator()

    - #### @Inject protected 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.