mirror of
https://github.com/irmen/prog8.git
synced 2025-11-02 13:16:07 +00:00
get rid of deprecated usage of thread id to create temporary test output file names
This commit is contained in:
@@ -91,8 +91,7 @@ main {
|
||||
}
|
||||
}
|
||||
"""
|
||||
@Suppress("DEPRECATION") // Thread.currentThread().id
|
||||
val filenameBase = "on_the_fly_test_" + Thread.currentThread().id.toString() + "_" + sourceText.hashCode().toUInt().toString(16)
|
||||
val filenameBase = "on_the_fly_test_${sourceText.hashCode().toUInt().toString(16)}"
|
||||
|
||||
val filepath = outputDir.resolve("$filenameBase.p8")
|
||||
filepath.toFile().writeText(sourceText)
|
||||
|
||||
@@ -61,8 +61,7 @@ internal fun compileText(
|
||||
errors: IErrorReporter? = null,
|
||||
writeAssembly: Boolean = true,
|
||||
) : CompilationResult? {
|
||||
@Suppress("DEPRECATION") // Thread.currentThread().id
|
||||
val filePath = outputDir.resolve("on_the_fly_test_" + Thread.currentThread().id.toString() + "_" + sourceText.hashCode().toUInt().toString(16) + ".p8")
|
||||
val filePath = outputDir.resolve("on_the_fly_test_${sourceText.hashCode().toUInt().toString(16)}.p8")
|
||||
// we don't assumeNotExists(filePath) - should be ok to just overwrite it
|
||||
filePath.toFile().writeText(sourceText)
|
||||
return compileFile(platform, optimize, filePath.parent, filePath.name, outputDir,
|
||||
|
||||
@@ -51,12 +51,3 @@ fun assumeDirectory(pathStr: String): Path = assumeDirectory(Path(pathStr))
|
||||
fun assumeDirectory(path: Path, other: String): Path = assumeDirectory(path / other)
|
||||
fun assumeDirectory(pathStr: String, other: String): Path = assumeDirectory(Path(pathStr) / other)
|
||||
fun assumeDirectory(pathStr: String, other: Path): Path = assumeDirectory(Path(pathStr) / other)
|
||||
|
||||
|
||||
@Deprecated(
|
||||
"Directories are checked automatically at init.",
|
||||
ReplaceWith("/* nothing */")
|
||||
)
|
||||
@Suppress("UNUSED_PARAMETER")
|
||||
fun sanityCheckDirectories(workingDirName: String? = null) {
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user