Skip to content

Commit

Permalink
build(deps): use JDK11 everywhere, validate it in build
Browse files Browse the repository at this point in the history
API31 can't be attempted until JDK11 is in place
  • Loading branch information
mikehardy committed Apr 21, 2022
1 parent 7ea2609 commit fc6c09a
Show file tree
Hide file tree
Showing 9 changed files with 78 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/linux_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ jobs:
- name: Fetch submodules
run: git submodule update --init --recursive --remote --force

- name: Configure JDK 1.11
uses: actions/setup-java@v3
with:
distribution: "adopt"
java-version: "11" # minimum for Android API31

- uses: nttld/setup-ndk@v1
with:
ndk-version: r22
Expand Down
12 changes: 12 additions & 0 deletions .github/workflows/macos_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ jobs:
- name: Fetch submodules
run: git submodule update --init --recursive --remote --force

- name: Configure JDK 1.11
uses: actions/setup-java@v3
with:
distribution: "adopt"
java-version: "11" # minimum for Android API31

- uses: nttld/setup-ndk@v1
with:
ndk-version: r22
Expand Down Expand Up @@ -96,6 +102,12 @@ jobs:
name: rsdroid-instrumented
path: rsdroid-instrumented/build/outputs/apk

- name: Configure JDK 1.11
uses: actions/setup-java@v3
with:
distribution: "adopt"
java-version: "11" # minimum for Android API31

- uses: nttld/setup-ndk@v1
with:
ndk-version: r22
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/publish_library.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ jobs:
- name: Fetch submodules
run: git submodule update --init --recursive --remote --force

- name: Configure JDK 1.11
uses: actions/setup-java@v3
with:
distribution: "adopt"
java-version: "11" # minimum for Android API31

- uses: nttld/setup-ndk@v1
with:
ndk-version: r22
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/publish_testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ jobs:
- name: Fetch submodules
run: git submodule update --init --recursive --remote --force

- name: Configure JDK 1.11
uses: actions/setup-java@v3
with:
distribution: "adopt"
java-version: "11" # minimum for Android API31

- uses: nttld/setup-ndk@v1
with:
ndk-version: r22
Expand Down
12 changes: 12 additions & 0 deletions .github/workflows/robolectric_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ jobs:
- name: Fetch submodules
run: git submodule update --init --recursive --remote --force

- name: Configure JDK 1.11
uses: actions/setup-java@v3
with:
distribution: "adopt"
java-version: "11" # minimum for Android API31

- uses: nttld/setup-ndk@v1
with:
ndk-version: r22
Expand Down Expand Up @@ -136,6 +142,12 @@ jobs:
exit 1
fi
- name: Configure JDK 1.11
uses: actions/setup-java@v3
with:
distribution: "adopt"
java-version: "11" # minimum for Android API31

- uses: nttld/setup-ndk@v1
with:
ndk-version: r22
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/update_gradle_wrapper.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ jobs:
with:
submodules: 'recursive'

- name: Configure JDK 1.11
uses: actions/setup-java@v3
with:
distribution: "adopt"
java-version: "11" # minimum for Android API31

- uses: nttld/setup-ndk@v1
with:
ndk-version: r22
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/windows_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ jobs:

- uses: actions/checkout@v2

- name: Configure JDK 1.11
uses: actions/setup-java@v3
with:
distribution: "adopt"
java-version: "11" # minimum for Android API31

- uses: nttld/setup-ndk@v1
with:
ndk-version: r22
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/windows_pure_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ jobs:
- name: Fetch submodules
run: git submodule update --init --recursive --remote --force

- name: Configure JDK 1.11
uses: actions/setup-java@v3
with:
distribution: "adopt"
java-version: "11" # minimum for Android API31

- uses: nttld/setup-ndk@v1
with:
ndk-version: r22
Expand Down
18 changes: 18 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import org.gradle.internal.jvm.Jvm

// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext {
Expand Down Expand Up @@ -39,4 +41,20 @@ allprojects {

task clean(type: Delete) {
delete rootProject.buildDir
}


ext {
jvmVersion = Jvm.current().javaVersion.majorVersion
if (jvmVersion != "11" && jvmVersion != "14" && jvmVersion != "16") {
println "\n\n\n"
println "**************************************************************************************************************"
println "\n\n\n"
println "ERROR: Anki-Android-Backend builds with JVM version 11, 14, or 16."
println " Incompatible major version detected: '" + jvmVersion + "'"
println "\n\n\n"
println "**************************************************************************************************************"
println "\n\n\n"
System.exit(1)
}
}

0 comments on commit fc6c09a

Please sign in to comment.