mirror of
https://github.com/Jozufozu/Flywheel.git
synced 2025-01-23 03:17:53 +01:00
0dc8f97b73
- Assume group/version are behind properties in subproject.init - Force each subproject to manually specify their base archive name - Don't generate mod/api artifact ids, just write them out by hand - Remove DependentProject
91 lines
2.2 KiB
Text
91 lines
2.2 KiB
Text
plugins {
|
|
idea
|
|
java
|
|
`maven-publish`
|
|
id("dev.architectury.loom")
|
|
id("flywheel.subproject")
|
|
}
|
|
|
|
subproject.init("flywheel-common", "flywheel_group", "flywheel_version")
|
|
|
|
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 vanillin = sourceSets.create("vanillin")
|
|
|
|
transitiveSourceSets {
|
|
compileClasspath = main.compileClasspath
|
|
|
|
sourceSet(api) {
|
|
rootCompile()
|
|
outgoingClasses()
|
|
}
|
|
sourceSet(lib) {
|
|
rootCompile()
|
|
compile(api)
|
|
outgoing()
|
|
}
|
|
sourceSet(backend) {
|
|
rootCompile()
|
|
compile(api, lib)
|
|
outgoing()
|
|
}
|
|
sourceSet(stubs) {
|
|
rootCompile()
|
|
outgoingClasses()
|
|
}
|
|
sourceSet(main) {
|
|
compile(api, lib, backend, stubs)
|
|
outgoing()
|
|
}
|
|
sourceSet(sourceSets.getByName("test")) {
|
|
implementation(api, lib, backend)
|
|
}
|
|
sourceSet(vanillin) {
|
|
rootCompile()
|
|
compile(api, lib)
|
|
outgoing()
|
|
}
|
|
}
|
|
|
|
defaultPackageInfos {
|
|
sources(api, lib, backend, main, vanillin)
|
|
}
|
|
|
|
jarSets {
|
|
// For publishing.
|
|
create("api", api, lib).apply {
|
|
addToAssemble()
|
|
publish("flywheel-common-intermediary-api-${property("artifact_minecraft_version")}")
|
|
|
|
configureJar {
|
|
manifest {
|
|
attributes("Fabric-Loom-Remap" to "true")
|
|
}
|
|
}
|
|
|
|
// Don't publish the un-remapped jars because they don't have the correct manifest populated by Loom.
|
|
forkRemap("apiMojmap").apply {
|
|
addToAssemble()
|
|
configureRemap {
|
|
// "named" == mojmap
|
|
// We're probably remapping from named to named so Loom should noop this.
|
|
targetNamespace = "named"
|
|
}
|
|
|
|
publish("flywheel-common-mojmap-api-${property("artifact_minecraft_version")}")
|
|
}
|
|
}
|
|
}
|
|
|
|
dependencies {
|
|
modCompileOnly("net.fabricmc:fabric-loader:${property("fabric_loader_version")}")
|
|
|
|
testImplementation("org.junit.jupiter:junit-jupiter:5.8.1")
|
|
}
|
|
|
|
tasks.test {
|
|
useJUnitPlatform()
|
|
}
|