fix: maybe add testmod dependency properly
This commit is contained in:
parent
26f31906bb
commit
05af344da2
@ -65,22 +65,19 @@ afterEvaluate {
|
||||
rootProject.allprojects.forEach {
|
||||
it.pAfterEvaluate { sub ->
|
||||
if (sub != this && rootArgs.isMod(sub)) {
|
||||
if (rootArgs.isFabric(sub) && lomArgs.isFabric) {
|
||||
loom {
|
||||
mods {
|
||||
register(sub.name) {
|
||||
sourceSet(sub.sourceSets.main.get())
|
||||
if (rootArgs.isSplitSources(sub)) sourceSet(sub.sourceSets.client.get())
|
||||
}
|
||||
if (!sourceSets.testmod.get().resources.isEmpty) {
|
||||
register("${sub.name}-testmod") {
|
||||
sourceSet(sub.sourceSets.testmod.get())
|
||||
}
|
||||
loom {
|
||||
mods {
|
||||
register(sub.name) {
|
||||
sourceSet(sub.sourceSets.main.get())
|
||||
if (rootArgs.isSplitSources(sub)) sourceSet(sub.sourceSets.client.get())
|
||||
}
|
||||
if (!sourceSets.testmod.get().resources.isEmpty) {
|
||||
register("${sub.name}-testmod") {
|
||||
sourceSet(sub.sourceSets.testmod.get())
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//TODO handle forge
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -103,7 +100,7 @@ afterEvaluate {
|
||||
if (!isRoot) rootProject.dependencies {
|
||||
api(project(path = project.path, configuration = "shadow"))
|
||||
if (lomArgs.isSplitSources) clientImplementation(sourceSets.client.get().output)
|
||||
testmodImplementation(sourceSets.testmod.get().output)
|
||||
testmodImplementation(project(mapOf("path" to project.path, "configuration" to "testmod")))
|
||||
|
||||
if (!devOnly) include(project)
|
||||
}
|
||||
|
@ -205,7 +205,11 @@ tasks.publish { dependsOn(tasks.build) }
|
||||
tasks.deployDebug.dependsOn(tasks.publish)
|
||||
|
||||
// create testmodInclude configuration
|
||||
val testmodIncludeConfiguration = configurations.create("testmodInclude")
|
||||
val testmodInclude by configurations.creating
|
||||
val testmod by configurations.creating {
|
||||
isCanBeConsumed = true
|
||||
isCanBeResolved = false
|
||||
}
|
||||
|
||||
if (hasTestmod) {
|
||||
// generate jar from testmod source set
|
||||
@ -214,6 +218,9 @@ if (hasTestmod) {
|
||||
destinationDirectory.set(devlibs)
|
||||
archiveClassifier.set("testmod")
|
||||
}
|
||||
artifacts {
|
||||
add(testmod.name, testmodJar)
|
||||
}
|
||||
|
||||
afterEvaluate {
|
||||
// remap configuration for outputting usable testmod jar
|
||||
@ -223,7 +230,7 @@ if (hasTestmod) {
|
||||
archiveClassifier.set("testmod")
|
||||
// add nested jars from testmodInclude
|
||||
addNestedDependencies.set(true)
|
||||
nestedJars.setFrom(*testmodIncludeConfiguration.files.toTypedArray())
|
||||
nestedJars.setFrom(*testmodInclude.files.toTypedArray())
|
||||
}
|
||||
tasks.assemble { dependsOn(remapTestmodJar) }
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user