Skip to content

Commit 3d8c451

Browse files
committed
* Updated dependencies to latest Kotlin
* Small fixes in DependencyResolverTest.kt
1 parent 0d6e7ee commit 3d8c451

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

build.gradle.kts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
22
import org.gradle.api.tasks.testing.logging.TestExceptionFormat
33
import org.gradle.api.tasks.testing.logging.TestLogEvent
44

5-
val kotlinVersion: String = "1.5.31"
5+
val kotlinVersion: String = "1.6.10"
66

77
plugins {
8-
kotlin("jvm") version "1.5.31"
8+
kotlin("jvm") version "1.6.10"
99
id("com.github.johnrengelman.shadow") version "6.1.0"
1010
}
1111

@@ -41,7 +41,7 @@ dependencies {
4141

4242
implementation("org.jetbrains.kotlin:kotlin-scripting-common:$kotlinVersion")
4343
implementation("org.jetbrains.kotlin:kotlin-reflect:$kotlinVersion")
44-
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.5.2")
44+
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.0-RC3")
4545

4646
implementation("org.jetbrains.kotlin:kotlin-scripting-jvm:$kotlinVersion")
4747
implementation("org.jetbrains.kotlin:kotlin-scripting-dependencies:$kotlinVersion")

src/test/kotlin/kscript/app/resolver/DependencyResolverTest.kt

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package kscript.app.resolver
22

33
import assertk.assertThat
44
import assertk.assertions.contains
5+
import assertk.assertions.exists
56
import assertk.assertions.isFailure
67
import assertk.assertions.isInstanceOf
78
import kscript.app.model.Dependency
@@ -12,6 +13,7 @@ import org.junit.jupiter.params.ParameterizedTest
1213
import org.junit.jupiter.params.provider.ValueSource
1314
import java.nio.file.Path
1415
import java.nio.file.Paths
16+
import kotlin.io.path.exists
1517
import kotlin.io.path.invariantSeparatorsPathString
1618

1719
class DependencyResolverTest {
@@ -30,7 +32,9 @@ class DependencyResolverTest {
3032
@ValueSource(strings = ["log4j:log4j:1.2.14", "net.clearvolume:cleargl:jar:2.0.1"])
3133
fun `Resolve dependencies`(dependencyString: String) {
3234
val dependency = Dependency(dependencyString)
33-
assertThat(dependencyResolver.resolve(setOf(dependency))).contains(calculateArtifactPath(dependency, true))
35+
val calculatedPath = calculateArtifactPath(dependency, true)
36+
assertThat(dependencyResolver.resolve(setOf(dependency))).contains(calculatedPath)
37+
assertThat(calculatedPath).exists()
3438
}
3539

3640
@Test
@@ -54,7 +58,9 @@ class DependencyResolverTest {
5458

5559
if (cleanupFirst) {
5660
val cleanupPath = Paths.get("$repositoryPathString/$group")
57-
FileUtils.cleanDirectory(cleanupPath.toFile())
61+
if (cleanupPath.exists()) {
62+
FileUtils.cleanDirectory(cleanupPath.toFile())
63+
}
5864
}
5965

6066
return calculatedPath

0 commit comments

Comments
 (0)