-
Notifications
You must be signed in to change notification settings - Fork 691
/
Copy pathbuild.gradle
128 lines (121 loc) · 4.43 KB
/
build.gradle
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
apply plugin: 'com.android.application'
def getGitCommitHash() {
return providers.exec {
commandLine 'git', 'rev-parse', '--short', 'HEAD'
}.standardOutput.asText.get().trim()
}
android {
signingConfigs {
debug {
storeFile file('..\\keystore\\GoGoGo.jks')
storePassword 'GoGoGo'
keyAlias 'GoGoKey'
keyPassword 'GoGoGo'
}
release {
storeFile file('..\\keystore\\GoGoGo.jks')
storePassword 'GoGoGo'
keyAlias 'GoGoKey'
keyPassword 'GoGoGo'
}
}
ndkVersion '26.2.11394342'
compileSdk 32
buildToolsVersion = '34.0.0'
defaultConfig {
applicationId "com.zcshou.gogogo"
minSdkVersion 27
//noinspection ExpiredTargetSdkVersion
targetSdkVersion 32
versionCode 1121
versionName '1.12.1-' + getGitCommitHash()
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
resConfigs 'zh', 'zh-rCN', 'en', 'en-rUS'
ndk {
//noinspection ChromeOsAbiSupport
abiFilters "arm64-v8a"
}
signingConfig signingConfigs.release
}
buildTypes {
release {
// Enables code shrinking, obfuscation, and optimization for only
// your project's release build type.
minifyEnabled true
// Enables resource shrinking, which is performed by the
// Android Gradle plugin.
shrinkResources true
// Includes the default ProGuard rules files that are packaged with
// the Android Gradle plugin. To learn more, go to the section about
// R8 configuration files.
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.release
multiDexEnabled true
}
debug {
signingConfig signingConfigs.debug
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_11
targetCompatibility JavaVersion.VERSION_11
}
packagingOptions {
jniLibs {
excludes += ['lib/armeabi/**']
}
resources {
excludes += ['lib/armeabi/**']
}
}
sourceSets {
main {
jniLibs.srcDirs = ['libs']
}
}
dependenciesInfo {
includeInApk false
includeInBundle false
}
namespace 'com.zcshou.gogogo'
// lintOptions {
// checkReleaseBuilds false
// // Or, if you prefer, you can continue to check for errors in release builds,
// // but continue the build even when errors are found:
// abortOnError false
// }
// 指定输出的可执行程序的名字
applicationVariants.configureEach { variant ->
variant.outputs.configureEach { output ->
def outputFile = output.outputFile
if (outputFile != null && outputFile.name.endsWith('.apk')) {
def fileName
if (variant.buildType.name == 'release') {
fileName = "Go_${defaultConfig.versionName}_arm64-v8a_release.apk"
} else {
fileName = "Go_${defaultConfig.versionName}_arm64-v8a_debug.apk"
}
outputFileName=fileName
}
}
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
// AppCompat 1.5.1 开始显式依赖于 Lifecycle 2.5.1 和 SavedState 1.2.0
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.5.1'
implementation 'androidx.appcompat:appcompat:1.5.1'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'androidx.preference:preference:1.2.1'
implementation 'com.google.android.material:material:1.7.0'
implementation 'com.squareup.okhttp3:okhttp:4.12.0'
implementation 'com.elvishew:xlog:1.11.1'
implementation 'io.noties.markwon:core:4.6.2'
implementation files('libs/BaiduLBS_Android.jar')
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'androidx.test:runner:1.6.2'
androidTestImplementation('androidx.test.espresso:espresso-core:3.5.1', {
exclude group: 'com.android.support', module: 'support-annotations'
})
}