From cbae2631d35456e9b4ba58f25f62ebeaf5485fda Mon Sep 17 00:00:00 2001 From: LoveSy Date: Sun, 23 Oct 2022 23:54:33 +0800 Subject: [PATCH] [skip ci] Bump 1.6.7 --- .github/workflows/android.yml | 1 + app/build.gradle.kts | 4 ++-- build.gradle.kts | 8 ++++++++ gradle.properties | 3 +-- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/.github/workflows/android.yml b/.github/workflows/android.yml index 750a624f22..d231107a7f 100644 --- a/.github/workflows/android.yml +++ b/.github/workflows/android.yml @@ -16,6 +16,7 @@ jobs: - uses: actions/checkout@v3 with: submodules: 'recursive' + fetch-depth: 0 - name: Setup JDK 17 uses: actions/setup-java@v3 with: diff --git a/app/build.gradle.kts b/app/build.gradle.kts index b72bab4865..6949a0753e 100644 --- a/app/build.gradle.kts +++ b/app/build.gradle.kts @@ -26,7 +26,7 @@ val releaseStorePassword: String? by rootProject val releaseKeyAlias: String? by rootProject val releaseKeyPassword: String? by rootProject -val appVerCode: String by rootProject +val appVerCode: Int by rootProject val appVerName: String by rootProject val kotlinVersion: String by rootProject @@ -41,7 +41,7 @@ android { applicationId = "me.iacn.biliroaming" minSdk = 24 targetSdk = 33 // Target Android T - versionCode = appVerCode.toInt() + versionCode = appVerCode versionName = appVerName externalNativeBuild { diff --git a/build.gradle.kts b/build.gradle.kts index e03fd733d9..e287316bac 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,4 +1,6 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. +import org.eclipse.jgit.api.Git +import org.eclipse.jgit.internal.storage.file.FileRepository buildscript { val kotlinVersion by extra("1.7.20") @@ -11,12 +13,18 @@ buildscript { classpath("com.android.tools.build:gradle:7.3.1") classpath("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion") classpath("com.google.protobuf:protobuf-gradle-plugin:0.9.1") + classpath("org.eclipse.jgit:org.eclipse.jgit:6.3.0.202209071007-r") // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files } } +val repo = FileRepository(rootProject.file(".git")) +val refId = repo.refDatabase.exactRef("refs/remotes/origin/master").objectId!! +val commitCount = Git(repo).log().add(refId).call().count() +val appVerCode by extra(commitCount) + allprojects { repositories { google() diff --git a/gradle.properties b/gradle.properties index 66a2a4671c..a92c3b8983 100644 --- a/gradle.properties +++ b/gradle.properties @@ -18,5 +18,4 @@ android.enableR8.fullMode=true android.experimental.enableNewResourceShrinker=true android.experimental.enableNewResourceShrinker.preciseShrinking=true -appVerName=1.6.6 -appVerCode=66 +appVerName=1.6.7