@@ -7,6 +7,7 @@ import com.kobylynskyi.graphql.codegen.model.exception.LanguageNotSupportedExcep
7
7
import com .kobylynskyi .graphql .codegen .model .GeneratedLanguage ._
8
8
import com .kobylynskyi .graphql .codegen .scala .ScalaGraphQLCodegen
9
9
import com .kobylynskyi .graphql .codegen .supplier ._
10
+ import com .kobylynskyi .graphql .codegen .generators .FreeMarkerTemplateType
10
11
import sbt .{ AutoPlugin , PluginTrigger , _ }
11
12
import sbt .Keys .{ sLog , sourceManaged , _ }
12
13
import sbt .internal .util .complete .DefaultParsers .spaceDelimited
@@ -67,6 +68,7 @@ class GraphQLCodegenPlugin(configuration: Configuration, private[codegen] val co
67
68
generateJacksonTypeIdResolver := MappingConfigConstants .DEFAULT_GENERATE_JACKSON_TYPE_ID_RESOLVER ,
68
69
customTypesMapping := new JHashMap [String , String ](), // TODO use scala Map, convert to java Map
69
70
customAnnotationsMapping := new JHashMap [String , JList [String ]](),
71
+ customTemplates := new JHashMap [FreeMarkerTemplateType , String ](),
70
72
directiveAnnotationsMapping := new JHashMap [String , JList [String ]](),
71
73
javaxValidationApiVersion := None ,
72
74
graphqlJavaCodegenVersion := None ,
@@ -118,17 +120,17 @@ class GraphQLCodegenPlugin(configuration: Configuration, private[codegen] val co
118
120
generateBuilder := MappingConfigConstants .DEFAULT_BUILDER ,
119
121
generateApis := MappingConfigConstants .DEFAULT_GENERATE_APIS ,
120
122
generateEqualsAndHashCode := MappingConfigConstants .DEFAULT_EQUALS_AND_HASHCODE ,
121
- generateImmutableModels := MappingConfigConstants .DEFAULT_GENERATE_IMMUTABLE_MODELS , // TODO change default value
122
- generateToString := MappingConfigConstants .DEFAULT_TO_STRING ,
123
+ generateImmutableModels := MappingConfigConstants .DEFAULT_GENERATE_IMMUTABLE_MODELS , // TODO change default value
124
+ generateToString := MappingConfigConstants .DEFAULT_TO_STRING ,
123
125
// parent interfaces configs:
124
- parentInterfaces := parentInterfacesConfig,
125
- generateAllMethodInProjection := MappingConfigConstants .DEFAULT_GENERATE_ALL_METHOD ,
126
- responseProjectionMaxDepth := MappingConfigConstants .DEFAULT_RESPONSE_PROJECTION_MAX_DEPTH ,
127
- supportUnknownFields := MappingConfigConstants .DEFAULT_SUPPORT_UNKNOWN_FIELDS ,
128
- unknownFieldsPropertyName := MappingConfigConstants .DEFAULT_UNKNOWN_FIELDS_PROPERTY_NAME ,
129
- generateNoArgsConstructorOnly := MappingConfigConstants .DEFAULT_GENERATE_NOARGS_CONSTRUCTOR_ONLY ,
130
- generateModelsWithPublicFields := MappingConfigConstants .DEFAULT_GENERATE_MODELS_WITH_PUBLIC_FIELDS ,
131
- skip := false
126
+ parentInterfaces := parentInterfacesConfig,
127
+ generateAllMethodInProjection := MappingConfigConstants .DEFAULT_GENERATE_ALL_METHOD ,
128
+ responseProjectionMaxDepth := MappingConfigConstants .DEFAULT_RESPONSE_PROJECTION_MAX_DEPTH ,
129
+ supportUnknownFields := MappingConfigConstants .DEFAULT_SUPPORT_UNKNOWN_FIELDS ,
130
+ unknownFieldsPropertyName := MappingConfigConstants .DEFAULT_UNKNOWN_FIELDS_PROPERTY_NAME ,
131
+ generateNoArgsConstructorOnly := MappingConfigConstants .DEFAULT_GENERATE_NOARGS_CONSTRUCTOR_ONLY ,
132
+ generateModelsWithPublicFields := MappingConfigConstants .DEFAULT_GENERATE_MODELS_WITH_PUBLIC_FIELDS ,
133
+ skip := false
132
134
)
133
135
134
136
private def getMappingConfig (): Def .Initialize [MappingConfig ] = Def .setting {
@@ -149,6 +151,7 @@ class GraphQLCodegenPlugin(configuration: Configuration, private[codegen] val co
149
151
mappingConfig.setTypeResolverPrefix((GraphQLCodegenConfig / typeResolverPrefix).value.orNull)
150
152
mappingConfig.setModelValidationAnnotation((GraphQLCodegenConfig / modelValidationAnnotation).value)
151
153
mappingConfig.setCustomAnnotationsMapping((GraphQLCodegenConfig / customAnnotationsMapping).value)
154
+ mappingConfig.setCustomTemplates((GraphQLCodegenConfig / customTemplates).value)
152
155
mappingConfig.setGenerateEqualsAndHashCode((GraphQLCodegenConfig / generateEqualsAndHashCode).value)
153
156
mappingConfig.setGenerateImmutableModels((GraphQLCodegenConfig / generateImmutableModels).value)
154
157
mappingConfig.setGenerateToString((GraphQLCodegenConfig / generateToString).value)
0 commit comments