Class ShadowApiDetectorPlugin

java.lang.Object
com.arc_e_tect.gradle.shadow.ShadowApiDetectorPlugin
All Implemented Interfaces:
org.gradle.api.Plugin<org.gradle.api.Project>

public class ShadowApiDetectorPlugin extends Object implements org.gradle.api.Plugin<org.gradle.api.Project>
Gradle plugin that registers the detectShadowApis task and wires the shadowApiDetector DSL extension into the project.

Usage

 plugins {
     id 'com.arc-e-tect.shadow-api-detector'
 }

 shadowApiDetector {
     rootDocument = file('src/main/resources/openapi/openapi.yaml')
 }
 

Defaults

  • Controller directories: src/main/java
  • OpenAPI description directory: the root document's own parent directory
  • Fail on shadow APIs: false
  • Report directory: build/reports/shadow-api-detector
  • Report file name: shadow-apis.adoc

The task is not wired into check or build automatically - teams that generate their OpenAPI documentation from code would otherwise see every build fail on documentation that hasn't been regenerated yet. Opt in explicitly once the task is safe to run as part of your build:

 tasks.named('check') {
     dependsOn 'detectShadowApis'
 }
 
  • Field Details

  • Constructor Details

    • ShadowApiDetectorPlugin

      public ShadowApiDetectorPlugin()
      Creates a new plugin instance. Instantiated by Gradle infrastructure.
  • Method Details

    • apply

      public void apply(org.gradle.api.Project project)
      Specified by:
      apply in interface org.gradle.api.Plugin<org.gradle.api.Project>