Skip to content

Commit

Permalink
Merge pull request #428 from Qawaz/fix-jvm-file-resource
Browse files Browse the repository at this point in the history
fix jvm file resource to use only forward slashes
  • Loading branch information
Alex009 authored Mar 10, 2023
2 parents 1d55b77 + da97129 commit cce55f5
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class JvmAssetsGenerator(
override fun getPropertyInitializer(fileSpec: AssetSpecFile) = CodeBlock.of(
"AssetResource(resourcesClassLoader = resourcesClassLoader, originalPath = %S, path = %S)",
fileSpec.pathRelativeToBase,
File(FILES_DIR, fileSpec.pathRelativeToBase).path
File(FILES_DIR, fileSpec.pathRelativeToBase).path.replace('\\', '/')
)

override fun generateResources(
Expand All @@ -42,6 +42,7 @@ class JvmAssetsGenerator(
when (assetSpec) {
is AssetSpecDirectory ->
generateResourcesInner(assetSpec.assets, fileResDir)

is AssetSpecFile ->
assetSpec.file.copyTo(File(fileResDir, assetSpec.pathRelativeToBase))
}
Expand Down

0 comments on commit cce55f5

Please sign in to comment.