-
Notifications
You must be signed in to change notification settings - Fork 3
/
commonlibsapks.gradle
159 lines (151 loc) · 5.38 KB
/
commonlibsapks.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
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
def config = rootProject.ext //配置
def librarys = config.dependencies //
if (isMIMode.toBoolean()) {
apply plugin: 'com.android.application'
} else {
apply plugin: 'com.android.library'
}
android {
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
dexOptions {
jumboMode = true
}
packagingOptions {
pickFirst 'lib/armeabi/libRSSupport.so'
pickFirst 'lib/armeabi/librsjni_androidx.so'
pickFirst 'lib/armeabi/librsjni.so'
pickFirst 'lib/armeabi-v7a/libRSSupport.so'
pickFirst 'lib/armeabi-v7a/librsjni_androidx.so'
pickFirst 'lib/armeabi-v7a/librsjni.so'
pickFirst 'lib/arm64-v8a/librsjni.so'
pickFirst 'lib/arm64-v8a/libRSSupport.so'
pickFirst 'lib/arm64-v8a/librsjni_androidx.so'
pickFirst 'lib/x86_64/libRSSupport.so'
pickFirst 'lib/x86_64/librsjni_androidx.so'
pickFirst 'lib/x86_64/librsjni.so'
pickFirst 'lib/x86/librsjni_androidx.so'
pickFirst 'lib/x86/libRSSupport.so'
pickFirst 'lib/x86/librsjni.so'
}
compileSdkVersion config.compileSdkVersion
defaultConfig {
minSdkVersion config.minSdkVersion
targetSdkVersion config.targetSdkVersion
versionCode config.appversionCode
versionName config.appversionName
multiDexEnabled true
renderscriptTargetApi 19
renderscriptSupportModeEnabled true
vectorDrawables.useSupportLibrary = true
// javaCompileOptions { annotationProcessorOptions { includeCompileClasspath = true } }
// Cmake
// externalNativeBuild {
// cmake {
// version "3.18.1"
// // 指定一些编译选项
// cppFlags "-std=c++11 -frtti -fexceptions"
// // 也可以使用下面这种语法向变量传递参数:
// // arguments "-D变量名=参数".
// arguments "-DANDROID_ARM_NEON=TRUE",
// // 使用下面这种语法向变量传递多个参数(参数之间使用空格隔开):
// // arguments "-D变量名=参数1 参数2"
// "-DANDROID_CPP_FEATURES=rtti exceptions"
// // 指定ABI
// abiFilters /*"armeabi-v7a" ,*/ "arm64-v8a"
// }
// }
ndk {
abiFilters /*'armeabi', */ /*'armeabi-v7a',*/ 'arm64-v8a'
// abiFilters 'armeabi-v7a'
}
}
sourceSets.main {
// MIM or Not MIM
if (config.isMIMode.toBoolean()) {
manifest.srcFile 'src/main/mi/AndroidManifest.xml'
} else {
manifest.srcFile 'src/main/AndroidManifest.xml'
java {
exclude 'mi/**'
}
}
// jni.srcDirs = []
// //LOCAL_LDFLAGS += -fuse-ld=bfd
// //jni.srcDirs 'src/main/jni'
// jniLibs.srcDir 'src/main/libs'
}
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
}
// CMakeLists.txt
// externalNativeBuild {
// cmake {
//// path "CMakeLists.txt" //
// path "src/main/cpp/CMakeLists.txt"
// version "3.18.1"
// }
// }
flavorDimensions "keep"
productFlavors {
bxnt_nation { dimension "keep" }
bxny_nation { dimension "keep" }
bxn_nation { dimension "keep" }
}
// MIM or Not MIM
if (config.isMIMode.toBoolean()) {
signingConfigs {
release {
storeFile file('./../../releasekey/harmonyandroid.jks')
keyAlias 'harmonyandroid'
keyPassword 'HarmonyAndroid'
storePassword 'HarmonyAndroid'
}
debug {
storeFile file('./../../releasekey/harmonyandroid.jks')
keyAlias 'harmonyandroid'
keyPassword 'HarmonyAndroid'
storePassword 'HarmonyAndroid'
}
}
buildTypes {
release {
minifyEnabled false
// zipAlignEnabled false
// shrinkResources false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.release
}
debug {
minifyEnabled false
// zipAlignEnabled false
// shrinkResources false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.release
}
}
// android.applicationVariants.all { variant ->
// def outputApkName = "yewulibs-demo1-app-${variant.flavorName}-release.apk"
// variant.outputs.all {
// outputFileName = outputApkName
// }
// }
} else {
libraryVariants.all { variant ->
variant.outputs.all {
// outputFileName = "${variant.name}-${variant.versionName}.apk"
outputFileName = "${project.name}_${variant.flavorName}.aar"
}
}
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
}
// TODO Wallet打包
//apply from: './multiple-channel.gradle'