From 51d2a4f4f2177fd1534559444cd7473df294a450 Mon Sep 17 00:00:00 2001 From: Masataka Hirano Date: Sat, 9 Dec 2023 22:59:57 +0100 Subject: [PATCH] build: declare dependency from KSP --- build.gradle | 8 ++++---- .../kotlin/com/gaelmarhic/quadrant/QuadrantPlugin.kt | 9 +++++++-- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/build.gradle b/build.gradle index 7028f40..10071b7 100644 --- a/build.gradle +++ b/build.gradle @@ -2,7 +2,7 @@ plugins { id "org.jetbrains.kotlin.jvm" version "1.4.0" id "com.gradle.plugin-publish" version "0.11.0" id 'java-gradle-plugin' - id "maven" + id "maven-publish" } repositories { @@ -35,10 +35,10 @@ compileTestKotlin { group = "com.gaelmarhic" version = "1.7" -uploadArchives { +publishing { repositories { - mavenDeployer { - repository(url: uri('mavenrepo')) + maven { + url = uri('mavenrepo') } } } diff --git a/src/main/kotlin/com/gaelmarhic/quadrant/QuadrantPlugin.kt b/src/main/kotlin/com/gaelmarhic/quadrant/QuadrantPlugin.kt index c0e7539..1738515 100644 --- a/src/main/kotlin/com/gaelmarhic/quadrant/QuadrantPlugin.kt +++ b/src/main/kotlin/com/gaelmarhic/quadrant/QuadrantPlugin.kt @@ -107,8 +107,13 @@ class QuadrantPlugin : Plugin { private fun BaseExtension.sourceSet(name: String) = sourceSets.getByName(name) - private fun Task.isCompileKotlinTask(variant: T) = - name == "compile${variant.name.capitalize()}Kotlin" + private fun Task.isCompileKotlinTask(variant: T): Boolean { + val variantName = variant.name.capitalize() + return name in listOf( + "compile${variantName}Kotlin", + "ksp${variantName}Kotlin", + ) + } companion object {