Skip to content

Commit 42b0fa6

Browse files
committed
Modify merge contents of build.gradle into constant definitions
1 parent d0a9554 commit 42b0fa6

4 files changed

Lines changed: 51 additions & 22 deletions

File tree

.secret/key_store_secret.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"keyAlias": "public",
3+
"keyPassword": "123456",
4+
"storeFileName": "universal.p12",
5+
"storePassword": "123456"
6+
}
File renamed without changes.

app/build.gradle

Lines changed: 31 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,51 @@
1+
import groovy.json.JsonSlurper
2+
13
plugins {
24
id 'com.android.application'
3-
id 'kotlin-android'
4-
id 'com.google.devtools.ksp' version '1.8.20-1.0.10'
5+
id 'org.jetbrains.kotlin.android'
6+
id 'com.google.devtools.ksp'
57
}
68

79
android {
8-
compileSdk 33
9-
1010
signingConfigs {
11-
debug {
12-
storeFile file('../keystore/public')
13-
storePassword '123456'
14-
keyAlias 'public'
15-
keyPassword '123456'
11+
universal {
12+
def dirPath = rootProject.ext.app.signingConfigs.secretConfigsDirPath
13+
def fileName = rootProject.ext.app.signingConfigs.secretConfigsFileName
14+
def configs = new JsonSlurper().parse(file("${dirPath}/${fileName}"))
15+
keyAlias configs.keyAlias
16+
keyPassword configs.keyPassword
17+
storeFile file("${dirPath}/${configs.storeFileName}")
18+
storePassword configs.storePassword
1619
v1SigningEnabled true
1720
v2SigningEnabled true
1821
}
1922
}
2023

24+
namespace 'com.fankes.miui.notify'
25+
compileSdk rootProject.ext.android.compileSdk
26+
2127
defaultConfig {
22-
applicationId "com.fankes.miui.notify"
23-
minSdk 28
24-
targetSdk 33
25-
versionCode rootProject.ext.appVersionCode
26-
versionName rootProject.ext.appVersionName
28+
applicationId 'com.fankes.miui.notify'
2729

28-
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
30+
minSdk rootProject.ext.android.minSdk
31+
targetSdk rootProject.ext.android.targetSdk
32+
33+
versionCode rootProject.ext.app.versionCode
34+
versionName rootProject.ext.app.versionName
35+
36+
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
2937
}
3038

3139
buildTypes {
40+
debug {
41+
minifyEnabled false
42+
signingConfig signingConfigs.universal
43+
}
3244
release {
33-
minifyEnabled rootProject.ext.enableR8
34-
shrinkResources rootProject.ext.enableR8
35-
zipAlignEnabled rootProject.ext.enableR8
36-
signingConfig signingConfigs.debug
45+
minifyEnabled true
46+
shrinkResources true
47+
zipAlignEnabled true
48+
signingConfig signingConfigs.universal
3749
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
3850
}
3951
}

build.gradle

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,23 @@ plugins {
22
id 'com.android.application' version '7.4.1' apply false
33
id 'com.android.library' version '7.4.1' apply false
44
id 'org.jetbrains.kotlin.android' version '1.8.20' apply false
5+
id 'com.google.devtools.ksp' version '1.8.20-1.0.10' apply false
56
}
67

78
ext {
8-
appVersionName = "2.95"
9-
appVersionCode = 36
10-
enableR8 = true
9+
android = [
10+
compileSdk: 33,
11+
minSdk : 28,
12+
targetSdk : 33
13+
]
14+
app = [
15+
versionName : '2.95',
16+
versionCode : 36,
17+
signingConfigs: [
18+
secretConfigsDirPath : "${projectDir.getAbsolutePath()}/.secret",
19+
secretConfigsFileName: "key_store_secret.json"
20+
]
21+
]
1122
}
1223

1324
task clean(type: Delete) {

0 commit comments

Comments
 (0)