fix assets paths
parent
97b5444159
commit
d23b4f472c
|
|
@ -38,7 +38,7 @@ class FilesystemAssetManager : AssetManager {
|
|||
}
|
||||
|
||||
private fun createAssetsPath(name: String): Path {
|
||||
return Paths.get("$name.assets.d").toAbsolutePath()
|
||||
return Paths.get(name).parent.resolve("$name.assets.d").toAbsolutePath()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -48,6 +48,10 @@ class FilesystemProject(
|
|||
|
||||
private val assetManager: AssetManager by inject()
|
||||
private val resourceFactory: ResourceFactory by inject()
|
||||
override fun resolveName(name: String): String {
|
||||
return basePath.resolve(name).toAbsolutePath().toString()
|
||||
}
|
||||
|
||||
override suspend fun assets(documentName: String): Assets {
|
||||
return assetManager.assets(documentName)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,7 +10,9 @@ interface Project {
|
|||
val name: String
|
||||
val displayName: String
|
||||
val documentNames: List<String>
|
||||
suspend fun assets(documentName: String): Assets
|
||||
|
||||
fun resolveName(name: String): String
|
||||
suspend fun assets(documentName: String): Assets
|
||||
suspend fun resource(name: String): Resource?
|
||||
|
||||
}
|
||||
|
|
@ -29,6 +29,9 @@ class Corpus(private val project: Project): KoinComponent {
|
|||
private val resourceFactory: ResourceFactory by inject()
|
||||
|
||||
suspend fun document(name: String): Document {
|
||||
return Document(name, listOf(project.resource(name)!!))
|
||||
return Document(
|
||||
project.resolveName(name),
|
||||
listOf(project.resource(name)!!)
|
||||
)
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue