-
Notifications
You must be signed in to change notification settings - Fork 182
Expand file tree
/
Copy pathbuild.gradle
More file actions
109 lines (96 loc) · 3.26 KB
/
build.gradle
File metadata and controls
109 lines (96 loc) · 3.26 KB
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
plugins {
id 'com.android.application'
id 'kotlin-android'
}
android {
compileSdk 36
namespace 'com.yuyan'
defaultConfig {
applicationId "com.yuyan.pinyin"
minSdk 23
targetSdk 36
versionCode Integer.valueOf(versionCodeDate())
versionName versionNameDate()
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
ndk {
abiFilters 'arm64-v8a'
}
javaCompileOptions {
annotationProcessorOptions {
arguments = [AROUTER_MODULE_NAME: project.getName()]
}
}
lintOptions {
abortOnError false
}
}
packagingOptions {
jniLibs {
useLegacyPackaging true
}
}
signingConfigs {
release {
def keystorePropertiesFile = rootProject.file("keystore/keystore.properties")
def keystoreProperties = new Properties()
if (keystorePropertiesFile.exists()) {
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
}
def keystoreFilePath = System.getenv("RELEASE_STORE_FILE") ?: keystoreProperties.getProperty('storeFile')
def keystorePassword = System.getenv("RELEASE_STORE_PASSWORD") ?: keystoreProperties.getProperty('storePassword')
def keyAliasName = System.getenv("RELEASE_KEY_ALIAS") ?: keystoreProperties.getProperty('keyAlias')
def keyPasswordValue = System.getenv("RELEASE_KEY_PASSWORD") ?: keystoreProperties.getProperty('keyPassword')
def keystoreFile = rootProject.file(keystoreFilePath)
if (keystoreFile.exists() && keystorePassword && keyAliasName && keyPasswordValue) {
storeFile keystoreFile
storePassword keystorePassword
keyAlias keyAliasName
keyPassword keyPasswordValue
v1SigningEnabled true
v2SigningEnabled true
}
}
}
//多渠道打包
flavorDimensions = ["default"]
productFlavors {
offline {
dimension "default"
applicationIdSuffix ".offline"
}
}
buildTypes {
release {
// 混淆
minifyEnabled true
shrinkResources true
applicationIdSuffix ".release"
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard.cfg'
signingConfig signingConfigs.release
}
debug {
applicationIdSuffix ".debug"
signingConfig signingConfigs.release
}
}
// 第三方库使用java1.8
compileOptions {
sourceCompatibility 17
targetCompatibility 17
}
android.applicationVariants.configureEach { variant ->
variant.outputs.configureEach {
outputFileName = "yuyanIme_${versionCodeDate()}_${variant.buildType.name}.apk"
}
}
}
static def versionCodeDate() {
return new Date().format("yyyyMMddHH", TimeZone.getTimeZone("GMT+8"))
}
static def versionNameDate() {
return new Date().format("yyyyMMdd.HH", TimeZone.getTimeZone("GMT+8"))
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation project(':yuyansdk')
}