Skip to content

Commit

Permalink
Merge pull request #15 from elide-dev/feat/java-17
Browse files Browse the repository at this point in the history
Chore: Upgrade to Java 17
  • Loading branch information
sgammon authored Jun 28, 2022
2 parents aabe77a + 43b1aba commit 0b3ea4b
Show file tree
Hide file tree
Showing 18 changed files with 65 additions and 53 deletions.
69 changes: 36 additions & 33 deletions .github/workflows/build.ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ on:
- stable
pull_request:
types: [labeled, opened, reopened, synchronize]
env:
JAVA_HOME: /opt/hostedtoolcache/GraalVM/21.0.0-2-java11-amd64/x64
GRAALVM_HOME: /opt/hostedtoolcache/GraalVM/21.0.0-2-java11-amd64/x64

jobs:
##
Expand Down Expand Up @@ -52,14 +49,15 @@ jobs:
- uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '11'
java-version: '17'

## Setup: GraalVM
- uses: elide-tools/setup-graalvm@5.0
- uses: graalvm/setup-graalvm@v1
with:
graalvm: '21.0.0.2'
java: 'java11'
arch: 'amd64'
version: 'latest'
java-version: '17'
components: 'native-image'
github-token: ${{ secrets.GITHUB_TOKEN }}

## Setup: Checkout Code
- uses: actions/checkout@v3
Expand Down Expand Up @@ -127,14 +125,15 @@ jobs:
- uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '11'
java-version: '17'

## Setup: GraalVM
- uses: elide-tools/setup-graalvm@5.0
- uses: graalvm/setup-graalvm@v1
with:
graalvm: '21.0.0.2'
java: 'java11'
arch: 'amd64'
version: 'latest'
java-version: '17'
components: 'native-image'
github-token: ${{ secrets.GITHUB_TOKEN }}

## Prep: Download Caches
- name: Cache dependencies
Expand Down Expand Up @@ -203,14 +202,15 @@ jobs:
- uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '11'
java-version: '17'

## Setup: GraalVM
- uses: DeLaGuardo/setup-graalvm@5.0
- uses: graalvm/setup-graalvm@v1
with:
graalvm: '21.0.0.2'
java: 'java11'
arch: 'amd64'
version: 'latest'
java-version: '17'
components: 'native-image'
github-token: ${{ secrets.GITHUB_TOKEN }}

## Setup: `gu` components
- name: Install native-image component
Expand Down Expand Up @@ -269,14 +269,15 @@ jobs:
- uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '11'
java-version: '17'

## Setup: GraalVM
- uses: elide-tools/setup-graalvm@5.0
- uses: graalvm/setup-graalvm@v1
with:
graalvm: '21.0.0.2'
java: 'java11'
arch: 'amd64'
version: 'latest'
java-version: '17'
components: 'native-image'
github-token: ${{ secrets.GITHUB_TOKEN }}

## Setup: Checkout Code
- name: Cache SonarCloud packages
Expand Down Expand Up @@ -375,14 +376,15 @@ jobs:
- uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '11'
java-version: '17'

## Setup: GraalVM
- uses: DeLaGuardo/setup-graalvm@5.0
- uses: graalvm/setup-graalvm@v1
with:
graalvm: '21.0.0.2'
java: 'java11'
arch: 'amd64'
version: 'latest'
java-version: '17'
components: 'native-image'
github-token: ${{ secrets.GITHUB_TOKEN }}

## Setup: QEMU
- name: Set up QEMU
Expand Down Expand Up @@ -534,14 +536,15 @@ jobs:
- uses: actions/setup-java@v3
with:
distribution: 'zulu'
java-version: '11'
java-version: '17'

## Setup: GraalVM
- uses: DeLaGuardo/setup-graalvm@5.0
- uses: graalvm/setup-graalvm@v1
with:
graalvm: '21.0.0.2'
java: 'java11'
arch: 'amd64'
version: 'latest'
java-version: '17'
components: 'native-image'
github-token: ${{ secrets.GITHUB_TOKEN }}

## Setup: QEMU
- name: Set up QEMU
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/codeql.ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ jobs:
java-version: '11'

