-
Notifications
You must be signed in to change notification settings - Fork 70
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1083 from Kotlin/java11
Setting java version to 11
- Loading branch information
Showing
15 changed files
with
101 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
58 changes: 58 additions & 0 deletions
58
...rter/tests/org/jetbrains/kotlinx/dataframe/services/TemporaryDirectoryManagerImplFixed.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
package org.jetbrains.kotlinx.dataframe.services | ||
|
||
import org.jetbrains.kotlin.test.services.TemporaryDirectoryManager | ||
import org.jetbrains.kotlin.test.services.TestServices | ||
import org.jetbrains.kotlin.test.services.testInfo | ||
import org.jetbrains.kotlin.test.util.KtTestUtil | ||
import java.io.File | ||
import java.nio.file.Paths | ||
import java.util.Locale | ||
import kotlin.io.path.ExperimentalPathApi | ||
import kotlin.io.path.deleteRecursively | ||
|
||
// Copied from org.jetbrains.kotlin.test.services.impl.TemporaryDirectoryManagerImpl | ||
// because it uses NioFiles#deleteRecursively and throws method not found as a result. | ||
class TemporaryDirectoryManagerImplFixed(testServices: TestServices) : TemporaryDirectoryManager(testServices) { | ||
private val cache = mutableMapOf<String, File>() | ||
private val rootTempDir = lazy { | ||
val testInfo = testServices.testInfo | ||
val className = testInfo.className | ||
val methodName = testInfo.methodName | ||
if (!onWindows && className.length + methodName.length < 255) { | ||
return@lazy KtTestUtil.tmpDirForTest(className, methodName) | ||
} | ||
|
||
// This code will simplify directory name for windows. This is needed because there can occur errors due to long name | ||
val lastDot = className.lastIndexOf('.') | ||
val simplifiedClassName = className.substring(lastDot + 1).getOnlyUpperCaseSymbols() | ||
val simplifiedMethodName = methodName.getOnlyUpperCaseSymbols() | ||
KtTestUtil.tmpDirForTest(simplifiedClassName, simplifiedMethodName) | ||
} | ||
|
||
override val rootDir: File | ||
get() = rootTempDir.value | ||
|
||
override fun getOrCreateTempDirectory(name: String): File = | ||
cache.getOrPut(name) { | ||
KtTestUtil.tmpDir(rootDir, name) | ||
} | ||
|
||
@OptIn(ExperimentalPathApi::class) | ||
override fun cleanupTemporaryDirectories() { | ||
cache.clear() | ||
|
||
if (rootTempDir.isInitialized()) { | ||
Paths.get(rootDir.path).deleteRecursively() | ||
} | ||
} | ||
|
||
companion object { | ||
private val onWindows: Boolean = | ||
System.getProperty("os.name").lowercase(Locale.getDefault()).contains("windows") | ||
|
||
private fun String.getOnlyUpperCaseSymbols(): String = | ||
this.filter { it.isUpperCase() || it == '$' } | ||
.toList() | ||
.joinToString(separator = "") | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,6 @@ | ||
kotlin.code.style=official | ||
kotlinVersion=2.0.20 | ||
|
||
# Optionally, you can set this property to point to your JDK 11 installation. | ||
# This version is used to run the box/diagnostics tests. | ||
# JDK_11_0=/path/to/jdk_11 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters