Merge branch '1.20.1/dev' into 1.21.1/dev

# Conflicts:
#	buildSrc/src/main/kotlin/dev/engine_room/gradle/subproject/SubprojectExtension.kt
#	neoforge/build.gradle.kts
#	vanillinNeoForge/build.gradle.kts
This commit is contained in:
Jozufozu 2025-03-01 22:04:09 -08:00
commit 452866498c
9 changed files with 151 additions and 61 deletions

13
Jenkinsfile vendored
View file

@ -8,6 +8,15 @@ pipeline {
jdk "jdk-21"
}
options {
// Sometimes builds freeze, but this doesn't have to be super aggressive.
timeout(time: 30, unit: 'MINUTES')
}
parameters {
booleanParam(name: 'RELEASE', defaultValue: false, description: 'Publish artifacts without a build number.')
}
stages {
stage('Setup') {
@ -22,6 +31,10 @@ pipeline {
stage('Build') {
environment {
RELEASE="${params.RELEASE}"
}
steps {
withCredentials([
// build_secrets is parsed in SubprojectExtension#loadSecrets

View file

@ -13,7 +13,6 @@ import org.gradle.api.tasks.javadoc.Javadoc
import org.gradle.jvm.tasks.Jar
import org.gradle.jvm.toolchain.JavaLanguageVersion
import org.gradle.kotlin.dsl.*
import org.gradle.language.jvm.tasks.ProcessResources
import java.io.File
import java.net.URI
import java.util.*
@ -31,11 +30,18 @@ open class SubprojectExtension(val project: Project) {
setupPublishing()
}
private fun setBaseProperties(archiveBase: String, group: String, version: String) {
val buildNumber: String? by lazy {
val dev = System.getenv("RELEASE")?.contentEquals("false", true) ?: true
val buildNumber = System.getenv("BUILD_NUMBER")
val versionSuffix = if (dev && buildNumber != null) "-${buildNumber}" else ""
if (dev) {
System.getenv("BUILD_NUMBER")
} else {
null
}
}
private fun setBaseProperties(archiveBase: String, group: String, version: String) {
val versionSuffix = if (buildNumber != null) "-${buildNumber}" else ""
project.group = project.property(group) as String
project.version = "${project.property(version)}${versionSuffix}"
@ -139,16 +145,6 @@ open class SubprojectExtension(val project: Project) {
options.optionFiles(project.rootProject.file("javadoc-options.txt"))
options.encoding = "UTF-8"
}
val replaceProperties = processResourcesExpandProperties.associateWith { project.property(it) as String }
withType<ProcessResources>().configureEach {
inputs.properties(replaceProperties)
filesMatching(processResourcesExpandFiles) {
expand(replaceProperties)
}
}
}
}
@ -207,26 +203,3 @@ open class SubprojectExtension(val project: Project) {
}
}
}
val processResourcesExpandFiles = listOf("pack.mcmeta", "fabric.mod.json", "META-INF/neoforge.mods.toml")
val processResourcesExpandProperties = listOf(
"mod_license",
"mod_sources",
"mod_issues",
"mod_homepage",
"flywheel_id",
"flywheel_name",
"flywheel_description",
"flywheel_version",
"vanillin_id",
"vanillin_name",
"vanillin_version",
"vanillin_description",
"flywheel_maven_version_range",
"flywheel_semver_version_range",
"minecraft_semver_version_range",
"minecraft_maven_version_range",
"fabric_api_version_range",
"neoforge_version_range",
)

View file

@ -8,6 +8,8 @@ import java.util.regex.Pattern;
import java.util.stream.Collectors;
import java.util.stream.Stream;
import org.jetbrains.annotations.Nullable;
import dev.engine_room.flywheel.backend.glsl.SourceFile;
import dev.engine_room.flywheel.backend.glsl.SourceLines;
import dev.engine_room.flywheel.backend.glsl.error.ConsoleColors;
@ -56,18 +58,22 @@ public class FailedCompilation {
return;
}
Matcher matcher;
try {
Matcher matcher;
matcher = PATTERN_ONE.matcher(s);
if (matcher.find()) {
out.accept(interpretPattern1(matcher));
return;
}
matcher = PATTERN_ONE.matcher(s);
if (matcher.find()) {
out.accept(interpretPattern1(matcher));
return;
}
matcher = PATTERN_TWO.matcher(s);
if (matcher.find()) {
out.accept(interpretPattern2(matcher));
return;
matcher = PATTERN_TWO.matcher(s);
if (matcher.find()) {
out.accept(interpretPattern2(matcher));
return;
}
} catch (Throwable ignored) {
// noop, if parsing/span matching fails somehow lets just emit the raw error string.
}
out.accept(ErrorBuilder.create()
@ -114,15 +120,10 @@ public class FailedCompilation {
.pointAt(span, 1);
}
private ErrorBuilder interpretWithSpan(ErrorLevel errorLevel, int fileId, int lineNo, String span, String msg) {
private ErrorBuilder interpretWithSpan(ErrorLevel errorLevel, int fileId, int lineNo, @Nullable String span, String msg) {
var sourceFile = files.get(fileId - 1);
Span errorSpan;
if (span != null) {
errorSpan = sourceFile.getLineSpanMatching(lineNo, span);
} else {
errorSpan = sourceFile.getLineSpanNoWhitespace(lineNo);
}
Span errorSpan = sourceFile.getLineSpanMatching(lineNo, span);
return ErrorBuilder.create()
.header(errorLevel, msg)

View file

@ -374,9 +374,12 @@ public class IndirectInstancer<I extends Instance> extends AbstractInstancer<I>
contentsChanged.clear();
}
@Override
public void parallelUpdate() {
var pages = this.pages.get();
mergeablePages.clear(pages.length, mergeablePages.currentCapacity() + 1);
int page = 0;
while (mergeablePages.cardinality() > 1) {
page = mergeablePages.nextSetBit(page);

View file

@ -66,16 +66,43 @@ platform {
setupTestMod(testMod)
}
var flywheelVersion = "${property("flywheel_version")}+${property("minecraft_version")}"
if (subproject.buildNumber != null) {
flywheelVersion += ".build.${subproject.buildNumber}"
}
val replaceProperties = listOf(
"mod_license",
"mod_sources",
"mod_issues",
"mod_homepage",
"flywheel_id",
"flywheel_name",
"flywheel_description",
"minecraft_semver_version_range",
"fabric_api_version_range",
).associateWith { property(it) as String }
.plus("flywheel_version" to flywheelVersion)
tasks.withType<ProcessResources>().configureEach {
inputs.properties(replaceProperties)
filesMatching(listOf("fabric.mod.json")) {
expand(replaceProperties)
}
}
jarSets {
mainSet.publishWithRemappedSources {
artifactId = "flywheel-fabric-${project.property("artifact_minecraft_version")}"
artifactId = "flywheel-fabric-${property("artifact_minecraft_version")}"
}
mainSet.outgoing("flywheel")
create("api", api, lib).apply {
addToAssemble()
publishWithRemappedSources {
artifactId = "flywheel-fabric-api-${project.property("artifact_minecraft_version")}"
artifactId = "flywheel-fabric-api-${property("artifact_minecraft_version")}"
}
configureJar {

View file

@ -8,7 +8,7 @@ mod_homepage = https://github.com/Engine-Room/Flywheel
# Flywheel metadata
flywheel_id=flywheel
flywheel_name=Flywheel
flywheel_version=1.0.0
flywheel_version=1.0.1
flywheel_description=An overhauled entity and block entity rendering API.
# Vanillin metadata
vanillin_id=vanillin

View file

@ -64,16 +64,37 @@ platform {
setupTestMod(testMod)
}
val replaceProperties = listOf(
"mod_license",
"mod_sources",
"mod_issues",
"mod_homepage",
"flywheel_id",
"flywheel_name",
"flywheel_description",
"minecraft_maven_version_range",
"neoforge_version_range",
).associateWith { property(it) as String }
.plus("flywheel_version" to "${property("flywheel_version")}${if (subproject.buildNumber != null) "-${subproject.buildNumber}" else ""}")
tasks.withType<ProcessResources>().configureEach {
inputs.properties(replaceProperties)
filesMatching(listOf("pack.mcmeta", "META-INF/neoforge.mods.toml")) {
expand(replaceProperties)
}
}
jarSets {
mainSet.publishWithRawSources {
artifactId = "flywheel-neoforge-${project.property("artifact_minecraft_version")}"
artifactId = "flywheel-neoforge-${property("artifact_minecraft_version")}"
}
mainSet.outgoing("flywheel")
create("api", api, lib).apply {
addToAssemble()
publishWithRawSources {
artifactId = "flywheel-neoforge-api-${project.property("artifact_minecraft_version")}"
artifactId = "flywheel-neoforge-api-${property("artifact_minecraft_version")}"
}
configureJar {

View file

@ -26,9 +26,38 @@ transitiveSourceSets {
}
}
var vanillinVersion = "${property("vanillin_version")}+${property("minecraft_version")}"
if (subproject.buildNumber != null) {
vanillinVersion += ".build.${subproject.buildNumber}"
}
val replaceProperties = listOf(
"mod_license",
"mod_sources",
"mod_issues",
"mod_homepage",
"flywheel_id",
"vanillin_id",
"vanillin_name",
"vanillin_description",
"minecraft_semver_version_range",
"flywheel_semver_version_range",
"fabric_api_version_range",
).associateWith { property(it) as String }
.plus("vanillin_version" to vanillinVersion)
tasks.withType<ProcessResources>().configureEach {
inputs.properties(replaceProperties)
filesMatching(listOf("fabric.mod.json")) {
expand(replaceProperties)
}
}
jarSets {
mainSet.publishWithRemappedSources {
artifactId = "vanillin-fabric-${project.property("artifact_minecraft_version")}"
artifactId = "vanillin-fabric-${property("artifact_minecraft_version")}"
}
}

View file

@ -26,9 +26,32 @@ transitiveSourceSets {
}
}
val replaceProperties = listOf(
"mod_license",
"mod_sources",
"mod_issues",
"mod_homepage",
"flywheel_id",
"vanillin_id",
"vanillin_name",
"vanillin_description",
"flywheel_maven_version_range",
"minecraft_maven_version_range",
"neoforge_version_range",
).associateWith { property(it) as String }
.plus("vanillin_version" to "${property("vanillin_version")}${if (subproject.buildNumber != null) "-${subproject.buildNumber}" else ""}")
tasks.withType<ProcessResources>().configureEach {
inputs.properties(replaceProperties)
filesMatching(listOf("pack.mcmeta", "META-INF/neoforge.mods.toml")) {
expand(replaceProperties)
}
}
jarSets {
mainSet.publishWithRawSources {
artifactId = "vanillin-neoforge-${project.property("artifact_minecraft_version")}"
artifactId = "vanillin-neoforge-${property("artifact_minecraft_version")}"
}
}