You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: modules/openapi-generator-gradle-plugin/src/main/kotlin/org/openapitools/generator/gradle/plugin/OpenApiGeneratorPlugin.kt
+1Lines changed: 1 addition & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -100,6 +100,7 @@ class OpenApiGeneratorPlugin : Plugin<Project> {
Copy file name to clipboardExpand all lines: modules/openapi-generator-gradle-plugin/src/main/kotlin/org/openapitools/generator/gradle/plugin/extensions/OpenApiGeneratorGenerateExtension.kt
+5Lines changed: 5 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -69,6 +69,11 @@ open class OpenApiGeneratorGenerateExtension(project: Project) {
69
69
*/
70
70
val templateDir = project.objects.property<String?>()
71
71
72
+
/**
73
+
* The template location (which may be a directory or a classpath location) holding custom templates.
74
+
*/
75
+
val templateResourcePath = project.objects.property<String?>()
76
+
72
77
/**
73
78
* Adds authorization headers when fetching the OpenAPI definitions remotely.
74
79
* Pass in a URL-encoded string of name:header with a comma separating multiple values
Copy file name to clipboardExpand all lines: modules/openapi-generator-gradle-plugin/src/main/kotlin/org/openapitools/generator/gradle/plugin/tasks/GenerateTask.kt
+14Lines changed: 14 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -133,6 +133,13 @@ open class GenerateTask @Inject constructor(private val objectFactory: ObjectFac
133
133
@PathSensitive(PathSensitivity.RELATIVE)
134
134
val templateDir = project.objects.property<String?>()
135
135
136
+
/**
137
+
* Resource path containing template files.
138
+
*/
139
+
@Optional
140
+
@Input
141
+
val templateResourcePath = project.objects.property<String?>()
142
+
136
143
/**
137
144
* Adds authorization headers when fetching the OpenAPI definitions remotely.
138
145
* Pass in a URL-encoded string of name:header with a comma separating multiple values
@@ -707,6 +714,13 @@ open class GenerateTask @Inject constructor(private val objectFactory: ObjectFac
707
714
configurator.setTemplateDir(value)
708
715
}
709
716
717
+
templateResourcePath.ifNotEmpty { value ->
718
+
templateDir.ifNotEmpty {
719
+
logger.warn("Both templateDir and templateResourcePath were configured. templateResourcePath overwrites templateDir.")
0 commit comments