Refactor properties
This commit is contained in:
-17
@@ -1,17 +0,0 @@
|
||||
/*
|
||||
* 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.api
|
||||
|
||||
import kotlin.script.experimental.util.typedKey
|
||||
|
||||
object ProcessedScriptDataProperties {
|
||||
val foundAnnotations by typedKey<List<Annotation>>()
|
||||
|
||||
val foundFragments by typedKey<List<ScriptSourceNamedFragment>>()
|
||||
}
|
||||
|
||||
+12
-1
@@ -8,12 +8,23 @@
|
||||
package kotlin.script.experimental.api
|
||||
|
||||
import kotlin.script.experimental.util.ChainedPropertyBag
|
||||
|
||||
import kotlin.script.experimental.util.typedKey
|
||||
|
||||
typealias ScriptCompileConfiguration = ChainedPropertyBag
|
||||
|
||||
object ScriptCompileConfigurationProperties {
|
||||
|
||||
val sourceFragments by typedKey<List<ScriptSourceNamedFragment>>()
|
||||
}
|
||||
|
||||
typealias ProcessedScriptData = ChainedPropertyBag
|
||||
|
||||
object ProcessedScriptDataProperties {
|
||||
val foundAnnotations by typedKey<List<Annotation>>()
|
||||
|
||||
val foundFragments by typedKey<List<ScriptSourceNamedFragment>>()
|
||||
}
|
||||
|
||||
interface RefineScriptCompilationConfiguration {
|
||||
suspend operator fun invoke(
|
||||
scriptSource: ScriptSource,
|
||||
|
||||
-46
@@ -1,46 +0,0 @@
|
||||
/*
|
||||
* 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.api
|
||||
|
||||
import kotlin.script.experimental.util.typedKey
|
||||
|
||||
object ScriptCompileConfigurationProperties {
|
||||
|
||||
val sourceFragments by typedKey<List<ScriptSourceNamedFragment>>()
|
||||
|
||||
val baseClass = ScriptDefinitionProperties.baseClass
|
||||
|
||||
val scriptBodyTarget by typedKey<ScriptBodyTarget>()
|
||||
|
||||
val scriptImplicitReceivers by typedKey<List<KotlinType>>() // in the order from outer to inner scope
|
||||
|
||||
val contextVariables by typedKey<Map<String, KotlinType>>() // external variables
|
||||
|
||||
val defaultImports by typedKey<List<String>>()
|
||||
|
||||
val restrictions by typedKey<List<ResolvingRestrictionRule>>()
|
||||
|
||||
val importedScripts by typedKey<List<ScriptSource>>()
|
||||
|
||||
val dependencies by typedKey<List<ScriptDependency>>()
|
||||
|
||||
val generatedClassAnnotations by typedKey<List<Annotation>>()
|
||||
|
||||
val generatedMethodAnnotations by typedKey<List<Annotation>>()
|
||||
|
||||
val compilerOptions by typedKey<List<String>>() // Q: CommonCompilerOptions instead?
|
||||
|
||||
val refineConfiguration by typedKey<RefineScriptCompilationConfiguration>() // dynamic configurator
|
||||
|
||||
val refineBeforeParsing by typedKey<Boolean>() // default: false
|
||||
|
||||
val refineConfigurationOnAnnotations by typedKey<List<KotlinType>>()
|
||||
|
||||
val refineConfigurationOnSections by typedKey<List<String>>()
|
||||
}
|
||||
|
||||
@@ -19,5 +19,33 @@ object ScriptDefinitionProperties {
|
||||
val fileExtension by typedKey<String>() // default: "kts"
|
||||
|
||||
val baseClass by typedKey<KotlinType>() // script base class
|
||||
|
||||
val scriptBodyTarget by typedKey<ScriptBodyTarget>()
|
||||
|
||||
val scriptImplicitReceivers by typedKey<List<KotlinType>>() // in the order from outer to inner scope
|
||||
|
||||
val contextVariables by typedKey<Map<String, KotlinType>>() // external variables
|
||||
|
||||
val defaultImports by typedKey<List<String>>()
|
||||
|
||||
val restrictions by typedKey<List<ResolvingRestrictionRule>>()
|
||||
|
||||
val importedScripts by typedKey<List<ScriptSource>>()
|
||||
|
||||
val dependencies by typedKey<List<ScriptDependency>>()
|
||||
|
||||
val generatedClassAnnotations by typedKey<List<Annotation>>()
|
||||
|
||||
val generatedMethodAnnotations by typedKey<List<Annotation>>()
|
||||
|
||||
val compilerOptions by typedKey<List<String>>() // Q: CommonCompilerOptions instead?
|
||||
|
||||
val refineConfiguration by typedKey<RefineScriptCompilationConfiguration>() // dynamic configurator
|
||||
|
||||
val refineBeforeParsing by typedKey<Boolean>() // default: false
|
||||
|
||||
val refineConfigurationOnAnnotations by typedKey<List<KotlinType>>()
|
||||
|
||||
val refineConfigurationOnSections by typedKey<List<String>>()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user