Rename script annotation params according to configuration keys...
rename evaluation params consistently too
This commit is contained in:
+3
-8
@@ -3,11 +3,6 @@
|
||||
* that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license
|
||||
* that can be found in the license/LICENSE.txt file.
|
||||
*/
|
||||
|
||||
@file:Suppress("unused")
|
||||
|
||||
package kotlin.script.experimental.annotations
|
||||
@@ -18,8 +13,8 @@ import kotlin.script.experimental.api.ScriptCompilationConfiguration
|
||||
@Target(AnnotationTarget.CLASS)
|
||||
@Retention(AnnotationRetention.RUNTIME)
|
||||
annotation class KotlinScript(
|
||||
val name: String = "Kotlin script",
|
||||
val extension: String = "kts",
|
||||
val compilationConfiguration: KClass<out ScriptCompilationConfiguration> = ScriptCompilationConfiguration.Default::class // object or class filled in 0-ary constructor
|
||||
val displayName: String = "Kotlin script",
|
||||
val fileExtension: String = "kts",
|
||||
val compilationConfiguration: KClass<out ScriptCompilationConfiguration> = ScriptCompilationConfiguration.Default::class
|
||||
)
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ class ScriptEvaluationConfiguration(baseEvaluationConfigurations: Iterable<Scrip
|
||||
|
||||
val ScriptEvaluationConfigurationKeys.implicitReceivers by PropertiesCollection.key<List<Any>>()
|
||||
|
||||
val ScriptEvaluationConfigurationKeys.contextVariables by PropertiesCollection.key<Map<String, Any?>>() // external variables
|
||||
val ScriptEvaluationConfigurationKeys.providedProperties by PropertiesCollection.key<Map<String, Any?>>() // external variables
|
||||
|
||||
val ScriptEvaluationConfigurationKeys.constructorArgs by PropertiesCollection.key<List<Any?>>()
|
||||
|
||||
|
||||
+2
-2
@@ -61,10 +61,10 @@ fun createCompilationConfigurationFromTemplate(
|
||||
baseClass(loadedBaseClassType)
|
||||
}
|
||||
if (fileExtension() == null) {
|
||||
fileExtension(mainAnnotation.extension)
|
||||
fileExtension(mainAnnotation.fileExtension)
|
||||
}
|
||||
if (displayName() == null) {
|
||||
displayName(mainAnnotation.name)
|
||||
displayName(mainAnnotation.displayName)
|
||||
}
|
||||
|
||||
body()
|
||||
|
||||
Reference in New Issue
Block a user