Skip to content

Commit

Permalink
use gradle openapitools GenerateTask to benefit from incremental builds
Browse files Browse the repository at this point in the history
  • Loading branch information
alafanechere committed Jan 11, 2022
1 parent f746be2 commit b285449
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,7 @@ subprojects {
source = fileTree(dir: projectDir)
.include("**/*.py")
.exclude(".venv/**/*.py")
.exclude("airbyte_api_client/**/*.py")
.exclude("**/__init__.py")
strictCheck = true
}
Expand Down
20 changes: 17 additions & 3 deletions octavia-cli/build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import org.openapitools.generator.gradle.plugin.tasks.GenerateTask

plugins {
id "org.openapi.generator" version "5.3.1"
id 'airbyte-python'
id 'airbyte-docker'
}
Expand All @@ -7,9 +10,20 @@ airbytePython {
moduleDirectory 'octavia_cli'
}

task generateApiClient(type: Exec) {
environment 'ROOT_DIR', rootDir.absolutePath
commandLine 'bin/generate-api-client.sh'
task generateApiClient(type: GenerateTask) {

def specFile = "$rootDir.absolutePath/airbyte-api/src/main/openapi/config.yaml"
def clientOutputDir = "$rootDir.absolutePath/octavia-cli/airbyte_api_client"

inputs.file specFile
outputs.dir clientOutputDir

generatorName = "python"
inputSpec = specFile
outputDir = clientOutputDir

packageName = "airbyte_api_client"

}

blackFormat.dependsOn generateApiClient
Expand Down

0 comments on commit b285449

Please sign in to comment.