@@ -23,14 +23,12 @@ val processorsControllerVersion: String = System.getenv("PROCESSORS_CONTROLLER_V
2323val processorsControllerFileName = " processorsController.yaml"
2424val processorsControllerFilePath = " ${sourceDirectory} /${processorsControllerFileName} "
2525
26- val openApiVersion: String = System .getenv(" OPENAPI_VERSION" )
27- val mergedFileName = " odmApi.yaml"
28- val mergedFilePath = " ${sourceDirectory} /${mergedFileName} "
26+ val odmFileName = " odm.yaml"
27+ val odmFilePath = " ${sourceDirectory} /${odmFileName} "
2928
30- val sourceFileList = KotlinPath (sourceDirectory)
31- .listDirectoryEntries(" *.yaml" )
32- .sorted()
33- .map { layout.projectDirectory.file(" ${sourceDirectory} /${it.name} " ) }
29+ val openapiVersion: String = System .getenv(" OPENAPI_VERSION" )
30+ val openapiFileName = " openapi.yaml"
31+ val openapiFilePath = " ${sourceDirectory} /${openapiFileName} "
3432
3533tasks {
3634 val downloadSpec by registering(DownloadSpecification ::class ) {
@@ -43,20 +41,21 @@ tasks {
4341 }
4442 val mergeSpecifications by registering(MergeSpecifications ::class ) {
4543 dependsOn(downloadSpec)
46- inputFiles = sourceFileList
47- outputFile = layout.projectDirectory.file(mergedFilePath)
44+ inputFiles = listOf (odmFilePath, processorsControllerFilePath)
45+ .sorted().map { layout.projectDirectory.file(it) }
46+ outputFile = layout.projectDirectory.file(openapiFilePath)
4847 }
4948 val generateOdmApiPython by registering(GenerateTask ::class ) {
5049 dependsOn(mergeSpecifications)
5150 generatorName.set(" python" )
52- inputSpec.set(mergedFilePath )
51+ inputSpec.set(openapiFilePath )
5352 outputDir.set(" $rootDir /generated/python" )
5453 packageName.set(" odm_api" )
5554 gitUserId.set(" genestack" )
5655 gitRepoId.set(" openapi" )
5756 nameMappings.set(mapOf (" genestack:accession" to " genestackaccession" ))
5857 configOptions = mapOf (
59- " packageVersion" to openApiVersion ,
58+ " packageVersion" to openapiVersion ,
6059 // Workaround for https://github.com/OpenAPITools/openapi-generator/issues/21619
6160 // The second version asks for license, which we can't provide due to unavailability of
6261 // "licenseName" and "licenseUrl" fields in the specification for python generator.
@@ -67,28 +66,28 @@ tasks {
6766 val generateOdmApiR by registering(GenerateTask ::class ) {
6867 dependsOn(mergeSpecifications)
6968 generatorName.set(" r" )
70- inputSpec.set(mergedFilePath )
69+ inputSpec.set(openapiFilePath )
7170 outputDir.set(" $rootDir /generated/r" )
7271 packageName.set(" odmApi" )
7372 gitUserId.set(" genestack" )
7473 gitRepoId.set(" openapi" )
7574 nameMappings.set(mapOf (" genestack:accession" to " genestackaccession" ))
7675 configOptions = mapOf (
77- " packageVersion" to openApiVersion
76+ " packageVersion" to openapiVersion
7877// "disallowAdditionalPropertiesIfNotPresent" to "true"
7978 )
8079 }
8180 val generateOdmApiPostmanCollection by registering(GenerateTask ::class ) {
8281 dependsOn(mergeSpecifications)
8382 generatorName.set(" postman-collection" )
84- inputSpec.set(mergedFilePath )
83+ inputSpec.set(openapiFilePath )
8584 outputDir.set(" $rootDir /generated/postman-collection" )
8685 packageName.set(" odm-api" )
8786 gitUserId.set(" genestack" )
8887 gitRepoId.set(" openapi" )
8988 nameMappings.set(mapOf (" genestack:accession" to " genestackaccession" ))
9089 configOptions = mapOf (
91- " packageVersion" to openApiVersion
90+ " packageVersion" to openapiVersion
9291// "disallowAdditionalPropertiesIfNotPresent" to "true"
9392 )
9493 }
0 commit comments