forked from OpenAPITools/openapi-generator
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
4289 gradle support for SE server generator (OpenAPITools#26)
gradle support for SE server generator, fix junit tests, fix mainClass var in pom.xml Signed-off-by: aserkes <andrii.serkes@oracle.com>
- Loading branch information
Showing
5 changed files
with
94 additions
and
10 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
81 changes: 81 additions & 0 deletions
81
...enapi-generator/src/main/resources/java-helidon/server/libraries/se/build.gradle.mustache
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 |
---|---|---|
@@ -0,0 +1,81 @@ | ||
plugins { | ||
id 'java' | ||
id 'application' | ||
} | ||
|
||
group = '{{{groupId}}}' | ||
version = '{{{artifactVersion}}}' | ||
|
||
{{#appDescription}} | ||
description = """{{.}}""" | ||
{{/appDescription}} | ||
|
||
|
||
sourceCompatibility = 11 | ||
targetCompatibility = 11 | ||
|
||
tasks.withType(JavaCompile) { | ||
options.encoding = 'UTF-8' | ||
} | ||
|
||
ext { | ||
helidonVersion = '{{{parentVersion}}}' | ||
mainClass='{{{invokerPackage}}}.Main' | ||
validationApiVersion = '2.0.1.Final' | ||
} | ||
|
||
test { | ||
useJUnitPlatform() | ||
} | ||
|
||
repositories { | ||
mavenCentral() | ||
mavenLocal() | ||
} | ||
|
||
dependencies { | ||
// import Helidon BOM | ||
implementation enforcedPlatform("io.helidon:helidon-dependencies:${project.helidonVersion}") | ||
implementation "javax.validation:validation-api:${project.validationApiVersion}" | ||
implementation 'io.helidon.webserver:helidon-webserver' | ||
implementation 'io.helidon.media:helidon-media-jsonp' | ||
implementation 'io.helidon.media:helidon-media-jsonb' | ||
implementation 'io.helidon.media:helidon-media-multipart' | ||
implementation 'io.helidon.config:helidon-config-yaml' | ||
implementation 'io.helidon.health:helidon-health' | ||
implementation 'io.helidon.health:helidon-health-checks' | ||
implementation 'io.helidon.metrics:helidon-metrics' | ||
implementation 'io.helidon.openapi:helidon-openapi' | ||
implementation 'org.glassfish.jersey.media:jersey-media-json-jackson' | ||
testImplementation 'org.junit.jupiter:junit-jupiter-api' | ||
testImplementation 'io.helidon.webclient:helidon-webclient' | ||
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine' | ||
} | ||
|
||
// define a custom task to copy all dependencies in the runtime classpath | ||
// into build/libs/libs | ||
// uses built-in Copy | ||
task copyLibs(type: Copy) { | ||
from configurations.runtimeClasspath | ||
into 'build/libs/libs' | ||
} | ||
|
||
// add it as a dependency of built-in task 'assemble' | ||
copyLibs.dependsOn jar | ||
assemble.dependsOn copyLibs | ||
|
||
// default jar configuration | ||
// set the main classpath | ||
// add each jar under build/libs/libs into the classpath | ||
jar { | ||
archiveFileName = "${project.name}.jar" | ||
manifest { | ||
attributes ('Main-Class': "${project.mainClass}", | ||
'Class-Path': configurations.runtimeClasspath.files.collect { "libs/$it.name" }.join(' ') | ||
) | ||
} | ||
} | ||
|
||
application { | ||
mainClass = "${project.mainClass}" | ||
} |
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
1 change: 1 addition & 0 deletions
1
modules/openapi-generator/src/main/resources/java-helidon/server/settings.gradle.mustache
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
rootProject.name = '{{artifactId}}' |
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