-
Notifications
You must be signed in to change notification settings - Fork 495
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
apk: read APK_VERSION_CODE env, set --numeric-version #1079
Conversation
Don't know if that's the solution buildozer devs want to support, but if that's to be merged, it would be better to also add documentation of the env variable somewhere. edit: as it's directly passed to p4a maybe it would be better to directly add the env variable handling in p4a instead? |
I'll try to add some docs in PR now
I'll look in p4a code |
Seems it's more logical make PR in p4a. Question about env name arised, possibly P4A_NUMERIC_VERSION is appropriate. I'll close this PR |
possibly APK_NUMERIC_VERSION is more appropriate, as P4A_NUMERIC_VERSION is used in p4a_env_vars.txt in |
Done PR to p4a: |
@zebra-lucky and @tshirtman, first of all thanks for the PR and the discussion. |
I'm using env to set separate versionCode for armeabi-v7a and arm64-v8a builds. |
Thanks for clarifying, yes I understand the need of having two different versions for different arch, it makes sense. But then I feel the environment var solution is kinda hacky from a buildozer/p4a perspective |
BTW: for now we using old version of buildozer/p4a and patching code before But then looking to new p4a code and see changes in |
There could be other solutions, but isn't p4a pretty open to using env vars to drive behaviors? Another solutions i can think of, that would be more invasive, but also extensible to other configuration tokens: give the ability to define a command or env variable name instead of a number for version in buildozer.spec (if a value starts with a |
Regarding the env on p4a, from what I'm ware of we only use 6 of them and all are in diff --git a/buildozer/targets/android.py b/buildozer/targets/android.py
index a508e22..8731b3b 100644
--- a/buildozer/targets/android.py
+++ b/buildozer/targets/android.py
@@ -1024,6 +1024,7 @@ class TargetAndroid(Target):
self.android_minapi)),
("--ndk-api", config.getdefault('app', 'android.minapi',
self.android_minapi)),
+ ("--numeric-version", config.get('app', 'android.numeric_version')),
]
is_private_storage = config.getbooldefault(
'app', 'android.private_storage', True) Untested, but you get the idea. The change is very straight forward and makes more sense to me. |
Meanwhile I'm also not against the idea of thinking something more generic like you suggested @tshirtman, that would make possible to override any possible parameter of p4a using environment variables. That would be more satisfying in terms of interface consistency at least, but introduce some (cyclomatic) "complexity" |
This flag is available in p4a and can be useful to have buildozer side too. Also refs kivy#1079
This flag is available in p4a and can be useful to have buildozer side too. Also refs kivy#1079
This flag is available in p4a and can be useful to have buildozer side too. Also refs kivy#1079
This flag is available in p4a and can be useful to have buildozer side too. Also refs kivy#1079
This flag is available in p4a and can be useful to have buildozer side too. Also refs kivy#1079
add possibility to set versionCode with APK_VERSION_CODE env