Add dependency scopes option for scripting resolvers
This commit is contained in:
+12
@@ -7,7 +7,9 @@ package org.jetbrains.kotlin.mainKts.test
|
||||
import org.jetbrains.kotlin.mainKts.COMPILED_SCRIPTS_CACHE_DIR_PROPERTY
|
||||
import org.jetbrains.kotlin.mainKts.impl.Directories
|
||||
import org.jetbrains.kotlin.mainKts.MainKtsScript
|
||||
import org.jetbrains.kotlin.scripting.compiler.plugin.assertTrue
|
||||
import org.junit.Assert
|
||||
import org.junit.Assert.assertEquals
|
||||
import org.junit.Test
|
||||
import java.io.*
|
||||
import java.util.*
|
||||
@@ -60,6 +62,16 @@ class MainKtsTest {
|
||||
)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun testResolveRuntimeDeps() {
|
||||
val resOk = evalFile(File("$TEST_DATA_ROOT/resolve-with-runtime.main.kts"))
|
||||
assertSucceeded(resOk)
|
||||
|
||||
val resultValue = resOk.valueOrThrow().returnValue
|
||||
assertTrue(resultValue is ResultValue.Value) { "Result value should be of type Value" }
|
||||
assertEquals("John Smith", (resultValue as ResultValue.Value).value)
|
||||
}
|
||||
|
||||
// @Test
|
||||
// this test is disabled: the resolving works fine, but ivy resolver is not processing "pom"-type dependencies correctly (
|
||||
// as far as I can tell)
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
name,surname
|
||||
John,Smith
|
||||
|
@@ -0,0 +1,9 @@
|
||||
@file:Repository("https://dl.bintray.com/holgerbrandl/mpicbg-scicomp")
|
||||
//Krangl depends on Klaxon transitively, that's why this repo is needed here
|
||||
@file:Repository("https://dl.bintray.com/cbeust/maven")
|
||||
@file:DependsOn("de.mpicbg.scicomp:krangl:0.13", options = arrayOf("scope=compile,runtime"))
|
||||
|
||||
import krangl.*
|
||||
|
||||
val df = DataFrame.readCSV("libraries/tools/kotlin-main-kts-test/testData/resolve-with-runtime.csv")
|
||||
df.head().rows.first().let { "${it["name"]} ${it["surname"]}" }
|
||||
Reference in New Issue
Block a user