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
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.StringtargetResourceFolderThe folder where the generated resources will be generatedprotected java.lang.StringtargetSourceFolderThe folder where the source code for the generated classes will be generatedFields inherited from class com.graphql_java_generator.gradleplugin.CommonTask
extension, extensionClass, skipGenerationIfSchemaHasNotChangedFields 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 -
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 GenerateCodeCommonExtensiongetExtension()com.graphql_java_generator.plugin.conf.PluginModegetMode()java.lang.StringgetPackageName()java.lang.StringgetSourceEncoding()java.lang.StringgetSpringAutoConfigurationPackage()java.lang.StringgetSpringBeanSuffix()java.io.FilegetTargetClassFolder()java.io.FilegetTargetResourceFolder()java.io.FilegetTargetSourceFolder()booleanisCopyRuntimeSources()booleanisGenerateJacksonAnnotations()booleanisGenerateUtilityClasses()booleanisSeparateUtilityClasses()voidregisterGeneratedFolders()This method registers to Gradle the source and resources folders in which files are generated, if anyvoidsetCopyRuntimeSources(boolean copyRuntimeSources)voidsetCustomScalars(com.graphql_java_generator.plugin.conf.CustomScalarDefinition[] customScalars)voidsetPackageName(java.lang.String packageName)voidsetSeparateUtilityClasses(boolean separateUtilityClasses)voidsetSourceEncoding(java.lang.String sourceEncoding)voidsetSpringBeanSuffix(java.lang.String springBeanSuffix)voidsetTargetResourceFolder(java.lang.String targetResourceFolder)voidsetTargetSourceFolder(java.lang.String targetSourceFolder)Methods inherited from class com.graphql_java_generator.gradleplugin.CommonTask
addThisTaskAsADependencyToAnotherTask, configure, getDefaultTargetSchemaFileName, getFileValue, getMaxTokens, getProjectDir, getSchemaFileFolder, getSchemaFilePattern, getTemplates, getValue, isAddRelayConnections, isInitialized, isSkipGenerationIfSchemaHasNotChanged, logConfiguration, setAddRelayConnections, setInitialized, setParserOptions, setSchemaFileFolder, setSchemaFilePattern, setSkipGenerationIfSchemaHasNotChanged, setTemplatesMethods 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, usesServiceMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Field Details
-
targetResourceFolder
protected java.lang.String targetResourceFolderThe folder where the generated resources will be generated -
targetSourceFolder
protected java.lang.String targetSourceFolderThe folder where the source code for the generated classes will be generated
-
-
Constructor Details
-
GenerateCodeCommonTask
@Inject public GenerateCodeCommonTask(java.lang.Class<? extends GenerateCodeCommonExtension> extensionClazz)
-
-
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 java.util.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
@Input public final java.lang.String getPackageName()- Specified by:
getPackageNamein interfacecom.graphql_java_generator.plugin.conf.GenerateCodeCommonConfiguration
-
setPackageName
public final void setPackageName(java.lang.String packageName) -
isSeparateUtilityClasses
@Input public boolean isSeparateUtilityClasses()- Specified by:
isSeparateUtilityClassesin interfacecom.graphql_java_generator.plugin.conf.GenerateCodeCommonConfiguration
-
setSeparateUtilityClasses
public final void setSeparateUtilityClasses(boolean separateUtilityClasses) -
getSourceEncoding
@Input public final java.lang.String getSourceEncoding()- Specified by:
getSourceEncodingin interfacecom.graphql_java_generator.plugin.conf.GenerateCodeCommonConfiguration
-
setSourceEncoding
public final void setSourceEncoding(java.lang.String sourceEncoding) -
getSpringAutoConfigurationPackage
@Internal public java.lang.String getSpringAutoConfigurationPackage()- Specified by:
getSpringAutoConfigurationPackagein interfacecom.graphql_java_generator.plugin.conf.GenerateCodeCommonConfiguration
-
getSpringBeanSuffix
@Input public final java.lang.String getSpringBeanSuffix()- Specified by:
getSpringBeanSuffixin interfacecom.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:
getTargetClassFolderin interfacecom.graphql_java_generator.plugin.conf.GenerateCodeCommonConfiguration
-
getTargetResourceFolder
@OutputDirectory public final java.io.File getTargetResourceFolder()- Specified by:
getTargetResourceFolderin interfacecom.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:
getTargetSourceFolderin interfacecom.graphql_java_generator.plugin.conf.GenerateCodeCommonConfiguration
-
setTargetSourceFolder
public final void setTargetSourceFolder(java.lang.String targetSourceFolder) -
getExtension
- Overrides:
getExtensionin classCommonTask
-
isGenerateJacksonAnnotations
@Internal public boolean isGenerateJacksonAnnotations()- Specified by:
isGenerateJacksonAnnotationsin interfacecom.graphql_java_generator.plugin.conf.CommonConfiguration- Overrides:
isGenerateJacksonAnnotationsin classCommonTask
-
registerGeneratedFolders
public void registerGeneratedFolders()Description copied from class:CommonTaskThis method registers to Gradle the source and resources folders in which files are generated, if any- Overrides:
registerGeneratedFoldersin classCommonTask
-