Class ConfigurationValidationReportTask
java.lang.Object
org.gradle.api.internal.AbstractTask
org.gradle.api.DefaultTask
io.micronaut.gradle.configuration.validation.tasks.ConfigurationValidationReportTask
- 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>
@CacheableTask
public abstract class ConfigurationValidationReportTask
extends org.gradle.api.DefaultTask
Cacheable task that runs Micronaut configuration validation and writes reports.
This task never fails the build when validation errors are found. Instead, it writes reports and
a result marker containing the exit code.
A separate ConfigurationValidationTask is responsible for failing the build based on the marker.
- Since:
- 5.0.0
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.gradle.api.Named
org.gradle.api.Named.Namer -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringBootstrap main class shipped bymicronaut-json-schema-configuration-validator.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 -
Method Summary
Modifier and TypeMethodDescriptionabstract org.gradle.api.file.ConfigurableFileCollectionApplication/runtime classpath used to discover schemas and configuration resources.abstract org.gradle.api.provider.Property<Boolean> Whether environments should be deduced.abstract org.gradle.api.provider.Property<Boolean> Combined enabled flag (global + scenario).abstract org.gradle.api.provider.ListProperty<String> Enabled environments.protected abstract org.gradle.process.ExecOperationsProvides theExecOperationsused to run the validator.abstract org.gradle.api.provider.Property<Boolean> Whether unknown properties are errors.abstract org.gradle.api.provider.Property<String> Report format (json/html/both).abstract org.gradle.api.provider.Property<String> Optional Java executable path.abstract org.gradle.api.provider.Property<org.gradle.jvm.toolchain.JavaLauncher> Optional Java launcher.abstract org.gradle.api.file.DirectoryPropertyOutput directory where reports will be generated.abstract org.gradle.api.provider.Property<Boolean> Whether the scenario classpath overrides the default computed classpath.abstract org.gradle.api.file.DirectoryPropertyBase directory used for rendering stable, relative origin paths.abstract org.gradle.api.provider.Property<String> Base directory path used for origin rewriting.abstract org.gradle.api.provider.ListProperty<String> Resource directories (relative togetProjectBaseDir()) used for origin rewriting.abstract org.gradle.api.file.RegularFilePropertyResult marker file containing the CLI exit code and report paths.abstract org.gradle.api.provider.ListProperty<String> Dependency injection suppression patterns.abstract org.gradle.api.provider.ListProperty<String> Suppression patterns.abstract org.gradle.api.provider.Property<Boolean> Whether dependency injection should be validated.abstract org.gradle.api.file.ConfigurableFileCollectionValidator tool classpath (should contain only the validator module).final voidRuns the configuration validator CLI and writes the result marker.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, usesServiceMethods inherited from class org.gradle.api.internal.AbstractTask
acceptServiceReferences, appendParallelSafeAction, doNotTrackState, getAsDynamicObject, getIdentityPath, getImpliesSubProjects, getLifecycleDependencies, getOnlyIf, getReasonNotToTrackState, getReasonTaskIsIncompatibleWithConfigurationCache, getRequiredServices, getServices, getSharedResources, getStandardOutputCapture, getTaskActions, getTaskIdentity, getTemporaryDirFactory, hasTaskActions, injectIntoNewInstance, isCompatibleWithConfigurationCache, isEnabled, isHasCustomActions, notCompatibleWithConfigurationCache, prependParallelSafeAction, setImpliesSubProjectsMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.gradle.api.Task
doNotTrackState, notCompatibleWithConfigurationCache
-
Field Details
-
BOOTSTRAP_MAIN_CLASS
Bootstrap main class shipped bymicronaut-json-schema-configuration-validator.- See Also:
-
-
Constructor Details
-
ConfigurationValidationReportTask
public ConfigurationValidationReportTask()Default constructor.
-
-
Method Details
-
getValidatorClasspath
@Classpath public abstract org.gradle.api.file.ConfigurableFileCollection getValidatorClasspath()Validator tool classpath (should contain only the validator module).- Returns:
- tool classpath
-
getApplicationClasspath
@Classpath public abstract org.gradle.api.file.ConfigurableFileCollection getApplicationClasspath()Application/runtime classpath used to discover schemas and configuration resources. Passed to the CLI using--classpath.- Returns:
- application classpath
-
getEnvironments
Enabled environments.- Returns:
- environments
-
getSuppressions
Suppression patterns.- Returns:
- suppressions
-
getSuppressedInjectionErrors
Dependency injection suppression patterns.When non-empty, passed to the validator CLI via
--suppress-inject-errors <csv>.- Returns:
- dependency injection suppression patterns
- Since:
- 5.1.0
-
getFailOnNotPresent
Whether unknown properties are errors.- Returns:
- flag
-
getDeduceEnvironments
Whether environments should be deduced.- Returns:
- flag
-
getValidateDependencyInjection
Whether dependency injection should be validated.- Returns:
- flag
-
getFormat
Report format (json/html/both).- Returns:
- format
-
getProjectBaseDir
@Internal public abstract org.gradle.api.file.DirectoryProperty getProjectBaseDir()Base directory used for rendering stable, relative origin paths.- Returns:
- base dir
-
getProjectBaseDirPath
Base directory path used for origin rewriting.This is an
Inputrather than an@InputDirectoryto avoid snapshotting the full project directory, which would prevent build cache reuse due to unrelated file changes.- Returns:
- base dir path
-
getResourcesDirs
Resource directories (relative togetProjectBaseDir()) used for origin rewriting.- Returns:
- resource directories
-
getOverrideClasspath
Whether the scenario classpath overrides the default computed classpath.- Returns:
- override flag
-
getOutputDirectory
@OutputDirectory public abstract org.gradle.api.file.DirectoryProperty getOutputDirectory()Output directory where reports will be generated.- Returns:
- output directory
-
getResultFile
@OutputFile public abstract org.gradle.api.file.RegularFileProperty getResultFile()Result marker file containing the CLI exit code and report paths.- Returns:
- marker file
-
getEnabledFlag
Combined enabled flag (global + scenario).- Returns:
- enabled flag
-
getJavaLauncher
@Optional public abstract org.gradle.api.provider.Property<org.gradle.jvm.toolchain.JavaLauncher> getJavaLauncher()Optional Java launcher.- Returns:
- java launcher
-
getJavaExecutable
Optional Java executable path.- Returns:
- executable
-
getExecOperations
@Inject protected abstract org.gradle.process.ExecOperations getExecOperations()Provides theExecOperationsused to run the validator.- Returns:
- exec operations
-
validateConfiguration
Runs the configuration validator CLI and writes the result marker.- Throws:
IOException- if output cannot be written
-