Class GenerateGraphQLSchemaTask
java.lang.Object
org.gradle.api.internal.AbstractTask
org.gradle.api.DefaultTask
com.graphql_java_generator.gradleplugin.CommonTask
com.graphql_java_generator.gradleplugin.GenerateGraphQLSchemaTask
- All Implemented Interfaces:
com.graphql_java_generator.plugin.conf.CommonConfiguration,com.graphql_java_generator.plugin.conf.GenerateGraphQLSchemaConfiguration,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 class GenerateGraphQLSchemaTask
extends CommonTask
implements com.graphql_java_generator.plugin.conf.GenerateGraphQLSchemaConfiguration
The generateGraphQLSchema goal generates GraphQL schema, based on the source GraphQL schemas, and possibly containing additional stuff, like the Relay connection objects.
It can be used to:- Generate several GraphQL schema files into one file, for instance with additional schema files that would use the extend GraphQL keyword
- Reformat the schema file
- Generate the GraphQL schema with the Relay Connection stuff (Node interface, XxxEdge and XxxConnection types), thanks to the addRelayConnections plugin parameter.
This goal is, by default, attached to the Initialize maven phase, to be sure that the GraphQL schema are generated before the code generation would need it, if relevant.
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 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_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 com.graphql_java_generator.plugin.conf.GenerateGraphQLSchemaConfiguration
DEFAULT_RESOURCE_ENCODING, DEFAULT_TARGET_FOLDER, DEFAULT_TARGET_SCHEMA_FILE_NAMEFields 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 TypeMethodDescriptionvoidexecute()protected GenerateGraphQLSchemaExtensionbooleanvoidThis method registers to Gradle the source and resources folders in which files are generated, if anysetResourceEncoding(String resourceEncoding) voidsetTargetFolder(String targetFolder) voidsetTargetSchemaFileName(String targetSchemaFileName) Methods inherited from class com.graphql_java_generator.gradleplugin.CommonTask
addThisTaskAsADependencyToAnotherTask, configure, getDefaultTargetSchemaFileName, getEnumPrefix, getEnumSuffix, getFileValue, getInputPrefix, getInputSuffix, getInterfacePrefix, getInterfaceSuffix, getMaxTokens, getProjectDir, getSchemaFileFolder, getSchemaFilePattern, getTargetSchemaSubFolder, getTemplates, getTypePrefix, getTypeSuffix, getUnionPrefix, getUnionSuffix, getValue, isAddRelayConnections, isInitialized, isSkipGenerationIfSchemaHasNotChanged, logConfiguration, setAddRelayConnections, setEnumPrefix, setEnumSuffix, setInitialized, setInputPrefix, setInputSuffix, setInterfacePrefix, setInterfaceSuffix, setParserOptions, setSchemaFileFolder, setSchemaFilePattern, setSkipGenerationIfSchemaHasNotChanged, setTemplates, setTypePrefix, setTypeSuffix, setUnionPrefix, setUnionSuffixMethods 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
getDefaultTargetSchemaFileName, getEnumPrefix, getEnumSuffix, getInputPrefix, getInputSuffix, getInterfacePrefix, getInterfaceSuffix, getMaxTokens, getProjectDir, getSchemaFileFolder, getSchemaFilePattern, getTargetSchemaSubFolder, getTemplates, getTypePrefix, getTypeSuffix, getUnionPrefix, getUnionSuffix, isAddRelayConnections, isSkipGenerationIfSchemaHasNotChanged, logCommonConfigurationMethods inherited from interface com.graphql_java_generator.plugin.conf.GenerateGraphQLSchemaConfiguration
logConfigurationMethods inherited from interface org.gradle.api.Task
doNotTrackState, getConvention, notCompatibleWithConfigurationCache
-
Constructor Details
-
GenerateGraphQLSchemaTask
public GenerateGraphQLSchemaTask()
-
-
Method Details
-
execute
- Throws:
IOException
-
getResourceEncoding
- Specified by:
getResourceEncodingin interfacecom.graphql_java_generator.plugin.conf.GenerateGraphQLSchemaConfiguration
-
setResourceEncoding
-
getTargetFolder
- Specified by:
getTargetFolderin interfacecom.graphql_java_generator.plugin.conf.GenerateGraphQLSchemaConfiguration
-
setTargetFolder
-
getTargetSchemaFileName
- Specified by:
getTargetSchemaFileNamein interfacecom.graphql_java_generator.plugin.conf.GenerateGraphQLSchemaConfiguration
-
setTargetSchemaFileName
-
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
-