Cleanup RC deprecations in compiler and plugin.

This commit is contained in:
Ilya Gorbunov
2016-01-26 21:53:07 +03:00
parent c7a0375c25
commit 744a7a83f7
68 changed files with 92 additions and 86 deletions
@@ -47,7 +47,7 @@ interface Conditional {
companion object {
val ANNOTATIONS: Map<String, Parser> = listOf<Parser>(JvmVersion, JsVersion, TargetName).toMapBy { it.name }
val ANNOTATIONS: Map<String, Parser> = listOf<Parser>(JvmVersion, JsVersion, TargetName).associateBy { it.name }
}
}
@@ -25,7 +25,7 @@ data class Modification(val range: TextRange, val apply: (String) -> String)
class CollectModificationsVisitor(evaluators: List<Evaluator>) : KtTreeVisitorVoid() {
val elementModifications: Map<Evaluator, MutableList<Modification>> =
evaluators.toMapBy(selector = { it }, transform = { arrayListOf<Modification>() })
evaluators.associateBy(keySelector = { it }, valueTransform = { arrayListOf<Modification>() })
override fun visitDeclaration(declaration: KtDeclaration) {
super.visitDeclaration(declaration)
@@ -36,7 +36,7 @@ fun createJvmProfile(targetRoot: File, version: Int): Profile = Profile("JVM$ver
fun createJsProfile(targetRoot: File): Profile = Profile("JS", JsPlatformEvaluator(), File(targetRoot, "js"))
val profileEvaluators: Map<String, () -> Evaluator> =
listOf(6, 7, 8).toMapBy({ version -> "JVM$version" }, { version -> { JvmPlatformEvaluator(version) } }) + ("JS" to { JsPlatformEvaluator() })
listOf(6, 7, 8).associateBy({ version -> "JVM$version" }, { version -> { JvmPlatformEvaluator(version) } }) + ("JS" to { JsPlatformEvaluator() })
fun createProfile(name: String, targetRoot: File): Profile {
val (profileName, evaluator) = profileEvaluators.entries.firstOrNull { it.key.equals(name, ignoreCase = true) } ?: throw IllegalArgumentException("Profile with name '$name' is not supported")