Support subprojects that are not mods via non_mod_project
This commit is contained in:
parent
1e1554597c
commit
a0c4952fe4
30
jfmod.gradle
30
jfmod.gradle
|
@ -96,6 +96,9 @@ if (!project.hasProperty("curseforge_optional_dependencies"))
|
|||
else
|
||||
project.ext.curseforge_optional_dependencies = project.curseforge_optional_dependencies
|
||||
|
||||
ext.devOnlyModules = project.hasProperty("dev_only_module") ? project.getProperty("dev_only_module").split(", ") : []
|
||||
ext.nonModSubprojects = project.hasProperty("non_mod_project") ? project.getProperty("non_mod_project").split(", ") : []
|
||||
|
||||
task deployDebug() {
|
||||
}
|
||||
|
||||
|
@ -105,6 +108,8 @@ task deployRelease() {
|
|||
tasks.deployRelease.dependsOn(tasks.deployDebug)
|
||||
|
||||
allprojects {
|
||||
if (project.name in rootProject.nonModSubprojects) return
|
||||
|
||||
apply plugin: "java-library"
|
||||
apply plugin: "maven-publish"
|
||||
apply plugin: net.fabricmc.loom.bootstrap.LoomGradlePluginBootstrap
|
||||
|
@ -210,13 +215,15 @@ allprojects {
|
|||
}
|
||||
|
||||
project.rootProject.allprojects.each { sub ->
|
||||
loom.mods.register(sub.name, {
|
||||
sourceSet sub.sourceSets.main
|
||||
sourceSet sub.sourceSets.client
|
||||
})
|
||||
loom.mods.register(sub.name + "-testmod", {
|
||||
sourceSet sub.sourceSets.testmod
|
||||
})
|
||||
if (!sub.name in rootProject.nonModSubprojects) {
|
||||
loom.mods.register(sub.name, {
|
||||
sourceSet sub.sourceSets.main
|
||||
sourceSet sub.sourceSets.client
|
||||
})
|
||||
loom.mods.register(sub.name + "-testmod", {
|
||||
sourceSet sub.sourceSets.testmod
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -294,9 +301,9 @@ allprojects {
|
|||
}
|
||||
}
|
||||
|
||||
ext.devOnlyModules = project.hasProperty("dev_only_module") ? project.getProperty("dev_only_module").split(", ") : []
|
||||
|
||||
subprojects {
|
||||
if (project.name in rootProject.nonModSubprojects) return
|
||||
|
||||
javadoc.enabled = false
|
||||
|
||||
dependencies {
|
||||
|
@ -312,12 +319,11 @@ subprojects {
|
|||
rootProject.dependencies {
|
||||
api project(path: project.path, configuration: "shadow")
|
||||
clientImplementation project.sourceSets.client.output
|
||||
testmodImplementation project.sourceSets.testmod.output
|
||||
|
||||
if (!(project.name in rootProject.devOnlyModules)) {
|
||||
if (!project.name in rootProject.devOnlyModules) {
|
||||
include project
|
||||
}
|
||||
|
||||
testmodImplementation project.sourceSets.testmod.output
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue