Skip to content
This repository has been archived by the owner on Sep 15, 2024. It is now read-only.

Commit

Permalink
chore: update version naming scheme
Browse files Browse the repository at this point in the history
  • Loading branch information
mkx173 committed Apr 14, 2024
1 parent 3eb17d9 commit 555b88b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
9 changes: 7 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ plugins {
}

def gitCommitCount = Integer.parseInt('git rev-list --count HEAD'.execute([], project.rootDir).text.trim())
def latestTag = String.valueOf('git describe --abbrev=0 --tags'.execute([], project.rootDir).text.trim())
def commitCountSinceLatestTag = String.valueOf(('git rev-list --count ' + latestTag + '..HEAD').execute([], project.rootDir).text.trim())
def sdk = 34

android {
Expand All @@ -17,7 +19,10 @@ android {
minSdk 28
targetSdk sdk
versionCode gitCommitCount
versionName '2.9.8'
versionName '2.9.9-beta'
if (versionName.contains('beta')) {
versionNameSuffix = '.' + commitCountSinceLatestTag
}
buildConfigField "String", "TARGET_VERSION", "\"12.59.0.3\""
buildConfigField "String", "MIN_VERSION", "\"12.53.1.0\""

Expand All @@ -31,7 +36,7 @@ android {
}
applicationVariants.all { variant ->
variant.outputs.all { output ->
outputFileName = "TS_${defaultConfig.versionName}_${defaultConfig.versionCode}-${variant.buildType.name}.apk"
outputFileName = "TS_${defaultConfig.versionName}${defaultConfig.versionNameSuffix ?: ''}_${variant.buildType.name}.apk"
}
}
buildTypes {
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/java/gm/tieba/tabswitch/hooker/TSPreference.java
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ private void proxyPage(final Activity activity, final NavigationBar navigationBa
private void startRootPreferenceActivity(final Activity activity) {
if (!Preferences.getIsEULAAccepted()) {
final StringBuilder stringBuilder = new StringBuilder().append(Constants.getStrings().get("EULA"));
if (BuildConfig.VERSION_NAME.contains("alpha") || BuildConfig.VERSION_NAME.contains("beta")) {
if (BuildConfig.VERSION_NAME.contains("beta")) {
stringBuilder.append("\n\n").append(Constants.getStrings().get("dev_tip"));
}
AlertDialog alert = new AlertDialog.Builder(activity, DisplayUtils.isLightMode(getContext()) ?
Expand Down Expand Up @@ -275,7 +275,7 @@ private LinearLayout createRootPreference(final Activity activity) {
intent.setData(Uri.parse("https://t.me/TabSwitch"));
activity.startActivity(intent);
}));
preferenceLayout.addView(TSPreferenceHelper.createButton("版本", String.format(Locale.CHINA, "%s_%d", BuildConfig.VERSION_NAME, BuildConfig.VERSION_CODE), true, v -> {
preferenceLayout.addView(TSPreferenceHelper.createButton("版本", String.format(Locale.CHINA, "%s", BuildConfig.VERSION_NAME), true, v -> {
final Intent intent = new Intent();
intent.setAction("android.intent.action.VIEW");
intent.setData(Uri.parse("https://github.com/GuhDoy/TiebaTS/releases"));
Expand Down

0 comments on commit 555b88b

Please sign in to comment.