Skip to content

Commit

Permalink
Upgrade Server Modules to Java 11
Browse files Browse the repository at this point in the history
Make Java 11 the baseline for the server modules going forward
  • Loading branch information
tgianos committed Jan 27, 2022
1 parent cc42ee8 commit 1a7e791
Show file tree
Hide file tree
Showing 10 changed files with 105 additions and 40 deletions.
9 changes: 6 additions & 3 deletions .travis.yml
@@ -1,15 +1,15 @@
dist: xenial
addons:
postgresql: '9.6'
postgresql: "9.6"
language: java
jdk:
- openjdk8
- openjdk11
services:
- mysql
- postgresql
- docker
git:
depth: false
depth: 100
install: "./travis/installViaTravis.sh"
before_script:
- cat "$TRAVIS_BUILD_DIR/travis/config/mysql/my.cnf" | sudo tee -a /etc/mysql/my.cnf
Expand All @@ -30,6 +30,9 @@ cache:
- genie-ui/.gradle/nodejs
- genie-ui/.gradle/npm
timeout: 1000
after_success:
# https://github.com/kt3k/coveralls-gradle-plugin/issues/85#issuecomment-475958699
- curl -F 'json_file=@build/coveralls/report.json' 'https://coveralls.io/api/v1/jobs'
env:
global:
- secure: a5QmXCWR7wwEf/poWSj3PDAb6VICKqTTw3qbNjQwSvCzaCYtZZmxLbruQQlKOyR6W4j2VMrp2Ip5xrBjlCrOTvkFymPY3L+EwbPxsXbO4uhzs43BNFLhDon/Duv3TRhnedkqP0s8hN1ylxCbcID0UUPXQGrhnu8mb5QlDUx2mr8=
Expand Down
19 changes: 11 additions & 8 deletions build.gradle
@@ -1,4 +1,5 @@
import com.github.spotbugs.snom.SpotBugsTask
import org.gradle.plugins.ide.idea.model.IdeaLanguageLevel
import org.springframework.boot.gradle.plugin.SpringBootPlugin

