Class GenerateJsonSchema

  • All Implemented Interfaces:
    java.lang.Comparable<org.gradle.api.Task>, org.gradle.api.internal.DynamicObjectAware, org.gradle.api.internal.TaskInternal, org.gradle.api.plugins.ExtensionAware, org.gradle.api.Task, org.gradle.util.Configurable<org.gradle.api.Task>

    public abstract class GenerateJsonSchema
    extends org.gradle.api.DefaultTask
    Task for generating JSON schemas from code
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface org.gradle.api.Task

        org.gradle.api.Task.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
    • Method Summary

      All Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      abstract org.gradle.api.file.ConfigurableFileCollection getClassFiles()  
      abstract org.gradle.api.provider.ListProperty<java.lang.String> getExtraArguments()  
      abstract org.gradle.api.file.ConfigurableFileCollection getGeneratorDeps()  
      abstract org.gradle.api.provider.Property<java.lang.String> getOutputDirectoryName()
      The name of the directory under the resource root where the schema will be written.
      abstract org.gradle.api.file.ConfigurableFileCollection getProjectDeps()  
      abstract org.gradle.api.file.DirectoryProperty getSchemaResourceRoot()
      The resource root where generated schemas should be stored
      abstract org.gradle.api.provider.ListProperty<java.lang.String> getSubtypeScanningModuleWhiteList()
      An optional list of module name used to limit the search for subtypes to only those types under the supplied module.
      abstract org.gradle.api.provider.ListProperty<java.lang.String> getSubtypeScanningPackageWhiteList()
      An optional list of package name used to limit the search for subtypes to only those types under the supplied packages.
      abstract org.gradle.api.provider.ListProperty<java.lang.String> getTypeScanningModuleWhiteList()
      An optional list of module names used to limit the generation of schemas to only those @GeneratesSchema annotated types within the named modules.
      abstract org.gradle.api.provider.ListProperty<java.lang.String> getTypeScanningPackageWhiteList()
      An optional list of package name used to limit the generation of schemas to only those @GeneratesSchema annotated types under the supplied packages.
      void run()
      The task action.
      void setExtraArgumentsFromOption​(java.util.List<java.lang.String> args)
      Method to allow setting extra arguments from the command line.
      void setSubtypePackageWhiteListFromOption​(java.util.List<java.lang.String> args)
      Method to allow setting allowed subtype packages from the command line.
      void setSubtypeScanningModuleWhiteListFromOption​(java.util.List<java.lang.String> args)
      Method to allow setting allowed subtype modules from the command line.
      void setTypeScanningModuleWhiteListFromOption​(java.util.List<java.lang.String> args)
      Method to allow setting allowed subtype packages from the command line.
      void setTypeScanningPackageWhiteListFromOption​(java.util.List<java.lang.String> args)
      Method to allow setting allowed subtype packages from the command line.
      • 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, property, setActions, setDependsOn, setDescription, setDidWork, setEnabled, setFinalizedBy, setGroup, setMustRunAfter, setOnlyIf, setOnlyIf, setProperty, setShouldRunAfter, shouldRunAfter, usesService
      • Methods inherited from class org.gradle.api.internal.AbstractTask

        appendParallelSafeAction, doNotTrackState, getAsDynamicObject, getConvention, getIdentityPath, getImpliesSubProjects, getLifecycleDependencies, getOnlyIf, getReasonNotToTrackState, getReasonTaskIsIncompatibleWithConfigurationCache, getRequiredServices, getServices, getSharedResources, getStandardOutputCapture, getTaskActions, getTaskIdentity, getTemporaryDirFactory, hasTaskActions, injectIntoNewInstance, isCompatibleWithConfigurationCache, isEnabled, isHasCustomActions, notCompatibleWithConfigurationCache, prependParallelSafeAction, 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, getConvention, notCompatibleWithConfigurationCache
    • Constructor Detail

      • GenerateJsonSchema

        public GenerateJsonSchema()
        Constructor
    • Method Detail

      • getTypeScanningModuleWhiteList

        @Input
        public abstract org.gradle.api.provider.ListProperty<java.lang.String> getTypeScanningModuleWhiteList()
        An optional list of module names used to limit the generation of schemas to only those @GeneratesSchema annotated types within the named modules.

        Allowed module names can include the glob wildcard * character.

        Setting this will speed up schema generation.

        Default: empty, meaning all modules.

        Returns:
        type scanning module white list property.
      • setTypeScanningModuleWhiteListFromOption

        public void setTypeScanningModuleWhiteListFromOption​(java.util.List<java.lang.String> args)
        Method to allow setting allowed subtype packages from the command line.
        Parameters:
        args - the modules to whitelist
      • getTypeScanningPackageWhiteList

        @Input
        public abstract org.gradle.api.provider.ListProperty<java.lang.String> getTypeScanningPackageWhiteList()
        An optional list of package name used to limit the generation of schemas to only those @GeneratesSchema annotated types under the supplied packages.

        Allowed package names can include the glob wildcard * character.

        Setting this will speed up schema generation.

        Default: empty, meaning all packages.

        Returns:
        type scanning packaging white list property.
      • setTypeScanningPackageWhiteListFromOption

        public void setTypeScanningPackageWhiteListFromOption​(java.util.List<java.lang.String> args)
        Method to allow setting allowed subtype packages from the command line.
        Parameters:
        args - the packages to whitelist
      • getSubtypeScanningModuleWhiteList

        @Input
        public abstract org.gradle.api.provider.ListProperty<java.lang.String> getSubtypeScanningModuleWhiteList()
        An optional list of module name used to limit the search for subtypes to only those types under the supplied module.

        Allowed module names can include the glob wildcard * character.

        Setting this will speed up schema generation.

        Default: empty, meaning all modules.

        Returns:
        subtype scanning module white list property.
      • setSubtypeScanningModuleWhiteListFromOption

        public void setSubtypeScanningModuleWhiteListFromOption​(java.util.List<java.lang.String> args)
        Method to allow setting allowed subtype modules from the command line.
        Parameters:
        args - the modules to whitelist
      • getSubtypeScanningPackageWhiteList

        @Input
        public abstract org.gradle.api.provider.ListProperty<java.lang.String> getSubtypeScanningPackageWhiteList()
        An optional list of package name used to limit the search for subtypes to only those types under the supplied packages.

        Allowed package names can include the glob wildcard * character.

        Setting this will speed up schema generation.

        Default: empty, meaning all packages.

        Returns:
        subtype scanning package white list property.
      • setSubtypePackageWhiteListFromOption

        public void setSubtypePackageWhiteListFromOption​(java.util.List<java.lang.String> args)
        Method to allow setting allowed subtype packages from the command line.
        Parameters:
        args - the packages to whitelist
      • getSchemaResourceRoot

        @OutputDirectory
        public abstract org.gradle.api.file.DirectoryProperty getSchemaResourceRoot()
        The resource root where generated schemas should be stored

        Default: $buildDir/generated/resources/schema

        Returns:
        the resource root property
      • getOutputDirectoryName

        @Input
        public abstract org.gradle.api.provider.Property<java.lang.String> getOutputDirectoryName()
        The name of the directory under the resource root where the schema will be written.

        This corresponds to the directory under which schema files will be located within the compiled jar file.

        Returns:
        output directory property.
      • getExtraArguments

        @Input
        public abstract org.gradle.api.provider.ListProperty<java.lang.String> getExtraArguments()
        Returns:
        additional command line arguments to pass to the generator
      • setExtraArgumentsFromOption

        public void setExtraArgumentsFromOption​(java.util.List<java.lang.String> args)
        Method to allow setting extra arguments from the command line.
        Parameters:
        args - the extra arguments to set.
      • getClassFiles

        @InputFiles
        public abstract org.gradle.api.file.ConfigurableFileCollection getClassFiles()
        Returns:
        the class files to scan, e.g. the output of the compileJava task or other compile task.
      • getGeneratorDeps

        @Internal
        public abstract org.gradle.api.file.ConfigurableFileCollection getGeneratorDeps()
        Returns:
        dependencies of the system test runner.
      • getProjectDeps

        @Internal
        public abstract org.gradle.api.file.ConfigurableFileCollection getProjectDeps()
        Returns:
        dependencies the project needs to compile.
      • run

        public void run()
        The task action.