Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .claude/settings.json
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
{
"worktree": { "bgIsolation": "none" },
"hooks": {
"SessionStart": [
{
Expand Down
129 changes: 82 additions & 47 deletions build.gradle.kts
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
import com.hypherionmc.modfusioner.plugin.FusionerExtension
import net.fabricmc.loom.api.LoomGradleExtensionAPI
import org.gradle.api.publish.PublishingExtension
import org.gradle.api.publish.maven.MavenPublication
import org.gradle.api.tasks.bundling.AbstractArchiveTask
import org.jetbrains.kotlin.konan.properties.loadProperties

plugins {
Expand DownExpand Up@@ -46,6 +48,10 @@ version = "mod_version".prop ?: "0.0.1-SNAPSHOT"
group = "mod_group".prop ?: "net.kernelpanicsoft"

subprojects {
// Stonecutter's tree/branch anchors (e.g. `:core`) are synthetic container projects with real
// leaf projects nested under them - they must not get build plugins applied to them directly.
if (subprojects.isNotEmpty()) return@subprojects

apply(plugin = "dev.architectury.loom")
apply(plugin = "net.kernelpanicsoft.actualizer")

Expand DownExpand Up@@ -115,41 +121,56 @@ subprojects {
})

compileOnly("org.jetbrains:annotations:24.1.0")

// Gradle 9 stopped bundling its own copy of the JUnit Platform launcher for
// useJUnitPlatform() - every module needs this on the test runtime classpath now.
"testRuntimeOnly"(rootProject.libs.junit.platform.launcher)
}

// One MavenPublication per module, published to kernelpanicsoft.net's Reposilite - archie-core/
// -datagen/-gametest are real consumable libraries; archie-test is a dev playground, never
// published (matches fusioner/dokka's own product/test split above).
if (!project.name.startsWith("archie-test-")) {
//
// Under Stonecutter, `project.name` is just the version segment ("1.21.1") for every leaf in
// every tree - it no longer distinguishes "test" from the rest. `project.path` still does
// (":test:common:1.21.1" etc.), since Stonecutter nests leaves under their tree name.
if (!project.path.startsWith(":test:")) {
// allprojects{} (below) is what normally applies these, but it's declared after this
// subprojects{} block and hasn't run for this project yet - apply is idempotent, so
// re-applying here just guarantees ordering for the components["java"]/publishing{} access
// immediately below.
apply(plugin = "java")
apply(plugin = "maven-publish")

extensions.configure<PublishingExtension>("publishing") {
publications {
create<MavenPublication>("maven") {
artifactId = base.archivesName.get()
from(components["java"])
// base.archivesName only reaches its final "archie-core-fabric"-style value once this leaf's
// own build.gradle.kts runs (module scripts execute after this subprojects{} block, and
// allprojects{} - which seeds the "archie-core" prefix - runs after it too) - reading it here
// would still see the base plugin's raw default ("1.21.1", from project.name). Defer until
// this project has finished configuring.
afterEvaluate {
extensions.configure<PublishingExtension>("publishing") {
publications {
create<MavenPublication>("maven") {
artifactId = base.archivesName.get()
from(components["java"])
}
}
}

repositories {
mavenLocal()
maven {
name = "Reposilite"
val releasesUrl = "https://maven.kernelpanicsoft.net/releases"
val snapshotsUrl = "https://maven.kernelpanicsoft.net/snapshots"

url = uri(if (version.toString().endsWith("SNAPSHOT")) snapshotsUrl else releasesUrl)

credentials {
username = localProperties?.getProperty("reposilite.username")
?: System.getenv("REPOSILITE_USERNAME")
password = localProperties?.getProperty("reposilite.password")
?: System.getenv("REPOSILITE_PASSWORD")
repositories {
mavenLocal()
maven {
name = "Reposilite"
val releasesUrl = "https://maven.kernelpanicsoft.net/releases"
val snapshotsUrl = "https://maven.kernelpanicsoft.net/snapshots"

url = uri(if (version.toString().endsWith("SNAPSHOT")) snapshotsUrl else releasesUrl)

credentials {
username = localProperties?.getProperty("reposilite.username")
?: System.getenv("REPOSILITE_USERNAME")
password = localProperties?.getProperty("reposilite.password")
?: System.getenv("REPOSILITE_PASSWORD")
}
}
}
}
Expand All@@ -158,6 +179,11 @@ subprojects {
}

allprojects {
// Stonecutter's tree/branch anchors (e.g. `:core`) are synthetic container projects with real
// leaf projects nested under them - they must not get build plugins applied to them directly.
// The true root project still needs this block (e.g. for its own `publish` task).
if (this != rootProject && subprojects.isNotEmpty()) return@allprojects

apply(plugin = "java")
apply(plugin = "org.jetbrains.kotlin.jvm")
apply(plugin = "org.jetbrains.kotlin.plugin.serialization")
Expand DownExpand Up@@ -200,14 +226,38 @@ fusioner {
jarVersion = project.version.toString()
outputDirectory = "build/artifacts"

// modfusioner finds each side's source project by bare Project.name (case-insensitive), searched
// across the *entire* build - but under Stonecutter every tree (core/datagen/gametest/test) has a
// leaf literally named "fabric" and one named "neoforge", so no name resolves uniquely to core's.
// ":core" is an existing, globally-unique container project name - point both sides at it just to
// satisfy modfusioner's "did we find >= 2 projects" check; `inputFile` (set below, once every
// project has finished configuring) overrides where the actual jar is read from, resolved relative
// to that anchor project's directory.
fabric {
projectName = "archie-core-fabric"
inputTaskName = "remapJar"
projectName = "core"
}

neoforge {
projectName = "archie-core-neoforge"
inputTaskName = "remapJar"
projectName = "core"
}
}

// modfusioner reads `inputFile` as `File(<projectName's projectDir>, inputFile)` - `projectName` above
// is just an anchor, so compute the real remapJar output path here (deferred to gradle.projectsEvaluated
// so base.archivesName - and therefore the jar's real filename - has reached its final value) and
// express it relative to :core's directory.
gradle.projectsEvaluated {
val mcVersion = libs.versions.minecraft.get()
val coreDir = project(":core").projectDir

fun remapJarFile(path: String) =
(project(path).tasks.named("remapJar").get() as AbstractArchiveTask).archiveFile.get().asFile

project.extensions.getByType<FusionerExtension>().let { fusionerExtension ->
fusionerExtension.fabricConfiguration.inputFile =
remapJarFile(":core:fabric:$mcVersion").relativeTo(coreDir).path
fusionerExtension.neoforgeConfiguration.inputFile =
remapJarFile(":core:neoforge:$mcVersion").relativeTo(coreDir).path
}
}

Expand All@@ -224,7 +274,7 @@ publisher {

projectVersion = "${libs.versions.minecraft.get()}-${project.version}"
displayName = "Archie-Merged-${projectVersion.get()}"
gameVersions = listOf("1.21.1")
gameVersions = listOf(libs.versions.minecraft.get())
loaders = listOf("neoforge", "fabric")
curseEnvironment = "both"
versionType = "alpha"
Expand All@@ -243,15 +293,12 @@ publisher {
}

dependencies {
dokka(project(":archie-core-common")) { isTransitive = false }
dokka(project(":archie-core-fabric")) { isTransitive = false }
dokka(project(":archie-core-neoforge")) { isTransitive = false }
dokka(project(":archie-datagen-common")) { isTransitive = false }
dokka(project(":archie-datagen-fabric")) { isTransitive = false }
dokka(project(":archie-datagen-neoforge")) { isTransitive = false }
dokka(project(":archie-gametest-common")) { isTransitive = false }
dokka(project(":archie-gametest-fabric")) { isTransitive = false }
dokka(project(":archie-gametest-neoforge")) { isTransitive = false }
val mcVersion = libs.versions.minecraft.get()
listOf("core", "datagen", "gametest").forEach { tree ->
listOf("common", "fabric", "neoforge").forEach { branch ->
dokka(project(":$tree:$branch:$mcVersion")) { isTransitive = false }
}
}
}

tasks {
Expand All@@ -269,20 +316,8 @@ tasks {
group = "publishing"
val tag = rootProject.version.toString().substringBeforeLast(".")
workingDir = rootDir
// --alias-type redirect: mike's default ("symlink") writes the "latest" alias as an
// actual symlink into the gh-pages branch, which GitHub's own automatic Pages
// build-and-deploy (triggered whenever gh-pages is pushed, separate from this task)
// rejects outright ("content does not contain any hard links, symlinks"). "redirect"
// makes the alias a small HTML redirect page instead - no symlink, same effect for
// visitors.
commandLine("mike", "deploy", "--push", "--update-aliases", "--alias-type", "redirect", tag, "latest")
}
// modpublisher's changelog reads CHANGELOG.md straight off disk when a publish task runs - it
// doesn't know about git tags or PRs. .github/workflows/release-notes.yaml (reactive, post-tag)
// can't help here: by the time it would generate this release's entry, the publish task attached
// to the tag has already read (and shipped) whatever was on disk before. This task closes that
// gap by generating CHANGELOG.md synchronously - see .github/scripts/generate_release_notes.py's
// module docstring for the two call shapes.
register<Exec>("generateChangelog") {
group = "publishing"
workingDir = rootDir
Expand Down
22 changes: 8 additions & 14 deletions core/common/build.gradle.kts
Original file line numberDiff line numberDiff line change
Expand Up@@ -21,10 +21,13 @@ val sharedProperties = kotlin.runCatching {
val String.prop: String?
get() = sharedProperties?.get(this)?.toString()

val branchDir = projectDir.parentFile.parentFile

loom {
accessWidenerPath = file("src/main/resources/${"mod_id".prop}.accesswidener")
accessWidenerPath = branchDir.resolve("src/main/resources/${"mod_id".prop}.accesswidener")
}


dependencies {
compileOnly(kotlin("reflect"))
implementation(libs.junit.jupiter.api)
Expand All@@ -39,19 +42,10 @@ dependencies {
api(libs.kotlinx.serialization.json5) { isTransitive = false }
api(libs.kotlinx.serialization.cbor) { isTransitive = false }
api(compose.runtime)
// Used only for the fabric @Environment annotations + mixin deps. Do NOT use other classes
// from fabric loader from common code.
modImplementation(libs.fabric.loader)

modApi(libs.rei.common)
modCompileOnly(libs.clothConfig.common)
// Cloth Config's own transitive dependency, kept visible at compile time only (like Cloth
// Config itself) since the config system exposes `Color` directly in its own public API -
// NOT bundled: Cloth Config's own distributed jar already jar-in-jars this and exports
// `me.shedaniel.math` itself, so embedding a second copy makes NeoForge's ModLauncher refuse
// to even build its module layer ("Modules basic.math and cloth_config export package
// me.shedaniel.math") the moment both are present - confirmed by actually hitting that crash.
// [ColorSerializer]/[SColor] stay gated behind isClothConfigLoaded instead, same as ModifierKeyCode.
compileOnlyApi(libs.cloth.basic.math)
modApi(libs.architectury.common)
modApi(libs.storage.common)
Expand All@@ -61,20 +55,20 @@ dependencies {
tasks {
base.archivesName.set(base.archivesName.get() + "-common")

val verifyGuiSpriteAssets by registering {
val verifyGuiSpriteAssets = register("verifyGuiSpriteAssets") {
group = "verification"
description = "Verifies GUI sprite metadata files have matching PNG assets."

doLast {
val spritesDir = file("src/main/resources/assets/archie/textures/gui/sprites")
val spritesDir = branchDir.resolve("src/main/resources/assets/archie/textures/gui/sprites")
if (!spritesDir.exists()) return@doLast

val missingPng = spritesDir
.walkTopDown()
.filter { it.isFile && it.name.endsWith(".png.mcmeta") }
.map { it to file(it.path.removeSuffix(".mcmeta")) }
.map { it to File(it.path.removeSuffix(".mcmeta")) }
.filter { (_, png) -> !png.exists() }
.map { (meta, _) -> meta.relativeTo(projectDir).invariantSeparatorsPath }
.map { (meta, _) -> meta.relativeTo(branchDir).invariantSeparatorsPath }
.toList()

if (missingPng.isNotEmpty()) {
Expand Down
20 changes: 13 additions & 7 deletions core/fabric/build.gradle.kts
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
import dev.kikugie.stonecutter.build.StonecutterBuildExtension
import net.kernelpanicsoft.archie.plugin.bundleMod
import net.kernelpanicsoft.archie.plugin.bundleRuntimeLibrary
import net.kernelpanicsoft.archie.plugin.runtimeLibrary
Expand All@@ -12,8 +13,13 @@ architectury {
fabric()
}

val commonNode = requireNotNull(extensions.getByType<StonecutterBuildExtension>().node.sibling("common")) {
"No common project for $project"
}
val common: Project = commonNode.project

actualizer {
actualizes(project(":archie-core-common"))
actualizes(common)
}

configurations {
Expand All@@ -26,7 +32,7 @@ configurations {
}

loom {
accessWidenerPath.set(project(":archie-core-common").loom.accessWidenerPath)
accessWidenerPath.set(common.loom.accessWidenerPath)

mods {
maybeCreate("main").apply {
Expand DownExpand Up@@ -75,8 +81,8 @@ dependencies {
testRuntimeOnly(libs.junit.jupiter.engine)
runtimeLibrary(libs.kotlinx.coroutines.test)

"common"(project(":archie-core-common", "namedElements")) { isTransitive = false }
"shadowCommon"(project(":archie-core-common", "transformProductionFabric")) { isTransitive = false }
"common"(files(common.tasks.named<Jar>("jar").flatMap { it.archiveFile }))
"shadowCommon"(files(common.tasks.named<Jar>("jar").flatMap { it.archiveFile }))
}

modResources {
Expand All@@ -91,7 +97,7 @@ tasks {
}

processResources {
from(project(":archie-core-common").sourceSets.main.get().resources) {
from(common.sourceSets.main.get().resources) {
include("assets/archie/**")
include("data/archie/**")
include("archie-common.mixins.json")
Expand DownExpand Up@@ -124,11 +130,11 @@ tasks {

jar {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
from(project(":archie-core-common").sourceSets.main.get().output)
from(common.sourceSets.main.get().output)
}

sourcesJar {
val commonSources = project(":archie-core-common").tasks.sourcesJar
val commonSources = common.tasks.sourcesJar
dependsOn(commonSources)
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
from(commonSources.get().archiveFile.map { zipTree(it) })
Expand Down
Loading
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Add copy buttons to all
 blocks\n(function() {\n function addCopyButtons() {\n document.querySelectorAll('pre code').forEach(function(codeBlock) {\n if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;\n codeBlock.parentElement.setAttribute('data-copy-added', 'true');\n \n var btn = document.createElement('button');\n btn.textContent = 'Copy';\n btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';\n btn.onmouseover = function() { this.style.opacity = '1'; };\n btn.onmouseout = function() { this.style.opacity = '0.7'; };\n btn.onclick = function() {\n navigator.clipboard.writeText(codeBlock.textContent).then(function() {\n btn.textContent = 'Copied!';\n setTimeout(function() { btn.textContent = 'Copy'; }, 1500);\n });\n };\n codeBlock.parentElement.style.position = 'relative';\n codeBlock.parentElement.appendChild(btn);\n });\n }\n \n addCopyButtons();\n \n // Re-run on dynamic content\n var observer = new MutationObserver(addCopyButtons);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Add Copy Buttons to Code Blocks");
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .claude/settings.json
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
{
"worktree": { "bgIsolation": "none" },
"hooks": {
"SessionStart": [
{
Expand Down
129 changes: 82 additions & 47 deletions build.gradle.kts
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
import com.hypherionmc.modfusioner.plugin.FusionerExtension
import net.fabricmc.loom.api.LoomGradleExtensionAPI
import org.gradle.api.publish.PublishingExtension
import org.gradle.api.publish.maven.MavenPublication
import org.gradle.api.tasks.bundling.AbstractArchiveTask
import org.jetbrains.kotlin.konan.properties.loadProperties

plugins {
Expand DownExpand Up@@ -46,6 +48,10 @@ version = "mod_version".prop ?: "0.0.1-SNAPSHOT"
group = "mod_group".prop ?: "net.kernelpanicsoft"

subprojects {
// Stonecutter's tree/branch anchors (e.g. `:core`) are synthetic container projects with real
// leaf projects nested under them - they must not get build plugins applied to them directly.
if (subprojects.isNotEmpty()) return@subprojects

apply(plugin = "dev.architectury.loom")
apply(plugin = "net.kernelpanicsoft.actualizer")

Expand DownExpand Up@@ -115,41 +121,56 @@ subprojects {
})

compileOnly("org.jetbrains:annotations:24.1.0")

// Gradle 9 stopped bundling its own copy of the JUnit Platform launcher for
// useJUnitPlatform() - every module needs this on the test runtime classpath now.
"testRuntimeOnly"(rootProject.libs.junit.platform.launcher)
}

// One MavenPublication per module, published to kernelpanicsoft.net's Reposilite - archie-core/
// -datagen/-gametest are real consumable libraries; archie-test is a dev playground, never
// published (matches fusioner/dokka's own product/test split above).
if (!project.name.startsWith("archie-test-")) {
//
// Under Stonecutter, `project.name` is just the version segment ("1.21.1") for every leaf in
// every tree - it no longer distinguishes "test" from the rest. `project.path` still does
// (":test:common:1.21.1" etc.), since Stonecutter nests leaves under their tree name.
if (!project.path.startsWith(":test:")) {
// allprojects{} (below) is what normally applies these, but it's declared after this
// subprojects{} block and hasn't run for this project yet - apply is idempotent, so
// re-applying here just guarantees ordering for the components["java"]/publishing{} access
// immediately below.
apply(plugin = "java")
apply(plugin = "maven-publish")

extensions.configure<PublishingExtension>("publishing") {
publications {
create<MavenPublication>("maven") {
artifactId = base.archivesName.get()
from(components["java"])
// base.archivesName only reaches its final "archie-core-fabric"-style value once this leaf's
// own build.gradle.kts runs (module scripts execute after this subprojects{} block, and
// allprojects{} - which seeds the "archie-core" prefix - runs after it too) - reading it here
// would still see the base plugin's raw default ("1.21.1", from project.name). Defer until
// this project has finished configuring.
afterEvaluate {
extensions.configure<PublishingExtension>("publishing") {
publications {
create<MavenPublication>("maven") {
artifactId = base.archivesName.get()
from(components["java"])
}
}
}

repositories {
mavenLocal()
maven {
name = "Reposilite"
val releasesUrl = "https://maven.kernelpanicsoft.net/releases"
val snapshotsUrl = "https://maven.kernelpanicsoft.net/snapshots"

url = uri(if (version.toString().endsWith("SNAPSHOT")) snapshotsUrl else releasesUrl)

credentials {
username = localProperties?.getProperty("reposilite.username")
?: System.getenv("REPOSILITE_USERNAME")
password = localProperties?.getProperty("reposilite.password")
?: System.getenv("REPOSILITE_PASSWORD")
repositories {
mavenLocal()
maven {
name = "Reposilite"
val releasesUrl = "https://maven.kernelpanicsoft.net/releases"
val snapshotsUrl = "https://maven.kernelpanicsoft.net/snapshots"

url = uri(if (version.toString().endsWith("SNAPSHOT")) snapshotsUrl else releasesUrl)

credentials {
username = localProperties?.getProperty("reposilite.username")
?: System.getenv("REPOSILITE_USERNAME")
password = localProperties?.getProperty("reposilite.password")
?: System.getenv("REPOSILITE_PASSWORD")
}
}
}
}
Expand All@@ -158,6 +179,11 @@ subprojects {
}

allprojects {
// Stonecutter's tree/branch anchors (e.g. `:core`) are synthetic container projects with real
// leaf projects nested under them - they must not get build plugins applied to them directly.
// The true root project still needs this block (e.g. for its own `publish` task).
if (this != rootProject && subprojects.isNotEmpty()) return@allprojects

apply(plugin = "java")
apply(plugin = "org.jetbrains.kotlin.jvm")
apply(plugin = "org.jetbrains.kotlin.plugin.serialization")
Expand DownExpand Up@@ -200,14 +226,38 @@ fusioner {
jarVersion = project.version.toString()
outputDirectory = "build/artifacts"

// modfusioner finds each side's source project by bare Project.name (case-insensitive), searched
// across the *entire* build - but under Stonecutter every tree (core/datagen/gametest/test) has a
// leaf literally named "fabric" and one named "neoforge", so no name resolves uniquely to core's.
// ":core" is an existing, globally-unique container project name - point both sides at it just to
// satisfy modfusioner's "did we find >= 2 projects" check; `inputFile` (set below, once every
// project has finished configuring) overrides where the actual jar is read from, resolved relative
// to that anchor project's directory.
fabric {
projectName = "archie-core-fabric"
inputTaskName = "remapJar"
projectName = "core"
}

neoforge {
projectName = "archie-core-neoforge"
inputTaskName = "remapJar"
projectName = "core"
}
}

// modfusioner reads `inputFile` as `File(<projectName's projectDir>, inputFile)` - `projectName` above
// is just an anchor, so compute the real remapJar output path here (deferred to gradle.projectsEvaluated
// so base.archivesName - and therefore the jar's real filename - has reached its final value) and
// express it relative to :core's directory.
gradle.projectsEvaluated {
val mcVersion = libs.versions.minecraft.get()
val coreDir = project(":core").projectDir

fun remapJarFile(path: String) =
(project(path).tasks.named("remapJar").get() as AbstractArchiveTask).archiveFile.get().asFile

project.extensions.getByType<FusionerExtension>().let { fusionerExtension ->
fusionerExtension.fabricConfiguration.inputFile =
remapJarFile(":core:fabric:$mcVersion").relativeTo(coreDir).path
fusionerExtension.neoforgeConfiguration.inputFile =
remapJarFile(":core:neoforge:$mcVersion").relativeTo(coreDir).path
}
}

Expand All@@ -224,7 +274,7 @@ publisher {

projectVersion = "${libs.versions.minecraft.get()}-${project.version}"
displayName = "Archie-Merged-${projectVersion.get()}"
gameVersions = listOf("1.21.1")
gameVersions = listOf(libs.versions.minecraft.get())
loaders = listOf("neoforge", "fabric")
curseEnvironment = "both"
versionType = "alpha"
Expand All@@ -243,15 +293,12 @@ publisher {
}

dependencies {
dokka(project(":archie-core-common")) { isTransitive = false }
dokka(project(":archie-core-fabric")) { isTransitive = false }
dokka(project(":archie-core-neoforge")) { isTransitive = false }
dokka(project(":archie-datagen-common")) { isTransitive = false }
dokka(project(":archie-datagen-fabric")) { isTransitive = false }
dokka(project(":archie-datagen-neoforge")) { isTransitive = false }
dokka(project(":archie-gametest-common")) { isTransitive = false }
dokka(project(":archie-gametest-fabric")) { isTransitive = false }
dokka(project(":archie-gametest-neoforge")) { isTransitive = false }
val mcVersion = libs.versions.minecraft.get()
listOf("core", "datagen", "gametest").forEach { tree ->
listOf("common", "fabric", "neoforge").forEach { branch ->
dokka(project(":$tree:$branch:$mcVersion")) { isTransitive = false }
}
}
}

tasks {
Expand All@@ -269,20 +316,8 @@ tasks {
group = "publishing"
val tag = rootProject.version.toString().substringBeforeLast(".")
workingDir = rootDir
// --alias-type redirect: mike's default ("symlink") writes the "latest" alias as an
// actual symlink into the gh-pages branch, which GitHub's own automatic Pages
// build-and-deploy (triggered whenever gh-pages is pushed, separate from this task)
// rejects outright ("content does not contain any hard links, symlinks"). "redirect"
// makes the alias a small HTML redirect page instead - no symlink, same effect for
// visitors.
commandLine("mike", "deploy", "--push", "--update-aliases", "--alias-type", "redirect", tag, "latest")
}
// modpublisher's changelog reads CHANGELOG.md straight off disk when a publish task runs - it
// doesn't know about git tags or PRs. .github/workflows/release-notes.yaml (reactive, post-tag)
// can't help here: by the time it would generate this release's entry, the publish task attached
// to the tag has already read (and shipped) whatever was on disk before. This task closes that
// gap by generating CHANGELOG.md synchronously - see .github/scripts/generate_release_notes.py's
// module docstring for the two call shapes.
register<Exec>("generateChangelog") {
group = "publishing"
workingDir = rootDir
Expand Down
22 changes: 8 additions & 14 deletions core/common/build.gradle.kts
Original file line numberDiff line numberDiff line change
Expand Up@@ -21,10 +21,13 @@ val sharedProperties = kotlin.runCatching {
val String.prop: String?
get() = sharedProperties?.get(this)?.toString()

val branchDir = projectDir.parentFile.parentFile

loom {
accessWidenerPath = file("src/main/resources/${"mod_id".prop}.accesswidener")
accessWidenerPath = branchDir.resolve("src/main/resources/${"mod_id".prop}.accesswidener")
}


dependencies {
compileOnly(kotlin("reflect"))
implementation(libs.junit.jupiter.api)
Expand All@@ -39,19 +42,10 @@ dependencies {
api(libs.kotlinx.serialization.json5) { isTransitive = false }
api(libs.kotlinx.serialization.cbor) { isTransitive = false }
api(compose.runtime)
// Used only for the fabric @Environment annotations + mixin deps. Do NOT use other classes
// from fabric loader from common code.
modImplementation(libs.fabric.loader)

modApi(libs.rei.common)
modCompileOnly(libs.clothConfig.common)
// Cloth Config's own transitive dependency, kept visible at compile time only (like Cloth
// Config itself) since the config system exposes `Color` directly in its own public API -
// NOT bundled: Cloth Config's own distributed jar already jar-in-jars this and exports
// `me.shedaniel.math` itself, so embedding a second copy makes NeoForge's ModLauncher refuse
// to even build its module layer ("Modules basic.math and cloth_config export package
// me.shedaniel.math") the moment both are present - confirmed by actually hitting that crash.
// [ColorSerializer]/[SColor] stay gated behind isClothConfigLoaded instead, same as ModifierKeyCode.
compileOnlyApi(libs.cloth.basic.math)
modApi(libs.architectury.common)
modApi(libs.storage.common)
Expand All@@ -61,20 +55,20 @@ dependencies {
tasks {
base.archivesName.set(base.archivesName.get() + "-common")

val verifyGuiSpriteAssets by registering {
val verifyGuiSpriteAssets = register("verifyGuiSpriteAssets") {
group = "verification"
description = "Verifies GUI sprite metadata files have matching PNG assets."

doLast {
val spritesDir = file("src/main/resources/assets/archie/textures/gui/sprites")
val spritesDir = branchDir.resolve("src/main/resources/assets/archie/textures/gui/sprites")
if (!spritesDir.exists()) return@doLast

val missingPng = spritesDir
.walkTopDown()
.filter { it.isFile && it.name.endsWith(".png.mcmeta") }
.map { it to file(it.path.removeSuffix(".mcmeta")) }
.map { it to File(it.path.removeSuffix(".mcmeta")) }
.filter { (_, png) -> !png.exists() }
.map { (meta, _) -> meta.relativeTo(projectDir).invariantSeparatorsPath }
.map { (meta, _) -> meta.relativeTo(branchDir).invariantSeparatorsPath }
.toList()

if (missingPng.isNotEmpty()) {
Expand Down
20 changes: 13 additions & 7 deletions core/fabric/build.gradle.kts
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
import dev.kikugie.stonecutter.build.StonecutterBuildExtension
import net.kernelpanicsoft.archie.plugin.bundleMod
import net.kernelpanicsoft.archie.plugin.bundleRuntimeLibrary
import net.kernelpanicsoft.archie.plugin.runtimeLibrary
Expand All@@ -12,8 +13,13 @@ architectury {
fabric()
}

val commonNode = requireNotNull(extensions.getByType<StonecutterBuildExtension>().node.sibling("common")) {
"No common project for $project"
}
val common: Project = commonNode.project

actualizer {
actualizes(project(":archie-core-common"))
actualizes(common)
}

configurations {
Expand All@@ -26,7 +32,7 @@ configurations {
}

loom {
accessWidenerPath.set(project(":archie-core-common").loom.accessWidenerPath)
accessWidenerPath.set(common.loom.accessWidenerPath)

mods {
maybeCreate("main").apply {
Expand DownExpand Up@@ -75,8 +81,8 @@ dependencies {
testRuntimeOnly(libs.junit.jupiter.engine)
runtimeLibrary(libs.kotlinx.coroutines.test)

"common"(project(":archie-core-common", "namedElements")) { isTransitive = false }
"shadowCommon"(project(":archie-core-common", "transformProductionFabric")) { isTransitive = false }
"common"(files(common.tasks.named<Jar>("jar").flatMap { it.archiveFile }))
"shadowCommon"(files(common.tasks.named<Jar>("jar").flatMap { it.archiveFile }))
}

modResources {
Expand All@@ -91,7 +97,7 @@ tasks {
}

processResources {
from(project(":archie-core-common").sourceSets.main.get().resources) {
from(common.sourceSets.main.get().resources) {
include("assets/archie/**")
include("data/archie/**")
include("archie-common.mixins.json")
Expand DownExpand Up@@ -124,11 +130,11 @@ tasks {

jar {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
from(project(":archie-core-common").sourceSets.main.get().output)
from(common.sourceSets.main.get().output)
}

sourcesJar {
val commonSources = project(":archie-core-common").tasks.sourcesJar
val commonSources = common.tasks.sourcesJar
dependsOn(commonSources)
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
from(commonSources.get().archiveFile.map { zipTree(it) })
Expand Down
Loading
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Force GitHub README to respect dark mode\n(function() {\n var style = document.createElement('style');\n style.textContent = '\n .markdown-body {\n color-scheme: dark light;\n }\n .markdown-body pre { background: #161b22 !important; }\n .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; }\n .markdown-body table th, .markdown-body table td { border-color: #30363d !important; }\n .markdown-body img { background: #0d1117; }\n .markdown-body blockquote { border-left-color: #8b949e; }\n .markdown-body hr { border-color: #30363d; }\n ';\n document.head.appendChild(style);\n})();", "GitHub Dark Mode README Fix"); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .claude/settings.json
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
{
"worktree": { "bgIsolation": "none" },
"hooks": {
"SessionStart": [
{
Expand Down
129 changes: 82 additions & 47 deletions build.gradle.kts
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
import com.hypherionmc.modfusioner.plugin.FusionerExtension
import net.fabricmc.loom.api.LoomGradleExtensionAPI
import org.gradle.api.publish.PublishingExtension
import org.gradle.api.publish.maven.MavenPublication
import org.gradle.api.tasks.bundling.AbstractArchiveTask
import org.jetbrains.kotlin.konan.properties.loadProperties

plugins {
Expand DownExpand Up@@ -46,6 +48,10 @@ version = "mod_version".prop ?: "0.0.1-SNAPSHOT"
group = "mod_group".prop ?: "net.kernelpanicsoft"

subprojects {
// Stonecutter's tree/branch anchors (e.g. `:core`) are synthetic container projects with real
// leaf projects nested under them - they must not get build plugins applied to them directly.
if (subprojects.isNotEmpty()) return@subprojects

apply(plugin = "dev.architectury.loom")
apply(plugin = "net.kernelpanicsoft.actualizer")

Expand DownExpand Up@@ -115,41 +121,56 @@ subprojects {
})

compileOnly("org.jetbrains:annotations:24.1.0")

// Gradle 9 stopped bundling its own copy of the JUnit Platform launcher for
// useJUnitPlatform() - every module needs this on the test runtime classpath now.
"testRuntimeOnly"(rootProject.libs.junit.platform.launcher)
}

// One MavenPublication per module, published to kernelpanicsoft.net's Reposilite - archie-core/
// -datagen/-gametest are real consumable libraries; archie-test is a dev playground, never
// published (matches fusioner/dokka's own product/test split above).
if (!project.name.startsWith("archie-test-")) {
//
// Under Stonecutter, `project.name` is just the version segment ("1.21.1") for every leaf in
// every tree - it no longer distinguishes "test" from the rest. `project.path` still does
// (":test:common:1.21.1" etc.), since Stonecutter nests leaves under their tree name.
if (!project.path.startsWith(":test:")) {
// allprojects{} (below) is what normally applies these, but it's declared after this
// subprojects{} block and hasn't run for this project yet - apply is idempotent, so
// re-applying here just guarantees ordering for the components["java"]/publishing{} access
// immediately below.
apply(plugin = "java")
apply(plugin = "maven-publish")

extensions.configure<PublishingExtension>("publishing") {
publications {
create<MavenPublication>("maven") {
artifactId = base.archivesName.get()
from(components["java"])
// base.archivesName only reaches its final "archie-core-fabric"-style value once this leaf's
// own build.gradle.kts runs (module scripts execute after this subprojects{} block, and
// allprojects{} - which seeds the "archie-core" prefix - runs after it too) - reading it here
// would still see the base plugin's raw default ("1.21.1", from project.name). Defer until
// this project has finished configuring.
afterEvaluate {
extensions.configure<PublishingExtension>("publishing") {
publications {
create<MavenPublication>("maven") {
artifactId = base.archivesName.get()
from(components["java"])
}
}
}

repositories {
mavenLocal()
maven {
name = "Reposilite"
val releasesUrl = "https://maven.kernelpanicsoft.net/releases"
val snapshotsUrl = "https://maven.kernelpanicsoft.net/snapshots"

url = uri(if (version.toString().endsWith("SNAPSHOT")) snapshotsUrl else releasesUrl)

credentials {
username = localProperties?.getProperty("reposilite.username")
?: System.getenv("REPOSILITE_USERNAME")
password = localProperties?.getProperty("reposilite.password")
?: System.getenv("REPOSILITE_PASSWORD")
repositories {
mavenLocal()
maven {
name = "Reposilite"
val releasesUrl = "https://maven.kernelpanicsoft.net/releases"
val snapshotsUrl = "https://maven.kernelpanicsoft.net/snapshots"

url = uri(if (version.toString().endsWith("SNAPSHOT")) snapshotsUrl else releasesUrl)

credentials {
username = localProperties?.getProperty("reposilite.username")
?: System.getenv("REPOSILITE_USERNAME")
password = localProperties?.getProperty("reposilite.password")
?: System.getenv("REPOSILITE_PASSWORD")
}
}
}
}
Expand All@@ -158,6 +179,11 @@ subprojects {
}

allprojects {
// Stonecutter's tree/branch anchors (e.g. `:core`) are synthetic container projects with real
// leaf projects nested under them - they must not get build plugins applied to them directly.
// The true root project still needs this block (e.g. for its own `publish` task).
if (this != rootProject && subprojects.isNotEmpty()) return@allprojects

apply(plugin = "java")
apply(plugin = "org.jetbrains.kotlin.jvm")
apply(plugin = "org.jetbrains.kotlin.plugin.serialization")
Expand DownExpand Up@@ -200,14 +226,38 @@ fusioner {
jarVersion = project.version.toString()
outputDirectory = "build/artifacts"

// modfusioner finds each side's source project by bare Project.name (case-insensitive), searched
// across the *entire* build - but under Stonecutter every tree (core/datagen/gametest/test) has a
// leaf literally named "fabric" and one named "neoforge", so no name resolves uniquely to core's.
// ":core" is an existing, globally-unique container project name - point both sides at it just to
// satisfy modfusioner's "did we find >= 2 projects" check; `inputFile` (set below, once every
// project has finished configuring) overrides where the actual jar is read from, resolved relative
// to that anchor project's directory.
fabric {
projectName = "archie-core-fabric"
inputTaskName = "remapJar"
projectName = "core"
}

neoforge {
projectName = "archie-core-neoforge"
inputTaskName = "remapJar"
projectName = "core"
}
}

// modfusioner reads `inputFile` as `File(<projectName's projectDir>, inputFile)` - `projectName` above
// is just an anchor, so compute the real remapJar output path here (deferred to gradle.projectsEvaluated
// so base.archivesName - and therefore the jar's real filename - has reached its final value) and
// express it relative to :core's directory.
gradle.projectsEvaluated {
val mcVersion = libs.versions.minecraft.get()
val coreDir = project(":core").projectDir

fun remapJarFile(path: String) =
(project(path).tasks.named("remapJar").get() as AbstractArchiveTask).archiveFile.get().asFile

project.extensions.getByType<FusionerExtension>().let { fusionerExtension ->
fusionerExtension.fabricConfiguration.inputFile =
remapJarFile(":core:fabric:$mcVersion").relativeTo(coreDir).path
fusionerExtension.neoforgeConfiguration.inputFile =
remapJarFile(":core:neoforge:$mcVersion").relativeTo(coreDir).path
}
}

Expand All@@ -224,7 +274,7 @@ publisher {

projectVersion = "${libs.versions.minecraft.get()}-${project.version}"
displayName = "Archie-Merged-${projectVersion.get()}"
gameVersions = listOf("1.21.1")
gameVersions = listOf(libs.versions.minecraft.get())
loaders = listOf("neoforge", "fabric")
curseEnvironment = "both"
versionType = "alpha"
Expand All@@ -243,15 +293,12 @@ publisher {
}

dependencies {
dokka(project(":archie-core-common")) { isTransitive = false }
dokka(project(":archie-core-fabric")) { isTransitive = false }
dokka(project(":archie-core-neoforge")) { isTransitive = false }
dokka(project(":archie-datagen-common")) { isTransitive = false }
dokka(project(":archie-datagen-fabric")) { isTransitive = false }
dokka(project(":archie-datagen-neoforge")) { isTransitive = false }
dokka(project(":archie-gametest-common")) { isTransitive = false }
dokka(project(":archie-gametest-fabric")) { isTransitive = false }
dokka(project(":archie-gametest-neoforge")) { isTransitive = false }
val mcVersion = libs.versions.minecraft.get()
listOf("core", "datagen", "gametest").forEach { tree ->
listOf("common", "fabric", "neoforge").forEach { branch ->
dokka(project(":$tree:$branch:$mcVersion")) { isTransitive = false }
}
}
}

tasks {
Expand All@@ -269,20 +316,8 @@ tasks {
group = "publishing"
val tag = rootProject.version.toString().substringBeforeLast(".")
workingDir = rootDir
// --alias-type redirect: mike's default ("symlink") writes the "latest" alias as an
// actual symlink into the gh-pages branch, which GitHub's own automatic Pages
// build-and-deploy (triggered whenever gh-pages is pushed, separate from this task)
// rejects outright ("content does not contain any hard links, symlinks"). "redirect"
// makes the alias a small HTML redirect page instead - no symlink, same effect for
// visitors.
commandLine("mike", "deploy", "--push", "--update-aliases", "--alias-type", "redirect", tag, "latest")
}
// modpublisher's changelog reads CHANGELOG.md straight off disk when a publish task runs - it
// doesn't know about git tags or PRs. .github/workflows/release-notes.yaml (reactive, post-tag)
// can't help here: by the time it would generate this release's entry, the publish task attached
// to the tag has already read (and shipped) whatever was on disk before. This task closes that
// gap by generating CHANGELOG.md synchronously - see .github/scripts/generate_release_notes.py's
// module docstring for the two call shapes.
register<Exec>("generateChangelog") {
group = "publishing"
workingDir = rootDir
Expand Down
22 changes: 8 additions & 14 deletions core/common/build.gradle.kts
Original file line numberDiff line numberDiff line change
Expand Up@@ -21,10 +21,13 @@ val sharedProperties = kotlin.runCatching {
val String.prop: String?
get() = sharedProperties?.get(this)?.toString()

val branchDir = projectDir.parentFile.parentFile

loom {
accessWidenerPath = file("src/main/resources/${"mod_id".prop}.accesswidener")
accessWidenerPath = branchDir.resolve("src/main/resources/${"mod_id".prop}.accesswidener")
}


dependencies {
compileOnly(kotlin("reflect"))
implementation(libs.junit.jupiter.api)
Expand All@@ -39,19 +42,10 @@ dependencies {
api(libs.kotlinx.serialization.json5) { isTransitive = false }
api(libs.kotlinx.serialization.cbor) { isTransitive = false }
api(compose.runtime)
// Used only for the fabric @Environment annotations + mixin deps. Do NOT use other classes
// from fabric loader from common code.
modImplementation(libs.fabric.loader)

modApi(libs.rei.common)
modCompileOnly(libs.clothConfig.common)
// Cloth Config's own transitive dependency, kept visible at compile time only (like Cloth
// Config itself) since the config system exposes `Color` directly in its own public API -
// NOT bundled: Cloth Config's own distributed jar already jar-in-jars this and exports
// `me.shedaniel.math` itself, so embedding a second copy makes NeoForge's ModLauncher refuse
// to even build its module layer ("Modules basic.math and cloth_config export package
// me.shedaniel.math") the moment both are present - confirmed by actually hitting that crash.
// [ColorSerializer]/[SColor] stay gated behind isClothConfigLoaded instead, same as ModifierKeyCode.
compileOnlyApi(libs.cloth.basic.math)
modApi(libs.architectury.common)
modApi(libs.storage.common)
Expand All@@ -61,20 +55,20 @@ dependencies {
tasks {
base.archivesName.set(base.archivesName.get() + "-common")

val verifyGuiSpriteAssets by registering {
val verifyGuiSpriteAssets = register("verifyGuiSpriteAssets") {
group = "verification"
description = "Verifies GUI sprite metadata files have matching PNG assets."

doLast {
val spritesDir = file("src/main/resources/assets/archie/textures/gui/sprites")
val spritesDir = branchDir.resolve("src/main/resources/assets/archie/textures/gui/sprites")
if (!spritesDir.exists()) return@doLast

val missingPng = spritesDir
.walkTopDown()
.filter { it.isFile && it.name.endsWith(".png.mcmeta") }
.map { it to file(it.path.removeSuffix(".mcmeta")) }
.map { it to File(it.path.removeSuffix(".mcmeta")) }
.filter { (_, png) -> !png.exists() }
.map { (meta, _) -> meta.relativeTo(projectDir).invariantSeparatorsPath }
.map { (meta, _) -> meta.relativeTo(branchDir).invariantSeparatorsPath }
.toList()

if (missingPng.isNotEmpty()) {
Expand Down
20 changes: 13 additions & 7 deletions core/fabric/build.gradle.kts
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
import dev.kikugie.stonecutter.build.StonecutterBuildExtension
import net.kernelpanicsoft.archie.plugin.bundleMod
import net.kernelpanicsoft.archie.plugin.bundleRuntimeLibrary
import net.kernelpanicsoft.archie.plugin.runtimeLibrary
Expand All@@ -12,8 +13,13 @@ architectury {
fabric()
}

val commonNode = requireNotNull(extensions.getByType<StonecutterBuildExtension>().node.sibling("common")) {
"No common project for $project"
}
val common: Project = commonNode.project

actualizer {
actualizes(project(":archie-core-common"))
actualizes(common)
}

configurations {
Expand All@@ -26,7 +32,7 @@ configurations {
}

loom {
accessWidenerPath.set(project(":archie-core-common").loom.accessWidenerPath)
accessWidenerPath.set(common.loom.accessWidenerPath)

mods {
maybeCreate("main").apply {
Expand DownExpand Up@@ -75,8 +81,8 @@ dependencies {
testRuntimeOnly(libs.junit.jupiter.engine)
runtimeLibrary(libs.kotlinx.coroutines.test)

"common"(project(":archie-core-common", "namedElements")) { isTransitive = false }
"shadowCommon"(project(":archie-core-common", "transformProductionFabric")) { isTransitive = false }
"common"(files(common.tasks.named<Jar>("jar").flatMap { it.archiveFile }))
"shadowCommon"(files(common.tasks.named<Jar>("jar").flatMap { it.archiveFile }))
}

modResources {
Expand All@@ -91,7 +97,7 @@ tasks {
}

processResources {
from(project(":archie-core-common").sourceSets.main.get().resources) {
from(common.sourceSets.main.get().resources) {
include("assets/archie/**")
include("data/archie/**")
include("archie-common.mixins.json")
Expand DownExpand Up@@ -124,11 +130,11 @@ tasks {

jar {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
from(project(":archie-core-common").sourceSets.main.get().output)
from(common.sourceSets.main.get().output)
}

sourcesJar {
val commonSources = project(":archie-core-common").tasks.sourcesJar
val commonSources = common.tasks.sourcesJar
dependsOn(commonSources)
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
from(commonSources.get().archiveFile.map { zipTree(it) })
Expand Down
Loading
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Highlight search terms from Google/DuckDuckGo/Bing referrer\n(function() {\n var ref = document.referrer;\n var terms = [];\n \n if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) {\n var url = new URL(ref);\n var q = url.searchParams.get('q') || url.searchParams.get('p');\n if (q) {\n terms = q.split(/\\s+/).filter(function(t) { return t.length > 2; });\n }\n }\n \n if (terms.length === 0) return;\n \n var style = document.createElement('style');\n style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }';\n document.head.appendChild(style);\n \n function highlight(node) {\n if (node.nodeType === 3) { // text node\n var text = node.textContent;\n var found = false;\n terms.forEach(function(term) {\n var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\') + ')', 'gi');\n if (regex.test(text)) {\n found = true;\n var frag = document.createDocumentFragment();\n var parts = text.split(regex);\n parts.forEach(function(part, i) {\n if (i % 2 === 0) {\n frag.appendChild(document.createTextNode(part));\n } else {\n var span = document.createElement('span');\n span.className = 'userscript-highlight';\n span.textContent = part;\n frag.appendChild(span);\n }\n });\n node.parentNode.replaceChild(frag, node);\n }\n });\n } else if (node.nodeType === 1 && node.childNodes) { // element\n var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT'];\n if (!skipTags.includes(node.tagName)) {\n Array.from(node.childNodes).forEach(highlight);\n }\n }\n }\n \n highlight(document.body);\n \n // Re-highlight on dynamic content\n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1 || node.nodeType === 3) highlight(node);\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Highlight Search Terms"); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .claude/settings.json
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
{
"worktree": { "bgIsolation": "none" },
"hooks": {
"SessionStart": [
{
Expand Down
129 changes: 82 additions & 47 deletions build.gradle.kts
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
import com.hypherionmc.modfusioner.plugin.FusionerExtension
import net.fabricmc.loom.api.LoomGradleExtensionAPI
import org.gradle.api.publish.PublishingExtension
import org.gradle.api.publish.maven.MavenPublication
import org.gradle.api.tasks.bundling.AbstractArchiveTask
import org.jetbrains.kotlin.konan.properties.loadProperties

plugins {
Expand DownExpand Up@@ -46,6 +48,10 @@ version = "mod_version".prop ?: "0.0.1-SNAPSHOT"
group = "mod_group".prop ?: "net.kernelpanicsoft"

subprojects {
// Stonecutter's tree/branch anchors (e.g. `:core`) are synthetic container projects with real
// leaf projects nested under them - they must not get build plugins applied to them directly.
if (subprojects.isNotEmpty()) return@subprojects

apply(plugin = "dev.architectury.loom")
apply(plugin = "net.kernelpanicsoft.actualizer")

Expand DownExpand Up@@ -115,41 +121,56 @@ subprojects {
})

compileOnly("org.jetbrains:annotations:24.1.0")

// Gradle 9 stopped bundling its own copy of the JUnit Platform launcher for
// useJUnitPlatform() - every module needs this on the test runtime classpath now.
"testRuntimeOnly"(rootProject.libs.junit.platform.launcher)
}

// One MavenPublication per module, published to kernelpanicsoft.net's Reposilite - archie-core/
// -datagen/-gametest are real consumable libraries; archie-test is a dev playground, never
// published (matches fusioner/dokka's own product/test split above).
if (!project.name.startsWith("archie-test-")) {
//
// Under Stonecutter, `project.name` is just the version segment ("1.21.1") for every leaf in
// every tree - it no longer distinguishes "test" from the rest. `project.path` still does
// (":test:common:1.21.1" etc.), since Stonecutter nests leaves under their tree name.
if (!project.path.startsWith(":test:")) {
// allprojects{} (below) is what normally applies these, but it's declared after this
// subprojects{} block and hasn't run for this project yet - apply is idempotent, so
// re-applying here just guarantees ordering for the components["java"]/publishing{} access
// immediately below.
apply(plugin = "java")
apply(plugin = "maven-publish")

extensions.configure<PublishingExtension>("publishing") {
publications {
create<MavenPublication>("maven") {
artifactId = base.archivesName.get()
from(components["java"])
// base.archivesName only reaches its final "archie-core-fabric"-style value once this leaf's
// own build.gradle.kts runs (module scripts execute after this subprojects{} block, and
// allprojects{} - which seeds the "archie-core" prefix - runs after it too) - reading it here
// would still see the base plugin's raw default ("1.21.1", from project.name). Defer until
// this project has finished configuring.
afterEvaluate {
extensions.configure<PublishingExtension>("publishing") {
publications {
create<MavenPublication>("maven") {
artifactId = base.archivesName.get()
from(components["java"])
}
}
}

repositories {
mavenLocal()
maven {
name = "Reposilite"
val releasesUrl = "https://maven.kernelpanicsoft.net/releases"
val snapshotsUrl = "https://maven.kernelpanicsoft.net/snapshots"

url = uri(if (version.toString().endsWith("SNAPSHOT")) snapshotsUrl else releasesUrl)

credentials {
username = localProperties?.getProperty("reposilite.username")
?: System.getenv("REPOSILITE_USERNAME")
password = localProperties?.getProperty("reposilite.password")
?: System.getenv("REPOSILITE_PASSWORD")
repositories {
mavenLocal()
maven {
name = "Reposilite"
val releasesUrl = "https://maven.kernelpanicsoft.net/releases"
val snapshotsUrl = "https://maven.kernelpanicsoft.net/snapshots"

url = uri(if (version.toString().endsWith("SNAPSHOT")) snapshotsUrl else releasesUrl)

credentials {
username = localProperties?.getProperty("reposilite.username")
?: System.getenv("REPOSILITE_USERNAME")
password = localProperties?.getProperty("reposilite.password")
?: System.getenv("REPOSILITE_PASSWORD")
}
}
}
}
Expand All@@ -158,6 +179,11 @@ subprojects {
}

allprojects {
// Stonecutter's tree/branch anchors (e.g. `:core`) are synthetic container projects with real
// leaf projects nested under them - they must not get build plugins applied to them directly.
// The true root project still needs this block (e.g. for its own `publish` task).
if (this != rootProject && subprojects.isNotEmpty()) return@allprojects

apply(plugin = "java")
apply(plugin = "org.jetbrains.kotlin.jvm")
apply(plugin = "org.jetbrains.kotlin.plugin.serialization")
Expand DownExpand Up@@ -200,14 +226,38 @@ fusioner {
jarVersion = project.version.toString()
outputDirectory = "build/artifacts"

// modfusioner finds each side's source project by bare Project.name (case-insensitive), searched
// across the *entire* build - but under Stonecutter every tree (core/datagen/gametest/test) has a
// leaf literally named "fabric" and one named "neoforge", so no name resolves uniquely to core's.
// ":core" is an existing, globally-unique container project name - point both sides at it just to
// satisfy modfusioner's "did we find >= 2 projects" check; `inputFile` (set below, once every
// project has finished configuring) overrides where the actual jar is read from, resolved relative
// to that anchor project's directory.
fabric {
projectName = "archie-core-fabric"
inputTaskName = "remapJar"
projectName = "core"
}

neoforge {
projectName = "archie-core-neoforge"
inputTaskName = "remapJar"
projectName = "core"
}
}

// modfusioner reads `inputFile` as `File(<projectName's projectDir>, inputFile)` - `projectName` above
// is just an anchor, so compute the real remapJar output path here (deferred to gradle.projectsEvaluated
// so base.archivesName - and therefore the jar's real filename - has reached its final value) and
// express it relative to :core's directory.
gradle.projectsEvaluated {
val mcVersion = libs.versions.minecraft.get()
val coreDir = project(":core").projectDir

fun remapJarFile(path: String) =
(project(path).tasks.named("remapJar").get() as AbstractArchiveTask).archiveFile.get().asFile

project.extensions.getByType<FusionerExtension>().let { fusionerExtension ->
fusionerExtension.fabricConfiguration.inputFile =
remapJarFile(":core:fabric:$mcVersion").relativeTo(coreDir).path
fusionerExtension.neoforgeConfiguration.inputFile =
remapJarFile(":core:neoforge:$mcVersion").relativeTo(coreDir).path
}
}

Expand All@@ -224,7 +274,7 @@ publisher {

projectVersion = "${libs.versions.minecraft.get()}-${project.version}"
displayName = "Archie-Merged-${projectVersion.get()}"
gameVersions = listOf("1.21.1")
gameVersions = listOf(libs.versions.minecraft.get())
loaders = listOf("neoforge", "fabric")
curseEnvironment = "both"
versionType = "alpha"
Expand All@@ -243,15 +293,12 @@ publisher {
}

dependencies {
dokka(project(":archie-core-common")) { isTransitive = false }
dokka(project(":archie-core-fabric")) { isTransitive = false }
dokka(project(":archie-core-neoforge")) { isTransitive = false }
dokka(project(":archie-datagen-common")) { isTransitive = false }
dokka(project(":archie-datagen-fabric")) { isTransitive = false }
dokka(project(":archie-datagen-neoforge")) { isTransitive = false }
dokka(project(":archie-gametest-common")) { isTransitive = false }
dokka(project(":archie-gametest-fabric")) { isTransitive = false }
dokka(project(":archie-gametest-neoforge")) { isTransitive = false }
val mcVersion = libs.versions.minecraft.get()
listOf("core", "datagen", "gametest").forEach { tree ->
listOf("common", "fabric", "neoforge").forEach { branch ->
dokka(project(":$tree:$branch:$mcVersion")) { isTransitive = false }
}
}
}

tasks {
Expand All@@ -269,20 +316,8 @@ tasks {
group = "publishing"
val tag = rootProject.version.toString().substringBeforeLast(".")
workingDir = rootDir
// --alias-type redirect: mike's default ("symlink") writes the "latest" alias as an
// actual symlink into the gh-pages branch, which GitHub's own automatic Pages
// build-and-deploy (triggered whenever gh-pages is pushed, separate from this task)
// rejects outright ("content does not contain any hard links, symlinks"). "redirect"
// makes the alias a small HTML redirect page instead - no symlink, same effect for
// visitors.
commandLine("mike", "deploy", "--push", "--update-aliases", "--alias-type", "redirect", tag, "latest")
}
// modpublisher's changelog reads CHANGELOG.md straight off disk when a publish task runs - it
// doesn't know about git tags or PRs. .github/workflows/release-notes.yaml (reactive, post-tag)
// can't help here: by the time it would generate this release's entry, the publish task attached
// to the tag has already read (and shipped) whatever was on disk before. This task closes that
// gap by generating CHANGELOG.md synchronously - see .github/scripts/generate_release_notes.py's
// module docstring for the two call shapes.
register<Exec>("generateChangelog") {
group = "publishing"
workingDir = rootDir
Expand Down
22 changes: 8 additions & 14 deletions core/common/build.gradle.kts
Original file line numberDiff line numberDiff line change
Expand Up@@ -21,10 +21,13 @@ val sharedProperties = kotlin.runCatching {
val String.prop: String?
get() = sharedProperties?.get(this)?.toString()

val branchDir = projectDir.parentFile.parentFile

loom {
accessWidenerPath = file("src/main/resources/${"mod_id".prop}.accesswidener")
accessWidenerPath = branchDir.resolve("src/main/resources/${"mod_id".prop}.accesswidener")
}


dependencies {
compileOnly(kotlin("reflect"))
implementation(libs.junit.jupiter.api)
Expand All@@ -39,19 +42,10 @@ dependencies {
api(libs.kotlinx.serialization.json5) { isTransitive = false }
api(libs.kotlinx.serialization.cbor) { isTransitive = false }
api(compose.runtime)
// Used only for the fabric @Environment annotations + mixin deps. Do NOT use other classes
// from fabric loader from common code.
modImplementation(libs.fabric.loader)

modApi(libs.rei.common)
modCompileOnly(libs.clothConfig.common)
// Cloth Config's own transitive dependency, kept visible at compile time only (like Cloth
// Config itself) since the config system exposes `Color` directly in its own public API -
// NOT bundled: Cloth Config's own distributed jar already jar-in-jars this and exports
// `me.shedaniel.math` itself, so embedding a second copy makes NeoForge's ModLauncher refuse
// to even build its module layer ("Modules basic.math and cloth_config export package
// me.shedaniel.math") the moment both are present - confirmed by actually hitting that crash.
// [ColorSerializer]/[SColor] stay gated behind isClothConfigLoaded instead, same as ModifierKeyCode.
compileOnlyApi(libs.cloth.basic.math)
modApi(libs.architectury.common)
modApi(libs.storage.common)
Expand All@@ -61,20 +55,20 @@ dependencies {
tasks {
base.archivesName.set(base.archivesName.get() + "-common")

val verifyGuiSpriteAssets by registering {
val verifyGuiSpriteAssets = register("verifyGuiSpriteAssets") {
group = "verification"
description = "Verifies GUI sprite metadata files have matching PNG assets."

doLast {
val spritesDir = file("src/main/resources/assets/archie/textures/gui/sprites")
val spritesDir = branchDir.resolve("src/main/resources/assets/archie/textures/gui/sprites")
if (!spritesDir.exists()) return@doLast

val missingPng = spritesDir
.walkTopDown()
.filter { it.isFile && it.name.endsWith(".png.mcmeta") }
.map { it to file(it.path.removeSuffix(".mcmeta")) }
.map { it to File(it.path.removeSuffix(".mcmeta")) }
.filter { (_, png) -> !png.exists() }
.map { (meta, _) -> meta.relativeTo(projectDir).invariantSeparatorsPath }
.map { (meta, _) -> meta.relativeTo(branchDir).invariantSeparatorsPath }
.toList()

if (missingPng.isNotEmpty()) {
Expand Down
20 changes: 13 additions & 7 deletions core/fabric/build.gradle.kts
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
import dev.kikugie.stonecutter.build.StonecutterBuildExtension
import net.kernelpanicsoft.archie.plugin.bundleMod
import net.kernelpanicsoft.archie.plugin.bundleRuntimeLibrary
import net.kernelpanicsoft.archie.plugin.runtimeLibrary
Expand All@@ -12,8 +13,13 @@ architectury {
fabric()
}

val commonNode = requireNotNull(extensions.getByType<StonecutterBuildExtension>().node.sibling("common")) {
"No common project for $project"
}
val common: Project = commonNode.project

actualizer {
actualizes(project(":archie-core-common"))
actualizes(common)
}

configurations {
Expand All@@ -26,7 +32,7 @@ configurations {
}

loom {
accessWidenerPath.set(project(":archie-core-common").loom.accessWidenerPath)
accessWidenerPath.set(common.loom.accessWidenerPath)

mods {
maybeCreate("main").apply {
Expand DownExpand Up@@ -75,8 +81,8 @@ dependencies {
testRuntimeOnly(libs.junit.jupiter.engine)
runtimeLibrary(libs.kotlinx.coroutines.test)

"common"(project(":archie-core-common", "namedElements")) { isTransitive = false }
"shadowCommon"(project(":archie-core-common", "transformProductionFabric")) { isTransitive = false }
"common"(files(common.tasks.named<Jar>("jar").flatMap { it.archiveFile }))
"shadowCommon"(files(common.tasks.named<Jar>("jar").flatMap { it.archiveFile }))
}

modResources {
Expand All@@ -91,7 +97,7 @@ tasks {
}

processResources {
from(project(":archie-core-common").sourceSets.main.get().resources) {
from(common.sourceSets.main.get().resources) {
include("assets/archie/**")
include("data/archie/**")
include("archie-common.mixins.json")
Expand DownExpand Up@@ -124,11 +130,11 @@ tasks {

jar {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
from(project(":archie-core-common").sourceSets.main.get().output)
from(common.sourceSets.main.get().output)
}

sourcesJar {
val commonSources = project(":archie-core-common").tasks.sourcesJar
val commonSources = common.tasks.sourcesJar
dependsOn(commonSources)
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
from(commonSources.get().archiveFile.map { zipTree(it) })
Expand Down
Loading
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Strip utm_, fbclid, gclid, etc. from all links on page\n(function() {\n var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content',\n 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid',\n 'ref', 'ref_src', 'source', 'medium', 'campaign'];\n \n function cleanUrl(url) {\n try {\n var u = new URL(url, window.location.origin);\n var changed = false;\n trackingParams.forEach(function(p) {\n if (u.searchParams.has(p)) {\n u.searchParams.delete(p);\n changed = true;\n }\n });\n return changed ? u.toString() : url;\n } catch (e) {\n return url;\n }\n }\n \n function cleanLinks() {\n document.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n \n cleanLinks();\n \n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1) {\n if (node.tagName === 'A') cleanLinks();\n node.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Remove Tracking Parameters from Links"); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + '
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .claude/settings.json
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
{
"worktree": { "bgIsolation": "none" },
"hooks": {
"SessionStart": [
{
Expand Down
129 changes: 82 additions & 47 deletions build.gradle.kts
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
import com.hypherionmc.modfusioner.plugin.FusionerExtension
import net.fabricmc.loom.api.LoomGradleExtensionAPI
import org.gradle.api.publish.PublishingExtension
import org.gradle.api.publish.maven.MavenPublication
import org.gradle.api.tasks.bundling.AbstractArchiveTask
import org.jetbrains.kotlin.konan.properties.loadProperties

plugins {
Expand DownExpand Up@@ -46,6 +48,10 @@ version = "mod_version".prop ?: "0.0.1-SNAPSHOT"
group = "mod_group".prop ?: "net.kernelpanicsoft"

subprojects {
// Stonecutter's tree/branch anchors (e.g. `:core`) are synthetic container projects with real
// leaf projects nested under them - they must not get build plugins applied to them directly.
if (subprojects.isNotEmpty()) return@subprojects

apply(plugin = "dev.architectury.loom")
apply(plugin = "net.kernelpanicsoft.actualizer")

Expand DownExpand Up@@ -115,41 +121,56 @@ subprojects {
})

compileOnly("org.jetbrains:annotations:24.1.0")

// Gradle 9 stopped bundling its own copy of the JUnit Platform launcher for
// useJUnitPlatform() - every module needs this on the test runtime classpath now.
"testRuntimeOnly"(rootProject.libs.junit.platform.launcher)
}

// One MavenPublication per module, published to kernelpanicsoft.net's Reposilite - archie-core/
// -datagen/-gametest are real consumable libraries; archie-test is a dev playground, never
// published (matches fusioner/dokka's own product/test split above).
if (!project.name.startsWith("archie-test-")) {
//
// Under Stonecutter, `project.name` is just the version segment ("1.21.1") for every leaf in
// every tree - it no longer distinguishes "test" from the rest. `project.path` still does
// (":test:common:1.21.1" etc.), since Stonecutter nests leaves under their tree name.
if (!project.path.startsWith(":test:")) {
// allprojects{} (below) is what normally applies these, but it's declared after this
// subprojects{} block and hasn't run for this project yet - apply is idempotent, so
// re-applying here just guarantees ordering for the components["java"]/publishing{} access
// immediately below.
apply(plugin = "java")
apply(plugin = "maven-publish")

extensions.configure<PublishingExtension>("publishing") {
publications {
create<MavenPublication>("maven") {
artifactId = base.archivesName.get()
from(components["java"])
// base.archivesName only reaches its final "archie-core-fabric"-style value once this leaf's
// own build.gradle.kts runs (module scripts execute after this subprojects{} block, and
// allprojects{} - which seeds the "archie-core" prefix - runs after it too) - reading it here
// would still see the base plugin's raw default ("1.21.1", from project.name). Defer until
// this project has finished configuring.
afterEvaluate {
extensions.configure<PublishingExtension>("publishing") {
publications {
create<MavenPublication>("maven") {
artifactId = base.archivesName.get()
from(components["java"])
}
}
}

repositories {
mavenLocal()
maven {
name = "Reposilite"
val releasesUrl = "https://maven.kernelpanicsoft.net/releases"
val snapshotsUrl = "https://maven.kernelpanicsoft.net/snapshots"

url = uri(if (version.toString().endsWith("SNAPSHOT")) snapshotsUrl else releasesUrl)

credentials {
username = localProperties?.getProperty("reposilite.username")
?: System.getenv("REPOSILITE_USERNAME")
password = localProperties?.getProperty("reposilite.password")
?: System.getenv("REPOSILITE_PASSWORD")
repositories {
mavenLocal()
maven {
name = "Reposilite"
val releasesUrl = "https://maven.kernelpanicsoft.net/releases"
val snapshotsUrl = "https://maven.kernelpanicsoft.net/snapshots"

url = uri(if (version.toString().endsWith("SNAPSHOT")) snapshotsUrl else releasesUrl)

credentials {
username = localProperties?.getProperty("reposilite.username")
?: System.getenv("REPOSILITE_USERNAME")
password = localProperties?.getProperty("reposilite.password")
?: System.getenv("REPOSILITE_PASSWORD")
}
}
}
}
Expand All@@ -158,6 +179,11 @@ subprojects {
}

allprojects {
// Stonecutter's tree/branch anchors (e.g. `:core`) are synthetic container projects with real
// leaf projects nested under them - they must not get build plugins applied to them directly.
// The true root project still needs this block (e.g. for its own `publish` task).
if (this != rootProject && subprojects.isNotEmpty()) return@allprojects

apply(plugin = "java")
apply(plugin = "org.jetbrains.kotlin.jvm")
apply(plugin = "org.jetbrains.kotlin.plugin.serialization")
Expand DownExpand Up@@ -200,14 +226,38 @@ fusioner {
jarVersion = project.version.toString()
outputDirectory = "build/artifacts"

// modfusioner finds each side's source project by bare Project.name (case-insensitive), searched
// across the *entire* build - but under Stonecutter every tree (core/datagen/gametest/test) has a
// leaf literally named "fabric" and one named "neoforge", so no name resolves uniquely to core's.
// ":core" is an existing, globally-unique container project name - point both sides at it just to
// satisfy modfusioner's "did we find >= 2 projects" check; `inputFile` (set below, once every
// project has finished configuring) overrides where the actual jar is read from, resolved relative
// to that anchor project's directory.
fabric {
projectName = "archie-core-fabric"
inputTaskName = "remapJar"
projectName = "core"
}

neoforge {
projectName = "archie-core-neoforge"
inputTaskName = "remapJar"
projectName = "core"
}
}

// modfusioner reads `inputFile` as `File(<projectName's projectDir>, inputFile)` - `projectName` above
// is just an anchor, so compute the real remapJar output path here (deferred to gradle.projectsEvaluated
// so base.archivesName - and therefore the jar's real filename - has reached its final value) and
// express it relative to :core's directory.
gradle.projectsEvaluated {
val mcVersion = libs.versions.minecraft.get()
val coreDir = project(":core").projectDir

fun remapJarFile(path: String) =
(project(path).tasks.named("remapJar").get() as AbstractArchiveTask).archiveFile.get().asFile

project.extensions.getByType<FusionerExtension>().let { fusionerExtension ->
fusionerExtension.fabricConfiguration.inputFile =
remapJarFile(":core:fabric:$mcVersion").relativeTo(coreDir).path
fusionerExtension.neoforgeConfiguration.inputFile =
remapJarFile(":core:neoforge:$mcVersion").relativeTo(coreDir).path
}
}

Expand All@@ -224,7 +274,7 @@ publisher {

projectVersion = "${libs.versions.minecraft.get()}-${project.version}"
displayName = "Archie-Merged-${projectVersion.get()}"
gameVersions = listOf("1.21.1")
gameVersions = listOf(libs.versions.minecraft.get())
loaders = listOf("neoforge", "fabric")
curseEnvironment = "both"
versionType = "alpha"
Expand All@@ -243,15 +293,12 @@ publisher {
}

dependencies {
dokka(project(":archie-core-common")) { isTransitive = false }
dokka(project(":archie-core-fabric")) { isTransitive = false }
dokka(project(":archie-core-neoforge")) { isTransitive = false }
dokka(project(":archie-datagen-common")) { isTransitive = false }
dokka(project(":archie-datagen-fabric")) { isTransitive = false }
dokka(project(":archie-datagen-neoforge")) { isTransitive = false }
dokka(project(":archie-gametest-common")) { isTransitive = false }
dokka(project(":archie-gametest-fabric")) { isTransitive = false }
dokka(project(":archie-gametest-neoforge")) { isTransitive = false }
val mcVersion = libs.versions.minecraft.get()
listOf("core", "datagen", "gametest").forEach { tree ->
listOf("common", "fabric", "neoforge").forEach { branch ->
dokka(project(":$tree:$branch:$mcVersion")) { isTransitive = false }
}
}
}

tasks {
Expand All@@ -269,20 +316,8 @@ tasks {
group = "publishing"
val tag = rootProject.version.toString().substringBeforeLast(".")
workingDir = rootDir
// --alias-type redirect: mike's default ("symlink") writes the "latest" alias as an
// actual symlink into the gh-pages branch, which GitHub's own automatic Pages
// build-and-deploy (triggered whenever gh-pages is pushed, separate from this task)
// rejects outright ("content does not contain any hard links, symlinks"). "redirect"
// makes the alias a small HTML redirect page instead - no symlink, same effect for
// visitors.
commandLine("mike", "deploy", "--push", "--update-aliases", "--alias-type", "redirect", tag, "latest")
}
// modpublisher's changelog reads CHANGELOG.md straight off disk when a publish task runs - it
// doesn't know about git tags or PRs. .github/workflows/release-notes.yaml (reactive, post-tag)
// can't help here: by the time it would generate this release's entry, the publish task attached
// to the tag has already read (and shipped) whatever was on disk before. This task closes that
// gap by generating CHANGELOG.md synchronously - see .github/scripts/generate_release_notes.py's
// module docstring for the two call shapes.
register<Exec>("generateChangelog") {
group = "publishing"
workingDir = rootDir
Expand Down
22 changes: 8 additions & 14 deletions core/common/build.gradle.kts
Original file line numberDiff line numberDiff line change
Expand Up@@ -21,10 +21,13 @@ val sharedProperties = kotlin.runCatching {
val String.prop: String?
get() = sharedProperties?.get(this)?.toString()

val branchDir = projectDir.parentFile.parentFile

loom {
accessWidenerPath = file("src/main/resources/${"mod_id".prop}.accesswidener")
accessWidenerPath = branchDir.resolve("src/main/resources/${"mod_id".prop}.accesswidener")
}


dependencies {
compileOnly(kotlin("reflect"))
implementation(libs.junit.jupiter.api)
Expand All@@ -39,19 +42,10 @@ dependencies {
api(libs.kotlinx.serialization.json5) { isTransitive = false }
api(libs.kotlinx.serialization.cbor) { isTransitive = false }
api(compose.runtime)
// Used only for the fabric @Environment annotations + mixin deps. Do NOT use other classes
// from fabric loader from common code.
modImplementation(libs.fabric.loader)

modApi(libs.rei.common)
modCompileOnly(libs.clothConfig.common)
// Cloth Config's own transitive dependency, kept visible at compile time only (like Cloth
// Config itself) since the config system exposes `Color` directly in its own public API -
// NOT bundled: Cloth Config's own distributed jar already jar-in-jars this and exports
// `me.shedaniel.math` itself, so embedding a second copy makes NeoForge's ModLauncher refuse
// to even build its module layer ("Modules basic.math and cloth_config export package
// me.shedaniel.math") the moment both are present - confirmed by actually hitting that crash.
// [ColorSerializer]/[SColor] stay gated behind isClothConfigLoaded instead, same as ModifierKeyCode.
compileOnlyApi(libs.cloth.basic.math)
modApi(libs.architectury.common)
modApi(libs.storage.common)
Expand All@@ -61,20 +55,20 @@ dependencies {
tasks {
base.archivesName.set(base.archivesName.get() + "-common")

val verifyGuiSpriteAssets by registering {
val verifyGuiSpriteAssets = register("verifyGuiSpriteAssets") {
group = "verification"
description = "Verifies GUI sprite metadata files have matching PNG assets."

doLast {
val spritesDir = file("src/main/resources/assets/archie/textures/gui/sprites")
val spritesDir = branchDir.resolve("src/main/resources/assets/archie/textures/gui/sprites")
if (!spritesDir.exists()) return@doLast

val missingPng = spritesDir
.walkTopDown()
.filter { it.isFile && it.name.endsWith(".png.mcmeta") }
.map { it to file(it.path.removeSuffix(".mcmeta")) }
.map { it to File(it.path.removeSuffix(".mcmeta")) }
.filter { (_, png) -> !png.exists() }
.map { (meta, _) -> meta.relativeTo(projectDir).invariantSeparatorsPath }
.map { (meta, _) -> meta.relativeTo(branchDir).invariantSeparatorsPath }
.toList()

if (missingPng.isNotEmpty()) {
Expand Down
20 changes: 13 additions & 7 deletions core/fabric/build.gradle.kts
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
import dev.kikugie.stonecutter.build.StonecutterBuildExtension
import net.kernelpanicsoft.archie.plugin.bundleMod
import net.kernelpanicsoft.archie.plugin.bundleRuntimeLibrary
import net.kernelpanicsoft.archie.plugin.runtimeLibrary
Expand All@@ -12,8 +13,13 @@ architectury {
fabric()
}

val commonNode = requireNotNull(extensions.getByType<StonecutterBuildExtension>().node.sibling("common")) {
"No common project for $project"
}
val common: Project = commonNode.project

actualizer {
actualizes(project(":archie-core-common"))
actualizes(common)
}

configurations {
Expand All@@ -26,7 +32,7 @@ configurations {
}

loom {
accessWidenerPath.set(project(":archie-core-common").loom.accessWidenerPath)
accessWidenerPath.set(common.loom.accessWidenerPath)

mods {
maybeCreate("main").apply {
Expand DownExpand Up@@ -75,8 +81,8 @@ dependencies {
testRuntimeOnly(libs.junit.jupiter.engine)
runtimeLibrary(libs.kotlinx.coroutines.test)

"common"(project(":archie-core-common", "namedElements")) { isTransitive = false }
"shadowCommon"(project(":archie-core-common", "transformProductionFabric")) { isTransitive = false }
"common"(files(common.tasks.named<Jar>("jar").flatMap { it.archiveFile }))
"shadowCommon"(files(common.tasks.named<Jar>("jar").flatMap { it.archiveFile }))
}

modResources {
Expand All@@ -91,7 +97,7 @@ tasks {
}

processResources {
from(project(":archie-core-common").sourceSets.main.get().resources) {
from(common.sourceSets.main.get().resources) {
include("assets/archie/**")
include("data/archie/**")
include("archie-common.mixins.json")
Expand DownExpand Up@@ -124,11 +130,11 @@ tasks {

jar {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
from(project(":archie-core-common").sourceSets.main.get().output)
from(common.sourceSets.main.get().output)
}

sourcesJar {
val commonSources = project(":archie-core-common").tasks.sourcesJar
val commonSources = common.tasks.sourcesJar
dependsOn(commonSources)
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
from(commonSources.get().archiveFile.map { zipTree(it) })
Expand Down
Loading
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Auto-enable theater mode on YouTube\n(function() {\n function tryTheater() {\n var btn = document.querySelector('button[aria-label=\"Theater mode\"], ytd-player #player button[title=\"Theater mode\"]');\n if (btn && !btn.classList.contains('activated')) {\n btn.click();\n }\n }\n \n // Try immediately\n tryTheater();\n \n // Try after navigation (SPA)\n var lastUrl = location.href;\n setInterval(function() {\n if (location.href !== lastUrl) {\n lastUrl = location.href;\n setTimeout(tryTheater, 500);\n }\n }, 1000);\n \n // Also try on player load\n var observer = new MutationObserver(tryTheater);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "YouTube Theater Mode Default"); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .claude/settings.json
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
{
"worktree": { "bgIsolation": "none" },
"hooks": {
"SessionStart": [
{
Expand Down
129 changes: 82 additions & 47 deletions build.gradle.kts
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
import com.hypherionmc.modfusioner.plugin.FusionerExtension
import net.fabricmc.loom.api.LoomGradleExtensionAPI
import org.gradle.api.publish.PublishingExtension
import org.gradle.api.publish.maven.MavenPublication
import org.gradle.api.tasks.bundling.AbstractArchiveTask
import org.jetbrains.kotlin.konan.properties.loadProperties

plugins {
Expand DownExpand Up@@ -46,6 +48,10 @@ version = "mod_version".prop ?: "0.0.1-SNAPSHOT"
group = "mod_group".prop ?: "net.kernelpanicsoft"

subprojects {
// Stonecutter's tree/branch anchors (e.g. `:core`) are synthetic container projects with real
// leaf projects nested under them - they must not get build plugins applied to them directly.
if (subprojects.isNotEmpty()) return@subprojects

apply(plugin = "dev.architectury.loom")
apply(plugin = "net.kernelpanicsoft.actualizer")

Expand DownExpand Up@@ -115,41 +121,56 @@ subprojects {
})

compileOnly("org.jetbrains:annotations:24.1.0")

// Gradle 9 stopped bundling its own copy of the JUnit Platform launcher for
// useJUnitPlatform() - every module needs this on the test runtime classpath now.
"testRuntimeOnly"(rootProject.libs.junit.platform.launcher)
}

// One MavenPublication per module, published to kernelpanicsoft.net's Reposilite - archie-core/
// -datagen/-gametest are real consumable libraries; archie-test is a dev playground, never
// published (matches fusioner/dokka's own product/test split above).
if (!project.name.startsWith("archie-test-")) {
//
// Under Stonecutter, `project.name` is just the version segment ("1.21.1") for every leaf in
// every tree - it no longer distinguishes "test" from the rest. `project.path` still does
// (":test:common:1.21.1" etc.), since Stonecutter nests leaves under their tree name.
if (!project.path.startsWith(":test:")) {
// allprojects{} (below) is what normally applies these, but it's declared after this
// subprojects{} block and hasn't run for this project yet - apply is idempotent, so
// re-applying here just guarantees ordering for the components["java"]/publishing{} access
// immediately below.
apply(plugin = "java")
apply(plugin = "maven-publish")

extensions.configure<PublishingExtension>("publishing") {
publications {
create<MavenPublication>("maven") {
artifactId = base.archivesName.get()
from(components["java"])
// base.archivesName only reaches its final "archie-core-fabric"-style value once this leaf's
// own build.gradle.kts runs (module scripts execute after this subprojects{} block, and
// allprojects{} - which seeds the "archie-core" prefix - runs after it too) - reading it here
// would still see the base plugin's raw default ("1.21.1", from project.name). Defer until
// this project has finished configuring.
afterEvaluate {
extensions.configure<PublishingExtension>("publishing") {
publications {
create<MavenPublication>("maven") {
artifactId = base.archivesName.get()
from(components["java"])
}
}
}

repositories {
mavenLocal()
maven {
name = "Reposilite"
val releasesUrl = "https://maven.kernelpanicsoft.net/releases"
val snapshotsUrl = "https://maven.kernelpanicsoft.net/snapshots"

url = uri(if (version.toString().endsWith("SNAPSHOT")) snapshotsUrl else releasesUrl)

credentials {
username = localProperties?.getProperty("reposilite.username")
?: System.getenv("REPOSILITE_USERNAME")
password = localProperties?.getProperty("reposilite.password")
?: System.getenv("REPOSILITE_PASSWORD")
repositories {
mavenLocal()
maven {
name = "Reposilite"
val releasesUrl = "https://maven.kernelpanicsoft.net/releases"
val snapshotsUrl = "https://maven.kernelpanicsoft.net/snapshots"

url = uri(if (version.toString().endsWith("SNAPSHOT")) snapshotsUrl else releasesUrl)

credentials {
username = localProperties?.getProperty("reposilite.username")
?: System.getenv("REPOSILITE_USERNAME")
password = localProperties?.getProperty("reposilite.password")
?: System.getenv("REPOSILITE_PASSWORD")
}
}
}
}
Expand All@@ -158,6 +179,11 @@ subprojects {
}

allprojects {
// Stonecutter's tree/branch anchors (e.g. `:core`) are synthetic container projects with real
// leaf projects nested under them - they must not get build plugins applied to them directly.
// The true root project still needs this block (e.g. for its own `publish` task).
if (this != rootProject && subprojects.isNotEmpty()) return@allprojects

apply(plugin = "java")
apply(plugin = "org.jetbrains.kotlin.jvm")
apply(plugin = "org.jetbrains.kotlin.plugin.serialization")
Expand DownExpand Up@@ -200,14 +226,38 @@ fusioner {
jarVersion = project.version.toString()
outputDirectory = "build/artifacts"

// modfusioner finds each side's source project by bare Project.name (case-insensitive), searched
// across the *entire* build - but under Stonecutter every tree (core/datagen/gametest/test) has a
// leaf literally named "fabric" and one named "neoforge", so no name resolves uniquely to core's.
// ":core" is an existing, globally-unique container project name - point both sides at it just to
// satisfy modfusioner's "did we find >= 2 projects" check; `inputFile` (set below, once every
// project has finished configuring) overrides where the actual jar is read from, resolved relative
// to that anchor project's directory.
fabric {
projectName = "archie-core-fabric"
inputTaskName = "remapJar"
projectName = "core"
}

neoforge {
projectName = "archie-core-neoforge"
inputTaskName = "remapJar"
projectName = "core"
}
}

// modfusioner reads `inputFile` as `File(<projectName's projectDir>, inputFile)` - `projectName` above
// is just an anchor, so compute the real remapJar output path here (deferred to gradle.projectsEvaluated
// so base.archivesName - and therefore the jar's real filename - has reached its final value) and
// express it relative to :core's directory.
gradle.projectsEvaluated {
val mcVersion = libs.versions.minecraft.get()
val coreDir = project(":core").projectDir

fun remapJarFile(path: String) =
(project(path).tasks.named("remapJar").get() as AbstractArchiveTask).archiveFile.get().asFile

project.extensions.getByType<FusionerExtension>().let { fusionerExtension ->
fusionerExtension.fabricConfiguration.inputFile =
remapJarFile(":core:fabric:$mcVersion").relativeTo(coreDir).path
fusionerExtension.neoforgeConfiguration.inputFile =
remapJarFile(":core:neoforge:$mcVersion").relativeTo(coreDir).path
}
}

Expand All@@ -224,7 +274,7 @@ publisher {

projectVersion = "${libs.versions.minecraft.get()}-${project.version}"
displayName = "Archie-Merged-${projectVersion.get()}"
gameVersions = listOf("1.21.1")
gameVersions = listOf(libs.versions.minecraft.get())
loaders = listOf("neoforge", "fabric")
curseEnvironment = "both"
versionType = "alpha"
Expand All@@ -243,15 +293,12 @@ publisher {
}

dependencies {
dokka(project(":archie-core-common")) { isTransitive = false }
dokka(project(":archie-core-fabric")) { isTransitive = false }
dokka(project(":archie-core-neoforge")) { isTransitive = false }
dokka(project(":archie-datagen-common")) { isTransitive = false }
dokka(project(":archie-datagen-fabric")) { isTransitive = false }
dokka(project(":archie-datagen-neoforge")) { isTransitive = false }
dokka(project(":archie-gametest-common")) { isTransitive = false }
dokka(project(":archie-gametest-fabric")) { isTransitive = false }
dokka(project(":archie-gametest-neoforge")) { isTransitive = false }
val mcVersion = libs.versions.minecraft.get()
listOf("core", "datagen", "gametest").forEach { tree ->
listOf("common", "fabric", "neoforge").forEach { branch ->
dokka(project(":$tree:$branch:$mcVersion")) { isTransitive = false }
}
}
}

tasks {
Expand All@@ -269,20 +316,8 @@ tasks {
group = "publishing"
val tag = rootProject.version.toString().substringBeforeLast(".")
workingDir = rootDir
// --alias-type redirect: mike's default ("symlink") writes the "latest" alias as an
// actual symlink into the gh-pages branch, which GitHub's own automatic Pages
// build-and-deploy (triggered whenever gh-pages is pushed, separate from this task)
// rejects outright ("content does not contain any hard links, symlinks"). "redirect"
// makes the alias a small HTML redirect page instead - no symlink, same effect for
// visitors.
commandLine("mike", "deploy", "--push", "--update-aliases", "--alias-type", "redirect", tag, "latest")
}
// modpublisher's changelog reads CHANGELOG.md straight off disk when a publish task runs - it
// doesn't know about git tags or PRs. .github/workflows/release-notes.yaml (reactive, post-tag)
// can't help here: by the time it would generate this release's entry, the publish task attached
// to the tag has already read (and shipped) whatever was on disk before. This task closes that
// gap by generating CHANGELOG.md synchronously - see .github/scripts/generate_release_notes.py's
// module docstring for the two call shapes.
register<Exec>("generateChangelog") {
group = "publishing"
workingDir = rootDir
Expand Down
22 changes: 8 additions & 14 deletions core/common/build.gradle.kts
Original file line numberDiff line numberDiff line change
Expand Up@@ -21,10 +21,13 @@ val sharedProperties = kotlin.runCatching {
val String.prop: String?
get() = sharedProperties?.get(this)?.toString()

val branchDir = projectDir.parentFile.parentFile

loom {
accessWidenerPath = file("src/main/resources/${"mod_id".prop}.accesswidener")
accessWidenerPath = branchDir.resolve("src/main/resources/${"mod_id".prop}.accesswidener")
}


dependencies {
compileOnly(kotlin("reflect"))
implementation(libs.junit.jupiter.api)
Expand All@@ -39,19 +42,10 @@ dependencies {
api(libs.kotlinx.serialization.json5) { isTransitive = false }
api(libs.kotlinx.serialization.cbor) { isTransitive = false }
api(compose.runtime)
// Used only for the fabric @Environment annotations + mixin deps. Do NOT use other classes
// from fabric loader from common code.
modImplementation(libs.fabric.loader)

modApi(libs.rei.common)
modCompileOnly(libs.clothConfig.common)
// Cloth Config's own transitive dependency, kept visible at compile time only (like Cloth
// Config itself) since the config system exposes `Color` directly in its own public API -
// NOT bundled: Cloth Config's own distributed jar already jar-in-jars this and exports
// `me.shedaniel.math` itself, so embedding a second copy makes NeoForge's ModLauncher refuse
// to even build its module layer ("Modules basic.math and cloth_config export package
// me.shedaniel.math") the moment both are present - confirmed by actually hitting that crash.
// [ColorSerializer]/[SColor] stay gated behind isClothConfigLoaded instead, same as ModifierKeyCode.
compileOnlyApi(libs.cloth.basic.math)
modApi(libs.architectury.common)
modApi(libs.storage.common)
Expand All@@ -61,20 +55,20 @@ dependencies {
tasks {
base.archivesName.set(base.archivesName.get() + "-common")

val verifyGuiSpriteAssets by registering {
val verifyGuiSpriteAssets = register("verifyGuiSpriteAssets") {
group = "verification"
description = "Verifies GUI sprite metadata files have matching PNG assets."

doLast {
val spritesDir = file("src/main/resources/assets/archie/textures/gui/sprites")
val spritesDir = branchDir.resolve("src/main/resources/assets/archie/textures/gui/sprites")
if (!spritesDir.exists()) return@doLast

val missingPng = spritesDir
.walkTopDown()
.filter { it.isFile && it.name.endsWith(".png.mcmeta") }
.map { it to file(it.path.removeSuffix(".mcmeta")) }
.map { it to File(it.path.removeSuffix(".mcmeta")) }
.filter { (_, png) -> !png.exists() }
.map { (meta, _) -> meta.relativeTo(projectDir).invariantSeparatorsPath }
.map { (meta, _) -> meta.relativeTo(branchDir).invariantSeparatorsPath }
.toList()

if (missingPng.isNotEmpty()) {
Expand Down
20 changes: 13 additions & 7 deletions core/fabric/build.gradle.kts
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
import dev.kikugie.stonecutter.build.StonecutterBuildExtension
import net.kernelpanicsoft.archie.plugin.bundleMod
import net.kernelpanicsoft.archie.plugin.bundleRuntimeLibrary
import net.kernelpanicsoft.archie.plugin.runtimeLibrary
Expand All@@ -12,8 +13,13 @@ architectury {
fabric()
}

val commonNode = requireNotNull(extensions.getByType<StonecutterBuildExtension>().node.sibling("common")) {
"No common project for $project"
}
val common: Project = commonNode.project

actualizer {
actualizes(project(":archie-core-common"))
actualizes(common)
}

configurations {
Expand All@@ -26,7 +32,7 @@ configurations {
}

loom {
accessWidenerPath.set(project(":archie-core-common").loom.accessWidenerPath)
accessWidenerPath.set(common.loom.accessWidenerPath)

mods {
maybeCreate("main").apply {
Expand DownExpand Up@@ -75,8 +81,8 @@ dependencies {
testRuntimeOnly(libs.junit.jupiter.engine)
runtimeLibrary(libs.kotlinx.coroutines.test)

"common"(project(":archie-core-common", "namedElements")) { isTransitive = false }
"shadowCommon"(project(":archie-core-common", "transformProductionFabric")) { isTransitive = false }
"common"(files(common.tasks.named<Jar>("jar").flatMap { it.archiveFile }))
"shadowCommon"(files(common.tasks.named<Jar>("jar").flatMap { it.archiveFile }))
}

modResources {
Expand All@@ -91,7 +97,7 @@ tasks {
}

processResources {
from(project(":archie-core-common").sourceSets.main.get().resources) {
from(common.sourceSets.main.get().resources) {
include("assets/archie/**")
include("data/archie/**")
include("archie-common.mixins.json")
Expand DownExpand Up@@ -124,11 +130,11 @@ tasks {

jar {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
from(project(":archie-core-common").sourceSets.main.get().output)
from(common.sourceSets.main.get().output)
}

sourcesJar {
val commonSources = project(":archie-core-common").tasks.sourcesJar
val commonSources = common.tasks.sourcesJar
dependsOn(commonSources)
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
from(commonSources.get().archiveFile.map { zipTree(it) })
Expand Down
Loading
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Remove or un-stick sticky/fixed headers that block content\n(function() {\n function unstick() {\n document.querySelectorAll('header, nav, [role=\"banner\"], .header, .navbar, .sticky, .fixed-top, [style*=\"position: fixed\"], [style*=\"position:sticky\"]').forEach(function(el) {\n if (el.style.position === 'fixed' || el.style.position === 'sticky' || \n getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') {\n el.style.position = 'static';\n el.style.top = 'auto';\n el.style.zIndex = 'auto';\n }\n });\n }\n \n unstick();\n \n var observer = new MutationObserver(unstick);\n observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] });\n})();", "Kill Sticky Headers"); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .claude/settings.json
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
{
"worktree": { "bgIsolation": "none" },
"hooks": {
"SessionStart": [
{
Expand Down
129 changes: 82 additions & 47 deletions build.gradle.kts
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
import com.hypherionmc.modfusioner.plugin.FusionerExtension
import net.fabricmc.loom.api.LoomGradleExtensionAPI
import org.gradle.api.publish.PublishingExtension
import org.gradle.api.publish.maven.MavenPublication
import org.gradle.api.tasks.bundling.AbstractArchiveTask
import org.jetbrains.kotlin.konan.properties.loadProperties

plugins {
Expand DownExpand Up@@ -46,6 +48,10 @@ version = "mod_version".prop ?: "0.0.1-SNAPSHOT"
group = "mod_group".prop ?: "net.kernelpanicsoft"

subprojects {
// Stonecutter's tree/branch anchors (e.g. `:core`) are synthetic container projects with real
// leaf projects nested under them - they must not get build plugins applied to them directly.
if (subprojects.isNotEmpty()) return@subprojects

apply(plugin = "dev.architectury.loom")
apply(plugin = "net.kernelpanicsoft.actualizer")

Expand DownExpand Up@@ -115,41 +121,56 @@ subprojects {
})

compileOnly("org.jetbrains:annotations:24.1.0")

// Gradle 9 stopped bundling its own copy of the JUnit Platform launcher for
// useJUnitPlatform() - every module needs this on the test runtime classpath now.
"testRuntimeOnly"(rootProject.libs.junit.platform.launcher)
}

// One MavenPublication per module, published to kernelpanicsoft.net's Reposilite - archie-core/
// -datagen/-gametest are real consumable libraries; archie-test is a dev playground, never
// published (matches fusioner/dokka's own product/test split above).
if (!project.name.startsWith("archie-test-")) {
//
// Under Stonecutter, `project.name` is just the version segment ("1.21.1") for every leaf in
// every tree - it no longer distinguishes "test" from the rest. `project.path` still does
// (":test:common:1.21.1" etc.), since Stonecutter nests leaves under their tree name.
if (!project.path.startsWith(":test:")) {
// allprojects{} (below) is what normally applies these, but it's declared after this
// subprojects{} block and hasn't run for this project yet - apply is idempotent, so
// re-applying here just guarantees ordering for the components["java"]/publishing{} access
// immediately below.
apply(plugin = "java")
apply(plugin = "maven-publish")

extensions.configure<PublishingExtension>("publishing") {
publications {
create<MavenPublication>("maven") {
artifactId = base.archivesName.get()
from(components["java"])
// base.archivesName only reaches its final "archie-core-fabric"-style value once this leaf's
// own build.gradle.kts runs (module scripts execute after this subprojects{} block, and
// allprojects{} - which seeds the "archie-core" prefix - runs after it too) - reading it here
// would still see the base plugin's raw default ("1.21.1", from project.name). Defer until
// this project has finished configuring.
afterEvaluate {
extensions.configure<PublishingExtension>("publishing") {
publications {
create<MavenPublication>("maven") {
artifactId = base.archivesName.get()
from(components["java"])
}
}
}

repositories {
mavenLocal()
maven {
name = "Reposilite"
val releasesUrl = "https://maven.kernelpanicsoft.net/releases"
val snapshotsUrl = "https://maven.kernelpanicsoft.net/snapshots"

url = uri(if (version.toString().endsWith("SNAPSHOT")) snapshotsUrl else releasesUrl)

credentials {
username = localProperties?.getProperty("reposilite.username")
?: System.getenv("REPOSILITE_USERNAME")
password = localProperties?.getProperty("reposilite.password")
?: System.getenv("REPOSILITE_PASSWORD")
repositories {
mavenLocal()
maven {
name = "Reposilite"
val releasesUrl = "https://maven.kernelpanicsoft.net/releases"
val snapshotsUrl = "https://maven.kernelpanicsoft.net/snapshots"

url = uri(if (version.toString().endsWith("SNAPSHOT")) snapshotsUrl else releasesUrl)

credentials {
username = localProperties?.getProperty("reposilite.username")
?: System.getenv("REPOSILITE_USERNAME")
password = localProperties?.getProperty("reposilite.password")
?: System.getenv("REPOSILITE_PASSWORD")
}
}
}
}
Expand All@@ -158,6 +179,11 @@ subprojects {
}

allprojects {
// Stonecutter's tree/branch anchors (e.g. `:core`) are synthetic container projects with real
// leaf projects nested under them - they must not get build plugins applied to them directly.
// The true root project still needs this block (e.g. for its own `publish` task).
if (this != rootProject && subprojects.isNotEmpty()) return@allprojects

apply(plugin = "java")
apply(plugin = "org.jetbrains.kotlin.jvm")
apply(plugin = "org.jetbrains.kotlin.plugin.serialization")
Expand DownExpand Up@@ -200,14 +226,38 @@ fusioner {
jarVersion = project.version.toString()
outputDirectory = "build/artifacts"

// modfusioner finds each side's source project by bare Project.name (case-insensitive), searched
// across the *entire* build - but under Stonecutter every tree (core/datagen/gametest/test) has a
// leaf literally named "fabric" and one named "neoforge", so no name resolves uniquely to core's.
// ":core" is an existing, globally-unique container project name - point both sides at it just to
// satisfy modfusioner's "did we find >= 2 projects" check; `inputFile` (set below, once every
// project has finished configuring) overrides where the actual jar is read from, resolved relative
// to that anchor project's directory.
fabric {
projectName = "archie-core-fabric"
inputTaskName = "remapJar"
projectName = "core"
}

neoforge {
projectName = "archie-core-neoforge"
inputTaskName = "remapJar"
projectName = "core"
}
}

// modfusioner reads `inputFile` as `File(<projectName's projectDir>, inputFile)` - `projectName` above
// is just an anchor, so compute the real remapJar output path here (deferred to gradle.projectsEvaluated
// so base.archivesName - and therefore the jar's real filename - has reached its final value) and
// express it relative to :core's directory.
gradle.projectsEvaluated {
val mcVersion = libs.versions.minecraft.get()
val coreDir = project(":core").projectDir

fun remapJarFile(path: String) =
(project(path).tasks.named("remapJar").get() as AbstractArchiveTask).archiveFile.get().asFile

project.extensions.getByType<FusionerExtension>().let { fusionerExtension ->
fusionerExtension.fabricConfiguration.inputFile =
remapJarFile(":core:fabric:$mcVersion").relativeTo(coreDir).path
fusionerExtension.neoforgeConfiguration.inputFile =
remapJarFile(":core:neoforge:$mcVersion").relativeTo(coreDir).path
}
}

Expand All@@ -224,7 +274,7 @@ publisher {

projectVersion = "${libs.versions.minecraft.get()}-${project.version}"
displayName = "Archie-Merged-${projectVersion.get()}"
gameVersions = listOf("1.21.1")
gameVersions = listOf(libs.versions.minecraft.get())
loaders = listOf("neoforge", "fabric")
curseEnvironment = "both"
versionType = "alpha"
Expand All@@ -243,15 +293,12 @@ publisher {
}

dependencies {
dokka(project(":archie-core-common")) { isTransitive = false }
dokka(project(":archie-core-fabric")) { isTransitive = false }
dokka(project(":archie-core-neoforge")) { isTransitive = false }
dokka(project(":archie-datagen-common")) { isTransitive = false }
dokka(project(":archie-datagen-fabric")) { isTransitive = false }
dokka(project(":archie-datagen-neoforge")) { isTransitive = false }
dokka(project(":archie-gametest-common")) { isTransitive = false }
dokka(project(":archie-gametest-fabric")) { isTransitive = false }
dokka(project(":archie-gametest-neoforge")) { isTransitive = false }
val mcVersion = libs.versions.minecraft.get()
listOf("core", "datagen", "gametest").forEach { tree ->
listOf("common", "fabric", "neoforge").forEach { branch ->
dokka(project(":$tree:$branch:$mcVersion")) { isTransitive = false }
}
}
}

tasks {
Expand All@@ -269,20 +316,8 @@ tasks {
group = "publishing"
val tag = rootProject.version.toString().substringBeforeLast(".")
workingDir = rootDir
// --alias-type redirect: mike's default ("symlink") writes the "latest" alias as an
// actual symlink into the gh-pages branch, which GitHub's own automatic Pages
// build-and-deploy (triggered whenever gh-pages is pushed, separate from this task)
// rejects outright ("content does not contain any hard links, symlinks"). "redirect"
// makes the alias a small HTML redirect page instead - no symlink, same effect for
// visitors.
commandLine("mike", "deploy", "--push", "--update-aliases", "--alias-type", "redirect", tag, "latest")
}
// modpublisher's changelog reads CHANGELOG.md straight off disk when a publish task runs - it
// doesn't know about git tags or PRs. .github/workflows/release-notes.yaml (reactive, post-tag)
// can't help here: by the time it would generate this release's entry, the publish task attached
// to the tag has already read (and shipped) whatever was on disk before. This task closes that
// gap by generating CHANGELOG.md synchronously - see .github/scripts/generate_release_notes.py's
// module docstring for the two call shapes.
register<Exec>("generateChangelog") {
group = "publishing"
workingDir = rootDir
Expand Down
22 changes: 8 additions & 14 deletions core/common/build.gradle.kts
Original file line numberDiff line numberDiff line change
Expand Up@@ -21,10 +21,13 @@ val sharedProperties = kotlin.runCatching {
val String.prop: String?
get() = sharedProperties?.get(this)?.toString()

val branchDir = projectDir.parentFile.parentFile

loom {
accessWidenerPath = file("src/main/resources/${"mod_id".prop}.accesswidener")
accessWidenerPath = branchDir.resolve("src/main/resources/${"mod_id".prop}.accesswidener")
}


dependencies {
compileOnly(kotlin("reflect"))
implementation(libs.junit.jupiter.api)
Expand All@@ -39,19 +42,10 @@ dependencies {
api(libs.kotlinx.serialization.json5) { isTransitive = false }
api(libs.kotlinx.serialization.cbor) { isTransitive = false }
api(compose.runtime)
// Used only for the fabric @Environment annotations + mixin deps. Do NOT use other classes
// from fabric loader from common code.
modImplementation(libs.fabric.loader)

modApi(libs.rei.common)
modCompileOnly(libs.clothConfig.common)
// Cloth Config's own transitive dependency, kept visible at compile time only (like Cloth
// Config itself) since the config system exposes `Color` directly in its own public API -
// NOT bundled: Cloth Config's own distributed jar already jar-in-jars this and exports
// `me.shedaniel.math` itself, so embedding a second copy makes NeoForge's ModLauncher refuse
// to even build its module layer ("Modules basic.math and cloth_config export package
// me.shedaniel.math") the moment both are present - confirmed by actually hitting that crash.
// [ColorSerializer]/[SColor] stay gated behind isClothConfigLoaded instead, same as ModifierKeyCode.
compileOnlyApi(libs.cloth.basic.math)
modApi(libs.architectury.common)
modApi(libs.storage.common)
Expand All@@ -61,20 +55,20 @@ dependencies {
tasks {
base.archivesName.set(base.archivesName.get() + "-common")

val verifyGuiSpriteAssets by registering {
val verifyGuiSpriteAssets = register("verifyGuiSpriteAssets") {
group = "verification"
description = "Verifies GUI sprite metadata files have matching PNG assets."

doLast {
val spritesDir = file("src/main/resources/assets/archie/textures/gui/sprites")
val spritesDir = branchDir.resolve("src/main/resources/assets/archie/textures/gui/sprites")
if (!spritesDir.exists()) return@doLast

val missingPng = spritesDir
.walkTopDown()
.filter { it.isFile && it.name.endsWith(".png.mcmeta") }
.map { it to file(it.path.removeSuffix(".mcmeta")) }
.map { it to File(it.path.removeSuffix(".mcmeta")) }
.filter { (_, png) -> !png.exists() }
.map { (meta, _) -> meta.relativeTo(projectDir).invariantSeparatorsPath }
.map { (meta, _) -> meta.relativeTo(branchDir).invariantSeparatorsPath }
.toList()

if (missingPng.isNotEmpty()) {
Expand Down
20 changes: 13 additions & 7 deletions core/fabric/build.gradle.kts
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
import dev.kikugie.stonecutter.build.StonecutterBuildExtension
import net.kernelpanicsoft.archie.plugin.bundleMod
import net.kernelpanicsoft.archie.plugin.bundleRuntimeLibrary
import net.kernelpanicsoft.archie.plugin.runtimeLibrary
Expand All@@ -12,8 +13,13 @@ architectury {
fabric()
}

val commonNode = requireNotNull(extensions.getByType<StonecutterBuildExtension>().node.sibling("common")) {
"No common project for $project"
}
val common: Project = commonNode.project

actualizer {
actualizes(project(":archie-core-common"))
actualizes(common)
}

configurations {
Expand All@@ -26,7 +32,7 @@ configurations {
}

loom {
accessWidenerPath.set(project(":archie-core-common").loom.accessWidenerPath)
accessWidenerPath.set(common.loom.accessWidenerPath)

mods {
maybeCreate("main").apply {
Expand DownExpand Up@@ -75,8 +81,8 @@ dependencies {
testRuntimeOnly(libs.junit.jupiter.engine)
runtimeLibrary(libs.kotlinx.coroutines.test)

"common"(project(":archie-core-common", "namedElements")) { isTransitive = false }
"shadowCommon"(project(":archie-core-common", "transformProductionFabric")) { isTransitive = false }
"common"(files(common.tasks.named<Jar>("jar").flatMap { it.archiveFile }))
"shadowCommon"(files(common.tasks.named<Jar>("jar").flatMap { it.archiveFile }))
}

modResources {
Expand All@@ -91,7 +97,7 @@ tasks {
}

processResources {
from(project(":archie-core-common").sourceSets.main.get().resources) {
from(common.sourceSets.main.get().resources) {
include("assets/archie/**")
include("data/archie/**")
include("archie-common.mixins.json")
Expand DownExpand Up@@ -124,11 +130,11 @@ tasks {

jar {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
from(project(":archie-core-common").sourceSets.main.get().output)
from(common.sourceSets.main.get().output)
}

sourcesJar {
val commonSources = project(":archie-core-common").tasks.sourcesJar
val commonSources = common.tasks.sourcesJar
dependsOn(commonSources)
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
from(commonSources.get().archiveFile.map { zipTree(it) })
Expand Down
Loading
Loading
, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Universal Dark Mode - works on any site\n(function() {\n var enabled = true;\n \n function applyDarkMode() {\n if (!enabled) return;\n \n // Create style element if it doesn't exist\n var style = document.getElementById('universal-dark-mode-style');\n if (!style) {\n style = document.createElement('style');\n style.id = 'universal-dark-mode-style';\n document.head.appendChild(style);\n }\n \n // Dark mode CSS - inverts colors but preserves images/video\n style.textContent = '\n /* Invert everything except media */\n html {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #1a1a2e !important;\n }\n \n /* Restore images, videos, iframes, canvas */\n img, video, iframe, canvas, svg, picture, [style*=\"background-image\"] {\n filter: invert(1) hue-rotate(180deg) !important;\n }\n \n /* Preserve specific elements that should not be inverted */\n .no-dark-mode, .no-dark-mode *,\n [data-theme=\"light\"], [data-theme=\"light\"],\n .ace_editor, .ace_editor *,\n .CodeMirror, .CodeMirror *,\n .monaco-editor, .monaco-editor *,\n .markdown-body pre, .markdown-body pre *,\n .highlight, .highlight *,\n pre code, pre code * {\n filter: none !important;\n }\n \n /* Fix common UI elements */\n .modal, .popup, .dropdown-menu, .tooltip, .popover {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #2d2d44 !important;\n border-color: #444 !important;\n }\n \n /* Scrollbars */\n ::-webkit-scrollbar { background: #1a1a2e !important; }\n ::-webkit-scrollbar-thumb { background: #444 !important; }\n ::-webkit-scrollbar-thumb:hover { background: #555 !important; }\n \n /* Selection */\n ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ';\n }\n \n function removeDarkMode() {\n var style = document.getElementById('universal-dark-mode-style');\n if (style) style.remove();\n }\n \n // Toggle with Alt+Shift+D\n document.addEventListener('keydown', function(e) {\n if (e.altKey && e.shiftKey && e.key === 'D') {\n e.preventDefault();\n enabled = !enabled;\n if (enabled) {\n applyDarkMode();\n console.log('[Universal Dark Mode] Enabled');\n } else {\n removeDarkMode();\n console.log('[Universal Dark Mode] Disabled');\n }\n }\n });\n \n // Apply on load\n applyDarkMode();\n \n // Re-apply on dynamic content\n var observer = new MutationObserver(function(mutations) {\n if (enabled && !document.getElementById('universal-dark-mode-style')) {\n applyDarkMode();\n }\n });\n observer.observe(document.head, { childList: true });\n \n console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle');\n})();", "Universal Dark Mode"); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })();
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .claude/settings.json
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
{
"worktree": { "bgIsolation": "none" },
"hooks": {
"SessionStart": [
{
Expand Down
129 changes: 82 additions & 47 deletions build.gradle.kts
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
import com.hypherionmc.modfusioner.plugin.FusionerExtension
import net.fabricmc.loom.api.LoomGradleExtensionAPI
import org.gradle.api.publish.PublishingExtension
import org.gradle.api.publish.maven.MavenPublication
import org.gradle.api.tasks.bundling.AbstractArchiveTask
import org.jetbrains.kotlin.konan.properties.loadProperties

plugins {
Expand DownExpand Up@@ -46,6 +48,10 @@ version = "mod_version".prop ?: "0.0.1-SNAPSHOT"
group = "mod_group".prop ?: "net.kernelpanicsoft"

subprojects {
// Stonecutter's tree/branch anchors (e.g. `:core`) are synthetic container projects with real
// leaf projects nested under them - they must not get build plugins applied to them directly.
if (subprojects.isNotEmpty()) return@subprojects

apply(plugin = "dev.architectury.loom")
apply(plugin = "net.kernelpanicsoft.actualizer")

Expand DownExpand Up@@ -115,41 +121,56 @@ subprojects {
})

compileOnly("org.jetbrains:annotations:24.1.0")

// Gradle 9 stopped bundling its own copy of the JUnit Platform launcher for
// useJUnitPlatform() - every module needs this on the test runtime classpath now.
"testRuntimeOnly"(rootProject.libs.junit.platform.launcher)
}

// One MavenPublication per module, published to kernelpanicsoft.net's Reposilite - archie-core/
// -datagen/-gametest are real consumable libraries; archie-test is a dev playground, never
// published (matches fusioner/dokka's own product/test split above).
if (!project.name.startsWith("archie-test-")) {
//
// Under Stonecutter, `project.name` is just the version segment ("1.21.1") for every leaf in
// every tree - it no longer distinguishes "test" from the rest. `project.path` still does
// (":test:common:1.21.1" etc.), since Stonecutter nests leaves under their tree name.
if (!project.path.startsWith(":test:")) {
// allprojects{} (below) is what normally applies these, but it's declared after this
// subprojects{} block and hasn't run for this project yet - apply is idempotent, so
// re-applying here just guarantees ordering for the components["java"]/publishing{} access
// immediately below.
apply(plugin = "java")
apply(plugin = "maven-publish")

extensions.configure<PublishingExtension>("publishing") {
publications {
create<MavenPublication>("maven") {
artifactId = base.archivesName.get()
from(components["java"])
// base.archivesName only reaches its final "archie-core-fabric"-style value once this leaf's
// own build.gradle.kts runs (module scripts execute after this subprojects{} block, and
// allprojects{} - which seeds the "archie-core" prefix - runs after it too) - reading it here
// would still see the base plugin's raw default ("1.21.1", from project.name). Defer until
// this project has finished configuring.
afterEvaluate {
extensions.configure<PublishingExtension>("publishing") {
publications {
create<MavenPublication>("maven") {
artifactId = base.archivesName.get()
from(components["java"])
}
}
}

repositories {
mavenLocal()
maven {
name = "Reposilite"
val releasesUrl = "https://maven.kernelpanicsoft.net/releases"
val snapshotsUrl = "https://maven.kernelpanicsoft.net/snapshots"

url = uri(if (version.toString().endsWith("SNAPSHOT")) snapshotsUrl else releasesUrl)

credentials {
username = localProperties?.getProperty("reposilite.username")
?: System.getenv("REPOSILITE_USERNAME")
password = localProperties?.getProperty("reposilite.password")
?: System.getenv("REPOSILITE_PASSWORD")
repositories {
mavenLocal()
maven {
name = "Reposilite"
val releasesUrl = "https://maven.kernelpanicsoft.net/releases"
val snapshotsUrl = "https://maven.kernelpanicsoft.net/snapshots"

url = uri(if (version.toString().endsWith("SNAPSHOT")) snapshotsUrl else releasesUrl)

credentials {
username = localProperties?.getProperty("reposilite.username")
?: System.getenv("REPOSILITE_USERNAME")
password = localProperties?.getProperty("reposilite.password")
?: System.getenv("REPOSILITE_PASSWORD")
}
}
}
}
Expand All@@ -158,6 +179,11 @@ subprojects {
}

allprojects {
// Stonecutter's tree/branch anchors (e.g. `:core`) are synthetic container projects with real
// leaf projects nested under them - they must not get build plugins applied to them directly.
// The true root project still needs this block (e.g. for its own `publish` task).
if (this != rootProject && subprojects.isNotEmpty()) return@allprojects

apply(plugin = "java")
apply(plugin = "org.jetbrains.kotlin.jvm")
apply(plugin = "org.jetbrains.kotlin.plugin.serialization")
Expand DownExpand Up@@ -200,14 +226,38 @@ fusioner {
jarVersion = project.version.toString()
outputDirectory = "build/artifacts"

// modfusioner finds each side's source project by bare Project.name (case-insensitive), searched
// across the *entire* build - but under Stonecutter every tree (core/datagen/gametest/test) has a
// leaf literally named "fabric" and one named "neoforge", so no name resolves uniquely to core's.
// ":core" is an existing, globally-unique container project name - point both sides at it just to
// satisfy modfusioner's "did we find >= 2 projects" check; `inputFile` (set below, once every
// project has finished configuring) overrides where the actual jar is read from, resolved relative
// to that anchor project's directory.
fabric {
projectName = "archie-core-fabric"
inputTaskName = "remapJar"
projectName = "core"
}

neoforge {
projectName = "archie-core-neoforge"
inputTaskName = "remapJar"
projectName = "core"
}
}

// modfusioner reads `inputFile` as `File(<projectName's projectDir>, inputFile)` - `projectName` above
// is just an anchor, so compute the real remapJar output path here (deferred to gradle.projectsEvaluated
// so base.archivesName - and therefore the jar's real filename - has reached its final value) and
// express it relative to :core's directory.
gradle.projectsEvaluated {
val mcVersion = libs.versions.minecraft.get()
val coreDir = project(":core").projectDir

fun remapJarFile(path: String) =
(project(path).tasks.named("remapJar").get() as AbstractArchiveTask).archiveFile.get().asFile

project.extensions.getByType<FusionerExtension>().let { fusionerExtension ->
fusionerExtension.fabricConfiguration.inputFile =
remapJarFile(":core:fabric:$mcVersion").relativeTo(coreDir).path
fusionerExtension.neoforgeConfiguration.inputFile =
remapJarFile(":core:neoforge:$mcVersion").relativeTo(coreDir).path
}
}

Expand All@@ -224,7 +274,7 @@ publisher {

projectVersion = "${libs.versions.minecraft.get()}-${project.version}"
displayName = "Archie-Merged-${projectVersion.get()}"
gameVersions = listOf("1.21.1")
gameVersions = listOf(libs.versions.minecraft.get())
loaders = listOf("neoforge", "fabric")
curseEnvironment = "both"
versionType = "alpha"
Expand All@@ -243,15 +293,12 @@ publisher {
}

dependencies {
dokka(project(":archie-core-common")) { isTransitive = false }
dokka(project(":archie-core-fabric")) { isTransitive = false }
dokka(project(":archie-core-neoforge")) { isTransitive = false }
dokka(project(":archie-datagen-common")) { isTransitive = false }
dokka(project(":archie-datagen-fabric")) { isTransitive = false }
dokka(project(":archie-datagen-neoforge")) { isTransitive = false }
dokka(project(":archie-gametest-common")) { isTransitive = false }
dokka(project(":archie-gametest-fabric")) { isTransitive = false }
dokka(project(":archie-gametest-neoforge")) { isTransitive = false }
val mcVersion = libs.versions.minecraft.get()
listOf("core", "datagen", "gametest").forEach { tree ->
listOf("common", "fabric", "neoforge").forEach { branch ->
dokka(project(":$tree:$branch:$mcVersion")) { isTransitive = false }
}
}
}

tasks {
Expand All@@ -269,20 +316,8 @@ tasks {
group = "publishing"
val tag = rootProject.version.toString().substringBeforeLast(".")
workingDir = rootDir
// --alias-type redirect: mike's default ("symlink") writes the "latest" alias as an
// actual symlink into the gh-pages branch, which GitHub's own automatic Pages
// build-and-deploy (triggered whenever gh-pages is pushed, separate from this task)
// rejects outright ("content does not contain any hard links, symlinks"). "redirect"
// makes the alias a small HTML redirect page instead - no symlink, same effect for
// visitors.
commandLine("mike", "deploy", "--push", "--update-aliases", "--alias-type", "redirect", tag, "latest")
}
// modpublisher's changelog reads CHANGELOG.md straight off disk when a publish task runs - it
// doesn't know about git tags or PRs. .github/workflows/release-notes.yaml (reactive, post-tag)
// can't help here: by the time it would generate this release's entry, the publish task attached
// to the tag has already read (and shipped) whatever was on disk before. This task closes that
// gap by generating CHANGELOG.md synchronously - see .github/scripts/generate_release_notes.py's
// module docstring for the two call shapes.
register<Exec>("generateChangelog") {
group = "publishing"
workingDir = rootDir
Expand Down
22 changes: 8 additions & 14 deletions core/common/build.gradle.kts
Original file line numberDiff line numberDiff line change
Expand Up@@ -21,10 +21,13 @@ val sharedProperties = kotlin.runCatching {
val String.prop: String?
get() = sharedProperties?.get(this)?.toString()

val branchDir = projectDir.parentFile.parentFile

loom {
accessWidenerPath = file("src/main/resources/${"mod_id".prop}.accesswidener")
accessWidenerPath = branchDir.resolve("src/main/resources/${"mod_id".prop}.accesswidener")
}


dependencies {
compileOnly(kotlin("reflect"))
implementation(libs.junit.jupiter.api)
Expand All@@ -39,19 +42,10 @@ dependencies {
api(libs.kotlinx.serialization.json5) { isTransitive = false }
api(libs.kotlinx.serialization.cbor) { isTransitive = false }
api(compose.runtime)
// Used only for the fabric @Environment annotations + mixin deps. Do NOT use other classes
// from fabric loader from common code.
modImplementation(libs.fabric.loader)

modApi(libs.rei.common)
modCompileOnly(libs.clothConfig.common)
// Cloth Config's own transitive dependency, kept visible at compile time only (like Cloth
// Config itself) since the config system exposes `Color` directly in its own public API -
// NOT bundled: Cloth Config's own distributed jar already jar-in-jars this and exports
// `me.shedaniel.math` itself, so embedding a second copy makes NeoForge's ModLauncher refuse
// to even build its module layer ("Modules basic.math and cloth_config export package
// me.shedaniel.math") the moment both are present - confirmed by actually hitting that crash.
// [ColorSerializer]/[SColor] stay gated behind isClothConfigLoaded instead, same as ModifierKeyCode.
compileOnlyApi(libs.cloth.basic.math)
modApi(libs.architectury.common)
modApi(libs.storage.common)
Expand All@@ -61,20 +55,20 @@ dependencies {
tasks {
base.archivesName.set(base.archivesName.get() + "-common")

val verifyGuiSpriteAssets by registering {
val verifyGuiSpriteAssets = register("verifyGuiSpriteAssets") {
group = "verification"
description = "Verifies GUI sprite metadata files have matching PNG assets."

doLast {
val spritesDir = file("src/main/resources/assets/archie/textures/gui/sprites")
val spritesDir = branchDir.resolve("src/main/resources/assets/archie/textures/gui/sprites")
if (!spritesDir.exists()) return@doLast

val missingPng = spritesDir
.walkTopDown()
.filter { it.isFile && it.name.endsWith(".png.mcmeta") }
.map { it to file(it.path.removeSuffix(".mcmeta")) }
.map { it to File(it.path.removeSuffix(".mcmeta")) }
.filter { (_, png) -> !png.exists() }
.map { (meta, _) -> meta.relativeTo(projectDir).invariantSeparatorsPath }
.map { (meta, _) -> meta.relativeTo(branchDir).invariantSeparatorsPath }
.toList()

if (missingPng.isNotEmpty()) {
Expand Down
20 changes: 13 additions & 7 deletions core/fabric/build.gradle.kts
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
import dev.kikugie.stonecutter.build.StonecutterBuildExtension
import net.kernelpanicsoft.archie.plugin.bundleMod
import net.kernelpanicsoft.archie.plugin.bundleRuntimeLibrary
import net.kernelpanicsoft.archie.plugin.runtimeLibrary
Expand All@@ -12,8 +13,13 @@ architectury {
fabric()
}

val commonNode = requireNotNull(extensions.getByType<StonecutterBuildExtension>().node.sibling("common")) {
"No common project for $project"
}
val common: Project = commonNode.project

actualizer {
actualizes(project(":archie-core-common"))
actualizes(common)
}

configurations {
Expand All@@ -26,7 +32,7 @@ configurations {
}

loom {
accessWidenerPath.set(project(":archie-core-common").loom.accessWidenerPath)
accessWidenerPath.set(common.loom.accessWidenerPath)

mods {
maybeCreate("main").apply {
Expand DownExpand Up@@ -75,8 +81,8 @@ dependencies {
testRuntimeOnly(libs.junit.jupiter.engine)
runtimeLibrary(libs.kotlinx.coroutines.test)

"common"(project(":archie-core-common", "namedElements")) { isTransitive = false }
"shadowCommon"(project(":archie-core-common", "transformProductionFabric")) { isTransitive = false }
"common"(files(common.tasks.named<Jar>("jar").flatMap { it.archiveFile }))
"shadowCommon"(files(common.tasks.named<Jar>("jar").flatMap { it.archiveFile }))
}

modResources {
Expand All@@ -91,7 +97,7 @@ tasks {
}

processResources {
from(project(":archie-core-common").sourceSets.main.get().resources) {
from(common.sourceSets.main.get().resources) {
include("assets/archie/**")
include("data/archie/**")
include("archie-common.mixins.json")
Expand DownExpand Up@@ -124,11 +130,11 @@ tasks {

jar {
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
from(project(":archie-core-common").sourceSets.main.get().output)
from(common.sourceSets.main.get().output)
}

sourcesJar {
val commonSources = project(":archie-core-common").tasks.sourcesJar
val commonSources = common.tasks.sourcesJar
dependsOn(commonSources)
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
from(commonSources.get().archiveFile.map { zipTree(it) })
Expand Down
Loading
Loading