Class GenerateCodeCommonTask
- All Implemented Interfaces:
com.graphql_java_generator.plugin.conf.CommonConfiguration,com.graphql_java_generator.plugin.conf.GenerateCodeCommonConfiguration,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>
- Direct Known Subclasses:
GenerateClientCodeTask,GenerateServerCodeTask
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.Named
org.gradle.api.Named.Namer -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected FileThe folder where the generated resources will be generatedprotected FileThe folder where the source code for the generated classes will be generatedprotected Boolean(since 2.0RC1) If false, it uses jakarta EE8 imports (that begins by javax.).Fields inherited from class com.graphql_java_generator.gradleplugin.CommonTask
extension, skipGenerationIfSchemaHasNotChangedFields inherited from interface com.graphql_java_generator.plugin.conf.CommonConfiguration
DEFAULT_ADD_RELAY_CONNECTIONS, DEFAULT_JSON_GRAPHQL_SCHEMA_FILE, DEFAULT_MAX_TOKENS, DEFAULT_PACKAGE_NAME, DEFAULT_PREFIX, DEFAULT_SCHEMA_FILE_FOLDER, DEFAULT_SCHEMA_FILE_PATTERN, DEFAULT_SCHEMA_SUB_FOLDER, DEFAULT_SKIP_GENERATION_IF_SCHEMA_HAS_NOT_CHANGED, DEFAULT_SUFFIX, DEFAULT_TARGET_SCHEMA_SUBFOLDERFields inherited from interface com.graphql_java_generator.plugin.conf.GenerateCodeCommonConfiguration
DEFAULT_COPY_RUNTIME_SOURCES, DEFAULT_QUERY_MUTATION_EXECUTION_PROTOCOL, DEFAULT_SCHEMA_PERSONALIZATION_FILE, DEFAULT_SEPARATE_UTIL_CLASSES, DEFAULT_SOURCE_ENCODING, DEFAULT_SPRING_BEAN_SUFFIX, DEFAULT_TARGET_RESOURCE_FOLDER, DEFAULT_TARGET_SOURCE_FOLDER, DEFAULT_USE_JAKARTA_EE9Fields 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
ConstructorsConstructorDescriptionGenerateCodeCommonTask(GenerateCodeCommonExtension extension, org.gradle.api.file.ProjectLayout projectLayout) -
Method Summary
Modifier and TypeMethodDescriptionfinal List<com.graphql_java_generator.plugin.conf.CustomScalarDefinition>protected GenerateCodeCommonExtensioncom.graphql_java_generator.plugin.conf.PluginModegetMode()final Stringfinal com.graphql_java_generator.plugin.conf.QueryMutationExecutionProtocolfinal Filefinal Stringfinal Stringfinal Filefinal Filefinal Filefinal booleanbooleanbooleanbooleanbooleanfinal voidsetCopyRuntimeSources(boolean copyRuntimeSources) final voidsetCustomScalars(com.graphql_java_generator.plugin.conf.CustomScalarDefinition[] customScalars) final voidsetPackageName(String packageName) final voidsetQueryMutationExecutionProtocol(com.graphql_java_generator.plugin.conf.QueryMutationExecutionProtocol queryMutationExecutionProtocol) final voidsetSchemaPersonalizationFile(String schemaPersonalizationFile) final voidsetSeparateUtilityClasses(boolean separateUtilityClasses) final voidsetSourceEncoding(String sourceEncoding) final voidsetSpringBeanSuffix(String springBeanSuffix) final voidsetTargetResourceFolder(String targetResourceFolder) final voidsetTargetSourceFolder(String targetSourceFolder) final voidsetUseJakartaEE9(boolean useJakartaEE9) Methods inherited from class com.graphql_java_generator.gradleplugin.CommonTask
getDefaultTargetSchemaFileName, getEnumPrefix, getEnumSuffix, getFileValue, getInputPrefix, getInputSuffix, getInterfacePrefix, getInterfaceSuffix, getJsonGraphqlSchemaFilename, getMaxTokens, getProjectBuildDir, getProjectDir, getProjectMainSourceFolder, getSchemaFileFolder, getSchemaFilePattern, getTargetSchemaSubFolder, getTemplates, getTypePrefix, getTypeSuffix, getUnionPrefix, getUnionSuffix, getValue, isAddRelayConnections, isInitialized, isSkipGenerationIfSchemaHasNotChanged, logConfiguration, setAddRelayConnections, setEnumPrefix, setEnumSuffix, setExtension, setInitialized, setInputPrefix, setInputSuffix, setInterfacePrefix, setInterfaceSuffix, setJsonGraphqlSchemaFilename, setParserOptions, setSchemaFileFolder, setSchemaFilePattern, setSkipGenerationIfSchemaHasNotChanged, setTargetSchemaSubFolder, setTemplates, setTypePrefix, setTypeSuffix, setUnionPrefix, setUnionSuffixMethods 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 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.graphql_java_generator.plugin.conf.CommonConfiguration
getDefaultTargetSchemaFileName, getEnumPrefix, getEnumSuffix, getInputPrefix, getInputSuffix, getInterfacePrefix, getInterfaceSuffix, getJsonGraphqlSchemaFilename, getMaxTokens, getProjectBuildDir, getProjectDir, getProjectMainSourceFolder, getSchemaFileFolder, getSchemaFilePattern, getTargetSchemaSubFolder, getTemplates, getTypePrefix, getTypeSuffix, getUnionPrefix, getUnionSuffix, isAddRelayConnections, isSkipGenerationIfSchemaHasNotChanged, logCommonConfigurationMethods inherited from interface com.graphql_java_generator.plugin.conf.GenerateCodeCommonConfiguration
logConfiguration, logGenerateCodeCommonConfigurationMethods inherited from interface org.gradle.api.Task
doNotTrackState, notCompatibleWithConfigurationCache
-
Field Details
-
targetResourceFolder
The folder where the generated resources will be generated -
targetSourceFolder
The folder where the source code for the generated classes will be generated -
useJakartaEE9
(since 2.0RC1) If false, it uses jakarta EE8 imports (that begins by javax.). If true, it uses jakarta EE8 imports (that begins by jakarta.).
(since 3.0) The parameter is ignored. Its value is always true.
-
-
Constructor Details
-
GenerateCodeCommonTask
@Inject public GenerateCodeCommonTask(GenerateCodeCommonExtension extension, org.gradle.api.file.ProjectLayout projectLayout)
-
-
Method Details
-
isCopyRuntimeSources
@Input public final boolean isCopyRuntimeSources()- Specified by:
isCopyRuntimeSourcesin interfacecom.graphql_java_generator.plugin.conf.GenerateCodeCommonConfiguration
-
isGenerateUtilityClasses
@Internal public boolean isGenerateUtilityClasses()- Specified by:
isGenerateUtilityClassesin interfacecom.graphql_java_generator.plugin.conf.GenerateCodeCommonConfiguration
-
setCopyRuntimeSources
public final void setCopyRuntimeSources(boolean copyRuntimeSources) -
getCustomScalars
@Input public final List<com.graphql_java_generator.plugin.conf.CustomScalarDefinition> getCustomScalars()- Specified by:
getCustomScalarsin interfacecom.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:
getModein interfacecom.graphql_java_generator.plugin.conf.GenerateCodeCommonConfiguration
-
getPackageName
- Specified by:
getPackageNamein interfacecom.graphql_java_generator.plugin.conf.GenerateCodeCommonConfiguration
-
setPackageName
-
getQueryMutationExecutionProtocol
@Input public final com.graphql_java_generator.plugin.conf.QueryMutationExecutionProtocol getQueryMutationExecutionProtocol()- Specified by:
getQueryMutationExecutionProtocolin interfacecom.graphql_java_generator.plugin.conf.GenerateCodeCommonConfiguration
-
setQueryMutationExecutionProtocol
public final void setQueryMutationExecutionProtocol(com.graphql_java_generator.plugin.conf.QueryMutationExecutionProtocol queryMutationExecutionProtocol) -
getSchemaPersonalizationFile
- Specified by:
getSchemaPersonalizationFilein interfacecom.graphql_java_generator.plugin.conf.GenerateCodeCommonConfiguration
-
setSchemaPersonalizationFile
-
isSeparateUtilityClasses
@Input public boolean isSeparateUtilityClasses()- Specified by:
isSeparateUtilityClassesin interfacecom.graphql_java_generator.plugin.conf.GenerateCodeCommonConfiguration
-
setSeparateUtilityClasses
public final void setSeparateUtilityClasses(boolean separateUtilityClasses) -
getSourceEncoding
- Specified by:
getSourceEncodingin interfacecom.graphql_java_generator.plugin.conf.GenerateCodeCommonConfiguration
-
setSourceEncoding
-
getSpringAutoConfigurationPackage
- Specified by:
getSpringAutoConfigurationPackagein interfacecom.graphql_java_generator.plugin.conf.GenerateCodeCommonConfiguration
-
getSpringBeanSuffix
- Specified by:
getSpringBeanSuffixin interfacecom.graphql_java_generator.plugin.conf.GenerateCodeCommonConfiguration
-
setSpringBeanSuffix
-
getTargetClassFolder
- Specified by:
getTargetClassFolderin interfacecom.graphql_java_generator.plugin.conf.GenerateCodeCommonConfiguration
-
getTargetResourceFolder
- Specified by:
getTargetResourceFolderin interfacecom.graphql_java_generator.plugin.conf.GenerateCodeCommonConfiguration
-
setTargetResourceFolder
- Parameters:
targetResourceFolder- A folder, relative to the project dir (not the the build dir)
-
getTargetSourceFolder
- Specified by:
getTargetSourceFolderin interfacecom.graphql_java_generator.plugin.conf.GenerateCodeCommonConfiguration
-
setTargetSourceFolder
- Parameters:
targetSourceFolder- A folder, relative to the project dir (not the the build dir)
-
isUseJakartaEE9
@Input public boolean isUseJakartaEE9()- Specified by:
isUseJakartaEE9in interfacecom.graphql_java_generator.plugin.conf.GenerateCodeCommonConfiguration
-
setUseJakartaEE9
public final void setUseJakartaEE9(boolean useJakartaEE9) -
getExtension
- Overrides:
getExtensionin classCommonTask
-
isGenerateJacksonAnnotations
@Internal public boolean isGenerateJacksonAnnotations()- Specified by:
isGenerateJacksonAnnotationsin interfacecom.graphql_java_generator.plugin.conf.CommonConfiguration- Overrides:
isGenerateJacksonAnnotationsin classCommonTask
-