Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 21 additions & 16 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,21 @@ val sourceFileList = KotlinPath(sourceDirectory)
.map { layout.projectDirectory.file("${sourceDirectory}/${it.name}") }

tasks {
val downloadSpec by registering(DownloadSpecification::class) {
version.set(processorsControllerVersion)
registryUsername.set(System.getenv("NEXUS_USER"))
registryPassword.set(System.getenv("NEXUS_PASSWORD"))
releaseRegistryUrl.set(System.getenv("RAW_REGISTRY_RELEASES"))
snapshotRegistryUrl.set(System.getenv("RAW_REGISTRY_SNAPSHOTS"))
outputFile.set(layout.projectDirectory.file(processorsControllerFilePath))
}
val mergeSpecifications by registering(MergeSpecifications::class) {
dependsOn(downloadSpec)
inputFiles = sourceFileList
outputFile = layout.projectDirectory.file(mergedFilePath)
}
val generateOdmApiPython by registering(GenerateTask::class) {
dependsOn(mergeSpecifications)
generatorName.set("python")
inputSpec.set(mergedFilePath)
outputDir.set("$rootDir/generated/python")
Expand All @@ -42,11 +56,16 @@ tasks {
gitRepoId.set("openapi")
nameMappings.set(mapOf("genestack:accession" to "genestackaccession"))
configOptions = mapOf(
"packageVersion" to openApiVersion
"packageVersion" to openApiVersion,
// Workaround for https://github.com/OpenAPITools/openapi-generator/issues/21619
// The second version asks for license, which we can't provide due to unavailability of
// "licenseName" and "licenseUrl" fields in the specification for python generator.
"poetry1" to "true"
// "disallowAdditionalPropertiesIfNotPresent" to "true"
)
}
val generateOdmApiR by registering(GenerateTask::class) {
dependsOn(mergeSpecifications)
generatorName.set("r")
inputSpec.set(mergedFilePath)
outputDir.set("$rootDir/generated/r")
Expand All @@ -60,6 +79,7 @@ tasks {
)
}
val generateOdmApiPostmanCollection by registering(GenerateTask::class) {
dependsOn(mergeSpecifications)
generatorName.set("postman-collection")
inputSpec.set(mergedFilePath)
outputDir.set("$rootDir/generated/postman-collection")
Expand All @@ -72,22 +92,7 @@ tasks {
// "disallowAdditionalPropertiesIfNotPresent" to "true"
)
}
val downloadSpec by registering(DownloadSpecification::class) {
version.set(processorsControllerVersion)
registryUsername.set(System.getenv("NEXUS_USER"))
registryPassword.set(System.getenv("NEXUS_PASSWORD"))
releaseRegistryUrl.set(System.getenv("RAW_REGISTRY_RELEASES"))
snapshotRegistryUrl.set(System.getenv("RAW_REGISTRY_SNAPSHOTS"))
outputFile.set(layout.projectDirectory.file(processorsControllerFilePath))
}
val mergeSpecifications by registering(MergeSpecifications::class) {
dependsOn(downloadSpec)
inputFiles = sourceFileList
outputFile = layout.projectDirectory.file(mergedFilePath)
}

val generateAll by registering(GradleBuild::class) {
dependsOn(mergeSpecifications)
file("$rootDir/generated").deleteRecursively()
tasks = listOf(
generateOdmApiPython.name,
Expand Down
2 changes: 1 addition & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# https://docs.gradle.org/current/userguide/platforms.html#sub::toml-dependencies-format

[versions]
openapiGenerator = "7.13.0"
openapiGenerator = "7.14.0"

[plugins]
openapi-generator = { id = "org.openapi.generator", version.ref = "openapiGenerator" }
Loading