Remove deprecated usages of CliOption in official compiler plugins
This commit is contained in:
+3
-3
@@ -133,9 +133,9 @@ class AndroidExtensionsGradleImportHandler : GradleProjectImportHandler {
|
||||
.filterTo(mutableListOf()) { !it.startsWith("plugin:$ANDROID_COMPILER_PLUGIN_ID:") } // Filter out old options
|
||||
|
||||
if (moduleNode.hasAndroidExtensionsPlugin) {
|
||||
newPluginOptions += makePluginOption(EXPERIMENTAL_OPTION.name, moduleNode.isExperimental.toString())
|
||||
newPluginOptions += makePluginOption(ENABLED_OPTION.name, moduleNode.hasAndroidExtensionsPlugin.toString())
|
||||
newPluginOptions += makePluginOption(DEFAULT_CACHE_IMPL_OPTION.name, moduleNode.defaultCacheImplementation)
|
||||
newPluginOptions += makePluginOption(EXPERIMENTAL_OPTION.optionName, moduleNode.isExperimental.toString())
|
||||
newPluginOptions += makePluginOption(ENABLED_OPTION.optionName, moduleNode.hasAndroidExtensionsPlugin.toString())
|
||||
newPluginOptions += makePluginOption(DEFAULT_CACHE_IMPL_OPTION.optionName, moduleNode.defaultCacheImplementation)
|
||||
}
|
||||
|
||||
commonArguments.pluginOptions = newPluginOptions.toTypedArray()
|
||||
|
||||
+3
-3
@@ -26,18 +26,18 @@ import org.jetbrains.kotlin.android.synthetic.AndroidCommandLineProcessor.Compan
|
||||
import org.jetbrains.kotlin.android.synthetic.AndroidCommandLineProcessor.Companion.ENABLED_OPTION
|
||||
import org.jetbrains.kotlin.android.synthetic.AndroidCommandLineProcessor.Companion.DEFAULT_CACHE_IMPL_OPTION
|
||||
import org.jetbrains.kotlin.android.synthetic.AndroidComponentRegistrar.Companion.parseCacheImplementationType
|
||||
import org.jetbrains.kotlin.compiler.plugin.CliOption
|
||||
import org.jetbrains.kotlin.compiler.plugin.AbstractCliOption
|
||||
import org.jetbrains.kotlin.idea.core.unwrapModuleSourceInfo
|
||||
import org.jetbrains.kotlin.idea.facet.KotlinFacet
|
||||
import org.jetbrains.kotlin.resolve.jvm.platform.JvmPlatform
|
||||
|
||||
private val ANNOTATION_OPTION_PREFIX = "plugin:$ANDROID_COMPILER_PLUGIN_ID:"
|
||||
|
||||
private fun Module.getOptionValueInFacet(option: CliOption): String? {
|
||||
private fun Module.getOptionValueInFacet(option: AbstractCliOption): String? {
|
||||
val kotlinFacet = KotlinFacet.get(this) ?: return null
|
||||
val commonArgs = kotlinFacet.configuration.settings.compilerArguments ?: return null
|
||||
|
||||
val prefix = ANNOTATION_OPTION_PREFIX + option.name + "="
|
||||
val prefix = ANNOTATION_OPTION_PREFIX + option.optionName + "="
|
||||
|
||||
val optionValue = commonArgs.pluginOptions
|
||||
?.firstOrNull { it.startsWith(prefix) }
|
||||
|
||||
Reference in New Issue
Block a user