Richard Leggett
09/21/2023, 2:57 PMSkieExtension
so we don't have to add the same skie{}
block to multiple modules (we have different app flavors / shared .frameworks represented as different gradle modules).
So it's something like this:
./my-exported-module/build.gradle.kts:
plugins {
id("com.domain.export.plugin")
...apply other plugins...
}
...rest of module gradle (but no need for skie {} block which is applied via above) ...
./build-logic/build.gradle.kts:
plugins {
`kotlin-dsl`
}
dependencies {
compileOnly(libs.skie.gradlePlugin)
compileOnly(libs.android.gradlePlugin)
compileOnly(libs.kotlin.multiplatform.gradlePlugin)
...
}
gradlePlugin {
plugins {
create("com.domain.export.plugin", "MyExportPlugin")
}
}
And we'd love to do this...
./build-logic/src/kotlin/MyExportPlugin.kts:
open class MyExportPlugin : Plugin<Project> {
override fun apply(target: Project) {
with(target) {
val libs = the<LibrariesForLibs>()
with(pluginManager) {
apply(libs.plugins.skie.get().pluginId)
}
extensions.getByType<SkieExtension>().apply {
analytics {
disableUpload.set(true)
} etc...
}
}
}
}
The problem is SkieExtension
is not accessible in this context when depending on just the SKIE gradle plugin package.SkieExtension
and it works - so I wondered if this is the right approach, or whether this class could be api-exposed in the main plugin:
skie-gradlePlugin = { module = "co.touchlab.skie:co.touchlab.skie.gradle.plugin", version.ref = "skie" }
# including this also gives us SkieExtension
skie-api-gradlePlugin = { module = "co.touchlab.skie:gradle-plugin-api-gradle_8.1", version.ref = "skie" }
Filip Dolník
09/21/2023, 3:15 PMRichard Leggett
09/21/2023, 3:24 PMFilip Dolník
09/21/2023, 3:24 PMimplementation
instead of api