From 816f80f862d2f5de6bc9b0ae84cd6df0da341228 Mon Sep 17 00:00:00 2001 From: Linnea Gräf Date: Sat, 31 Aug 2024 11:59:47 +0200 Subject: Add configured compat [no changelog] --- build.gradle.kts | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'build.gradle.kts') diff --git a/build.gradle.kts b/build.gradle.kts index fe527ba..90eb334 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -8,6 +8,7 @@ import moe.nea.licenseextractificator.LicenseDiscoveryTask import net.fabricmc.loom.LoomGradleExtension +import org.gradle.internal.extensions.stdlib.capitalized import org.jetbrains.kotlin.gradle.dsl.JvmTarget import org.jetbrains.kotlin.gradle.tasks.KotlinCompile @@ -96,7 +97,7 @@ val compatSourceSets: MutableSet = mutableSetOf() fun createIsolatedSourceSet(name: String, path: String = "compat/$name"): SourceSet { val ss = sourceSets.create(name) { this.java.setSrcDirs(listOf(layout.projectDirectory.dir("src/$path/java"))) - this.kotlin.setSrcDirs(listOf(layout.projectDirectory.dir("src/$path/kotlin"))) + this.kotlin.setSrcDirs(listOf(layout.projectDirectory.dir("src/$path/java"))) } compatSourceSets.add(ss) loom.createRemapConfigurations(ss) @@ -111,12 +112,15 @@ fun createIsolatedSourceSet(name: String, path: String = "compat/$name"): Source (mainSS.runtimeOnlyConfigurationName) { extendsFrom(getByName(ss.runtimeClasspathConfigurationName)) } + ("ksp" + ss.name.replaceFirstChar { it.uppercaseChar() }) { + extendsFrom(ksp.get()) + } } dependencies { runtimeOnly(ss.output) (ss.implementationConfigurationName)(sourceSets.main.get().output) } - tasks.jar { + tasks.shadowJar { from(ss.output) } return ss @@ -171,6 +175,8 @@ dependencies { include(libs.hypixelmodapi.fabric) compileOnly(project(":javaplugin")) annotationProcessor(project(":javaplugin")) + implementation("com.google.auto.service:auto-service-annotations:1.1.1") + ksp("dev.zacsweers.autoservice:auto-service-ksp:1.2.0") include(libs.manninghamMills) include(libs.moulconfig) @@ -285,6 +291,7 @@ tasks.shadowJar { archiveClassifier.set("dev") relocate("io.github.moulberry.repo", "moe.nea.firmament.deps.repo") destinationDirectory.set(layout.buildDirectory.dir("badjars")) + mergeServiceFiles() } tasks.remapJar { -- cgit