Created
June 5, 2025 13:03
-
-
Save efemoney/0007b9052b54ff372b0193ade3927bc2 to your computer and use it in GitHub Desktop.
This file contains hidden or 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 parcelize plugin only applies to KotlinJvmAndroidCompilation, | |
| * this copy extends support to the KotlinMultiplatformAndroidCompilation. | |
| */ | |
| class NotParcelizeSubplugin : KotlinCompilerPluginSupportPlugin { | |
| override fun apply(target: Project) = Unit | |
| override fun isApplicable(kotlinCompilation: KotlinCompilation<*>) = | |
| kotlinCompilation is KotlinJvmAndroidCompilation || kotlinCompilation is KotlinMultiplatformAndroidCompilation | |
| override fun applyToCompilation(kotlinCompilation: KotlinCompilation<*>): Provider<List<SubpluginOption>> { | |
| return kotlinCompilation.target.project.run { | |
| kotlinCompilation.defaultSourceSet.dependencies { | |
| implementation("org.jetbrains.kotlin:kotlin-parcelize-runtime:${getKotlinPluginVersion()}") | |
| } | |
| provider(::emptyList) | |
| } | |
| } | |
| override fun getCompilerPluginId() = "org.jetbrains.kotlin.parcelize" | |
| override fun getPluginArtifact() = JetBrainsSubpluginArtifact("kotlin-parcelize-compiler") | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment