Skip to content

Commit a3721d3

Browse files
committed
Fix versionname for mainSample
1 parent fa24504 commit a3721d3

File tree

3 files changed

+7
-18
lines changed

3 files changed

+7
-18
lines changed

β€Žandroid/mainSample/build.gradle

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ android {
1313
minSdkVersion 24
1414
targetSdkVersion 34
1515

16-
// versionCode getGitCommitCount()
17-
// versionName getTag()
16+
versionCode getGitCommitCount()
17+
versionName getTag()
1818
buildConfigField "String", 'GIT_REPOSITORY', "\"" + getGitOriginRemote() + "\""
19-
buildConfigField "String", 'VERSION', "\"" + versionName + "\""
19+
buildConfigField "String", 'VERSION', "\"" + getTag() + "\""
2020
}
2121

2222
buildTypes {
@@ -67,18 +67,8 @@ dependencies {
6767
}
6868

6969
static def getTag() {
70-
def tagVersion = "$System.env.TAG_VERSION"
71-
if (tagVersion == "null") {
72-
println "No variable TAG_VERSION specified, I'm using 'git describe --abbrev=0'"
73-
def process = "git describe --abbrev=0".execute()
74-
tagVersion = process.text.toString().trim()
75-
if (tagVersion.equals("")) {
76-
println "abbrev failed, I'm using 'git --tags'"
77-
def processT = "git describe --tags".execute()
78-
tagVersion = processT.text.toString().trim()
79-
}
80-
}
81-
return tagVersion
70+
def process = "git describe --tags --abbrev=0".execute()
71+
return process.text.toString().trim()
8272
}
8373

8474
static def getGitCommitCount() {

β€Žandroid/mainSample/src/main/java/com/example/virosample/SystemInfoFragment.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class SystemInfoFragment : PreferenceFragmentCompat() {
1616
addPreferencesFromResource(R.xml.prefs)
1717
// TODO after next release you can use info from library
1818
//findPreference<Preference>(PREFERENCE_ + "APPVERSION")?.summary = com.viro.renderer.BuildConfig.VIRO_VERSION
19-
findPreference<Preference>(PREFERENCE_ + "APPVERSION")?.summary = BuildConfig.VERSION_NAME
19+
findPreference<Preference>(PREFERENCE_ + "APPVERSION")?.summary = BuildConfig.VERSION
2020
findPreference<Preference>(PREFERENCE_ + "APPVERSION")?.title =
2121
"${findPreference<Preference>(PREFERENCE_ + "APPVERSION")?.title} [${BuildConfig.FLAVOR}]"
2222
findPreference<Preference>(PREFERENCE_ + "BOARD")?.summary = Build.BOARD
Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2-
package="com.viro.ar"/>
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android" />

0 commit comments

Comments
Β (0)