You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

28 lines
1.1 KiB

/*
* Copyright 2020-2021 JetBrains s.r.o. and respective authors and developers.
* Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE.txt file.
*/
package org.jetbrains.compose
import org.gradle.api.provider.Provider
import org.jetbrains.kotlin.gradle.plugin.*
class ComposeCompilerKotlinSupportPlugin : KotlinCompilerPluginSupportPlugin {
override fun getCompilerPluginId(): String =
"org.jetbrains.compose"
override fun isApplicable(kotlinCompilation: KotlinCompilation<*>): Boolean {
val targetPlatform = kotlinCompilation.target.platformType
return targetPlatform != KotlinPlatformType.js
&& targetPlatform != KotlinPlatformType.native
}
override fun applyToCompilation(kotlinCompilation: KotlinCompilation<*>): Provider<List<SubpluginOption>> =
kotlinCompilation.target.project.provider { emptyList() }
override fun getPluginArtifact(): SubpluginArtifact =
SubpluginArtifact(
groupId = "org.jetbrains.compose.compiler", artifactId = "compiler", version = composeVersion
)
}