Class GenerateCodeCommonTask

java.lang.Object
org.gradle.api.internal.AbstractTask
org.gradle.api.DefaultTask
com.graphql_java_generator.gradleplugin.CommonTask
com.graphql_java_generator.gradleplugin.GenerateCodeCommonTask
All Implemented Interfaces:
com.graphql_java_generator.plugin.conf.CommonConfiguration, com.graphql_java_generator.plugin.conf.GenerateCodeCommonConfiguration, 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>
Direct Known Subclasses:
GenerateClientCodeTask, GenerateServerCodeTask

public class GenerateCodeCommonTask
extends CommonTask
implements com.graphql_java_generator.plugin.conf.GenerateCodeCommonConfiguration

This class is the super class of all Gradle Extensions that generate code, that is the GenerateClientCodeExtension, the GenerateServerCodeExtension and the GraphQLExtension extensions. It contains all parameters that are common to these tasks. The parameters common to all tasks are inherited from the CommonExtension class.

This avoids to redeclare each common parameter in each task, including its comment. When a comment is updated, only one update is necessary, instead of updating it in each.

Note: The attribute have no default values: their default values is read from the GenerateCodeCommonExtension, whose attributes can be either the default value, or a value set in the build script.

  • Nested Class Summary

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

    org.gradle.api.Task.Namer
  • Field Summary

    Fields 
    Modifier and Type Field Description
    protected java.lang.String targetResourceFolder
    The folder where the generated resources will be generated
    protected java.lang.String targetSourceFolder
    The folder where the source code for the generated classes will be generated

    Fields inherited from class com.graphql_java_generator.gradleplugin.CommonTask

    extension, extensionClass, skipGenerationIfSchemaHasNotChanged

    Fields inherited from interface com.graphql_java_generator.plugin.conf.CommonConfiguration

    DEFAULT_ADD_RELAY_CONNECTIONS, DEFAULT_MAX_TOKENS, DEFAULT_PACKAGE_NAME, DEFAULT_SCHEMA_FILE_FOLDER, DEFAULT_SCHEMA_FILE_PATTERN, DEFAULT_SKIP_GENERATION_IF_SCHEMA_HAS_NOT_CHANGED

    Fields inherited from interface com.graphql_java_generator.plugin.conf.GenerateCodeCommonConfiguration

    DEFAULT_COPY_RUNTIME_SOURCES, DEFAULT_SEPARATE_UTIL_CLASSES, DEFAULT_SOURCE_ENCODING, DEFAULT_SPRING_BEAN_SUFFIX, DEFAULT_TARGET_RESOURCE_FOLDER, DEFAULT_TARGET_SOURCE_FOLDER

    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 
    Constructor Description
    GenerateCodeCommonTask​(java.lang.Class<? extends GenerateCodeCommonExtension> extensionClazz)  
  • Method Summary

    Modifier and Type Method Description
    java.util.List<com.graphql_java_generator.plugin.conf.CustomScalarDefinition> getCustomScalars()  
    protected GenerateCodeCommonExtension getExtension()  
    com.graphql_java_generator.plugin.conf.PluginMode getMode()  
    java.lang.String getPackageName()  
    java.lang.String getSourceEncoding()  
    java.lang.String getSpringAutoConfigurationPackage()  
    java.lang.String getSpringBeanSuffix()  
    java.io.File getTargetClassFolder()  
    java.io.File getTargetResourceFolder()  
    java.io.File getTargetSourceFolder()  
    boolean isCopyRuntimeSources()  
    boolean isGenerateJacksonAnnotations()  
    boolean isGenerateUtilityClasses()  
    boolean isSeparateUtilityClasses()  
    void registerGeneratedFolders()
    This method registers to Gradle the source and resources folders in which files are generated, if any
    void setCopyRuntimeSources​(boolean copyRuntimeSources)  
    void setCustomScalars​(com.graphql_java_generator.plugin.conf.CustomScalarDefinition[] customScalars)  
    void setPackageName​(java.lang.String packageName)  
    void setSeparateUtilityClasses​(boolean separateUtilityClasses)  
    void setSourceEncoding​(java.lang.String sourceEncoding)  
    void setSpringBeanSuffix​(java.lang.String springBeanSuffix)  
    void setTargetResourceFolder​(java.lang.String targetResourceFolder)  
    void setTargetSourceFolder​(java.lang.String targetSourceFolder)  

    Methods inherited from class org.gradle.api.internal.AbstractTask

    appendParallelSafeAction, compareTo, dependsOn, doFirst, doFirst, doFirst, doLast, doLast, doLast, finalizedBy, getActions, getAnt, getAsDynamicObject, getConvention, getDependsOn, getDescription, getDestroyables, getDidWork, getEnabled, getExtensions, getFinalizedBy, getGroup, getIdentityPath, getImpliesSubProjects, getInputs, getLocalState, getLogger, getLogging, getMustRunAfter, getName, getOnlyIf, getOutputs, getPath, getProject, getRequiredServices, getServices, getSharedResources, getShouldRunAfter, getStandardOutputCapture, getState, getTaskActions, getTaskDependencies, getTaskIdentity, getTemporaryDir, getTemporaryDirFactory, getTimeout, hasProperty, hasTaskActions, injectIntoNewInstance, isEnabled, isHasCustomActions, mustRunAfter, onlyIf, onlyIf, prependParallelSafeAction, property, replaceLogger, setActions, setDependsOn, setDescription, setDidWork, setEnabled, setFinalizedBy, setGroup, setImpliesSubProjects, setMustRunAfter, setOnlyIf, setOnlyIf, setProperty, setShouldRunAfter, shouldRunAfter, toString, usesService

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface com.graphql_java_generator.plugin.conf.CommonConfiguration

    getDefaultTargetSchemaFileName, getMaxTokens, getProjectDir, getSchemaFileFolder, getSchemaFilePattern, getTemplates, isAddRelayConnections, isSkipGenerationIfSchemaHasNotChanged, logCommonConfiguration

    Methods inherited from interface com.graphql_java_generator.plugin.conf.GenerateCodeCommonConfiguration

    logConfiguration, logGenerateCodeCommonConfiguration
  • Field Details

    • targetResourceFolder

      protected java.lang.String targetResourceFolder
      The folder where the generated resources will be generated
    • targetSourceFolder

      protected java.lang.String targetSourceFolder
      The folder where the source code for the generated classes will be generated
  • Constructor Details

  • Method Details

    • isCopyRuntimeSources

      @Input public final boolean isCopyRuntimeSources()
      Specified by:
      isCopyRuntimeSources in interface com.graphql_java_generator.plugin.conf.GenerateCodeCommonConfiguration
    • isGenerateUtilityClasses

      @Internal public boolean isGenerateUtilityClasses()
      Specified by:
      isGenerateUtilityClasses in interface com.graphql_java_generator.plugin.conf.GenerateCodeCommonConfiguration
    • setCopyRuntimeSources

      public final void setCopyRuntimeSources​(boolean copyRuntimeSources)
    • getCustomScalars

      @Input public final java.util.List<com.graphql_java_generator.plugin.conf.CustomScalarDefinition> getCustomScalars()
      Specified by:
      getCustomScalars in interface com.graphql_java_generator.plugin.conf.GenerateCodeCommonConfiguration
    • setCustomScalars

      public final void setCustomScalars​(com.graphql_java_generator.plugin.conf.CustomScalarDefinition[] customScalars)
    • getMode

      @Input @Optional public com.graphql_java_generator.plugin.conf.PluginMode getMode()
      Specified by:
      getMode in interface com.graphql_java_generator.plugin.conf.GenerateCodeCommonConfiguration
    • getPackageName

      @Input public final java.lang.String getPackageName()
      Specified by:
      getPackageName in interface com.graphql_java_generator.plugin.conf.GenerateCodeCommonConfiguration
    • setPackageName

      public final void setPackageName​(java.lang.String packageName)
    • isSeparateUtilityClasses

      @Input public boolean isSeparateUtilityClasses()
      Specified by:
      isSeparateUtilityClasses in interface com.graphql_java_generator.plugin.conf.GenerateCodeCommonConfiguration
    • setSeparateUtilityClasses

      public final void setSeparateUtilityClasses​(boolean separateUtilityClasses)
    • getSourceEncoding

      @Input public final java.lang.String getSourceEncoding()
      Specified by:
      getSourceEncoding in interface com.graphql_java_generator.plugin.conf.GenerateCodeCommonConfiguration
    • setSourceEncoding

      public final void setSourceEncoding​(java.lang.String sourceEncoding)
    • getSpringAutoConfigurationPackage

      @Internal public java.lang.String getSpringAutoConfigurationPackage()
      Specified by:
      getSpringAutoConfigurationPackage in interface com.graphql_java_generator.plugin.conf.GenerateCodeCommonConfiguration
    • getSpringBeanSuffix

      @Input public final java.lang.String getSpringBeanSuffix()
      Specified by:
      getSpringBeanSuffix in interface com.graphql_java_generator.plugin.conf.GenerateCodeCommonConfiguration
    • setSpringBeanSuffix

      public final void setSpringBeanSuffix​(java.lang.String springBeanSuffix)
    • getTargetClassFolder

      @OutputDirectory public final java.io.File getTargetClassFolder()
      Specified by:
      getTargetClassFolder in interface com.graphql_java_generator.plugin.conf.GenerateCodeCommonConfiguration
    • getTargetResourceFolder

      @OutputDirectory public final java.io.File getTargetResourceFolder()
      Specified by:
      getTargetResourceFolder in interface com.graphql_java_generator.plugin.conf.GenerateCodeCommonConfiguration
    • setTargetResourceFolder

      public final void setTargetResourceFolder​(java.lang.String targetResourceFolder)
    • getTargetSourceFolder

      @OutputDirectory public final java.io.File getTargetSourceFolder()
      Specified by:
      getTargetSourceFolder in interface com.graphql_java_generator.plugin.conf.GenerateCodeCommonConfiguration
    • setTargetSourceFolder

      public final void setTargetSourceFolder​(java.lang.String targetSourceFolder)
    • getExtension

      protected GenerateCodeCommonExtension getExtension()
      Overrides:
      getExtension in class CommonTask
    • isGenerateJacksonAnnotations

      @Internal public boolean isGenerateJacksonAnnotations()
      Specified by:
      isGenerateJacksonAnnotations in interface com.graphql_java_generator.plugin.conf.CommonConfiguration
      Overrides:
      isGenerateJacksonAnnotations in class CommonTask
    • registerGeneratedFolders

      public void registerGeneratedFolders()
      Description copied from class: CommonTask
      This method registers to Gradle the source and resources folders in which files are generated, if any
      Overrides:
      registerGeneratedFolders in class CommonTask