This repository has been archived by the owner on Nov 29, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
59 changed files
with
2,517 additions
and
825 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
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
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
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
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
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
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
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
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
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
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,35 +1,48 @@ | ||
plugins { | ||
id 'org.hidetake.swagger.generator' | ||
id 'org.springframework.boot' | ||
id 'org.openapi.generator' | ||
} | ||
apply from: project(":").file('gradle/java.gradle') | ||
|
||
dependencies { | ||
implementation group: 'com.google.code.gson', name: 'gson' | ||
implementation group: 'javax.annotation', name: 'javax.annotation-api' | ||
implementation group: 'io.swagger.core.v3', name: 'swagger-annotations' | ||
swaggerCodegen group: 'io.swagger.codegen.v3', name: 'swagger-codegen-cli' | ||
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-web' | ||
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-validation' | ||
implementation group: 'org.openapitools', name: 'jackson-databind-nullable' | ||
} | ||
|
||
swaggerSources { | ||
model { | ||
inputFile = file('../swagger/v1/swagger.yaml') | ||
code { | ||
language = 'java' | ||
configFile = file('../swagger/v1/swagger_codegen.json') | ||
components = [models: true] | ||
dependsOn validation | ||
} | ||
} | ||
modelV1Exp { | ||
inputFile = file('../swagger/v1exp/swagger.yaml') | ||
code { | ||
language = 'java' | ||
configFile = file('../swagger/v1exp/swagger_codegen.json') | ||
components = [models: true] | ||
dependsOn validation | ||
openApiValidate { | ||
inputSpec = "$rootDir/common/swagger/v1openapi3/swagger.json" | ||
recommend = true | ||
} | ||
|
||
openApiGenerate { | ||
generatorName = 'spring' | ||
packageName = "ai.h2o.mojos.deploy.common.rest" | ||
invokerPackage = "ai.h2o.mojos.deploy.common.rest" | ||
inputSpec = "$rootDir/common/swagger/v1openapi3/swagger.json" | ||
outputDir = "$buildDir/gen" | ||
globalProperties.set([ | ||
"skipFormModel": "false", | ||
]) | ||
configOptions.set([ | ||
"useSpringBoot3": "true", | ||
"interfaceOnly": "true", | ||
"basePackage": "ai.h2o.mojos.deploy.common.rest", | ||
"modelPackage": "ai.h2o.mojos.deploy.common.rest.model", | ||
]) | ||
} | ||
|
||
bootJar { | ||
enabled=false | ||
} | ||
|
||
compileJava.dependsOn tasks.openApiValidate, tasks.openApiGenerate | ||
sourceSets { | ||
main { | ||
java { | ||
srcDir("$buildDir/gen/src/main/java") | ||
} | ||
} | ||
} | ||
|
||
compileJava.dependsOn swaggerSources.model.code, swaggerSources.modelV1Exp.code | ||
sourceSets.main.java.srcDirs "${swaggerSources.model.code.outputDir}/src/main/java", "${swaggerSources.modelV1Exp.code.outputDir}/src/main/java" |
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.