Add ScriptExpectedLocations annotation to script-runtime.

It describes where script file can be found.
This commit is contained in:
Natalia Selezneva
2018-03-19 10:53:35 +03:00
parent 27f1eb1e13
commit 15914dac86
3 changed files with 37 additions and 0 deletions
@@ -25,6 +25,7 @@ import org.jetbrains.kotlin.parsing.KotlinParserDefinition
import org.jetbrains.kotlin.psi.KtScript
import kotlin.reflect.KClass
import kotlin.script.experimental.dependencies.DependenciesResolver
import kotlin.script.experimental.location.ScriptExpectedLocation
import kotlin.script.templates.standard.ScriptTemplateWithArgs
open class KotlinScriptDefinition(val template: KClass<out Any>) : UserDataHolderBase() {
@@ -49,6 +50,9 @@ open class KotlinScriptDefinition(val template: KClass<out Any>) : UserDataHolde
@Deprecated("temporary workaround for missing functionality, will be replaced by the new API soon")
open val additionalCompilerArguments: Iterable<String>? = null
open val scriptExpectedLocations: List<ScriptExpectedLocation> =
listOf(ScriptExpectedLocation.SourcesOnly, ScriptExpectedLocation.TestsOnly)
}
object StandardScriptDefinition : KotlinScriptDefinition(ScriptTemplateWithArgs::class)