[JS IR] tie together IC code in tests and K2JsIrCompiler
This commit is contained in:
committed by
TeamCityServer
parent
ff02ea5840
commit
75368a2c06
+13
@@ -50,6 +50,8 @@ interface PersistentCacheProvider {
|
||||
|
||||
fun sourceMap(path: String): ByteArray?
|
||||
|
||||
fun filePaths(): Iterable<String>
|
||||
|
||||
companion object {
|
||||
val EMPTY = object : PersistentCacheProvider {
|
||||
override fun fileFingerPrint(path: String): Hash {
|
||||
@@ -83,6 +85,8 @@ interface PersistentCacheProvider {
|
||||
override fun sourceMap(path: String): ByteArray? {
|
||||
return null
|
||||
}
|
||||
|
||||
override fun filePaths(): Iterable<String> = emptyList()
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -178,6 +182,15 @@ class PersistentCacheProviderImpl(private val cachePath: String) : PersistentCac
|
||||
override fun sourceMap(path: String): ByteArray? {
|
||||
return readBytesFromCacheFile(path, fileSourceMap)
|
||||
}
|
||||
|
||||
override fun filePaths(): Iterable<String> {
|
||||
return File(cachePath).listFiles()!!.filter { it.isDirectory }.mapNotNull { f ->
|
||||
val fileInfo = File(f, fileInfoFile)
|
||||
if (fileInfo.exists()) {
|
||||
fileInfo.readLines()[0]
|
||||
} else null
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
interface PersistentCacheConsumer {
|
||||
|
||||
Reference in New Issue
Block a user