[Gradle] Update Gradle integration tests code as the new stdlib is now available
#KTI-1221 In Progress
This commit is contained in:
committed by
Space Team
parent
7690904bc4
commit
76ba0c60b2
+1
@@ -10,6 +10,7 @@ import java.nio.file.Path
|
||||
import java.util.*
|
||||
import kotlin.io.path.createDirectories
|
||||
import kotlin.io.path.deleteIfExists
|
||||
import kotlin.io.path.deleteRecursively
|
||||
import kotlin.io.path.writeText
|
||||
import kotlin.test.assertEquals
|
||||
|
||||
|
||||
+1
-4
@@ -22,10 +22,7 @@ import java.io.File
|
||||
import java.nio.file.Files
|
||||
import java.nio.file.Path
|
||||
import java.util.zip.ZipFile
|
||||
import kotlin.io.path.appendText
|
||||
import kotlin.io.path.extension
|
||||
import kotlin.io.path.readText
|
||||
import kotlin.io.path.writeText
|
||||
import kotlin.io.path.*
|
||||
import kotlin.streams.toList
|
||||
import kotlin.test.*
|
||||
|
||||
|
||||
+1
@@ -11,6 +11,7 @@ import org.jetbrains.kotlin.gradle.util.replaceFirst
|
||||
import org.jetbrains.kotlin.gradle.util.replaceText
|
||||
import org.junit.jupiter.api.DisplayName
|
||||
import org.junit.jupiter.api.condition.OS
|
||||
import kotlin.io.path.deleteRecursively
|
||||
|
||||
@OsCondition(supportedOn = [OS.MAC], enabledOnCI = [OS.MAC])
|
||||
@DisplayName("Tests for K/N with apple XCFramework")
|
||||
|
||||
+1
@@ -9,6 +9,7 @@ import org.gradle.util.GradleVersion
|
||||
import org.jetbrains.kotlin.gradle.testbase.*
|
||||
import org.junit.jupiter.api.DisplayName
|
||||
import kotlin.io.path.createDirectories
|
||||
import kotlin.io.path.deleteRecursively
|
||||
import kotlin.io.path.writeText
|
||||
|
||||
@DisplayName("JVM API validation")
|
||||
|
||||
-20
@@ -87,26 +87,6 @@ internal fun Path.copyRecursively(dest: Path) {
|
||||
})
|
||||
}
|
||||
|
||||
internal fun Path.deleteRecursively() {
|
||||
Files.walkFileTree(this, object : SimpleFileVisitor<Path>() {
|
||||
override fun visitFile(
|
||||
file: Path,
|
||||
fileAttributes: BasicFileAttributes
|
||||
): FileVisitResult {
|
||||
file.deleteIfExists()
|
||||
return FileVisitResult.CONTINUE
|
||||
}
|
||||
|
||||
override fun postVisitDirectory(
|
||||
dir: Path,
|
||||
exception: IOException?
|
||||
): FileVisitResult {
|
||||
dir.deleteIfExists()
|
||||
return FileVisitResult.CONTINUE
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
internal fun Iterable<String>.toPaths(): List<Path> = map { Paths.get(it) }
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user