[SAM with receiver] Extract some constants to common module

This is needed to publish them into corresponding jar for IDE
This commit is contained in:
Dmitriy Novozhilov
2022-06-22 13:26:14 +03:00
committed by teamcity
parent ffc680f4a6
commit 04bf5bfe0b
2 changed files with 20 additions and 7 deletions
@@ -15,9 +15,12 @@ import org.jetbrains.kotlin.descriptors.ModuleDescriptor
import org.jetbrains.kotlin.extensions.StorageComponentContainerContributor
import org.jetbrains.kotlin.platform.TargetPlatform
import org.jetbrains.kotlin.platform.jvm.isJvm
import org.jetbrains.kotlin.samWithReceiver.SamWithReceiverCommandLineProcessor.Companion.SUPPORTED_PRESETS
import org.jetbrains.kotlin.samWithReceiver.SamWithReceiverPluginNames.SUPPORTED_PRESETS
import org.jetbrains.kotlin.samWithReceiver.SamWithReceiverConfigurationKeys.ANNOTATION
import org.jetbrains.kotlin.samWithReceiver.SamWithReceiverConfigurationKeys.PRESET
import org.jetbrains.kotlin.samWithReceiver.SamWithReceiverPluginNames.ANNOTATION_OPTION_NAME
import org.jetbrains.kotlin.samWithReceiver.SamWithReceiverPluginNames.PLUGIN_ID
import org.jetbrains.kotlin.samWithReceiver.SamWithReceiverPluginNames.PRESET_OPTION_NAME
object SamWithReceiverConfigurationKeys {
val ANNOTATION: CompilerConfigurationKey<List<String>> = CompilerConfigurationKey.create("annotation qualified name")
@@ -27,19 +30,15 @@ object SamWithReceiverConfigurationKeys {
class SamWithReceiverCommandLineProcessor : CommandLineProcessor {
companion object {
val SUPPORTED_PRESETS = emptyMap<String, List<String>>()
val ANNOTATION_OPTION = CliOption(
"annotation", "<fqname>", "Annotation qualified names",
ANNOTATION_OPTION_NAME, "<fqname>", "Annotation qualified names",
required = false, allowMultipleOccurrences = true
)
val PRESET_OPTION = CliOption(
"preset", "<name>", "Preset name (${SUPPORTED_PRESETS.keys.joinToString()})",
PRESET_OPTION_NAME, "<name>", "Preset name (${SUPPORTED_PRESETS.keys.joinToString()})",
required = false, allowMultipleOccurrences = true
)
val PLUGIN_ID = "org.jetbrains.kotlin.samWithReceiver"
}
override val pluginId = PLUGIN_ID
@@ -0,0 +1,14 @@
/*
* Copyright 2010-2022 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.samWithReceiver
object SamWithReceiverPluginNames {
const val PLUGIN_ID = "org.jetbrains.kotlin.samWithReceiver"
const val ANNOTATION_OPTION_NAME = "annotation"
const val PRESET_OPTION_NAME = "preset"
val SUPPORTED_PRESETS = emptyMap<String, List<String>>()
}