#`Build.Step.Run.addOutputFileArg` for a file outside of the `.zig-cache`

1 messages · Page 1 of 1 (latest)

vital onyx
#

I have an intermediate step of generating a keystore for an android package and I want to store it in ~/.android, how do I add it as an output file arg (and subsequently a file arg for a future step) if it's outside the .zig-cache?

I tried invoking addPrefixedOutputFileArg with a prefix of /home/user/.android, but it ends up in the .zig-cache under that name. Can I somehow change the prefix path just for one step or how is it supposed to be done?

peak pike
#

errm... you want to put things in the user's home directory during a build? Are you sure?

vital onyx
#

Android studio creates a default debug.keystore it uses for all debug APK signatures, and I want to use that if it exists. But I'd also like to create it if by some chance it doesn't exist.

Because if the keystore lives in .zig-cache or zig-out and the user uses it to sign and install an app, then nukes the cache, generates a new keystore for the next build, android OS won't allow them to reinstall the APK because the keystore doesn't match, so you have to explicitly uninstall the app first.

daring dune
#

AFAICT, there's no way to move files outside of the project root directory using the API provided by the build system

vital onyx
#

Alrighty then, what if I wanted to complicate things with symlinks then? Is there an API for that?

daring dune
#

you can do b.addInstallFile so it is installed in the place you want

cedar tendon
#

the zig build system is not a package distribution system, the only place you can output files is the installation prefix.

perhaps you could change where you want to put the store to be more compatible with typical unix install file structures. e.g pfx/share/my_app/android_key_store