From 90197a16301b94dbc143b8ffafba720c71937135 Mon Sep 17 00:00:00 2001 From: ix0rai Date: Tue, 9 Apr 2024 20:16:20 -0500 Subject: [PATCH] start fixing build --- .github/workflows/build.yml | 4 ++-- .github/workflows/generate-diff.yml | 6 +++--- .github/workflows/publish.yml | 2 +- .github/workflows/update-base.yml | 4 ++-- CONVENTIONS.md | 6 +++--- build.gradle | 29 ++++++++++++----------------- buildSrc/build.gradle | 4 ++++ gradle.properties | 2 +- gradle/libs.versions.toml | 6 +++--- settings.gradle | 6 +++--- 10 files changed, 34 insertions(+), 35 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 16c9e3c86d..453436a01e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -4,7 +4,7 @@ jobs: build: strategy: matrix: - java: [17, 19] + java: [21] runs-on: ubuntu-latest container: image: eclipse-temurin:${{ matrix.java }} @@ -19,7 +19,7 @@ jobs: - uses: gradle/wrapper-validation-action@v2 - run: ./gradlew build javadocJar --stacktrace - name: Build artifacts - if: ${{ matrix.java == 17 }} + if: ${{ matrix.java == 21 }} continue-on-error: true uses: actions/upload-artifact@v3 with: diff --git a/.github/workflows/generate-diff.yml b/.github/workflows/generate-diff.yml index ec638484ee..1685688f4c 100644 --- a/.github/workflows/generate-diff.yml +++ b/.github/workflows/generate-diff.yml @@ -4,7 +4,7 @@ jobs: diff: strategy: matrix: - java: [17] + java: [21] runs-on: ubuntu-latest container: image: eclipse-temurin:${{ matrix.java }} @@ -18,7 +18,7 @@ jobs: distribution: temurin - uses: gradle/wrapper-validation-action@v2 - run: ./gradlew decompileVineflower decompileTargetVineflower --stacktrace - if: ${{ matrix.java == 17 }} + if: ${{ matrix.java == 21 }} - name: Check Target Decompiled id: can-create-diff uses: andstor/file-existence-action@v3 @@ -30,7 +30,7 @@ jobs: continue-on-error: true - name: Create diff comment uses: ./.github/actions/diff-uploader/ - if: ${{ matrix.java == 17 }} + if: ${{ matrix.java == 21 }} id: diff-uploader with: github-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 631f79b026..f2550f851c 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -5,7 +5,7 @@ jobs: if: ${{ github.repository_owner == 'QuiltMC' }} runs-on: ubuntu-latest container: - image: eclipse-temurin:17 + image: eclipse-temurin:21 options: --user root steps: - uses: actions/checkout@v4 diff --git a/.github/workflows/update-base.yml b/.github/workflows/update-base.yml index 8c37de6e64..f1ffa5442e 100644 --- a/.github/workflows/update-base.yml +++ b/.github/workflows/update-base.yml @@ -27,11 +27,11 @@ jobs: with: ref: ${{ github.head_ref }} repository: ${{ github.event.pull_request.head.repo.full_name }} - # The container image openjdk:17 doesn't have git installed + # The container image openjdk:21 doesn't have git installed - uses: actions/setup-java@v4 with: distribution: 'temurin' - java-version: '17' + java-version: '21' - name: Drop invalid mappings run: ./gradlew dropInvalidMappings --stacktrace - name: Check for changes in the mappings directory diff --git a/CONVENTIONS.md b/CONVENTIONS.md index 4c65628936..329c2731c8 100644 --- a/CONVENTIONS.md +++ b/CONVENTIONS.md @@ -153,7 +153,7 @@ Since enigma format does not support `package-info.java` file creation, Quilt Ma ### Tooling -Quilt-hosted Javadocs are generated using [JDK 17 Standard Doclet](https://docs.oracle.com/en/java/javase/17/docs/specs/javadoc/doc-comment-spec.html) and can use any feature it supports. For example, it has a [list of supported tags](https://docs.oracle.com/en/java/javase/17/docs/specs/javadoc/doc-comment-spec.html#where-tags-can-be-used). You can personally build the documentation with a newer Java version. See [the 'Checking Javadoc' section](#checking-javadoc) for how to build the documentation locally. +Quilt-hosted Javadocs are generated using [JDK 21 Standard Doclet](https://docs.oracle.com/en/java/javase/21/docs/specs/javadoc/doc-comment-spec.html) and can use any feature it supports. For example, it has a [list of supported tags](https://docs.oracle.com/en/java/javase/21/docs/specs/javadoc/doc-comment-spec.html#where-tags-can-be-used). You can personally build the documentation with a newer Java version. See [the 'Checking Javadoc' section](#checking-javadoc) for how to build the documentation locally. ### Custom tags @@ -175,9 +175,9 @@ A class is assumed to be imported in the following scenarios: - If it is from the `java.lang` package - If it is from the same package as the currently documented class -- If it is used as part of its API, such as in the signature of the class or its members (methods and fields). See Javadoc's definition of "use" in its [`-use` command line option specification](https://docs.oracle.com/en/java/javase/17/docs/specs/man/javadoc.html#options-for-javadoc). +- If it is used as part of its API, such as in the signature of the class or its members (methods and fields). See Javadoc's definition of "use" in its [`-use` command line option specification](https://docs.oracle.com/en/java/javase/21/docs/specs/man/javadoc.html#options-for-javadoc). -If it does not fulfill one of these scenarios, use the [full binary name](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/ClassLoader.html#binary-name), such as `com.google.common.collect.Lists` rather than simply `Lists`. Unlike class naming in enigma, do not use `/` to separate packages; use `.` instead. +If it does not fulfill one of these scenarios, use the [full binary name](https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/ClassLoader.html#binary-name), such as `com.google.common.collect.Lists` rather than simply `Lists`. Unlike class naming in enigma, do not use `/` to separate packages; use `.` instead. Use Quilt Mappings when referencing Minecraft members, such as `net.minecraft.server.world.ThreadedChunkManager` rather than `net.minecraft.unmapped.C_ccazprxg`. The Javadoc task will warn if some links no longer work after a rename. diff --git a/build.gradle b/build.gradle index 1b5f4c84dc..eee7a61508 100644 --- a/build.gradle +++ b/build.gradle @@ -12,6 +12,10 @@ buildscript { name "Fabric Repository" url 'https://maven.fabricmc.net' } + // remove when ASM fix is released + maven { + url = "https://repository.ow2.org/nexus/content/repositories/snapshots/" + } mavenCentral() mavenLocal() } @@ -61,9 +65,10 @@ repositories { name "Quilt Snapshot Repository" url "https://maven.quiltmc.org/repository/snapshot" } + // remove when ASM fix is released maven { - // Vineflower snapshots - url = "https://s01.oss.sonatype.org/content/repositories/snapshots/" + name "OW2 Snapshots" + url "https://repository.ow2.org/nexus/content/repositories/snapshots/" } mavenLocal() } @@ -131,13 +136,13 @@ remapUnpickDefinitions { } java { - sourceCompatibility = JavaVersion.VERSION_17 - targetCompatibility = JavaVersion.VERSION_17 + sourceCompatibility = JavaVersion.VERSION_21 + targetCompatibility = JavaVersion.VERSION_21 } tasks.withType(JavaCompile).configureEach { it.options.encoding = "UTF-8" - it.options.release = 17 + it.options.release = 21 } sourceSets { @@ -224,16 +229,6 @@ task buildIntermediary { task eraseBytecode(type: TransformJarClassesTask, dependsOn: mapNamedJar) { jarFile = mappings.fileConstants.namedJar output = file(".gradle/temp/erased-classes/") - // TODO: https://github.com/Vineflower/vineflower/issues/297 - visitor { new ClassVisitor(Opcodes.ASM9, it) { - @Override - void visit(int version, int access, String name, String signature, String superName, String[] interfaces) { - if (superName == "java/lang/Record") { - access |= Opcodes.ACC_RECORD - } - super.visit(version, access, name, signature, superName, interfaces) - } - } } visitor(DraftsmanAdapterClassVisitor::new) // Set protected/package-private classes to public so that we don't have any access compile errors. @@ -375,7 +370,7 @@ javadoc { // verbose = true // enable to debug options { // verbose() // enable to debug - source = "17" + source = "21" encoding = 'UTF-8' charSet = 'UTF-8' memberLevel = JavadocMemberLevel.PRIVATE @@ -407,7 +402,7 @@ javadoc { "https://javadoc.quiltmc.org/quilt-loader/${libs.versions.quilt.loader.get()}/", "https://docs.oracle.com/en/java/javase/${project.java}/docs/api/" ) - // https://docs.oracle.com/en/java/javase/17/docs/specs/man/javadoc.html#additional-options-provided-by-the-standard-doclet + // https://docs.oracle.com/en/java/javase/21/docs/specs/man/javadoc.html#additional-options-provided-by-the-standard-doclet addBooleanOption 'Xdoclint:html', true addBooleanOption 'Xdoclint:syntax', true addBooleanOption 'Xdoclint:reference', true diff --git a/buildSrc/build.gradle b/buildSrc/build.gradle index 299048f475..6bda4033a7 100644 --- a/buildSrc/build.gradle +++ b/buildSrc/build.gradle @@ -25,6 +25,10 @@ repositories { // Vineflower snapshots url = "https://s01.oss.sonatype.org/content/repositories/snapshots/" } + // remove when ASM fix is released + maven { + url = "https://repository.ow2.org/nexus/content/repositories/snapshots/" + } mavenLocal() } diff --git a/gradle.properties b/gradle.properties index 474940ede6..d0945aa10c 100644 --- a/gradle.properties +++ b/gradle.properties @@ -7,5 +7,5 @@ org.gradle.jvmargs=-Xmx3G commons_codec=1.15 commons_compress=1.21 gson=2.9.1 -java=17 +java=21 netty=4.1.68.Final diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 2e54d4da96..d5fc7a4cfc 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -4,7 +4,7 @@ download_task = "4.1.1" guava = "31.1-jre" jackson_xml = "2.14.1" launchermeta_parser = "1.0.0" -enigma = "2.2.1" +enigma = "2.3.0" enigma_plugin = "2.2.0" tiny_remapper = "0.7.2" stitch = "0.6.1" @@ -12,13 +12,13 @@ unpick = "3.0.7" mapping_io = "0.3.0" javadoc_draftsman = "1.2.3" -quilt_loader = "0.20.0-beta.9" +quilt_loader = "0.23.0" jetbrains_annotations = "23.0.0" jsr305 = "3.0.2" gson = "2.9.1" netty = "4.1" -vineflower = "1.10.0-20230713.053900-2" +vineflower = "1.10.0" cfr = "0.2.0" junit = "5.9.1" diff --git a/settings.gradle b/settings.gradle index 67a0ecbb5c..489c0155c1 100644 --- a/settings.gradle +++ b/settings.gradle @@ -12,9 +12,9 @@ pluginManagement { } } -// This check is done here before any plugins that may require java 17 are able to load. -if (!JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_17)) { - throw new UnsupportedOperationException("Quilt Mappings's buildscript requires Java 17 or higher.") +// This check is done here before any plugins that may require java 21 are able to load. +if (!JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_21)) { + throw new UnsupportedOperationException("Quilt Mappings's buildscript requires Java 21 or higher. (current version: " + JavaVersion.current() + ")") } rootProject.name = "quilt-mappings"