Update buildscript

This commit is contained in:
modmuss50 2024-02-07 23:08:02 +00:00
parent eafbb88a09
commit ac7bd167b7
10 changed files with 48 additions and 46 deletions

View File

@ -4,18 +4,18 @@ jobs:
build: build:
strategy: strategy:
matrix: matrix:
java: [17-jdk, 20-jdk] java: [17-jdk, 21-jdk]
runs-on: ubuntu-22.04 runs-on: ubuntu-22.04
container: container:
image: eclipse-temurin:${{ matrix.java }} image: eclipse-temurin:${{ matrix.java }}
options: --user root options: --user root
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- run: ./gradlew build javadocJar checkMappings --stacktrace --warning-mode fail - run: ./gradlew build javadocJar checkMappings --stacktrace --warning-mode fail
- name: Build artifacts - name: Build artifacts
if: ${{ matrix.java == '20-jdk' }} if: ${{ matrix.java == '21-jdk' }}
continue-on-error: true continue-on-error: true
uses: actions/upload-artifact@v3 uses: actions/upload-artifact@v4
with: with:
name: Artifacts name: Artifacts
path: build/libs/ path: build/libs/
@ -23,9 +23,9 @@ jobs:
test-build-logic: test-build-logic:
runs-on: ubuntu-22.04 runs-on: ubuntu-22.04
container: container:
image: eclipse-temurin:20-jdk image: eclipse-temurin:21-jdk
options: --user root options: --user root
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- uses: gradle/wrapper-validation-action@v1 - uses: gradle/wrapper-validation-action@v1
- run: ./gradlew :filament:build - run: ./gradlew :filament:build

View File

@ -6,10 +6,10 @@ jobs:
if: ${{ github.repository_owner == 'FabricMC' }} if: ${{ github.repository_owner == 'FabricMC' }}
runs-on: ubuntu-22.04 runs-on: ubuntu-22.04
container: container:
image: eclipse-temurin:20-jdk image: eclipse-temurin:21-jdk
options: --user root options: --user root
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
# Generate the build number based on tags to allow per branch build numbers, not something github provides by default. # Generate the build number based on tags to allow per branch build numbers, not something github provides by default.
- name: Generate build number - name: Generate build number
id: buildnumber id: buildnumber

View File

@ -4,10 +4,10 @@ jobs:
build: build:
runs-on: ubuntu-22.04 runs-on: ubuntu-22.04
container: container:
image: eclipse-temurin:20-jdk image: eclipse-temurin:21-jdk
options: --user root options: --user root
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v4
- run: ./gradlew :filament:build :filament:publish --stacktrace --no-configuration-cache - run: ./gradlew :filament:build :filament:publish --stacktrace --no-configuration-cache
env: env:
MAVEN_URL: ${{ secrets.MAVEN_URL }} MAVEN_URL: ${{ secrets.MAVEN_URL }}

View File

