File tree Expand file tree Collapse file tree 4 files changed +12
-4
lines changed Expand file tree Collapse file tree 4 files changed +12
-4
lines changed Original file line number Diff line number Diff line change 16
16
- uses : actions/checkout@v3
17
17
with :
18
18
submodules : ' recursive'
19
+ fetch-depth : 0
19
20
- name : Setup JDK 17
20
21
uses : actions/setup-java@v3
21
22
with :
Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ val releaseStorePassword: String? by rootProject
26
26
val releaseKeyAlias: String? by rootProject
27
27
val releaseKeyPassword: String? by rootProject
28
28
29
- val appVerCode: String by rootProject
29
+ val appVerCode: Int by rootProject
30
30
val appVerName: String by rootProject
31
31
32
32
val kotlinVersion: String by rootProject
@@ -41,7 +41,7 @@ android {
41
41
applicationId = " me.iacn.biliroaming"
42
42
minSdk = 24
43
43
targetSdk = 33 // Target Android T
44
- versionCode = appVerCode.toInt()
44
+ versionCode = appVerCode
45
45
versionName = appVerName
46
46
47
47
externalNativeBuild {
Original file line number Diff line number Diff line change 1
1
// Top-level build file where you can add configuration options common to all sub-projects/modules.
2
+ import org.eclipse.jgit.api.Git
3
+ import org.eclipse.jgit.internal.storage.file.FileRepository
2
4
3
5
buildscript {
4
6
val kotlinVersion by extra(" 1.7.20" )
@@ -11,12 +13,18 @@ buildscript {
11
13
classpath(" com.android.tools.build:gradle:7.3.1" )
12
14
classpath(" org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion " )
13
15
classpath(" com.google.protobuf:protobuf-gradle-plugin:0.9.1" )
16
+ classpath(" org.eclipse.jgit:org.eclipse.jgit:6.3.0.202209071007-r" )
14
17
15
18
// NOTE: Do not place your application dependencies here; they belong
16
19
// in the individual module build.gradle files
17
20
}
18
21
}
19
22
23
+ val repo = FileRepository (rootProject.file(" .git" ))
24
+ val refId = repo.refDatabase.exactRef(" refs/remotes/origin/master" ).objectId!!
25
+ val commitCount = Git (repo).log().add(refId).call().count()
26
+ val appVerCode by extra(commitCount)
27
+
20
28
allprojects {
21
29
repositories {
22
30
google()
Original file line number Diff line number Diff line change @@ -18,5 +18,4 @@ android.enableR8.fullMode=true
18
18
android.experimental.enableNewResourceShrinker =true
19
19
android.experimental.enableNewResourceShrinker.preciseShrinking =true
20
20
21
- appVerName =1.6.6
22
- appVerCode =66
21
+ appVerName =1.6.7
You can’t perform that action at this time.
0 commit comments