From f5db84345e353f83fce5f9236b568b80a3c29f31 Mon Sep 17 00:00:00 2001 From: gnembon Date: Wed, 12 May 2021 22:48:44 -0300 Subject: [PATCH 1/2] update toolchain to Java 16 --- .github/workflows/build-on-pr.yml | 4 ++-- .github/workflows/devbuild.yml | 4 ++-- .github/workflows/publish-release.yml | 10 ++++---- build.gradle | 30 ++++++++++++++---------- gradle/wrapper/gradle-wrapper.properties | 2 +- 5 files changed, 28 insertions(+), 22 deletions(-) diff --git a/.github/workflows/build-on-pr.yml b/.github/workflows/build-on-pr.yml index 334149db..46bb858a 100644 --- a/.github/workflows/build-on-pr.yml +++ b/.github/workflows/build-on-pr.yml @@ -15,10 +15,10 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Set up JDK 1.8 + - name: Set up JDK 16 uses: actions/setup-java@v1 with: - java-version: 1.8 + java-version: 16 - name: Cache Gradle packages uses: actions/cache@v2 with: diff --git a/.github/workflows/devbuild.yml b/.github/workflows/devbuild.yml index 27ada928..cfef27e7 100644 --- a/.github/workflows/devbuild.yml +++ b/.github/workflows/devbuild.yml @@ -15,10 +15,10 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Set up JDK 1.8 + - name: Set up JDK 16 uses: actions/setup-java@v1 with: - java-version: 1.8 + java-version: 16 - name: Cache Gradle packages uses: actions/cache@v2 with: diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml index 6bbe6b4b..526ab335 100644 --- a/.github/workflows/publish-release.yml +++ b/.github/workflows/publish-release.yml @@ -65,10 +65,10 @@ jobs: uses: actions/checkout@v2 with: ref: ${{ steps.getbranchinfo.outputs.branchname }} - - name: Set up JDK 1.8 + - name: Set up JDK 16 uses: actions/setup-java@v1 with: - java-version: 1.8 + java-version: 16 - name: Cache Gradle packages uses: actions/cache@v2 with: @@ -139,10 +139,10 @@ jobs: steps: - name: Checkout Carpet sources uses: actions/checkout@v2 - - name: Set up JDK 1.8 + - name: Set up JDK 16 uses: actions/setup-java@v1 with: - java-version: 1.8 + java-version: 16 - name: Cache Gradle packages uses: actions/cache@v2 with: @@ -157,7 +157,7 @@ jobs: { "schemaVersion": 1, "id": "carpet", - "version": "1.4.11", + "version": "1.4.36", "entrypoints": { "server": [ "carpet.utils.CarpetRulePrinter" ], "preLaunch": [ "carpet.utils.CarpetRulePrinter" ] diff --git a/build.gradle b/build.gradle index 86cbcc83..317189c7 100644 --- a/build.gradle +++ b/build.gradle @@ -1,5 +1,5 @@ plugins { - id 'fabric-loom' version '0.5-SNAPSHOT' + id 'fabric-loom' version '0.8-SNAPSHOT' id 'maven-publish' } @@ -18,7 +18,7 @@ dependencies { // To change the versions see the gradle.properties file minecraft "com.mojang:minecraft:${project.minecraft_version}" mappings "net.fabricmc:yarn:${project.yarn_mappings}:v2" - modCompile "net.fabricmc:fabric-loader:${project.loader_version}" + modImplementation "net.fabricmc:fabric-loader:${project.loader_version}" // Fabric API. This is technically optional, but you probably want it anyway. // modCompile "net.fabricmc:fabric:${project.fabric_version}" @@ -31,14 +31,17 @@ dependencies { processResources { inputs.property "version", project.version - from(sourceSets.main.resources.srcDirs) { - include "fabric.mod.json" - expand "version": project.mod_version + filesMatching("fabric.mod.json") { + expand "version": project.version } + //from(sourceSets.main.resources.srcDirs) { + // include "fabric.mod.json" + // expand "version": project.mod_version + //} - from(sourceSets.main.resources.srcDirs) { - exclude "fabric.mod.json" - } + //from(sourceSets.main.resources.srcDirs) { + // exclude "fabric.mod.json" + //} } @@ -52,10 +55,13 @@ tasks.withType(JavaCompile).configureEach { // The Minecraft launcher currently installs Java 8 for users, so your mod probably wants to target Java 8 too // JDK 9 introduced a new way of specifying this that will make sure no newer classes or methods are used. // We'll use that if it's available, but otherwise we'll use the older option. - def targetVersion = 8 - if (JavaVersion.current().isJava9Compatible()) { - it.options.release = targetVersion - } + //def targetVersion = 8 + //if (JavaVersion.current().isJava9Compatible()) { + // it.options.release = targetVersion + //} + + // Minecraft 1.17 (21w19a) upwards uses Java 16. + //it.options.release = 16 } java { diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index be52383e..e5338d37 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.1-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists From 15bba80cb5955352bec8df084ee12f17256a6670 Mon Sep 17 00:00:00 2001 From: gnembon <41132274+gnembon@users.noreply.github.com> Date: Wed, 12 May 2021 20:08:06 -0300 Subject: [PATCH 2/2] uncomment (#857) * uncomment * copy from altrisi's --- .github/workflows/build-on-pr.yml | 8 +++----- .github/workflows/devbuild.yml | 8 +++----- .github/workflows/publish-release.yml | 6 ++++-- build.gradle | 8 ++++---- 4 files changed, 14 insertions(+), 16 deletions(-) diff --git a/.github/workflows/build-on-pr.yml b/.github/workflows/build-on-pr.yml index 46bb858a..084e24f7 100644 --- a/.github/workflows/build-on-pr.yml +++ b/.github/workflows/build-on-pr.yml @@ -3,10 +3,7 @@ name: Pull Request Builds -on: - pull_request: - paths: - - "src/**" +on: [pull_request] jobs: Build: @@ -16,8 +13,9 @@ jobs: steps: - uses: actions/checkout@v2 - name: Set up JDK 16 - uses: actions/setup-java@v1 + uses: actions/setup-java@v2 with: + distribution: 'adopt' java-version: 16 - name: Cache Gradle packages uses: actions/cache@v2 diff --git a/.github/workflows/devbuild.yml b/.github/workflows/devbuild.yml index cfef27e7..0853e93e 100644 --- a/.github/workflows/devbuild.yml +++ b/.github/workflows/devbuild.yml @@ -3,10 +3,7 @@ name: Development Builds -on: - push: - paths: - - "src/**" +on: [push] jobs: Build: @@ -16,8 +13,9 @@ jobs: steps: - uses: actions/checkout@v2 - name: Set up JDK 16 - uses: actions/setup-java@v1 + uses: actions/setup-java@v2 with: + distribution: 'adopt' java-version: 16 - name: Cache Gradle packages uses: actions/cache@v2 diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml index 526ab335..16676ba1 100644 --- a/.github/workflows/publish-release.yml +++ b/.github/workflows/publish-release.yml @@ -66,8 +66,9 @@ jobs: with: ref: ${{ steps.getbranchinfo.outputs.branchname }} - name: Set up JDK 16 - uses: actions/setup-java@v1 + uses: actions/setup-java@v2 with: + distribution: 'adopt' java-version: 16 - name: Cache Gradle packages uses: actions/cache@v2 @@ -140,8 +141,9 @@ jobs: - name: Checkout Carpet sources uses: actions/checkout@v2 - name: Set up JDK 16 - uses: actions/setup-java@v1 + uses: actions/setup-java@v2 with: + distribution: 'adopt' java-version: 16 - name: Cache Gradle packages uses: actions/cache@v2 diff --git a/build.gradle b/build.gradle index 317189c7..83f535d4 100644 --- a/build.gradle +++ b/build.gradle @@ -55,10 +55,10 @@ tasks.withType(JavaCompile).configureEach { // The Minecraft launcher currently installs Java 8 for users, so your mod probably wants to target Java 8 too // JDK 9 introduced a new way of specifying this that will make sure no newer classes or methods are used. // We'll use that if it's available, but otherwise we'll use the older option. - //def targetVersion = 8 - //if (JavaVersion.current().isJava9Compatible()) { - // it.options.release = targetVersion - //} + def targetVersion = 8 + if (JavaVersion.current().isJava9Compatible()) { + it.options.release = targetVersion + } // Minecraft 1.17 (21w19a) upwards uses Java 16. //it.options.release = 16