import io.gitlab.jfronny.convention.ext.* import io.gitlab.jfronny.lom.ext.* plugins { id("jf.autoversion") id("jf.maven-publish") id("lom") } //TODO test libjf-config-compiler-plugin integration if (project.hasProperty("libjf_version")) { buildscript { repositories { maven { name = "JF Commons" url = uri("https://gitlab.com/api/v4/projects/35745143/packages/maven") } maven { name = "LibJF" url = uri("https://gitlab.com/api/v4/projects/25805200/packages/maven") } } dependencies { classpath("io.gitlab.jfronny.libjf:libjf-config-compiler-plugin:${prop("libjf_version")}") } } } val devOnlyModules by extra(prop("dev_only_module", "").split(", ", ",").filter { it.isNotBlank() }) val nonModSubprojects by extra(prop("non_mod_project", "").split(", ", ",").filter { it.isNotBlank() }) val self = project allprojects { if (name in nonModSubprojects) return@allprojects group = self.group version = self.version apply(plugin = "jf.maven-publish") apply(plugin = "lom") if (self.hasProperty("libjf_version")) apply(plugin = "io.gitlab.jfronny.libjf.libjf-config-compiler-plugin") base { archivesName.set(prop("archives_base_name", archivesName.get())) } lom { minecraftVersion.set(prop("minecraft_version")) loaderVersion.set(prop("loader_version")) if (hasProperty("yarn_mappings")) yarn(prop("yarn_mappings")) else mojmap() } afterEvaluate { self.allprojects.forEach { sub -> if (sub != this && sub.name !in nonModSubprojects) { loom { mods { register(sub.name) { sourceSet(sub.sourceSets.main) sourceSet(sub.sourceSets.client) } register("${sub.name}-testmod") { sourceSet(sub.sourceSets.testmod) } } } } } } } subprojects { if (name in nonModSubprojects) return@subprojects self.tasks.deployDebug.dependsOn(tasks.deployDebug) self.tasks.deployRelease.dependsOn(tasks.deployRelease) tasks.named("javadoc").get().enabled = false afterEvaluate { dependencies { testmodImplementation(sourceSets.main.output) } tasks.genClientOnlySources.enabled = false tasks.genCommonSources.enabled = false tasks.unpickClientOnlyJar.enabled = false tasks.unpickCommonJar.enabled = false rootProject.dependencies { api(project(mapOf("path" to project.path, "configuration" to "shadow"))) clientImplementation(sourceSets.client.output) testmodImplementation(sourceSets.testmod.output) if (name !in devOnlyModules) include(project) } } } if (hasProperty("curseforge_id")) apply(plugin = "jfmod.curseforge") if (hasProperty("modrinth_id")) apply(plugin = "jfmod.modrinth")