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

[buildSrc] Refactor version name and version code for build #157

Closed
wax911 opened this issue Sep 17, 2022 · 1 comment
Closed

[buildSrc] Refactor version name and version code for build #157

wax911 opened this issue Sep 17, 2022 · 1 comment
Assignees
Labels
🔧 enhancement request A request for enhancing functionality
Milestone

Comments

@wax911
Copy link
Member

wax911 commented Sep 17, 2022

AniTrend Issue Guidelines

Before opening a new issue, please take a moment to review our community guidelines to make the contribution process easy and effective for everyone involved.

You may find an answer in already closed issues:
https://github.com/AniTrend/anitrend-v2/issues?q=is%3Aissue+is%3Aclosed

Feature Information

An experimental feature for analytic purposes, we would like to generate builds with smarter versioning tags. The channel name will be retrieved from the current branch while the identifier will be the commit id.

e.g. feature/* will be alpha release names while develop be beta & master will have no identifier and represents a stable channel

Solution Information

Example: v2.0.0-beta-fra446e -> v{versionName}-{channel}-{commit}

See current implementation:

/**
* **RR**_X.Y.Z_
* > **RR** reserved for build flavours and **X.Y.Z** follow the [versionName] convention
*/
const val versionCode = major.times(1_000_000_000) +
minor.times(1_000_000) +
patch.times(1_000) +
candidate
/**
* Naming schema: X.Y.Z-variant##
* > **X**(Major).**Y**(Minor).**Z**(Patch)
*/
val versionName = if (candidate > 0)
"$major.$minor.$patch-$channel${candidate.toVersion()}"
else
"$major.$minor.$patch"

Additional Context

Consider using https://github.com/swiftzer/semver for version name management in buildSrc

@wax911 wax911 added the 🔧 enhancement Improve existing functionality label Sep 17, 2022
@wax911 wax911 added this to the v2.0.0-alpha milestone Sep 17, 2022
@wax911 wax911 self-assigned this Nov 21, 2022
@wax911 wax911 changed the title Refactor version name and version code for build [buildSrc] Refactor version name and version code for build Jan 28, 2023
@wax911 wax911 added 🔧 enhancement request A request for enhancing functionality and removed 🔧 enhancement Improve existing functionality labels Apr 2, 2023
@wax911
Copy link
Member Author

wax911 commented May 23, 2023

Completed in #285

@wax911 wax911 closed this as completed May 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔧 enhancement request A request for enhancing functionality
Projects
Status: Done
Development

No branches or pull requests

1 participant