Skip to content
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

Why the versionName is 2.0.0? #68

Closed
abdonrd opened this issue Jan 15, 2020 · 5 comments
Closed

Why the versionName is 2.0.0? #68

abdonrd opened this issue Jan 15, 2020 · 5 comments

Comments

@abdonrd
Copy link
Contributor

abdonrd commented Jan 15, 2020

Why the versionName is 2.0.0?

https://github.com/GoogleChromeLabs/llama-pack/blob/2137ae160ffa9c64dfbe97e04815185ed733a66d/template_project/app/build.gradle#L47

There are any way to manage it? Or should we edit it manually from there?

@andreban
Copy link
Member

andreban commented Jan 15, 2020

That's a left-over from svgomg-twa, which was used as a base for the template. We can reset that back to 1.0.0.

Nevertheless, we need a mechanism to enable #3, where versionCode and versionName are updated with the template.

One option is to control this via the template. We'd have to bump versionName and versionCode on the template when it's changed, and update would apply the new template.

The second option (somewhat my preferred, is to save the current versionCode and versionName to twa-manifest.json and bump it when llama-pack update is invoked. We'd still probably want to have a way to track template versions, for debugging purposes.

@abdonrd
Copy link
Contributor Author

abdonrd commented Jan 15, 2020

Reading about Versioning Android apps here...

What do you think of having a version field in the manifest?
And let the build.gradle generate versionCode and versionName.

Something like:

...
"version": "2.3.1",
...

And then the build.gradle generates:

versionCode 20301
versionName "2.3.1"

(ignoring the API level and screen sizes from the post)

Then the user just need to update the application version in the manifest in a semantic version way.


To calculate the versionCode:

const versionCode = (majorVersion * 10000) + (minorVersion * 100) + patchVersion;

@andreban
Copy link
Member

versionCode is the bit that really matters on the Play Store, and the number must always go up between versions. I think we can just have the 2 values on the twa-manifest and update them independently. eg:

...
"version": {
    "code": 1,
    "name": "1.0.0"
} 
...

@abdonrd
Copy link
Contributor Author

abdonrd commented Jan 16, 2020

Yes, but following a formula like this, the versionCode would always increase:

const versionCode = (majorVersion * 10000) + (minorVersion * 100) + patchVersion;

So a version like "2.3.1" generates the version code 20301.

But having both options also works. 👍

@andreban
Copy link
Member

Moving the conversation on how to update versions to #74 and closing this issue, as resetting the versionName has been implemented on #71.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants