File tree Expand file tree Collapse file tree 2 files changed +24
-5
lines changed
src/main/kotlin/io/openapiprocessor/gradle Expand file tree Collapse file tree 2 files changed +24
-5
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ import org.gradle.api.file.RegularFile
1212import org.gradle.api.file.RegularFileProperty
1313import org.gradle.api.provider.MapProperty
1414import org.gradle.api.provider.Property
15+ import org.gradle.api.provider.Provider
1516import java.io.File
1617
1718/* *
@@ -106,7 +107,19 @@ abstract class OpenApiProcessorExtension(private val project: Project): OpenApiP
106107 * set apiPath.
107108 */
108109 fun apiPath (apiPath : String ) {
109- this .api.fileValue(File (apiPath))
110+ api.fileValue(File (apiPath))
111+ }
112+
113+ fun apiPath (apiPath : File ) {
114+ api.fileValue(apiPath)
115+ }
116+
117+ fun apiPath (apiPath : RegularFile ) {
118+ api.value(apiPath)
119+ }
120+
121+ fun apiPath (apiPath : Provider <RegularFile >) {
122+ api.value(apiPath.get())
110123 }
111124
112125 /* *
Original file line number Diff line number Diff line change @@ -115,10 +115,16 @@ open class Processor(configName: String): ProcessorBase() {
115115 }
116116
117117 fun prop (key : String , value : Any ) {
118- if (value is RegularFile ) {
119- other[key] = value.toString()
120- } else {
121- other[key] = value
118+ when (value) {
119+ is RegularFile -> {
120+ other[key] = value.toString()
121+ }
122+ is Provider <* > -> {
123+ prop(key, value.get())
124+ }
125+ else -> {
126+ other[key] = value
127+ }
122128 }
123129 }
124130
You can’t perform that action at this time.
0 commit comments