Change versionCode/versionName when running with --release
See original GitHub issueHi,
I’ve been building-beta releasing-building-beta releasing an Android app for a couple of days now. Pretty much every time I build it I forget to update the versionCode and versionName in the AndroidManifest.xml. I get reminded of this then Google’s Developer Console rejects my APK because of the versionCode not being larger than the previous version.
An easy way to make a little bit easier for the developers would be to add a prompt for versionCode/versionName in the CLI if the build is run with the --release
flag. And let the predefined value be read from the current AndroidManifest.xml. This way the developer will be reminded to update the versionCode/versionName and if s/he doesn’t want to it’s just an enter stroke away.
If versionCode/versionName is changed then write it back to the AndroidManifest.xml
As tns build
could be a part of a larger build script where user input is not possible, a new flag, such as --auto
or --quiet
, should probably be added as well - skipping the prompt.
Issue Analytics
- State:
- Created 8 years ago
- Reactions:2
- Comments:24 (9 by maintainers)
Revisiting this…
Since NativeScript is really created for the JS dev (versus the “native developers”), I think it feels more intuitive to control these basic app configuration values in the
package.json
. As Steve said, I like the option of setting the value in one place to manage all of my target platforms (could be more than iOS/Android in the future).Steve’s proposal for version numbers in
package.json
is great.If we want to reduce confusion, we could change the default value in
Info.plist
/AndroidManifest.xml
to a clear variable placeholder (like${app_version}
) that gets replaced at build time.If someone REMOVES this variable from the native config files, then they can set the values directly and
package.json
will NOT be used to change version numbers.Thoughts?
Any updates here?