Skip to content

Commit eaa1c23

Browse files
author
andela-akhenda
committed
fix(build): fix calculation of versionCode from git commits
1 parent f3a4268 commit eaa1c23

3 files changed

Lines changed: 4 additions & 26 deletions

File tree

android/app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ android {
101101
applicationId "com.wapi"
102102
minSdkVersion 18
103103
targetSdkVersion 26
104-
versionCode googleVer.toInteger()
104+
versionCode googleVer
105105
versionName "${versionMajor}.${versionMinor}.${versionPatch}"
106106
ndk {
107107
abiFilters "armeabi-v7a", "x86"

android/build.gradle

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,10 @@ def getNpmVersionArray() { // major [0], minor [1], patch [2]
4242

4343
/* calculated from git commits to give sequential integers */
4444
def getGitVersion() {
45-
def process = "git rev-list develop --first-parent --count".execute()
46-
// def num = process.text as int
45+
def process = "git rev-list HEAD --first-parent --count".execute()
46+
def num = process.text.trim()
4747
// println "[$num]"
48-
return process.text
48+
return num.toInteger()
4949
}
5050

5151
/* It’s important that versionCode is an integer – so we can’t use semantic versioning here. This is used on the play store to tell which versions come after others – that’s why it’s tied to git commits in getGitVersion */

docs/CHANGELOG.md

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -14,25 +14,3 @@
1414
### Features
1515

1616
* **dummy:** test semantic release ([9b4162d](https://github.com/akhenda/WAPI/commit/9b4162d))
17-
18-
<a name="0.0.1"></a>
19-
# [0.0.1](https://github.com/akhenda/WAPI/releases/tag/v0.0.1) (2018-01-06)
20-
21-
* chore(build): update npm scripts ([775b9bc](https://github.com/akhenda/WAPI/commit/775b9bc))
22-
* chore(build): finish semantic release setup ([7b9e654](https://github.com/akhenda/WAPI/commit/7b9e654))
23-
* chore(build): add semantic release to handle automatic app releases ([8d07e70](https://github.com/akhenda/WAPI/commit/8d07e70))
24-
* chore: add commitizen and commitlint ([4de55fb](https://github.com/akhenda/WAPI/commit/4de55fb))
25-
* (chore) update iOS build settings to XCode recommended settings ([68e388a](https://github.com/akhenda/WAPI/commit/68e388a))
26-
* (chore) add changelog ([12cd40a](https://github.com/akhenda/WAPI/commit/12cd40a))
27-
* (chore) update pre-version script ([56969ac](https://github.com/akhenda/WAPI/commit/56969ac))
28-
* (chore) rename the bin folder ([65c9b1e](https://github.com/akhenda/WAPI/commit/65c9b1e))
29-
* (chore) update shell script permissions ([74a51b9](https://github.com/akhenda/WAPI/commit/74a51b9))
30-
* (chore) update npm precommit script ([a8fad0a](https://github.com/akhenda/WAPI/commit/a8fad0a))
31-
* (chore) setup automated app versioning and changelog generation ([2b9def4](https://github.com/akhenda/WAPI/commit/2b9def4))
32-
* (chore) setup integration and e2e tests using Wix's Detox ([b12bcff](https://github.com/akhenda/WAPI/commit/b12bcff))
33-
* (chore) setup unit tests for components, utils, actions and reducers ([a3324d5](https://github.com/akhenda/WAPI/commit/a3324d5))
34-
* (chore) add husky, eslint rules and more npm scripts ([223af4b](https://github.com/akhenda/WAPI/commit/223af4b))
35-
* (chore) upgrade to Gradle v4.1 ([2212f14](https://github.com/akhenda/WAPI/commit/2212f14))
36-
* (chore) add splash screen to both android and iOS ([32930cf](https://github.com/akhenda/WAPI/commit/32930cf))
37-
* (chore) eslint setup ([172b128](https://github.com/akhenda/WAPI/commit/172b128))
38-
* (chore) initial commit ([9af591c](https://github.com/akhenda/WAPI/commit/9af591c))

0 commit comments

Comments
 (0)