Flywheel/forge/build.gradle.kts
IThundxr 461578ec0e
Automated testing (#269)
* Automated testing

* Testing testing

- Use 2 spaces for indents yaml
- Move setupTestMod to PlatformExtension
- Allow specifying the sourceSet for the testMod artifact
- Rename things to camelCase
- Use rootCompile from transitiveSourceSets for the testMod source sets
- Use a blanket remapTestModJar task in the gh actions build

* Fail slowly

- We want to know the results of both tests regardless

* Add workflow dispatch

* Shoes should be steel toed, dangerous stuff

* Update build.yml

* fix modid

* Update FlywheelTestModClient.java

* add debug logging

* fix syntax issues

* fix issues

* Update build.yml

* Add debug logging

* more logging

* get testmod from correct dir

* switch to env var

* Why wait?

- Immediately audit on client tick

* DidObfuscate

- Fix RenderSystemMixin on fabric
- setShaderFogShape's arguments need to be remapped, but the name of the
  function should not be. Fortunately mixin allows matching by function
  name alone

* Clever commit title

- Change the Fabric mod ID to match Forge
- Move "Flywheel Test Mod" to static
- Cleanup start/stop messages
- Use the client start event on Fabric

---------

Co-authored-by: Jozufozu <jozsefaug@gmail.com>
2024-11-03 17:57:47 -08:00

101 lines
2.4 KiB
Text

plugins {
idea
java
`maven-publish`
id("dev.architectury.loom")
id("flywheel.subproject")
id("flywheel.platform")
}
val api = sourceSets.create("api")
val lib = sourceSets.create("lib")
val backend = sourceSets.create("backend")
val stubs = sourceSets.create("stubs")
val main = sourceSets.getByName("main")
val testMod = sourceSets.create("testMod")
transitiveSourceSets {
compileClasspath = main.compileClasspath
sourceSet(api) {
rootCompile()
}
sourceSet(lib) {
rootCompile()
compile(api)
}
sourceSet(backend) {
rootCompile()
compile(api, lib)
}
sourceSet(stubs) {
rootCompile()
}
sourceSet(main) {
compile(api, lib, backend, stubs)
}
sourceSet(testMod) {
rootCompile()
}
createCompileConfigurations()
}
platform {
commonProject = project(":common")
compileWithCommonSourceSets(api, lib, backend, stubs, main)
setupLoomMod(api, lib, backend, main)
setupLoomRuns()
setupFatJar(api, lib, backend, main)
setupTestMod(testMod)
}
jarSets {
mainSet.publish(platform.modArtifactId)
create("api", api, lib).apply {
addToAssemble()
publish(platform.apiArtifactId)
configureJar {
manifest {
attributes("Fabric-Loom-Remap" to "true")
}
}
}
}
defaultPackageInfos {
sources(api, lib, backend, main)
}
loom {
mixin {
useLegacyMixinAp = true
add(main, "flywheel.refmap.json")
add(backend, "backend-flywheel.refmap.json")
}
forge {
mixinConfig("flywheel.backend.mixins.json")
mixinConfig("flywheel.impl.mixins.json")
}
runs {
configureEach {
property("forge.logging.markers", "")
property("forge.logging.console.level", "debug")
}
}
}
dependencies {
forge("net.minecraftforge:forge:${property("minecraft_version")}-${property("forge_version")}")
modCompileOnly("maven.modrinth:embeddium:${property("embeddium_version")}")
"forApi"(project(path = ":common", configuration = "commonApiOnly"))
"forLib"(project(path = ":common", configuration = "commonLib"))
"forBackend"(project(path = ":common", configuration = "commonBackend"))
"forStubs"(project(path = ":common", configuration = "commonStubs"))
"forMain"(project(path = ":common", configuration = "commonImpl"))
}