Edoardo Luppi
08/14/2023, 1:06 PMAdam S
08/14/2023, 1:14 PMEdoardo Luppi
08/14/2023, 1:19 PMkotlinx-resources
plugin is what I need to allow loading resource files in every platform.
My plan was to require the plugin dependency, e.g.,
dependencies {
...
implementation("com.goncalossilva:resources-plugin:0.4.0")
}
And apply that plugin, e.g.,
override fun apply(project: Project) {
project.pluginManager.apply(ResourcesPlugin::class)
...
Vampire
08/14/2023, 1:20 PMproject.apply
directly like project.apply<ResourcesPlugin>()
🙂Edoardo Luppi
08/14/2023, 1:23 PMEdoardo Luppi
08/14/2023, 1:25 PMVampire
08/14/2023, 1:27 PMPluginAware
like Project
, there is no need to go the detour over pluginManager
. But both should be fine.Vampire
08/14/2023, 1:28 PMEdoardo Luppi
08/14/2023, 1:35 PMEdoardo Luppi
08/14/2023, 1:51 PMcommonTest
source set easier from the plugin, I've decided to apply the KMP plugin by default too.
Was just wondering, what's the difference between
project.apply<KotlinMultiplatformPluginWrapper>()
and
project.apply<KotlinMultiplatformPlugin>()
? Or better, let me reword it: applying plugins like this is cool, but what's the best way to understand which class gets activated via the usual
plugins {
id("...") version "..."
}
?Vampire
08/14/2023, 1:54 PM_project.apply_(plugin = "...")
.
But to answer your question, open the according META-INF/gradle-plugins/<plugin-id>.properties
file and check which implementation-class
is configured.Edoardo Luppi
08/14/2023, 1:57 PMimplementation-class=org.jetbrains.kotlin.gradle.plugin.KotlinMultiplatformPluginWrapper
Nice, thanks!
The reason I'm using the class directly is because I've defined the plugin's dependencies using the version catalog
dependencies {
implementation(libs.kotlin.plugin)
implementation(libs.kotlinx.resources)
}
Vampire
08/14/2023, 1:58 PMEdoardo Luppi
08/14/2023, 2:00 PMEdoardo Luppi
08/14/2023, 2:00 PMVampire
08/14/2023, 2:03 PM