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

Make version name and version code available from BuildConfig #796

Merged
merged 2 commits into from
Jun 16, 2016

Conversation

matteblair
Copy link
Member

@matteblair matteblair commented Jun 15, 2016

The Gradle plugin generates a class called BuildConfig at compile time, we can use it to access values determined at build time like the version name and version code:

// Print the version of tangram in use.
Log.d(com.mapzen.tangram.BuildConfig.VERSION_NAME);

The version name is probably more useful than the version code, but version code seems to be used sometimes as well, so I stole the script used in Eraser Map to generate version codes automatically :)

Closes #795

@nvkelso
Copy link
Member

nvkelso commented Jun 15, 2016

Is there a JS equivalent for this already?

On Wed, Jun 15, 2016 at 3:10 PM, Matt Blair notifications@github.com
wrote:

The Gradle plugin generates a class called BuildConfig at compile time, we
can use it to access values determined at build time like the version name
and version code:

// Print the version of tangram in use.Log.d(com.mapzen.tangram.BuildConfig.VERSION_NAME);

The version name is probably more useful than the version code, but
version code seems to be used sometimes as well, so I stole the script
used in Eraser Map
https://github.com/mapzen/eraser-map/blob/master/versioning.gradle to

generate version codes automatically :)

You can view, comment on, or merge this pull request online at:

#796
Commit Summary

  • Add 'versionName' to build config in Gradle script
  • Add gradle script to generate Android version code

File Changes

Patch Links:


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#796, or mute the thread
https://github.com/notifications/unsubscribe/AA0EO-Gd-CoSf8VaDtTjOzqcft6baNqFks5qMHhlgaJpZM4I22Ha
.

@tallytalwar
Copy link
Member

This is good to go. Should also resolve #795!

@tallytalwar tallytalwar merged commit 9bf6900 into master Jun 16, 2016
@tallytalwar tallytalwar deleted the gradle-version-name branch June 16, 2016 15:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants