Skip to content

Commit

Permalink
start fixing build
Browse files Browse the repository at this point in the history
  • Loading branch information
ix0rai committed Apr 10, 2024
1 parent 065b913 commit 90197a1
Show file tree
Hide file tree
Showing 10 changed files with 34 additions and 35 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ jobs:
build:
strategy:
matrix:
java: [17, 19]
java: [21]
runs-on: ubuntu-latest
container:
image: eclipse-temurin:${{ matrix.java }}
Expand All @@ -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:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/generate-diff.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ jobs:
diff:
strategy:
matrix:
java: [17]
java: [21]
runs-on: ubuntu-latest
container:
image: eclipse-temurin:${{ matrix.java }}
Expand All @@ -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
Expand All @@ -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 }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/update-base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions CONVENTIONS.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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.

Expand Down
29 changes: 12 additions & 17 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
Expand Down Expand Up @@ -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()
}
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions buildSrc/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}

Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 3 additions & 3 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,21 @@ 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"
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"
Expand Down
6 changes: 3 additions & 3 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 90197a1

Please sign in to comment.