From 6ed285dea145c90af58583113fbc302e52ea92a6 Mon Sep 17 00:00:00 2001 From: HuanChengFly <609486518@qq.com> Date: Sun, 5 Apr 2020 19:04:01 +0800 Subject: [PATCH] =?UTF-8?q?chore(build):=20=E6=9B=B4=E6=94=B9=E4=BA=86?= =?UTF-8?q?=E8=BE=93=E5=87=BA=20apk=20=E7=9A=84=E4=BD=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .circleci/config.yml | 2 +- CHANGELOG.md | 10 ++++++++++ app/build.gradle | 29 ++++++++++++++++------------- application.properties | 2 ++ 4 files changed, 29 insertions(+), 14 deletions(-) create mode 100644 CHANGELOG.md create mode 100644 application.properties diff --git a/.circleci/config.yml b/.circleci/config.yml index 1bd2a03e..e9eafd09 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -34,5 +34,5 @@ jobs: name: Initial build command: ./gradlew clean resguardRelease --no-daemon --stacktrace - store_artifacts: - path: app/build/outputs/apk/ + path: app/release/ destination: apks/ diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 00000000..2761f8f9 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,10 @@ +# Changelog + +All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. + +### 3.8.1 (2020-04-05) + + +### Bug Fixes + +* the good classify does not show ([b811065](https://github.com/HuanCheng65/TiebaLite/commit/b81106521d65e31796bf5a4d7a1ad2a33855a67d)) diff --git a/app/build.gradle b/app/build.gradle index bc8e9a8e..3ac4c6a0 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -16,6 +16,17 @@ buildscript { } } +def keystoreProperties = new Properties() +keystoreProperties.load(new FileInputStream(rootProject.file("keystore.properties"))) +def applicationProperties = new Properties() +applicationProperties.load(new FileInputStream(rootProject.file("application.properties"))) +def SHA1 = System.getenv("CIRCLE_SHA1") +def applicationVersionCode = applicationProperties["versionCode"].toInteger() +def applicationVersionName = applicationProperties["versionName"] +if (SHA1 != null) { + applicationVersionName = applicationVersionName + "-${SHA1.substring(0, 8)}" +} + andResGuard { mappingFile = null use7zip = true @@ -33,23 +44,15 @@ andResGuard { "*.jpeg", "*.gif", "*.webp", + "*.kotlin_metadata", "resources.arsc"] sevenzip { artifact = 'com.tencent.mm:SevenZip:1.2.10' - //path = "C:/Users/xppxu/AndroidStudioProjects/TiebaLite/app/7z/7za.exe" } - - /** - * Optional: if finalApkBackupPath is null, AndResGuard will overwrite final apk - * to the path which assemble[Task] write to*/ - finalApkBackupPath = "${project.rootDir}/app/release/final.apk" + finalApkBackupPath = "${project.rootDir}/app/release/${applicationVersionName}(${applicationVersionCode}).apk" digestalg = "SHA-256" } -def keystorePropertiesFile = rootProject.file("keystore.properties") -def keystoreProperties = new Properties() -keystoreProperties.load(new FileInputStream(keystorePropertiesFile)) - android { signingConfigs { release { @@ -65,10 +68,10 @@ android { applicationId "com.huanchengfly.tieba.post" minSdkVersion 21 targetSdkVersion 29 - versionCode 38006 - versionName "3.8.1 Beta" + versionCode applicationVersionCode + versionName applicationVersionName testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" - project.ext.set("archivesBaseName", versionName.replace(" ", "_") + "(" + versionCode + ")") + project.ext.set("archivesBaseName", "${versionName}(${versionCode})".toString()) } buildTypes { release { diff --git a/application.properties b/application.properties new file mode 100644 index 00000000..350bb09a --- /dev/null +++ b/application.properties @@ -0,0 +1,2 @@ +versionCode=38006 +versionName=3.8.1-beta \ No newline at end of file