-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.gradle
165 lines (142 loc) · 6.28 KB
/
config.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
160
161
162
163
164
165
Properties properties = new Properties()
properties.load(new FileInputStream(file('local.properties')))
ext {
//android version
android = [
applicationId : "com.tz.basicsmvp",
versionCode : 1,
versionName : "1.0.01",
compileSdkVersion: 27,
buildToolsVersion: '28.0.3',
minSdkVersion : 17,
targetSdkVersion : 28,
]
//all dependencies version
dependVersion = [
supportLib : "27.1.1",
androidxconstrLib: "1.1.3",
retrofitLib : "2.3.0",
glideLib : "4.7.1",
rxJavaLib : "2.1.5",
rxAndroidLib : "2.0.1",
okhttpLib : "3.4.1",
flexboxLib : "0.3.1",
aspectjLib : "1.8.9",
blankjLib : "1.23.7",
permiLib : "2.0.1",
]
//android support will be deprecated ,Recommended use of androidx
androidAndSupportD = [
// supportv4 : "com.android.support:support-v4:$dependVersion.supportLib",
// design : "com.android.support:design:$dependVersion.supportLib",
annotations : 'androidx.annotation:annotation:1.0.2',
cardview : 'androidx.cardview:cardview:1.0.0',
recyclerview : 'androidx.recyclerview:recyclerview:1.1.0-beta01',
androidxappc : "androidx.appcompat:appcompat:1.0.2",
androidxconstr: "androidx.constraintlayout:constraintlayout:$dependVersion.androidxconstrLib",
]
netWorksD = [
retrofit : "com.squareup.retrofit2:retrofit:$dependVersion.retrofitLib",
retrofitGson : "com.squareup.retrofit2:converter-gson:$dependVersion.retrofitLib",
retrofitRxjava2: "com.squareup.retrofit2:adapter-rxjava2:$dependVersion.retrofitLib",
okhttp3 : "com.squareup.okhttp3:logging-interceptor:$dependVersion.okhttpLib",
rxJava : "io.reactivex.rxjava2:rxjava:$dependVersion.rxJavaLib",
rxAndroid : "io.reactivex.rxjava2:rxandroid:$dependVersion.rxAndroidLib",
glide : "com.github.bumptech.glide:glide:$dependVersion.glideLib",
glideCompiler : "com.github.bumptech.glide:compiler:$dependVersion.glideLib",
glideOkhttp : "com.github.bumptech.glide:okhttp3-integration:$dependVersion.glideLib",
]
// multidex : 'com.android.support:multidex:1.0.0',
// greendao : "org.greenrobot:greendao:3.2.0",
// greendao : "org.greenrobot:greendao:3.2.2",
// aspectj : "org.aspectj:aspectjrt:$dependVersion.aspectjLib", //AOP
othersD = [
flexbox : "com.google.android:flexbox:$dependVersion.flexboxLib", //google 开源布局库
ktxId : "androidx.core:core-ktx:1.0.1", //kotlin 扩展
blankj : "com.blankj:utilcodex:$dependVersion.blankjLib",
permi : "com.yanzhenjie.permission:x:$dependVersion.permiLib",
adapter : "com.github.CymChad:BaseRecyclerViewAdapterHelper:2.9.47",
eventbus : "org.greenrobot:eventbus:3.0.0",
logdot : "com.tzlog.dotlib:TzLogDotLib:1.0.66@aar",
smartswipe: "com.billy.android:smart-swipe:1.0.4",
smartdraw : "com.wuyr:arrowdrawable:1.0.1",
sak : 'com.wanjian:sak:2.0.2',
picker : 'com.contrarywind:Android-PickerView:4.1.8'
]
androidxAddress = androidAndSupportD.values()
netAddress = netWorksD.values()
otherAddress = othersD.values()
//微信
WechatAppId = getAppId("wechat")
WechatAppKey = getAppKey("wechat")
//QQ
QQAppId = getAppId("QQ")
QQAppKey = getAppKey("QQ")
//微博
WeiboAppId = getAppId("weibo")
WeiboAppKey = getAppKey("weibo")
//友盟统计 appkey
UmengAppId = getAppId("Umeng")
//友盟推送 pushSecret
UmengAppKey = getAppKey("Umeng")
//应用图标
AppIcon = AppIcon()
//应用名称
AppName = AppName()
AppNavLogo = AppNavLogo()
releaseSigningStoreFile = properties['release.signing.storeFile']
releaseSigningStorePassword = properties['release.signing.storePassword']
releaseSigningKeyAlias = properties['release.signing.keyAlias']
releaseSigningKeyPassword = properties['release.signing.keyPassword']
debugSigningStoreFile = properties['debug.signing.storeFile']
//for package
//test 测试包专用渠道,alpha 内部透明版,grey灰度版本,beat 公测版,母包 _GAIA_
defaultChannel = '_GAIA_'
//用于同渠道同版本,不同审核包,
// (如果某渠道,某版本,因为某个原因被下架,但是已经有一部分用户因为灰度下载到了本版本,为了不让这一部分用户被影响,再次打审核包的时候,packageCode+1,
packageCode = 1
}
static HashMap<String, String> getOtherMVPMaps(int type) {
//TODO something
return []
}
static HashMap<String, String> getTestMVPMaps(int type) {
//TODO something
return []
}
static HashMap<String, String> getBasicMVPMaps(int type) {
if (type == 1) {
//各种 第三方 申请 的 id, {dianxin-电信 yidong-移动 AppName-应用图标 AppIcon-应用icon}
return [wechat: "wxc****123", QQ: "123***123", Umeng: "um****132"]
} else if (type == 2) {
//各种 第三方 申请 的 key {gaode-高德地图}
return [wechat: "", QQ: "", Umeng: ""]
} else {
// 应用名, 应用图标,主页顶部正中间logo, 如果还有别的需要加,添加到此map 里面即可
return [AppName: "@string/app_name", AppIcon: "@mipmap/ic_launcher", AppNavLogo: "app_nav_logo"]
}
}
HashMap getAppMap(int type) {
if (rootProject.ext.android.applicationId == "com.tz.basicsmvp") {
return getBasicMVPMaps(type)
} else if (rootProject.ext.android.applicationId == "com.tz.other") {
return getOtherMVPMaps(type)
} else {
return getTestMVPMaps(type)
}
}
String getAppId(String app) {
return getAppMap(1)[app]
}
String getAppKey(String app) {
return getAppMap(2)[app]
}
String AppIcon() {
return getAppMap(3)["AppIcon"]
}
String AppNavLogo() {
return getAppMap(3)["AppNavLogo"]
}
String AppName() {
return getAppMap(3)["AppName"]
}