-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
minor: (#173) remove incorrect Json2YamlTask and make the output form…
…at configurable (#175) * minor: (#173) remove incorrect Json2YamlTask and make the output format configurable * update docs * add workaround for lazy task configuration of the `generateOpenApiDocs` task --------- Signed-off-by: Clemens Grabmann <[email protected]>
- Loading branch information
Showing
14 changed files
with
249 additions
and
121 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 0 additions & 14 deletions
14
...tlin/io/cloudflight/gradle/autoconfigure/extentions/gradle/api/NamedDomainObjectSetExt.kt
This file was deleted.
Oops, something went wrong.
23 changes: 22 additions & 1 deletion
23
...tlin/io/cloudflight/gradle/autoconfigure/extentions/gradle/api/tasks/TaskCollectionExt.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,32 @@ | ||
package io.cloudflight.gradle.autoconfigure.extentions.gradle.api.tasks | ||
|
||
import org.gradle.api.DomainObjectCollection | ||
import org.gradle.api.NamedDomainObjectProvider | ||
import org.gradle.api.NamedDomainObjectSet | ||
import org.gradle.api.Task | ||
import org.gradle.api.tasks.TaskCollection | ||
import org.gradle.api.tasks.TaskProvider | ||
import kotlin.reflect.KClass | ||
|
||
|
||
/** | ||
* @see TaskCollection.withType | ||
*/ | ||
internal fun <T : Task, S : T> TaskCollection<T>.withType(klass: KClass<S>): NamedDomainObjectSet<S> = this.withType(klass.java) | ||
|
||
|
||
/** | ||
* @see TaskCollection.withType | ||
*/ | ||
internal fun <T : Task, S : T> TaskCollection<T>.withType(klass: KClass<S>, configuration: (it: S) -> Unit): DomainObjectCollection<S> = this.withType(klass.java, configuration) | ||
|
||
/** | ||
* @see TaskCollection.named | ||
*/ | ||
internal fun <T : Task, S : T> TaskCollection<T>.named(name: String, klass: KClass<S>): TaskProvider<S> = this.named(name, klass.java) | ||
|
||
|
||
/** | ||
* @see TaskCollection.named | ||
*/ | ||
internal fun <T : Task, S : T> TaskCollection<T>.named(name: String, klass: KClass<S>): TaskProvider<S> = this.named(name, klass.java) | ||
internal fun <T: Task, S : T> TaskCollection<T>.named(name: String, klass: KClass<S>, configuration: (it: S) -> Unit): NamedDomainObjectProvider<S> = this.named(name, klass.java, configuration) |
35 changes: 0 additions & 35 deletions
35
src/main/kotlin/io/cloudflight/gradle/autoconfigure/springdoc/openapi/Json2YamlTask.kt
This file was deleted.
Oops, something went wrong.
12 changes: 12 additions & 0 deletions
12
.../cloudflight/gradle/autoconfigure/springdoc/openapi/SpringDocOpenApiConfigureExtension.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package io.cloudflight.gradle.autoconfigure.springdoc.openapi | ||
|
||
import org.gradle.api.provider.Property | ||
|
||
enum class OpenApiFormat(val extension: String) { | ||
YAML("yaml"), | ||
JSON("json") | ||
} | ||
|
||
abstract class SpringDocOpenApiConfigureExtension { | ||
abstract val fileFormat: Property<OpenApiFormat> | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 3 additions & 0 deletions
3
...otlin/io/cloudflight/gradle/autoconfigure/springdoc/openapi/UnsupportedFormatException.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
package io.cloudflight.gradle.autoconfigure.springdoc.openapi | ||
|
||
class UnsupportedFormatException(message: String) : RuntimeException(message) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.