Skip to content

Commit

Permalink
Update buildscript
Browse files Browse the repository at this point in the history
- Filament 0.7.1
- Multi-filament 0.3.0
- Gradle 8.6
- Other dependencies + Github Actions

(cherry picked from commit 89655ba)
  • Loading branch information
thecatcore committed Feb 25, 2024
1 parent 9758fa8 commit 1abbdb5
Show file tree
Hide file tree
Showing 11 changed files with 74 additions and 47 deletions.
3 changes: 2 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
* text eol=lf
* text=auto eol=lf
*.bat text eol=crlf
6 changes: 3 additions & 3 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ jobs:
env:
MC_VERSION: ${{ matrix.mc_version }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.x' # Version range or exact version of a Python version to use, using SemVer's version range syntax
- uses: actions/setup-java@v3
- uses: actions/setup-java@v4
with:
distribution: 'temurin' # See 'Supported distributions' for available options
java-version: '17'
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -157,11 +157,11 @@ jobs:
env:
MC_VERSION: ${{ matrix.mc_version }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.x' # Version range or exact version of a Python version to use, using SemVer's version range syntax
- uses: actions/setup-java@v3
- uses: actions/setup-java@v4
with:
distribution: 'temurin' # See 'Supported distributions' for available options
java-version: '17'
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/publish_others.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
"16w04a","16w05a","16w05b","16w06a","16w07a","16w07b",
"1.9-pre1","1.9-pre2","1.9-pre3","1.9-pre4",
"1.9.1-pre1","1.9.1-pre2","1.9.1-pre3",

"16w14a","16w15a","16w15b",

"1.9.3-pre1","1.9.3-pre2","1.9.3-pre3",
Expand Down Expand Up @@ -92,11 +92,11 @@ jobs:
env:
MC_VERSION: ${{ matrix.mc_version }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.x' # Version range or exact version of a Python version to use, using SemVer's version range syntax
- uses: actions/setup-java@v3
- uses: actions/setup-java@v4
with:
distribution: 'temurin' # See 'Supported distributions' for available options
java-version: '17'
Expand Down
16 changes: 16 additions & 0 deletions .github/workflows/spellcheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: "Check spelling"

on:
pull_request:
push:

jobs:
spellcheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: streetsidesoftware/cspell-action@v5
with:
config: "cspell.config.json"
files: "mappings/**/*.mapping"
incremental_files_only: false
31 changes: 20 additions & 11 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ plugins {
id 'java' // for constants, packages, javadoc
id 'maven-publish'
id "com.diffplug.spotless" version "6.21.0"
id 'net.fabricmc.filament' version "0.6.2"
id 'net.legacyfabric.multifilament' version "0.2.8" apply false
id 'net.fabricmc.filament' version "0.7.1"
id 'net.legacyfabric.multifilament' version "0.3.0" apply false
}

def taskName = project.gradle.startParameter.taskNames[0]
Expand Down Expand Up @@ -121,13 +121,16 @@ dependencies {

def minecraftLibraries = configurations.minecraftLibraries


import com.diffplug.spotless.LineEnding
import cuchaz.enigma.command.CheckMappingsCommand
import net.fabricmc.filament.task.MapJarTask
import net.fabricmc.filament.task.UnpickJarTask
import net.fabricmc.filament.task.minecraft.MergeMinecraftTask
import net.fabricmc.filament.task.base.WithFileInput
import net.fabricmc.filament.task.base.WithFileOutput
import net.fabricmc.filament.task.enigma.MapSpecializedMethodsTask
import net.fabricmc.filament.task.mappingio.CompleteMappingsTask
import net.fabricmc.filament.task.mappingio.ConvertMappingsTask
import net.fabricmc.filament.task.mappingio.MergeMappingsTask
import net.fabricmc.mappingio.format.MappingFormat
Expand Down Expand Up @@ -219,24 +222,30 @@ tasks.register('mapSpecializedMethods', MapSpecializedMethodsTask) {
dependsOn versionifyMappingsExclude
intermediaryJarFile = mapIntermediaryJar.output
mappings = multiFilament.activeMappingsDir
output = multiFilament.tempDirectory.file("yarn-mappings-v2.tiny")
output = multiFilament.tempDirectory.file("yarn-specialized-mappings-v2.tiny")

inputMappingsFormat = "enigma"
outputMappingsFormat = "tinyv2:intermediary:named"
}

tasks.register('completeMappings', CompleteMappingsTask) {
input = mapSpecializedMethods.output
output = multiFilament.tempDirectory.file("yarn-mappings-v2.tiny")
outputFormat = MappingFormat.TINY_2_FILE
}

tasks.register('convertToV1', ConvertMappingsTask) {
input = mapSpecializedMethods.output
output = multiFilament.tempDirectory.file("yarn-mappings.tiny")
outputFormat = MappingFormat.TINY
outputFormat = MappingFormat.TINY_FILE
}

tasks.register('mergeTiny', MergeMappingsTask) {
group = multiFilament.buildMappingGroup.get()
output = multiFilament.tempDirectory.file("mappings.tiny")
mappingInputs.from downloadIntermediary.output
mappingInputs.from convertToV1.output
outputFormat = MappingFormat.TINY
outputFormat = MappingFormat.TINY_FILE
}

// Disable the default jar task
Expand Down Expand Up @@ -323,7 +332,7 @@ tasks.withType(AbstractArchiveTask).configureEach {
}

spotless {
lineEndings = com.diffplug.spotless.LineEnding.UNIX
lineEndings = LineEnding.UNIX

java {
licenseHeaderFile(rootProject.file("HEADER"))
Expand All @@ -343,7 +352,7 @@ build.dependsOn constantsJar
tasks.register('insertAutoGeneratedEnumMappings', FileInputOutput) {
dependsOn mapIntermediaryJar, downloadIntermediary
group = multiFilament.buildMappingGroup.get()
input = mapSpecializedMethods.output
input = completeMappings.output
output = multiFilament.tempDirectory.file("unmerged-named-v2-with-enum.tiny")

inputs.file mapIntermediaryJar.output
Expand Down Expand Up @@ -389,7 +398,7 @@ tasks.register('mergeV2', MergeMappingsTask) {
output = multiFilament.tempDirectory.file("merged-v2.tiny")
mappingInputs.from downloadIntermediary.output
mappingInputs.from insertAutoGeneratedEnumMappings.output
outputFormat = MappingFormat.TINY_2
outputFormat = MappingFormat.TINY_2_FILE
}

tasks.register('v2UnmergedYarnJar', Jar) {
Expand Down Expand Up @@ -552,8 +561,8 @@ javadoc {
source fileTree(fakeSourceDir) + sourceSets.constants.allJava + sourceSets.packageDocs.allJava
classpath = configurations.javadocClasspath.plus minecraftLibraries

def fs = services.get(FileSystemOperations.class)
def outputDir = javadoc.outputDirectory
def fs = project.services.get(FileSystemOperations.class)
def outputDir = javadoc.destinationDir

doLast {
fs.copy {
Expand Down Expand Up @@ -602,7 +611,7 @@ check.dependsOn javadocLint

publishing {
publications {
maven(MavenPublication) {
register("maven", MavenPublication) {
groupId "net.legacyfabric" + getIntermediaryGroup()
artifactId "yarn"
version yarnVersion
Expand Down
12 changes: 6 additions & 6 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ org.gradle.configuration-cache=true

intermediary_version=2

enigma_version=2.3.1
enigma_version=2.4.1
unpick_version=2.3.0
cfr_version=0.2.1
name_proposal_version=0.1.4
asm_version=9.5
cfr_version=0.2.2
name_proposal_version=0.2.0
asm_version=9.6

# Javadoc generation/linking
fabric_loader_version=0.14.14
jetbrains_annotations_version=23.0.0
fabric_loader_version=0.15.6
jetbrains_annotations_version=24.1.0
mappingpoet_version=0.3.2
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
17 changes: 9 additions & 8 deletions gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ done
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
Expand Down Expand Up @@ -141,15 +142,15 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC2039,SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
# shellcheck disable=SC2039,SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
Expand Down Expand Up @@ -198,11 +199,11 @@ fi
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
# double quotes to make sure that they get re-expanded; and
# * put everything else in single quotes, so that it's not re-expanded.
# Collect all arguments for the java command:
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# and any embedded shellness will be escaped.
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# treated as '${Hostname}' itself on the command line.

set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
Expand Down
20 changes: 10 additions & 10 deletions gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if %ERRORLEVEL% equ 0 goto execute

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo. 1>&2
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2

goto fail

Expand All @@ -57,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe

if exist "%JAVA_EXE%" goto execute

echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo. 1>&2
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2

goto fail

Expand Down

0 comments on commit 1abbdb5

Please sign in to comment.