@ -109,6 +109,8 @@ import net.fabricmc.filament.task.mappingio.MergeMappingsTask
import net.fabricmc.mappingio.format.MappingFormat import net.fabricmc.mappingio.format.MappingFormat
import net.fabricmc.nameproposal.MappingNameCompleter import net.fabricmc.nameproposal.MappingNameCompleter
import org.gradle.work.DisableCachingByDefault import org.gradle.work.DisableCachingByDefault
import com.diffplug.spotless.LineEnding
import groovy.xml.XmlSlurper
import java.util.zip.GZIPOutputStream import java.util.zip.GZIPOutputStream
@ -186,7 +188,7 @@ tasks.register('mapSpecializedMethods', MapSpecializedMethodsTask) {
tasks.register('convertToV1', ConvertMappingsTask) { tasks.register('convertToV1', ConvertMappingsTask) {
input = mapSpecializedMethods.output input = mapSpecializedMethods.output
output = new File(tempDir, "yarn-mappings.tiny") output = new File(tempDir, "yarn-mappings.tiny")
outputFormat = MappingFormat.TINY outputFormat = MappingFormat.TINY_FILE
} }
tasks.register('mergeTiny', MergeMappingsTask) { tasks.register('mergeTiny', MergeMappingsTask) {
@ -194,7 +196,7 @@ tasks.register('mergeTiny', MergeMappingsTask) {
output = new File(tempDir, "mappings.tiny") output = new File(tempDir, "mappings.tiny")
mappingInputs.from downloadIntermediary.output mappingInputs.from downloadIntermediary.output
mappingInputs.from convertToV1.output mappingInputs.from convertToV1.output
outputFormat = MappingFormat.TINY outputFormat = MappingFormat.TINY_FILE
} }
// Disable the default jar task // Disable the default jar task
@ -281,7 +283,7 @@ tasks.withType(AbstractArchiveTask).configureEach {
} }
spotless { spotless {
lineEndings = com.diffplug.spotless.LineEnding.UNIX lineEndings = LineEnding.UNIX
java { java {
licenseHeaderFile(rootProject.file("HEADER")) licenseHeaderFile(rootProject.file("HEADER"))
@ -347,7 +349,7 @@ tasks.register('mergeV2', MergeMappingsTask) {
output = new File(tempDir, "merged-v2.tiny") output = new File(tempDir, "merged-v2.tiny")
mappingInputs.from downloadIntermediary.output mappingInputs.from downloadIntermediary.output
mappingInputs.from insertAutoGeneratedEnumMappings.output mappingInputs.from insertAutoGeneratedEnumMappings.output
outputFormat = MappingFormat.TINY_2 outputFormat = MappingFormat.TINY_2_FILE
} }
tasks.register('v2UnmergedYarnJar', Jar) { tasks.register('v2UnmergedYarnJar', Jar) {
@ -510,8 +512,8 @@ javadoc {
source fileTree(fakeSourceDir) + sourceSets.constants.allJava + sourceSets.packageDocs.allJava source fileTree(fakeSourceDir) + sourceSets.constants.allJava + sourceSets.packageDocs.allJava
classpath = configurations.javadocClasspath.plus minecraftLibraries classpath = configurations.javadocClasspath.plus minecraftLibraries
def fs = services.get(FileSystemOperations.class) def fs = project.services.get(FileSystemOperations.class)
def outputDir = javadoc.outputDirectory def outputDir = javadoc.destinationDir
doLast { doLast {
fs.copy { fs.copy {
@ -558,7 +560,7 @@ check.dependsOn javadocLint
publishing { publishing {
publications { publications {
maven(MavenPublication) { register("maven", MavenPublication) {
groupId 'net.fabricmc' groupId 'net.fabricmc'
artifactId "yarn" artifactId "yarn"
version yarnVersion version yarnVersion

View File

@ -38,10 +38,10 @@ dependencies {
implementation "net.fabricmc:tiny-remapper:$properties.tiny_remapper_version" implementation "net.fabricmc:tiny-remapper:$properties.tiny_remapper_version"
implementation "net.fabricmc:mappingpoet:$properties.mappingpoet_version" implementation "net.fabricmc:mappingpoet:$properties.mappingpoet_version"
implementation 'com.fasterxml.jackson.core:jackson-databind:2.13.4.2' implementation 'com.fasterxml.jackson.core:jackson-databind:2.13.4.2'
implementation 'net.fabricmc:mapping-io:0.4.0' implementation 'net.fabricmc:mapping-io:0.5.1'
// Contains a number of useful utilities we can re-use. // Contains a number of useful utilities we can re-use.
implementation ("net.fabricmc:fabric-loom:1.2.7") { implementation ("net.fabricmc:fabric-loom:1.5.7") {
transitive = false transitive = false
} }
@ -61,7 +61,7 @@ test {
checkstyle { checkstyle {
configFile = file('checkstyle.xml') configFile = file('checkstyle.xml')
toolVersion = '10.3.3' toolVersion = '10.13.0'
} }
gradlePlugin { gradlePlugin {
@ -91,7 +91,7 @@ publishing {
/** /**
* Run this task to download the gradle sources next to the api jar, you may need to manually attach the sources jar * Run this task to download the gradle sources next to the api jar, you may need to manually attach the sources jar
*/ */
task downloadGradleSources() { tasks.register('downloadGradleSources') {
doLast { doLast {
// Awful hack to find the gradle api location // Awful hack to find the gradle api location
def gradleApiFile = project.configurations.detachedConfiguration(dependencies.gradleApi()).files.stream() def gradleApiFile = project.configurations.detachedConfiguration(dependencies.gradleApi()).files.stream()

View File

@ -6,15 +6,15 @@ org.gradle.configuration-cache=true
enigma_version=2.3.3 enigma_version=2.3.3
unpick_version=2.3.0 unpick_version=2.3.0
cfr_version=0.2.1 cfr_version=0.2.1
name_proposal_version=0.1.5 name_proposal_version=0.2.0
asm_version=9.5 asm_version=9.6
# Javadoc generation/linking # Javadoc generation/linking
fabric_loader_version=0.14.25 fabric_loader_version=0.15.6
jetbrains_annotations_version=23.0.0 jetbrains_annotations_version=24.1.0
mappingpoet_version=0.3.2 mappingpoet_version=0.3.2
# Build logic # Build logic
tiny_remapper_version=0.8.5 tiny_remapper_version=0.10.1
junit_version=5.7.1 junit_version=5.10.2
assertj_version=3.19.0 assertj_version=3.25.3

Binary file not shown.

View File

@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists 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 networkTimeout=10000
validateDistributionUrl=true validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME

14
gradlew vendored
View File

@ -145,7 +145,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #( case $MAX_FD in #(
max*) max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked. # 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 ) || MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit" warn "Could not query maximum file descriptor limit"
esac esac
@ -153,7 +153,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
'' | soft) :;; #( '' | soft) :;; #(
*) *)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked. # 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" || ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD" warn "Could not set maximum file descriptor limit to $MAX_FD"
esac esac
@ -202,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. # 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"' DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Collect all arguments for the java command; # Collect all arguments for the java command:
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of # * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
# shell script including quotes and variable substitutions, so put them in # and any embedded shellness will be escaped.
# double quotes to make sure that they get re-expanded; and # * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
# * put everything else in single quotes, so that it's not re-expanded. # treated as '${Hostname}' itself on the command line.
set -- \ set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \ "-Dorg.gradle.appname=$APP_BASE_NAME" \

20
gradlew.bat vendored
View File

@ -43,11 +43,11 @@ set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1 %JAVA_EXE% -version >NUL 2>&1
if %ERRORLEVEL% equ 0 goto execute if %ERRORLEVEL% equ 0 goto execute
echo. echo. 1>&2
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
echo. echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. echo location of your Java installation. 1>&2
goto fail goto fail
@ -57,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto execute if exist "%JAVA_EXE%" goto execute
echo. echo. 1>&2
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
echo. echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. echo location of your Java installation. 1>&2
goto fail goto fail