Class GradleTestKitSupportExtension

  • All Implemented Interfaces:

    
    public abstract class GradleTestKitSupportExtension
    
                        

    Usage:

    gradleTestKitSupport {
      withIncludedBuildProjects("build-logic:plugin", ...)
      withClasspaths("myCustomClasspath", ...)
      disablePublication()
    }
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Method Summary

      Modifier and Type Method Description
      final Unit withIncludedBuildProjects(String projects) Include projects from included builds.
      final Unit withClasspaths(String classpaths)
      gradleTestKitSupport {
        // Install projects on `myCustomClasspath`
        withClasspaths("myCustomClasspath", ...)
      }
      final Unit disablePublication() Disable the creation of a test publication (probably as a workaround for issues with other plugins that also configure publications a little too automatically).
      final Unit withSupportLibrary(String version) Adds a dependency on com.autonomousapps:gradle-testkit-support with version DEFAULT_SUPPORT_VERSION unless otherwise specified.
      final Unit withSupportLibrary() Adds a dependency on com.autonomousapps:gradle-testkit-support with version DEFAULT_SUPPORT_VERSION unless otherwise specified.
      final Unit withTruthLibrary(String version) Adds a dependency on com.autonomousapps:gradle-testkit-truth with version DEFAULT_TRUTH_VERSION unless otherwise specified.
      final Unit withTruthLibrary() Adds a dependency on com.autonomousapps:gradle-testkit-truth with version DEFAULT_TRUTH_VERSION unless otherwise specified.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • GradleTestKitSupportExtension

        GradleTestKitSupportExtension(Project project)
    • Method Detail

      • withIncludedBuildProjects

         final Unit withIncludedBuildProjects(String projects)

        Include projects from included builds. Must be the fully-qualified path to the project. For example, if your included build is named "build-logic" (you have the statement includeBuild("build-logic") in your settings script), and the build-logic project has a subproject "plugin", then call this method like this:

        gradleTestKitSupport {
          includeProjects("build-logic:plugin", ...)
        }

        TODO(tsr): this can be automated.

      • withClasspaths

         final Unit withClasspaths(String classpaths)
        gradleTestKitSupport {
          // Install projects on `myCustomClasspath`
          withClasspaths("myCustomClasspath", ...)
        }
      • disablePublication

         final Unit disablePublication()

        Disable the creation of a test publication (probably as a workaround for issues with other plugins that also configure publications a little too automatically).

      • withSupportLibrary

        @JvmOverloads() final Unit withSupportLibrary(String version)

        Adds a dependency on com.autonomousapps:gradle-testkit-support with version DEFAULT_SUPPORT_VERSION unless otherwise specified.

      • withSupportLibrary

        @JvmOverloads() final Unit withSupportLibrary()

        Adds a dependency on com.autonomousapps:gradle-testkit-support with version DEFAULT_SUPPORT_VERSION unless otherwise specified.

      • withTruthLibrary

        @JvmOverloads() final Unit withTruthLibrary(String version)

        Adds a dependency on com.autonomousapps:gradle-testkit-truth with version DEFAULT_TRUTH_VERSION unless otherwise specified.

      • withTruthLibrary

        @JvmOverloads() final Unit withTruthLibrary()

        Adds a dependency on com.autonomousapps:gradle-testkit-truth with version DEFAULT_TRUTH_VERSION unless otherwise specified.