buildscript {
Expand Down Expand Up @@ -46,10 +47,15 @@ allprojects {

idea {
project {
jdkName = "1.8"
languageLevel = "8"
jdkName = "11"
languageLevel = new IdeaLanguageLevel(JavaVersion.VERSION_1_8)
vcs = "Git"
}
module {
languageLevel = new IdeaLanguageLevel(JavaVersion.VERSION_1_8)
downloadJavadoc true
downloadSources true
}
}

configure((Set<Project>) ext.javaProjects) {
Expand Down Expand Up @@ -329,6 +335,9 @@ task codeCoverageReport(type: JacocoReport, group: "Coverage reports") {
coveralls {
sourceDirs = project.javaProjects.sourceSets.main.allSource.srcDirs.flatten()
jacocoReportPath = (String) "${project.buildDir}/reports/jacoco/report.xml"
// https://github.com/kt3k/coveralls-gradle-plugin/issues/85#issuecomment-475958699
saveAsFile = true
sendToCoveralls = false
}

tasks.coveralls {
Expand Down Expand Up @@ -489,9 +498,3 @@ gradleEnterprise {
termsOfServiceAgree = "yes"
}
}

task printOsDetector {
doLast {
println "${osdetector.os}"
}
}
11 changes: 1 addition & 10 deletions genie-agent/build.gradle
Expand Up @@ -69,15 +69,6 @@ dependencies {

def genieVersion = project.version.toString()

compileJava {
if (JavaVersion.current().isJava9Compatible() && project.targetCompatibility != JavaVersion.VERSION_1_8) {
options.compilerArgs += [
"--add-exports",
"jdk.unsupported/sun.misc=ALL-UNNAMED"
]
}
}

jar {
manifest {
attributes("Implementation-Version": genieVersion)
Expand All @@ -93,7 +84,7 @@ javadoc {
processResources {
filesMatching("**/*.txt") {
filter ReplaceTokens, tokens: [
"genie.version": genieVersion
"genie.version": genieVersion
]
}
}
16 changes: 15 additions & 1 deletion genie-app/build.gradle
@@ -1,9 +1,23 @@
import org.gradle.plugins.ide.idea.model.IdeaLanguageLevel

apply plugin: "org.springframework.boot"

idea {
module {
languageLevel = new IdeaLanguageLevel(JavaVersion.VERSION_11)
}
}

configurations {
genieAgent
}

java {
toolchain {
languageVersion = JavaLanguageVersion.of(11)
}
}

dependencies {
/*******************************
* Implementation Dependencies
Expand Down Expand Up @@ -47,7 +61,7 @@ bootJar {
}

springBoot {
mainClassName = "com.netflix.genie.GenieApp"
getMainClass().set("com.netflix.genie.GenieApp")
buildInfo()
}

Expand Down
2 changes: 1 addition & 1 deletion genie-app/src/main/docker/Dockerfile
@@ -1,4 +1,4 @@
from openjdk:8-jre
from openjdk:11-jre-slim
MAINTAINER NetflixOSS <netflixoss@netflix.com>
EXPOSE 8080
VOLUME /tmp
Expand Down
14 changes: 7 additions & 7 deletions genie-docs/build.gradle
Expand Up @@ -12,12 +12,12 @@ asciidoctor {

asciidoctorj {
attributes(
[
"revnumber" : genieVersion,
"docinfo1" : "",
"isSnapshot" : isSnapshot,
"springBootVersion" : "${spring_boot_version}",
"springCloudVersion": "${spring_cloud_version}"
]
[
"revnumber" : genieVersion,
"docinfo1" : "",
"isSnapshot" : isSnapshot,
"springBootVersion" : "${spring_boot_version}",
"springCloudVersion": "${spring_cloud_version}"
]
)
}
18 changes: 16 additions & 2 deletions genie-swagger/build.gradle
@@ -1,5 +1,19 @@
import org.gradle.plugins.ide.idea.model.IdeaLanguageLevel

apply plugin: "java-library"

idea {
module {
languageLevel = new IdeaLanguageLevel(JavaVersion.VERSION_11)
}
}

java {
toolchain {
languageVersion = JavaLanguageVersion.of(11)
}
}

dependencies {
/*******************************
* API Dependencies
Expand Down Expand Up @@ -34,8 +48,8 @@ dependencies {
jar {
manifest {
attributes(
"Implementation-Title": project.name,
"Implementation-Version": project.version,
"Implementation-Title": project.name,
"Implementation-Version": project.version,
)
}
}
15 changes: 14 additions & 1 deletion genie-test-web/build.gradle
@@ -1,7 +1,20 @@
import org.apache.tools.ant.filters.ReplaceTokens
import org.gradle.plugins.ide.idea.model.IdeaLanguageLevel

apply plugin: "java-library"

idea {
module {
languageLevel = new IdeaLanguageLevel(JavaVersion.VERSION_11)
}
}

java {
toolchain {
languageVersion = JavaLanguageVersion.of(11)
}
}

dependencies {
/*******************************
* API Dependencies
Expand Down Expand Up @@ -33,7 +46,7 @@ dependencies {
processResources {
filesMatching("**/*.yml") {
filter ReplaceTokens, tokens: [
"genie.version": project.version.toString()
"genie.version": project.version.toString()
]
}
}
18 changes: 16 additions & 2 deletions genie-ui/build.gradle
@@ -1,6 +1,20 @@
import org.gradle.plugins.ide.idea.model.IdeaLanguageLevel

apply plugin: "java-library"
apply plugin: "nebula.node"

idea {
module {
languageLevel = new IdeaLanguageLevel(JavaVersion.VERSION_11)
}
}

java {
toolchain {
languageVersion = JavaLanguageVersion.of(11)
}
}

dependencies {
/*******************************
* API Dependencies
Expand Down Expand Up @@ -70,8 +84,8 @@ jar {

manifest {
attributes(
"Implementation-Title": project.name,
"Implementation-Version": project.version,
"Implementation-Title": project.name,
"Implementation-Version": project.version,
)
}
}
23 changes: 18 additions & 5 deletions genie-web/build.gradle
@@ -1,8 +1,21 @@
import org.apache.tools.ant.filters.ReplaceTokens
import org.gradle.plugins.ide.idea.model.IdeaLanguageLevel

apply plugin: "java-library"
apply plugin: "org.asciidoctor.jvm.convert"

idea {
module {
languageLevel = new IdeaLanguageLevel(JavaVersion.VERSION_11)
}
}

java {
toolchain {
languageVersion = JavaLanguageVersion.of(11)
}
}

project.parent.tasks.collectDocumentation.dependsOn project.tasks.asciidoctor

ext {
Expand Down Expand Up @@ -122,7 +135,7 @@ dependencies {
testImplementation("org.dbunit:dbunit")
testImplementation("org.springframework.boot:spring-boot-starter-jetty")
integTestImplementation("com.github.ppodgorsek:spring-test-dbunit-core")
integTestImplementation("org.apache.curator:curator-test:2.13.0")
integTestImplementation("org.apache.curator:curator-test:5.1.0")
integTestImplementation("org.springframework.cloud:spring-cloud-contract-wiremock")
integTestImplementation("org.springframework.restdocs:spring-restdocs-core")
integTestImplementation("org.springframework.restdocs:spring-restdocs-restassured")
Expand Down Expand Up @@ -169,7 +182,7 @@ asciidoctor {
logging.removeStandardErrorListener(listener)
capturedOutput.join('').with { output ->
if (output =~ /include file not found:/) {
throw new RuntimeException("Include file(s) not found.\n" + output)
throw new RuntimeException((String) ("Include file(s) not found.\n" + output))
}
}
}
Expand All @@ -182,8 +195,8 @@ asciidoctorj {
jar {
manifest {
attributes(
"Implementation-Title": project.name,
"Implementation-Version": project.version,
"Implementation-Title": project.name,
"Implementation-Version": project.version,
)
}
}
Expand All @@ -200,7 +213,7 @@ tasks.withType(Pmd) {
processResources {
filesMatching("**/*.yml") {
filter ReplaceTokens, tokens: [
"genie.version": project.version.toString()
"genie.version": project.version.toString()
]
}
}

0 comments on commit 1a7e791

Please sign in to comment.