Implement a compiler config key to add preconfigured extra imports for scripts

This commit is contained in:
Ilya Chernikov
2016-05-30 14:33:56 +02:00
parent 956bcf6d7a
commit 478ae96e50
6 changed files with 96 additions and 25 deletions
@@ -75,6 +75,11 @@ class StandardWithClasspathScriptDefinition(extension: String, classpath: List<S
StandardScriptDefinition.getScriptParameters(scriptDescriptor)
}
class SimpleScriptExtraImport(
override val classpath: List<String>,
override val names: List<String> = emptyList()
) : KotlinScriptExtraImport
fun classpathFromProperty(): List<String> =
System.getProperty("java.class.path")?.let {
it.split(String.format("\\%s", File.pathSeparatorChar).toRegex()).dropLastWhile { it.isEmpty() }.toTypedArray()