-
Notifications
You must be signed in to change notification settings - Fork 82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add the assets folder to the apk #235
base: master
Are you sure you want to change the base?
Conversation
add the assets folder to the apk if the folder exists
Hi, good idea, but IMHO a bit too hardwired. I think the asset directory should be provided from the outside through a command line arg to android-create-apk.py, and maybe exposed as a cmake macro. I'll keep the PR open as a reminder, we'll also need a similar solution for iOS sooner or later. For instance the last batch of sokol_fetch.h samples doesn't work yet neither on Android nor iOS, not only because the assets are not copied, but also because sokol_fetch.h doesn't know the root path of the asset directory (I'd like to create some sort of sokol_filesystem_util.h header for stuff like this). |
I see that you load assets from an URL in Oryol and not the filesystem so I thought you do the same in Sokol. Having a macro is a good one. I use a generator that creates a CPP file for versioning the assets something like: But the first time I call fips build the new code builds but doesn't create apk then next time I call build creates apk. I can not find the bug. Do you have any idea? |
Have a look at the 'isDirty' helper function in fips: Line 70 in 9e14332
This takes a Version number and a list of input and output files. The Version number mechanism is mainly useful for actual code-generation scenarios, the isDirty function will basically check the output files for the magic string In addition, isDirty() does a timestamp check, if any input file's modification date is newer than any outputs, the function will also return true (this timestamp check makes a lot more sense with asset-copying scripts, if any of the asset source file has been modified, copying will take place). The file copying generator script here should do the right thing: https://github.com/floooh/sokol-samples/blob/master/fips-files/generators/copy.py |
This is my generator I think the problem is not with my generator because the generator change the files but in the next compilation the fips create the apk. It looks like the create apk script calls before the generators. |
add the assets folder to the apk if the folder exists