Class CommonTask
- All Implemented Interfaces:
com.graphql_java_generator.plugin.conf.CommonConfiguration,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:
GenerateCodeCommonTask,GenerateGraphQLSchemaTask
This class contain the parameters that are common to all Gradle Extensions for this plugin, that is the parameters that are common to all the tasks of this plugin.
This avoids to redeclare each common parameter in each Extension, including its comment. When a comment is updated, only one update is necessary, instead of updating it in each Extension.
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
FieldsModifier and TypeFieldDescriptionprotected CommonExtensionThis is the extension, that contains default value for the task attributesprotected Class<? extends CommonExtension>This is the class of the extension, that contains default value for the task attributesThis parameter is now deprecated: it's value used in the plugin is always true, that is: if the generated sources or resources are older than the GraphQL schema file(s), then there is no source or resource generation.Fields inherited from interface com.graphql_java_generator.plugin.conf.CommonConfiguration
DEFAULT_ADD_RELAY_CONNECTIONS, 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_SUFFIXFields 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 TypeMethodDescriptionprotected voidaddThisTaskAsADependencyToAnotherTask(String taskName) This method find the task(s) from the given name, and add the current task as a task that must be executed before (dependsOn) thetaskNametaskorg.gradle.api.Taskconfigure(groovy.lang.Closure closure) final StringAn optional prefix to add to the classnames of the generated java classes for GraphQL enums.An optional suffix to add to the classnames of the generated java classes for GraphQL enums.protected CommonExtensionprotected FilegetFileValue(String taskValue, File extensionValue) An optional prefix to add to the classnames of the generated java classes for GraphQL input objects.An optional suffix to add to the classnames of the generated java classes for GraphQL input objects.An optional prefix to add to the classnames of the generated java classes for GraphQL interfaces.An optional suffix to add to the classnames of the generated java classes for GraphQL interfaces.final Filefinal Filefinal StringThis method is overriden here only to mark it as "@Internal", and allow the plugin validation by Gradle.An optional prefix to add to the classnames of the generated java classes for GraphQL types.An optional suffix to add to the classnames of the generated java classes for GraphQL types.An optional prefix to add to the classnames of the generated java classes for GraphQL unions.An optional suffix to add to the classnames of the generated java classes for GraphQL unions.protected <T> TgetValue(T taskValue, T extensionValue) final booleanbooleanbooleanReturns true if either this task or its extension has been initialized, that is: at least one of their setters has been called.final booleanDeprecated.voidvoidThis method registers to Gradle the source and resources folders in which files are generated, if anyfinal voidsetAddRelayConnections(Boolean addRelayConnections) voidsetEnumPrefix(String enumPrefix) voidsetEnumSuffix(String enumSuffix) protected voidsetInitialized(boolean initialized) When initialized is set to true, this marks this task as being configured.voidsetInputPrefix(String inputPrefix) voidsetInputSuffix(String inputSuffix) voidsetInterfacePrefix(String interfacePrefix) voidsetInterfaceSuffix(String interfaceSuffix) voidsetParserOptions(Integer maxTokens) final voidsetSchemaFileFolder(String schemaFileFolder) final voidsetSchemaFilePattern(String schemaFilePattern) final voidsetSkipGenerationIfSchemaHasNotChanged(boolean skipGenerationIfSchemaHasNotChanged) final voidsetTemplates(Map<String, String> templates) voidsetTypePrefix(String typePrefix) voidsetTypeSuffix(String typeSuffix) voidsetUnionPrefix(String unionPrefix) voidsetUnionSuffix(String unionSuffix) Methods inherited from class org.gradle.api.DefaultTask
compareTo, 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
appendParallelSafeAction, doNotTrackState, getAsDynamicObject, getConvention, 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
logCommonConfigurationMethods inherited from interface org.gradle.api.Task
doNotTrackState, getConvention, notCompatibleWithConfigurationCache
-
Field Details
-
skipGenerationIfSchemaHasNotChanged
This parameter is now deprecated: it's value used in the plugin is always true, that is: if the generated sources or resources are older than the GraphQL schema file(s), then there is no source or resource generation. In clear, the source and resource generation is executed only if the provided input (GraphQL schema...) has been updated since the last plugin execution.
-
extensionClass
This is the class of the extension, that contains default value for the task attributes -
extension
This is the extension, that contains default value for the task attributes
-
-
Constructor Details
-
CommonTask
-
-
Method Details
-
getValue
protected <T> T getValue(T taskValue, T extensionValue) -
getFileValue
-
isAddRelayConnections
@Input public final boolean isAddRelayConnections()- Specified by:
isAddRelayConnectionsin interfacecom.graphql_java_generator.plugin.conf.CommonConfiguration
-
setAddRelayConnections
-
getDefaultTargetSchemaFileName
- Specified by:
getDefaultTargetSchemaFileNamein interfacecom.graphql_java_generator.plugin.conf.CommonConfiguration
-
getEnumPrefix
An optional prefix to add to the classnames of the generated java classes for GraphQL enums. The prefix is added at the beginning of the java classname, and must be compatible with java naming rules (no space, dot, comma, etc.)- Specified by:
getEnumPrefixin interfacecom.graphql_java_generator.plugin.conf.CommonConfiguration
-
setEnumPrefix
-
getEnumSuffix
An optional suffix to add to the classnames of the generated java classes for GraphQL enums. The suffix is added at the end of the java classname, and must be compatible with java naming rules (no space, dot, comma, etc.)- Specified by:
getEnumSuffixin interfacecom.graphql_java_generator.plugin.conf.CommonConfiguration
-
setEnumSuffix
-
getInputPrefix
An optional prefix to add to the classnames of the generated java classes for GraphQL input objects. The prefix is added at the beginning of the java classname, and must be compatible with java naming rules (no space, dot, comma, etc.)- Specified by:
getInputPrefixin interfacecom.graphql_java_generator.plugin.conf.CommonConfiguration
-
setInputPrefix
-
getInputSuffix
An optional suffix to add to the classnames of the generated java classes for GraphQL input objects. The suffix is added at the end of the java classname, and must be compatible with java naming rules (no space, dot, comma, etc.)- Specified by:
getInputSuffixin interfacecom.graphql_java_generator.plugin.conf.CommonConfiguration
-
setInputSuffix
-
isInitialized
@Input public boolean isInitialized()Returns true if either this task or its extension has been initialized, that is: at least one of their setters has been called.- Returns:
- The value for initialized
-
getInterfacePrefix
An optional prefix to add to the classnames of the generated java classes for GraphQL interfaces. The prefix is added at the beginning of the java classname, and must be compatible with java naming rules (no space, dot, comma, etc.)- Specified by:
getInterfacePrefixin interfacecom.graphql_java_generator.plugin.conf.CommonConfiguration
-
setInterfacePrefix
-
getInterfaceSuffix
An optional suffix to add to the classnames of the generated java classes for GraphQL interfaces. The suffix is added at the end of the java classname, and must be compatible with java naming rules (no space, dot, comma, etc.)- Specified by:
getInterfaceSuffixin interfacecom.graphql_java_generator.plugin.conf.CommonConfiguration
-
setInterfaceSuffix
-
getMaxTokens
- Specified by:
getMaxTokensin interfacecom.graphql_java_generator.plugin.conf.CommonConfiguration
-
setParserOptions
-
getProjectDir
- Specified by:
getProjectDirin interfacecom.graphql_java_generator.plugin.conf.CommonConfiguration
-
getTypePrefix
An optional prefix to add to the classnames of the generated java classes for GraphQL types. The prefix is added at the beginning of the java classname, and must be compatible with java naming rules (no space, dot, comma, etc.)- Specified by:
getTypePrefixin interfacecom.graphql_java_generator.plugin.conf.CommonConfiguration
-
setTypePrefix
-
getTypeSuffix
An optional suffix to add to the classnames of the generated java classes for GraphQL types. The suffix is added at the end of the java classname, and must be compatible with java naming rules (no space, dot, comma, etc.)- Specified by:
getTypeSuffixin interfacecom.graphql_java_generator.plugin.conf.CommonConfiguration
-
setTypeSuffix
-
getUnionPrefix
An optional prefix to add to the classnames of the generated java classes for GraphQL unions. The prefix is added at the beginning of the java classname, and must be compatible with java naming rules (no space, dot, comma, etc.)- Specified by:
getUnionPrefixin interfacecom.graphql_java_generator.plugin.conf.CommonConfiguration
-
setUnionPrefix
-
getUnionSuffix
An optional suffix to add to the classnames of the generated java classes for GraphQL unions. The suffix is added at the end of the java classname, and must be compatible with java naming rules (no space, dot, comma, etc.)- Specified by:
getUnionSuffixin interfacecom.graphql_java_generator.plugin.conf.CommonConfiguration
-
setUnionSuffix
-
isGenerateJacksonAnnotations
@Internal public boolean isGenerateJacksonAnnotations()- Specified by:
isGenerateJacksonAnnotationsin interfacecom.graphql_java_generator.plugin.conf.CommonConfiguration
-
isSkipGenerationIfSchemaHasNotChanged
Deprecated.- Specified by:
isSkipGenerationIfSchemaHasNotChangedin interfacecom.graphql_java_generator.plugin.conf.CommonConfiguration
-
setSkipGenerationIfSchemaHasNotChanged
public final void setSkipGenerationIfSchemaHasNotChanged(boolean skipGenerationIfSchemaHasNotChanged) -
getSchemaFileFolder
- Specified by:
getSchemaFileFolderin interfacecom.graphql_java_generator.plugin.conf.CommonConfiguration
-
setSchemaFileFolder
-
getSchemaFilePattern
- Specified by:
getSchemaFilePatternin interfacecom.graphql_java_generator.plugin.conf.CommonConfiguration
-
setSchemaFilePattern
-
getTargetSchemaSubFolder
This method is overriden here only to mark it as "@Internal", and allow the plugin validation by Gradle.
- Specified by:
getTargetSchemaSubFolderin interfacecom.graphql_java_generator.plugin.conf.CommonConfiguration
-
getTemplates
- Specified by:
getTemplatesin interfacecom.graphql_java_generator.plugin.conf.CommonConfiguration
-
setTemplates
-
logConfiguration
public void logConfiguration()- Specified by:
logConfigurationin interfacecom.graphql_java_generator.plugin.conf.CommonConfiguration
-
getExtension
-
registerGeneratedFolders
public void registerGeneratedFolders()This method registers to Gradle the source and resources folders in which files are generated, if any -
addThisTaskAsADependencyToAnotherTask
This method find the task(s) from the given name, and add the current task as a task that must be executed before (dependsOn) thetaskNametask- Parameters:
taskName- The task's name
-
setInitialized
protected void setInitialized(boolean initialized) When initialized is set to true, this marks this task as being configured. So we'll mark compileJava and processResources as depending on it.- Parameters:
initialized- The new value for initialized
-
configure
public org.gradle.api.Task configure(groovy.lang.Closure closure) - Specified by:
configurein interfaceorg.gradle.util.Configurable<org.gradle.api.Task>- Specified by:
configurein interfaceorg.gradle.api.Task- Overrides:
configurein classorg.gradle.api.DefaultTask
-