Class CustomPropertyAnalyzerPlugin

java.lang.Object
io.github.timoIpeters.custompropertyanalyzer.CustomPropertyAnalyzerPlugin
All Implemented Interfaces:
org.gradle.api.Plugin<org.gradle.api.Project>

public class CustomPropertyAnalyzerPlugin extends Object implements org.gradle.api.Plugin<org.gradle.api.Project>
Entry point for the Custom Property Analyzer Gradle plugin.

Applying this plugin registers the following tasks:

  • analyzeCustomProperties — scans the project's Java source files for @Value and @ConfigurationProperties annotations and produces a JSON report of all discovered custom properties and their default values.
  • checkUnusedProperties — compares the properties defined in configuration files against those discovered by analyzeCustomProperties and flags any that are never referenced in code. Depends on analyzeCustomProperties and fails the build by default if unused properties are found.

The plugin also applies the java plugin if not already present, as it relies on the main source set to locate Java files for analysis.

  • Constructor Details

    • CustomPropertyAnalyzerPlugin

      public CustomPropertyAnalyzerPlugin()
  • Method Details

    • apply

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