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
  • Loading branch information
thecatcore committed Feb 25, 2024
1 parent 4f5554e commit 89655ba
Show file tree
Hide file tree
Showing 11 changed files with 59 additions and 48 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 @@ -24,11 +24,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'
- uses: actions/setup-java@v3
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
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 @@ -73,11 +73,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'
- uses: actions/setup-java@v2
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/publish_others.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,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'
- uses: actions/setup-java@v3
- uses: actions/setup-java@v4
with:
distribution: 'temurin'
java-version: '17'
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/spellcheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ jobs:
spellcheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: streetsidesoftware/cspell-action@v3
- uses: actions/checkout@v4
- uses: streetsidesoftware/cspell-action@v5
with:
config: "cspell.config.json"
files: "mappings/**/*.mapping"
Expand Down
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=1

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.22
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
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
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 @@ -144,15 +145,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 @@ -201,11 +202,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 89655ba

Please sign in to comment.