Commit 23758260 authored by Nikolay Igotti's avatar Nikolay Igotti

Resource must be named in original way.

parent 38370178
......@@ -13,12 +13,13 @@ object Library {
private fun loadOrGet(path: String, resource: String, isLibrary: Boolean) {
File(cacheDir).mkdirs()
val resourceName = if (isLibrary) System.mapLibraryName(resource) else resource
val hash = Library::class.java.getResourceAsStream("$path$resourceName.sha256").use {
BufferedReader(InputStreamReader(it)).lines().toArray()[0] as String
}
val fileName = if (isLibrary) System.mapLibraryName(hash) else hash
val fileName = if (isLibrary) System.mapLibraryName(hash) else resource
val file = File(cacheDir, fileName)
// TODO: small race change when multiple Compose apps are started first time, can handle with atomic rename.
if (!file.exists()) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment