Skip to content

Latest commit

 

History

History
executable file
·
24 lines (22 loc) · 725 Bytes

2015-06-09-unified-versioning-of-android-wear-and-mobile-apps.md

File metadata and controls

executable file
·
24 lines (22 loc) · 725 Bytes
layout title date categories
post
Unified versioning of android wear and mobile apps
2015-06-09 14:28:36 +0100
android

Having to update both mobile and wear version numbers & codes soon becomes a pain when you're releasing frequently and it's easy to forget. I dug into Gradle a little and found you can have project level variables so I placed the version numbers in the project level and both the wear and mobile build files reference this.

gradle.properties (project level)

...
VERSION_NAME=1.0.0
VERSION_CODE=1
build.gradle (module level)

android {
    defaultConfig {
        versionName project.VERSION_NAME
        versionCode Integer.parseInt(project.VERSION_CODE)
        ...
    }
...