diff options
Diffstat (limited to 'build.gradle.kts')
-rw-r--r-- | build.gradle.kts | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/build.gradle.kts b/build.gradle.kts index 90eb334..1df163e 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -6,10 +6,11 @@ * SPDX-License-Identifier: GPL-3.0-or-later */ +import com.google.devtools.ksp.gradle.KspTaskJvm 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.plugin.SubpluginOption import org.jetbrains.kotlin.gradle.tasks.KotlinCompile plugins { @@ -102,6 +103,7 @@ fun createIsolatedSourceSet(name: String, path: String = "compat/$name"): Source compatSourceSets.add(ss) loom.createRemapConfigurations(ss) val mainSS = sourceSets.main.get() + val upperName = ss.name.replaceFirstChar { it.uppercaseChar() } configurations { (ss.implementationConfigurationName) { extendsFrom(getByName(mainSS.compileClasspathConfigurationName)) @@ -112,10 +114,15 @@ fun createIsolatedSourceSet(name: String, path: String = "compat/$name"): Source (mainSS.runtimeOnlyConfigurationName) { extendsFrom(getByName(ss.runtimeClasspathConfigurationName)) } - ("ksp" + ss.name.replaceFirstChar { it.uppercaseChar() }) { + ("ksp$upperName") { extendsFrom(ksp.get()) } } + afterEvaluate { + tasks.named("ksp${upperName}Kotlin", KspTaskJvm::class) { + this.options.add(SubpluginOption("apoption", "firmament.sourceset=${ss.name}")) + } + } dependencies { runtimeOnly(ss.output) (ss.implementationConfigurationName)(sourceSets.main.get().output) |