All Downloads are FREE. Search and download functionalities are using the official Maven repository.

server.build.gradle.mustache Maven / Gradle / Ivy

There is a newer version: 4.8.4
Show newest version
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
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy