server.build.gradle.mustache Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of web3j-openapi-codegen Show documentation
Show all versions of web3j-openapi-codegen Show documentation
web3j-openapi project code generators
plugins {
id 'application'
id 'com.github.johnrengelman.shadow'
id 'org.hidetake.swagger.generator' version '2.18.2'
id 'io.swagger.core.v3.swagger-gradle-plugin' version '2.1.2'
}
mainClassName = 'org.web3j.openapi.server.console.RunServerCommand'
dependencies {
implementation project(':{{rootProjectName}}-core')
implementation "org.web3j.openapi:web3j-openapi-server:{{version}}"
implementation "org.glassfish.jersey.containers:jersey-container-servlet:${versions.jersey}"
swaggerUI 'org.webjars:swagger-ui:3.10.0'
}
repositories{
maven { url 'https://repo.gradle.org/gradle/libs-releases' }
}
swaggerSources {
openapi {
inputFile = file('src/main/resources/static/openapiSpecs.yaml')
}
}
task moveSwaggerUiToResources {
doLast{
ant.move file: "$buildDir/swagger-ui-openapi",
todir: "$rootDir/server/src/main/resources/static"
file("$rootDir/server/src/main/resources/static/swagger-ui-openapi")
.renameTo(file("$rootDir/server/src/main/resources/static/swagger-ui"))
}
}
resolve {
outputFileName = 'openapiSpecs'
outputFormat = 'YAML'
prettyPrint = 'TRUE'
classpath = sourceSets.main.runtimeClasspath
resourcePackages = ['org.web3j.openapi', '{{packageName}}']
outputDir = file('src/main/resources/static')
}
task completeSwaggerUiGeneration {
dependsOn resolve, generateSwaggerUI, moveSwaggerUiToResources
generateSwaggerUI.mustRunAfter resolve
moveSwaggerUiToResources.mustRunAfter generateSwaggerUI
}