-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e082e74
commit 67ebd99
Showing
6 changed files
with
42 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 0 additions & 43 deletions
43
...otlin/io/github/reactivecircus/kstreamlined/buildlogic/convention/KaptConventionPlugin.kt
This file was deleted.
Oops, something went wrong.
36 changes: 36 additions & 0 deletions
36
...kotlin/io/github/reactivecircus/kstreamlined/buildlogic/convention/KspConventionPlugin.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
package io.github.reactivecircus.kstreamlined.buildlogic.convention | ||
|
||
import com.google.devtools.ksp.gradle.KspExtension | ||
import org.gradle.api.Plugin | ||
import org.gradle.api.Project | ||
import org.gradle.kotlin.dsl.configure | ||
|
||
internal class KspConventionPlugin : Plugin<Project> { | ||
override fun apply(target: Project) = with(target) { | ||
with(pluginManager) { | ||
apply("com.google.devtools.ksp") | ||
} | ||
|
||
extensions.configure<KspExtension> { | ||
if (hasHiltCompilerDependency) { | ||
arg("dagger.fastInit", "enabled") | ||
arg("dagger.strictMultibindingValidation", "enabled") | ||
arg("dagger.experimentalDaggerErrorMessages", "enabled") | ||
} | ||
} | ||
|
||
// disable ksp tasks for unit tests | ||
tasks.matching { | ||
it.name.startsWith("ksp") && it.name.endsWith("UnitTestKotlin") | ||
}.configureEach { | ||
enabled = false | ||
} | ||
} | ||
} | ||
|
||
private val Project.hasHiltCompilerDependency: Boolean | ||
get() = configurations.any { | ||
it.dependencies.any { dependency -> | ||
dependency.name == "hilt-compiler" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters