Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/1.20/dev' into feat/multi-load…
Browse files Browse the repository at this point in the history
…er-1.21

# Conflicts:
#	.github/workflows/build.yml
#	forge/src/main/resources/META-INF/neoforge.mods.toml
  • Loading branch information
IThundxr committed Nov 13, 2024
2 parents 69f4899 + 868a263 commit fd786b0
Show file tree
Hide file tree
Showing 33 changed files with 1,226 additions and 622 deletions.
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.yml]
indent_size = 2

[*.json]
indent_size = 2
max_line_length = 500
Expand Down
102 changes: 70 additions & 32 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,47 +1,85 @@
name: build
name: Build

on: [ pull_request, push ]
on: [ workflow_dispatch, pull_request, push ]

env:
JAVA_VERSION: 21

jobs:
build:
strategy:
matrix:
java: [
21 # Current Java LTS & minimum supported by Minecraft
]
os: [ ubuntu-latest ]
runs-on: ${{ matrix.os }}
runs-on: ubuntu-latest
steps:
- name: Checkout
- name: Checkout Repository
uses: actions/checkout@v4
- name: Validate Gradle Wrapper
uses: gradle/actions/wrapper-validation@v3
- name: Gradle Cache

- name: Setup Java
run: echo "JAVA_HOME=$JAVA_HOME_${{ env.JAVA_VERSION }}_X64" >> "$GITHUB_ENV"

- name: Loom Cache
uses: actions/cache@v4
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
.gradle/loom-cache
build/
key: ${{ runner.os }}-jdk${{ matrix.java }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle.properties', '**/gradle-wrapper.properties', '.github/workflows/build.yml') }}
- name: Setup JDK ${{ matrix.java }}
uses: actions/setup-java@v4
path: "**/.gradle/loom-cache"
key: "${{ runner.os }}-gradle-${{ hashFiles('**/libs.versions.*', '**/*.gradle*', '**/gradle-wrapper.properties') }}"
restore-keys: "${{ runner.os }}-gradle-"

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
with:
distribution: 'temurin'
java-version: ${{ matrix.java }}
- name: Make Gradle Wrapper Executable
if: ${{ runner.os != 'Windows' }}
run: chmod +x ./gradlew
gradle-home-cache-cleanup: true
cache-read-only: ${{ !endsWith(github.ref_name, '/dev') }}

- name: Validate Gradle Wrapper Integrity
uses: gradle/wrapper-validation-action@v2

- name: Build
# doesn't actually publish, as no secrets are passed in, just makes sure that publishing works
run: ./gradlew publish --no-daemon
# Doesn't actually publish, as no secrets are passed in, just makes sure that publishing works
# Also generate the mod jars for the test job
run: ./gradlew remapTestModJar publish --no-daemon

- name: Capture Build Artifacts
if: ${{ runner.os == 'Linux' && matrix.java == '17' }}
uses: actions/upload-artifact@v4
with:
name: Artifacts
path: |
common/build/libs/
fabric/build/libs/
forge/build/libs/
common/build/libs/
fabric/build/libs/
forge/build/libs/
test:
strategy:
fail-fast: false
matrix:
loader: [ forge, fabric ]
needs: build
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Download build artifact
uses: actions/download-artifact@v4
with:
name: Artifacts

- name: Setup Environment Variables
run: |
echo "MOD_VERSION=$(grep '^mod_version =' gradle.properties | cut -d'=' -f2 | tr -d ' ')" >> "$GITHUB_ENV"
echo "MINECRAFT_VERSION=$(grep '^minecraft_version =' gradle.properties | cut -d'=' -f2 | tr -d ' ')" >> "$GITHUB_ENV"
echo "FABRIC_API_VERSION=$(grep '^fabric_api_version =' gradle.properties | cut -d'=' -f2 | tr -d ' ' | sed 's/+.*//')" >> "$GITHUB_ENV"
- name: Move Test Mod and Flywheel into run/mods
run: |
mkdir -p run/mods
cp ${{ matrix.loader }}/build/libs/flywheel-${{ matrix.loader }}-${{ env.MINECRAFT_VERSION }}-${{ env.MOD_VERSION }}.jar run/mods
cp ${{ matrix.loader }}/build/libs/flywheel-${{ matrix.loader }}-${{ env.MINECRAFT_VERSION }}-${{ env.MOD_VERSION }}-testmod.jar run/mods
# Lock to a specific commit, it would be bad if the tag is re-pushed with unwanted changes
- name: Run the MC client
uses: 3arthqu4ke/mc-runtime-test@e72f8fe1134aabf6fc749a2a8c09bb56dd7d283e
with:
mc: ${{ env.MINECRAFT_VERSION }}
modloader: ${{ matrix.loader }}
regex: .*${{ matrix.loader }}.*
mc-runtime-test: none
java: ${{ env.JAVA_VERSION }}
fabric-api: ${{ matrix.loader == 'fabric' && env.FABRIC_API_VERSION || 'none' }}
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@ package dev.engine_room.gradle.platform

import dev.engine_room.gradle.jarset.JarTaskSet
import net.fabricmc.loom.api.LoomGradleExtensionAPI
import net.fabricmc.loom.task.RemapJarTask
import org.gradle.api.Project
import org.gradle.api.Task
import org.gradle.api.tasks.SourceSet
import org.gradle.api.tasks.SourceSetContainer
import org.gradle.api.tasks.compile.JavaCompile
import org.gradle.api.tasks.javadoc.Javadoc
import org.gradle.jvm.tasks.Jar
import org.gradle.kotlin.dsl.named
import org.gradle.kotlin.dsl.provideDelegate
import org.gradle.kotlin.dsl.the
import org.gradle.kotlin.dsl.withType
import org.gradle.kotlin.dsl.*
import org.gradle.language.jvm.tasks.ProcessResources
import java.io.File
import kotlin.properties.ReadWriteProperty
import kotlin.reflect.KProperty

Expand Down Expand Up @@ -102,6 +102,29 @@ open class PlatformExtension(val project: Project) {
}
}

fun setupTestMod(sourceSet: SourceSet) {
project.tasks.apply {
val testModJar = register<Jar>("testModJar") {
from(sourceSet.output)
val file = File(project.layout.buildDirectory.asFile.get(), "devlibs");
destinationDirectory.set(file)
archiveClassifier = "testmod"
}

val remapTestModJar = register<RemapJarTask>("remapTestModJar") {
dependsOn(testModJar)
inputFile.set(testModJar.get().archiveFile)
archiveClassifier = "testmod"
addNestedDependencies = false
classpath.from(sourceSet.compileClasspath)
}

named<Task>("build").configure {
dependsOn(remapTestModJar)
}
}
}

private class DependentProject(private val thisProject: Project) : ReadWriteProperty<Any?, Project> {
private var value: Project? = null

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public abstract class InstanceAssemblerComponent implements SourceComponent {
FLOAT_UNPACKING_FUNCS.put(FloatRepr.UNSIGNED_INT, e -> e.cast("float"));
FLOAT_UNPACKING_FUNCS.put(FloatRepr.NORMALIZED_UNSIGNED_INT, e -> e.cast("float").div(4294967295f));

FLOAT_UNPACKING_FUNCS.put(FloatRepr.FLOAT, e -> e.callFunction("uintBitsToFloat")); // FIXME: GLSL 330+
FLOAT_UNPACKING_FUNCS.put(FloatRepr.FLOAT, e -> e.callFunction("uintBitsToFloat"));
}

protected final Layout layout;
Expand Down
Loading

0 comments on commit fd786b0

Please sign in to comment.