Skip to content

Commit

Permalink
Merge pull request #735 from Chilledheart/build_bump_apk_version
Browse files Browse the repository at this point in the history
build: bump apk version
  • Loading branch information
Chilledheart authored Feb 5, 2024
2 parents 6b2e271 + 4e1c07a commit cd5520b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
8 changes: 6 additions & 2 deletions android/yass/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,16 @@ apply plugin: 'com.android.application'

android {
compileSdkVersion rootProject.ext.compileSdkVersion

def Properties properties = new Properties()
properties.load(project.rootProject.file("local.properties").newDataInputStream())

defaultConfig {
applicationId 'it.gui.yass'
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1
versionName '1.0'
versionCode properties.getProperty("YASS_VERSION", "1").trim().toInteger()
versionName properties.getProperty("YASS_VERSION_NAME", "1.0").trim()
}
sourceSets {
main {
Expand Down
6 changes: 6 additions & 0 deletions tools/build.go
Original file line number Diff line number Diff line change
Expand Up @@ -1905,6 +1905,12 @@ func archiveMainFile(output string, prefix string, paths []string, dllPaths []st
if (androidNdkDir != "") {
localProperties += fmt.Sprintf("ndk.dir=%s\n", androidNdkDir)
}
tagVersionStrs := strings.Split(tagFlag, ".")
tagMajorVer, _ := strconv.Atoi(tagVersionStrs[0])
tagMinorVer, _ := strconv.Atoi(tagVersionStrs[1])
tagPatchVer, _ := strconv.Atoi(tagVersionStrs[2])
localProperties += fmt.Sprintf("YASS_VERSION=%d\n", tagMajorVer * 1000000 + tagMinorVer * 1000 + tagPatchVer)
localProperties += fmt.Sprintf("YASS_VERSION_NAME=%s\n", tagFlag)
err = ioutil.WriteFile("local.properties", []byte(localProperties), 0666)
if err != nil {
glog.Fatalf("%v", err)
Expand Down

0 comments on commit cd5520b

Please sign in to comment.