Jelajahi Sumber

Use JDK 11 for CI

Karlatemp 4 tahun lalu
induk
melakukan
6f55816b08

+ 5 - 31
.github/workflows/build.yml

@@ -3,46 +3,20 @@ name: Build
 on: [ push, pull_request ]
 
 jobs:
-  build-mirai-core:
+  build:
 
     runs-on: ubuntu-latest
 
     steps:
       - uses: actions/checkout@v2
-
-      - name: Set up JDK 1.8
-        uses: actions/setup-java@v1
-        with:
-          java-version: 1.8
-
-      - name: chmod -R 777 *
-        run: chmod -R 777 *
-
-      - name: Init gradle project
-        run: ./gradlew clean --scan
-
-      - name: Build mirai-core series
-        run: ./gradlew assemble --scan
-
-      - name: mirai-core Tests
-        run: >
-          ./gradlew check --scan
-          -Dmirai.network.show.all.components=true
-          -Dkotlinx.coroutines.debug=on
-          -Dmirai.network.show.packet.details=true
-  build-all:
-    runs-on: ubuntu-latest
-    steps:
-      - name: Checkout repository
-        uses: actions/checkout@v2
-
       - name: Checkout submodules
         run: git submodule update --init --recursive
 
-      - name: Set up JDK 1.8
-        uses: actions/setup-java@v1
+      - name: Setup JDK 11
+        uses: actions/setup-java@v2
         with:
-          java-version: 1.8
+          distribution: 'adopt'
+          java-version: '11'
 
       - name: chmod -R 777 *
         run: chmod -R 777 *

+ 4 - 6
.github/workflows/doc.yml

@@ -13,13 +13,11 @@ jobs:
       - name: Checkout repository
         uses: actions/checkout@v2
 
-      - name: Checkout submodules
-        run: git submodule update --init --recursive
-
-      - name: Set up JDK 1.8
-        uses: actions/setup-java@v1
+      - name: Setup JDK 11
+        uses: actions/setup-java@v2
         with:
-          java-version: 1.8
+          distribution: 'adopt'
+          java-version: '11'
 
       - name: chmod -R 777 *
         run: chmod -R 777 *

+ 4 - 3
.github/workflows/release.yml

@@ -15,10 +15,11 @@ jobs:
       - name: Checkout submodules
         run: git submodule update --init --recursive
 
-      - name: Set up JDK 1.8
-        uses: actions/setup-java@v1
+      - name: Setup JDK 11
+        uses: actions/setup-java@v2
         with:
-          java-version: 1.8
+          distribution: 'adopt'
+          java-version: '11'
 
       - name: chmod -R 777 *
         run: chmod -R 777 *

+ 5 - 0
buildSrc/src/main/kotlin/ProjectConfigure.kt

@@ -46,6 +46,11 @@ fun Project.configureJvmTarget() {
     extensions.findByType(JavaPluginExtension::class.java)?.run {
         sourceCompatibility = defaultVer
         targetCompatibility = defaultVer
+
+        if (project.path.endsWith("mirai-console-intellij")) {
+            sourceCompatibility = JavaVersion.VERSION_11
+            targetCompatibility = JavaVersion.VERSION_11
+        }
     }
 
     kotlinTargets.orEmpty().filterIsInstance<KotlinJvmTarget>().forEach { target ->