Class ShadowApiDetectorExtension

java.lang.Object
com.arc_e_tect.gradle.shadow.ShadowApiDetectorExtension

public abstract class ShadowApiDetectorExtension extends Object
DSL extension for the Shadow API Detector Gradle plugin.
 shadowApiDetector {
     controllerDirs.from('src/main/java')                                    // default
     rootDocument   = file('src/main/resources/openapi/openapi.yaml')       // required
     // openApiDir  = rootDocument.get().asFile.parentFile                  // default
     failOnShadow   = false                                                  // default
     reportDir      = layout.buildDirectory.dir('reports/shadow-api-detector') // default
     reportFileName = 'shadow-apis.adoc'                                     // default
 }
 
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    Default relative path of the directory searched for @RestController classes.
    static final String
    Default name of the generated AsciiDoc report file.
    static final String
    Extension DSL block name, i.e.
  • Constructor Summary

    Constructors
    Constructor
    Description
    For use by the Gradle-generated concrete subclass.
  • Method Summary

    Modifier and Type
    Method
    Description
    abstract org.gradle.api.file.ConfigurableFileCollection
    Directories to search recursively for @RestController classes.
    abstract org.gradle.api.provider.Property<Boolean>
    Whether the build should fail when shadow APIs are found.
    abstract org.gradle.api.file.DirectoryProperty
    Directory where OpenAPI descriptions are stored.
    abstract org.gradle.api.file.DirectoryProperty
    Directory the AsciiDoc report is written to.
    abstract org.gradle.api.provider.Property<String>
    Name of the generated AsciiDoc report file (without path).
    abstract org.gradle.api.file.RegularFileProperty
    The root OpenAPI document describing the API.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • NAME

      public static final String NAME
      Extension DSL block name, i.e. the name used to register the extension with the project.
      See Also:
    • DEFAULT_CONTROLLER_DIR

      public static final String DEFAULT_CONTROLLER_DIR
      Default relative path of the directory searched for @RestController classes.
      See Also:
    • DEFAULT_REPORT_FILE_NAME

      public static final String DEFAULT_REPORT_FILE_NAME
      Default name of the generated AsciiDoc report file.
      See Also:
  • Constructor Details

    • ShadowApiDetectorExtension

      public ShadowApiDetectorExtension()
      For use by the Gradle-generated concrete subclass.
  • Method Details

    • getControllerDirs

      public abstract org.gradle.api.file.ConfigurableFileCollection getControllerDirs()
      Directories to search recursively for @RestController classes. One or more directories may be configured. Defaults to "src/main/java".
      Returns:
      mutable file collection of controller source directories
    • getRootDocument

      public abstract org.gradle.api.file.RegularFileProperty getRootDocument()
      The root OpenAPI document describing the API. Required: every other OpenAPI document is expected to be reachable from this one via $ref links relative to it.
      Returns:
      mutable file property for the root OpenAPI document
    • getOpenApiDir

      public abstract org.gradle.api.file.DirectoryProperty getOpenApiDir()
      Directory where OpenAPI descriptions are stored. Used only to determine which files the task should track as inputs for up-to-date checks; every document actually consulted is discovered by following the $ref links reachable from getRootDocument(). Defaults to the root document's own parent directory.
      Returns:
      mutable directory property for the OpenAPI description directory
    • getFailOnShadow

      public abstract org.gradle.api.provider.Property<Boolean> getFailOnShadow()
      Whether the build should fail when shadow APIs are found. The report is written either way. Defaults to false.
      Returns:
      mutable boolean property controlling whether the build fails on shadow APIs
    • getReportDir

      public abstract org.gradle.api.file.DirectoryProperty getReportDir()
      Directory the AsciiDoc report is written to. Defaults to build/reports/shadow-api-detector.
      Returns:
      mutable directory property for the report output directory
    • getReportFileName

      public abstract org.gradle.api.provider.Property<String> getReportFileName()
      Name of the generated AsciiDoc report file (without path). Defaults to "shadow-apis.adoc".
      Returns:
      mutable string property for the report file name