Class GenerateArchitectureTestsTask

java.lang.Object
org.gradle.api.internal.AbstractTask
org.gradle.api.DefaultTask
com.arc_e_tect.gradle.architecture.GenerateArchitectureTestsTask
All Implemented Interfaces:
Comparable<org.gradle.api.Task>, org.gradle.api.internal.DynamicObjectAware, org.gradle.api.internal.TaskInternal, org.gradle.api.Named, org.gradle.api.plugins.ExtensionAware, org.gradle.api.Task, org.gradle.util.Configurable<org.gradle.api.Task>

@DisableCachingByDefault(because="Generates test sources from extension configuration") public abstract class GenerateArchitectureTestsTask extends org.gradle.api.DefaultTask
Generates the built-in hexagonal architecture test, and a bridge suite for any external rule pack tests discovered on getRulePackClasspath(), under getOutputDirectory().
  • Nested Class Summary

    Nested classes/interfaces inherited from interface org.gradle.api.Named

    org.gradle.api.Named.Namer
  • Field Summary

    Fields inherited from interface org.gradle.api.Task

    TASK_ACTION, TASK_CONSTRUCTOR_ARGS, TASK_DEPENDS_ON, TASK_DESCRIPTION, TASK_GROUP, TASK_NAME, TASK_OVERWRITE, TASK_TYPE
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a new task instance.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Generates the built-in hexagonal architecture test and the external rule pack bridge suite.
    abstract org.gradle.api.provider.ListProperty<String>
    Adapter package patterns, matching both inbound and outbound adapters not already covered by getInboundAdapters()/getOutboundAdapters().
    abstract org.gradle.api.provider.ListProperty<String>
    Application service package patterns.
    abstract org.gradle.api.provider.Property<String>
    The explicitly configured base package, i.e.
    abstract org.gradle.api.provider.ListProperty<String>
    Shared/common package patterns, excluded from layer-boundary rules.
    abstract org.gradle.api.provider.ListProperty<String>
    Domain model package patterns.
    abstract org.gradle.api.provider.Property<Boolean>
    Whether generation fails when duplicate rules are discovered.
    abstract org.gradle.api.provider.Property<String>
    Base package used only when getBasePackage() is blank and no package could be inferred from getMainSourceDirectory()'s own layout - the project's own group, resolved by the plugin at apply time.
    abstract org.gradle.api.provider.ListProperty<String>
    Inbound adapter package patterns.
    abstract org.gradle.api.provider.ListProperty<String>
    Inbound port package patterns.
    abstract org.gradle.api.file.DirectoryProperty
    The project's main Java source directory, used to infer a base package from its own directory layout when getBasePackage() is blank.
    abstract org.gradle.api.provider.ListProperty<String>
    Outbound adapter package patterns.
    abstract org.gradle.api.provider.ListProperty<String>
    Outbound port package patterns.
    abstract org.gradle.api.file.DirectoryProperty
    Directory generated test sources are written to.
    abstract org.gradle.api.file.ConfigurableFileCollection
    Classpath scanned for external rule pack tests to bridge into a generated JUnit Platform suite.
    abstract org.gradle.api.provider.Property<Boolean>
    Whether the built-in hexagonal architecture test is generated at all.
    abstract org.gradle.api.file.DirectoryProperty
    Directory holding hand-written architecture tests, scanned only to detect duplicate rules against the generated ones - not itself compiled by this task.

    Methods inherited from class org.gradle.api.DefaultTask

    compareTo, configure, dependsOn, doFirst, doFirst, doFirst, doLast, doLast, doLast, finalizedBy, getActions, getAnt, getDependsOn, getDescription, getDestroyables, getDidWork, getEnabled, getExtensions, getFinalizedBy, getGroup, getInputs, getLocalState, getLogger, getLogging, getMustRunAfter, getName, getOutputs, getPath, getProject, getShouldRunAfter, getState, getTaskDependencies, getTemporaryDir, getTimeout, hasProperty, mustRunAfter, onlyIf, onlyIf, onlyIf, property, setActions, setDependsOn, setDescription, setDidWork, setEnabled, setFinalizedBy, setGroup, setMustRunAfter, setOnlyIf, setOnlyIf, setOnlyIf, setProperty, setShouldRunAfter, shouldRunAfter, usesService

    Methods inherited from class org.gradle.api.internal.AbstractTask

    acceptServiceReferences, appendParallelSafeAction, doNotTrackState, doNotTrackStateIf, getAsDynamicObject, getIdentityPath, getImpliesSubProjects, getLifecycleDependencies, getOnlyIf, getReasonNotToTrackState, getReasonsNotToTrackState, getReasonTaskIsIncompatibleWithConfigurationCache, getRequiredServices, getServices, getSharedResources, getStandardOutputCapture, getTaskActions, getTaskIdentity, getTemporaryDirFactory, hasTaskActions, injectIntoNewInstance, isCompatibleWithConfigurationCache, isEnabled, isHasCustomActions, notCompatibleWithConfigurationCache, prependParallelSafeAction, restoreOnlyIf, restoreTaskActions, setImpliesSubProjects

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.gradle.api.Task

    doNotTrackState, notCompatibleWithConfigurationCache
  • Constructor Details

    • GenerateArchitectureTestsTask

      @Inject public GenerateArchitectureTestsTask()
      Creates a new task instance. Instantiated by Gradle infrastructure.
  • Method Details

    • getBasePackage

      @Input public abstract org.gradle.api.provider.Property<String> getBasePackage()
      The explicitly configured base package, i.e. architectureValidator.basePackage. Takes priority over both an inferred package (from getMainSourceDirectory()'s own layout) and getFallbackBasePackage() when non-blank.
      Returns:
      mutable property for the configured base package
    • getFallbackBasePackage

      @Input public abstract org.gradle.api.provider.Property<String> getFallbackBasePackage()
      Base package used only when getBasePackage() is blank and no package could be inferred from getMainSourceDirectory()'s own layout - the project's own group, resolved by the plugin at apply time.
      Returns:
      mutable property for the fallback base package
    • getInPorts

      @Input public abstract org.gradle.api.provider.ListProperty<String> getInPorts()
      Inbound port package patterns.
      Returns:
      mutable list property of inbound port package patterns
    • getOutPorts

      @Input public abstract org.gradle.api.provider.ListProperty<String> getOutPorts()
      Outbound port package patterns.
      Returns:
      mutable list property of outbound port package patterns
    • getDomainModel

      @Input public abstract org.gradle.api.provider.ListProperty<String> getDomainModel()
      Domain model package patterns.
      Returns:
      mutable list property of domain model package patterns
    • getAdapters

      @Input public abstract org.gradle.api.provider.ListProperty<String> getAdapters()
      Adapter package patterns, matching both inbound and outbound adapters not already covered by getInboundAdapters()/getOutboundAdapters().
      Returns:
      mutable list property of adapter package patterns
    • getInboundAdapters

      @Input public abstract org.gradle.api.provider.ListProperty<String> getInboundAdapters()
      Inbound adapter package patterns.
      Returns:
      mutable list property of inbound adapter package patterns
    • getOutboundAdapters

      @Input public abstract org.gradle.api.provider.ListProperty<String> getOutboundAdapters()
      Outbound adapter package patterns.
      Returns:
      mutable list property of outbound adapter package patterns
    • getApplicationServices

      @Input public abstract org.gradle.api.provider.ListProperty<String> getApplicationServices()
      Application service package patterns.
      Returns:
      mutable list property of application service package patterns
    • getCommonPackages

      @Input public abstract org.gradle.api.provider.ListProperty<String> getCommonPackages()
      Shared/common package patterns, excluded from layer-boundary rules.
      Returns:
      mutable list property of common package patterns
    • getFailOnDuplicateRules

      @Input public abstract org.gradle.api.provider.Property<Boolean> getFailOnDuplicateRules()
      Whether generation fails when duplicate rules are discovered.
      Returns:
      mutable property for the fail-on-duplicate-rules flag
    • getUseBuiltInHexagonalRulePack

      @Input public abstract org.gradle.api.provider.Property<Boolean> getUseBuiltInHexagonalRulePack()
      Whether the built-in hexagonal architecture test is generated at all.
      Returns:
      mutable property for the use-built-in-hexagonal-rule-pack flag
    • getUserTestsDirectory

      @Internal public abstract org.gradle.api.file.DirectoryProperty getUserTestsDirectory()
      Directory holding hand-written architecture tests, scanned only to detect duplicate rules against the generated ones - not itself compiled by this task.
      Returns:
      read-only directory property for the hand-written test directory
    • getMainSourceDirectory

      @Internal public abstract org.gradle.api.file.DirectoryProperty getMainSourceDirectory()
      The project's main Java source directory, used to infer a base package from its own directory layout when getBasePackage() is blank.
      Returns:
      read-only directory property for the main source directory
    • getRulePackClasspath

      @Classpath public abstract org.gradle.api.file.ConfigurableFileCollection getRulePackClasspath()
      Classpath scanned for external rule pack tests to bridge into a generated JUnit Platform suite.
      Returns:
      read-only file collection for the rule pack classpath
    • getOutputDirectory

      @OutputDirectory public abstract org.gradle.api.file.DirectoryProperty getOutputDirectory()
      Directory generated test sources are written to.
      Returns:
      mutable directory property for the output directory
    • generate

      public void generate()
      Generates the built-in hexagonal architecture test and the external rule pack bridge suite.