Slackbot
10/18/2022, 3:50 PMVampire
10/18/2022, 4:16 PMval downloadNexusOpenApiSpec by tasks.registering {
val nexusOpenApiSpecInput = resources
.text
.fromUri("<https://nexus.company.com/service/rest/swagger.json>")
.asFile("UTF-8")
inputs
.file(nexusOpenApiSpecInput.absolutePath)
.withPathSensitivity(NONE)
.withPropertyName("nexusOpenApiSpec")
val nexusOpenApiSpecOutput = layout.buildDirectory.file("nexusOpenApiSpec.json")
outputs
.file(nexusOpenApiSpecOutput)
.withPropertyName("nexusOpenApiSpec")
doLast {
nexusOpenApiSpecOutput.get().asFile.writeBytes(nexusOpenApiSpecInput.readBytes())
}
}
And then I can use the tasks output as input for other tasks like for openapi generator plugin
inputSpec.set(downloadNexusOpenApiSpec.map {
it.outputs.files.singleFile.absolutePath
})SriHarsha
10/18/2022, 4:19 PM