## Setup: GraalVM
- uses: DeLaGuardo/setup-graalvm@5.0
- uses: graalvm/setup-graalvm@v1
with:
graalvm: '21.0.0.2'
java: 'java11'
arch: 'amd64'
version: '21.1.0'
java-version: '17'
components: 'native-image'

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
Expand Down
6 changes: 6 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ props.load(file(if (project.hasProperty("elide.ci") && project.properties["elide
"local.properties"
}).inputStream())

val javaVersion = Versions.javaLanguage

tasks.dokkaHtmlMultiModule.configure {
outputDirectory.set(buildDir.resolve("docs/kotlin/html"))
}
Expand Down Expand Up @@ -128,6 +130,10 @@ allprojects {
maven("https://maven-central.storage-download.googleapis.com/maven2/")
jcenter()
}
tasks.withType<JavaCompile>().configureEach {
sourceCompatibility = javaVersion
targetCompatibility = javaVersion
}
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompileCommon>().configureEach {
kotlinOptions {
apiVersion = Versions.kotlinLanguage
Expand Down
2 changes: 1 addition & 1 deletion buildSrc/src/main/kotlin/Versions.kt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ object Versions {
const val kotlinLanguage = "1.7"
const val kotlinSerialization = "1.3.3"
const val kotlinxHtml = "0.7.5"
const val javaLanguage = "11"
const val javaLanguage = "17"
const val kotest = "5.3.2"
const val micronaut = "3.5.2"
const val micronautPlugin = "3.4.1"
Expand Down
5 changes: 4 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ org.gradle.configureondemand=true
org.gradle.jvmargs=-XX:MaxMetaspaceSize=768m

## Settings: Languages
versions.java.language=11
versions.java.language=17
versions.kotlin.sdk=1.7.0
versions.kotlin.language=1.7

Expand All @@ -27,6 +27,9 @@ kotlin.code.style=official
kotlin.js.compiler=both
kotlin.js.generate.executable.default=false
kotlin.parallel.tasks.in.project=true
kotlin.build.report.output=build_scan
kotlin.incremental=true
kotlin.incremental.useClasspathSnapshot=true
kotlin.mpp.stability.nowarn=true
kotlin.mpp.enableCInteropCommonization=true
kotlin.mpp.enableCompatibilityMetadataVariant=true
Expand Down
2 changes: 1 addition & 1 deletion images/base/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ FROM --platform=linux/${UBUNTU_ARCH} ubuntu:${UBUNTU_VERSION}
ARG GRAAL_EDITION=ce
ARG GRAAL_VERSION=22.1.0
ARG GRAAL_ARCH=amd64
ARG JAVA_VERSION=java11
ARG JAVA_VERSION=java17

RUN apt-get update \
&& apt-get -y upgrade \
Expand Down
4 changes: 2 additions & 2 deletions images/builder/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ ARG BASE_ARCH="amd64"

FROM --platform=linux/${BASE_ARCH} us-docker.pkg.dev/elide-fw/tools/base${BASE_IMAGE}

ARG JDK_VERSION="11"
ARG JDK_VERSION="17"
ARG NODE_VERSION="17"
ARG YARN_VERSION="berry"
ARG GRADLE_VERSION=7.4.2
Expand Down Expand Up @@ -193,7 +193,7 @@ RUN echo "Building Elide builder image..." \

ENV GRADLE_HOME="/opt/gradle" \
KOTLIN_HOME="/opt/kotlinc" \
JAVA_HOME="/usr/lib/jvm/zulu11" \
JAVA_HOME="/usr/lib/jvm/zulu17" \
GRAALVM_HOME="/usr/lib/gvm" \
GOPATH="/go" \
QTWEBENGINE_DISABLE_SANDBOX="1" \
Expand Down
2 changes: 1 addition & 1 deletion packages/graalvm/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ kotlin {

java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(11))
languageVersion.set(JavaLanguageVersion.of(17))
vendor.set(JvmVendorSpec.GRAAL_VM)
if (project.hasProperty("elide.graalvm.variant")) {
val variant = project.property("elide.graalvm.variant") as String
Expand Down
2 changes: 1 addition & 1 deletion packages/rpc-jvm/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ kotlin {

java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(11))
languageVersion.set(JavaLanguageVersion.of(17))
}
}

Expand Down
2 changes: 1 addition & 1 deletion packages/server/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ kotlin {

java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(11))
languageVersion.set(JavaLanguageVersion.of(17))
}
}

Expand Down
Empty file.
Empty file.
2 changes: 1 addition & 1 deletion samples/fullstack/basic/server/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ kotlin {

java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(11))
languageVersion.set(JavaLanguageVersion.of(17))
}
}

Expand Down
4 changes: 2 additions & 2 deletions samples/fullstack/react-ssr/server/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ kotlin {

java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(11))
languageVersion.set(JavaLanguageVersion.of(17))
vendor.set(JvmVendorSpec.GRAAL_VM)
if (project.hasProperty("elide.graalvm.variant")) {
val variant = project.property("elide.graalvm.variant") as String
Expand All @@ -50,7 +50,7 @@ graalvmNative {
))

javaLauncher.set(javaToolchains.launcherFor {
languageVersion.set(JavaLanguageVersion.of(11))
languageVersion.set(JavaLanguageVersion.of(17))
if (project.hasProperty("elide.graalvm.variant")) {
val variant = project.property("elide.graalvm.variant") as String
if (variant != "COMMUNITY") {
Expand Down
2 changes: 1 addition & 1 deletion samples/fullstack/react/server/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ kotlin {

java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(11))
languageVersion.set(JavaLanguageVersion.of(17))
}
}

Expand Down
4 changes: 2 additions & 2 deletions samples/fullstack/ssr/server/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ kotlin {

java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(11))
languageVersion.set(JavaLanguageVersion.of(17))
}
}

Expand Down Expand Up @@ -103,7 +103,7 @@ graalvmNative {
))

javaLauncher.set(javaToolchains.launcherFor {
languageVersion.set(JavaLanguageVersion.of(11))
languageVersion.set(JavaLanguageVersion.of(17))
if (project.hasProperty("elide.graalvm.variant")) {
val variant = project.property("elide.graalvm.variant") as String
if (variant != "COMMUNITY") {
Expand Down
2 changes: 1 addition & 1 deletion samples/server/hellocss/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ kotlin {

java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(11))
languageVersion.set(JavaLanguageVersion.of(17))
}
}

Expand Down
2 changes: 1 addition & 1 deletion samples/server/helloworld/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ kotlin {

java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(11))
languageVersion.set(JavaLanguageVersion.of(17))
}
}

Expand Down

0 comments on commit 0b3ea4b

Please sign in to comment.