Skip to content

Commit ef8236d

Browse files
author
Blankj
committed
see 11/23 log
2 parents f181949 + 3513c74 commit ef8236d

446 files changed

Lines changed: 14930 additions & 7656 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/android.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: Android CI
2+
3+
on: [push]
4+
5+
jobs:
6+
build:
7+
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- uses: actions/checkout@v1
12+
- name: set up JDK 1.8
13+
uses: actions/setup-java@v1
14+
with:
15+
java-version: 1.8
16+
- name: Build with Gradle
17+
run: ./gradlew build

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@ local.properties
1111
/apk
1212
*.phrof
1313
/maven
14+
/reports

CHANGELOG.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,12 @@
1-
* `19/08/25` [upd] ImageUtils#getImageType. [add] LogUtils# Publish v1.25.9.
1+
* `19/11/22` [fix] Adapt the project for Gradle version of 6.0.
2+
* `19/10/30` [add] Publish bus plugin v2.3. Publish api plugin v1.1.
3+
* `19/10/24` [upd] Demo's UI.
4+
* `19/10/22` [add] NotificationUtils.
5+
* `19/10/20` [add] UiMessageUtils.
6+
* `19/09/20` [add] ShadowUtils.
7+
* `19/08/27` [add] DebugUtils.
8+
* `19/08/26` [fix] PermissionUtils NPE.
9+
* `19/08/25` [upd] ImageUtils#getImageType. [add] LogUtils#getLogFiles. Publish v1.25.9.
210
* `19/08/24` [fix] PhoneUtils#getIMEI crash on SDK 29.
311
* `19/08/23` [add] ViewUtils#isLayoutRtl.
412
* `19/08/22` [add] LogUtils#getLogFiles.

README-CN.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242

4343
## 打个小广告
4444

45-
欢迎加入我的知识星球「**[基你太美](https://t.zsxq.com/FmeqfYF)**」,我会在星球中分享 [AucFrame](https://blankj.com/2019/07/22/auc-frame/) 框架、大厂面经、[AndroidUtilCode](https://github.com/Blankj/AndroidUtilCode) 更详尽的说明...一切我所了解的知识,你可以通过支付进入我的星球「**[基你太美](https://t.zsxq.com/FmeqfYF)**」进行体验,加入后优先观看星球中精华的部分,如果觉得星球的内容对自身没有收益,你可以自行申请退款退出星球,也没必要加我好友;**如果你已确定要留在我的星球,可以通过扫描如下二维码(备注:基你太美)加我个人微信,发送给我你的星球 ID,方便我后续拉你进群(PS:进得越早价格越便宜)。**
45+
欢迎加入我的知识星球「**[基你太美](https://t.zsxq.com/FmeqfYF)**」,我会在星球中分享 [AucFrame](https://blankj.com/2019/07/22/auc-frame/) 框架、大厂面经、[AndroidUtilCode](https://github.com/Blankj/AndroidUtilCode) 更详尽的说明...一切我所了解的知识,你可以通过支付进入我的星球「**[基你太美](https://t.zsxq.com/FmeqfYF)**」进行体验,加入后优先观看星球中精华的部分,如果觉得星球的内容对自身没有收益,你可以自行申请退款退出星球,也没必要加我好友;**如果你已确定要留在我的星球,可以通过扫描如下二维码(备注:基你太美+你的星球昵称)加我个人微信,方便我后续拉你进群(PS:进得越早价格越便宜)。**
4646

4747
![我的二维码](https://raw.githubusercontent.com/Blankj/AndroidUtilCode/master/art/wechat.png)
4848

build.gradle

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
// Top-level build file where you can add configuration options common to all sub-projects/modules.
22
buildscript {
3+
ConfigUtils.init(gradle)
34
repositories {
45
// use for debug plugin local
5-
if (Config.depConfig.plugin.bus.useLocal || Config.depConfig.plugin.api.useLocal) {
6+
if (Config.depConfig.plugin_bus.useLocal || Config.depConfig.plugin_api.useLocal) {
67
maven() {
78
url new File("maven")
89
}
@@ -44,6 +45,9 @@ allprojects {
4445
url 'https://maven.aliyun.com/repository/google'
4546
name 'replace google()'
4647
}
48+
maven {
49+
url "https://jitpack.io"
50+
}
4751
google()
4852
jcenter()
4953
}

buildApp.gradle

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,29 @@ apply {
22
plugin "com.android.application"
33
plugin "kotlin-android"
44
plugin "kotlin-android-extensions"
5-
if (Config.depConfig.plugin.bus.isApply) {
6-
plugin "com.blankj.bus"
5+
if (Config.depConfig.plugin_bus.isApply) {
6+
plugin Config.depConfig.plugin_bus.pluginId
77
}
8-
if (Config.depConfig.plugin.api.isApply) {
9-
plugin "com.blankj.api"
8+
if (Config.depConfig.plugin_api.isApply) {
9+
plugin Config.depConfig.plugin_api.pluginId
1010
}
1111
}
1212

1313
configSigning()
1414
configApkName()
1515

16+
bus {
17+
onlyScanLibRegex = '^([:]|(com\\.blankj)).+$'
18+
}
19+
20+
api {
21+
onlyScanLibRegex = '^([:]|(com\\.blankj)).+$'
22+
}
23+
1624
android {
1725
compileSdkVersion Config.compileSdkVersion
1826
defaultConfig {
19-
minSdkVersion 16
27+
minSdkVersion Config.minSdkVersion
2028
versionCode Config.versionCode
2129
versionName Config.versionName
2230
applicationId Config.applicationId + suffix
@@ -56,20 +64,20 @@ android {
5664

5765
dependencies {
5866
// LeakCanary
59-
debugImplementation Config.depConfig.leakcanary.android.dep
60-
debugImplementation Config.depConfig.leakcanary.support_fragment.dep
61-
releaseImplementation Config.depConfig.leakcanary.android_no_op.dep
67+
debugImplementation Config.depConfig.leakcanary_android.dep
68+
debugImplementation Config.depConfig.leakcanary_support_fragment.dep
69+
releaseImplementation Config.depConfig.leakcanary_android_no_op.dep
6270

63-
debugImplementation 'com.didichuxing.doraemonkit:doraemonkit:1.1.8'
64-
releaseImplementation 'com.didichuxing.doraemonkit:doraemonkit-no-op:1.1.8'
71+
debugImplementation Config.depConfig.lib_utildebug.dep
72+
releaseImplementation Config.depConfig.lib_utildebug_no_op.dep
6573

6674
// 根据 Config.pkgConfig 来依赖所有 pkg
6775
for (def entrySet : ConfigUtils.getApplyPkgs().entrySet()) {
6876
api entrySet.value.dep
6977
}
7078

71-
if (Config.depConfig.feature.mock.isApply) {
72-
api Config.depConfig.feature.mock.dep
79+
if (Config.depConfig.feature_mock.isApply) {
80+
api Config.depConfig.feature_mock.dep
7381
}
7482
}
7583

buildLib.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,6 @@ dependencies {
3838
api entrySet.value.dep
3939
}
4040
} else if (project.name == 'export') {
41-
api Config.depConfig.lib.common.dep
41+
api Config.depConfig.lib_common.dep
4242
}
4343
}

buildSrc/src/main/groovy/Config.groovy

Lines changed: 62 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -15,101 +15,74 @@ class Config {
1515
static minSdkVersion = 14
1616

1717
static targetSdkVersion = 28
18-
static versionCode = 1_025_009
19-
static versionName = '1.25.9'// E.g. 1.9.72 => 1,009,072
18+
static versionCode = 1_026_000
19+
static versionName = '1.26.0'// E.g. 1.9.72 => 1,009,072
2020

2121
// lib version
22-
static kotlin_version = '1.3.10'
22+
static kotlin_version = '1.3.50'
2323
static leakcanary_version = '1.6.3'
2424
static androidx_version = '1.0.0'
2525

26-
// appConfig 配置的是可以跑 app 的模块,git 提交务必只包含 launcher
27-
static appConfig = ['launcher']
28-
// pkgConfig 配置的是要依赖的功能包,为空则依赖全部,git 提交务必为空
29-
static pkgConfig = []
30-
3126
static depConfig = [
32-
plugin : [
33-
gradle : new DepConfig("com.android.tools.build:gradle:3.4.2"),
34-
kotlin : new DepConfig("org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"),
35-
maven : new DepConfig("com.github.dcendents:android-maven-gradle-plugin:2.1"),// 上传到 maven
36-
bintray: new DepConfig("com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4"),// 上传到 bintray
37-
traute : new DepConfig("tech.harmonysoft:traute-gradle:1.1.10"),// 注解转非空判断
38-
39-
// 本地第一次上传插件新的版本需设置 useLocal = true, isApply = false
40-
// 本地上传成功之后 isApply = true 即可应用插件来调试,后续版本更新无需设置 isApply = false
41-
// 发布版本的话把 useLocal = false, isApply = false,更新版本号,发布成功后 isApply = true 即可使用远程库版本
42-
api : new DepConfig(false/*是否本地调试*/, "com.blankj:api-gradle-plugin:1.0", true/*是否使用插件*/),
43-
bus : new DepConfig(false/*是否本地调试*/, "com.blankj:bus-gradle-plugin:2.1", true/*是否使用插件*/),
44-
],
45-
46-
api_gradle_plugin: new DepConfig(":plugin:api-gradle-plugin", false),
47-
bus_gradle_plugin: new DepConfig(":plugin:bus-gradle-plugin", false),
48-
49-
feature : [
50-
mock : new DepConfig(":feature:mock"),
51-
52-
launcher: [
53-
app: new DepConfig(":feature:launcher:app")
54-
],
55-
56-
main : [
57-
app: new DepConfig(":feature:main:app"),
58-
pkg: new DepConfig(":feature:main:pkg"),
59-
],
60-
61-
subutil : [
62-
app : new DepConfig(":feature:subutil:app"),
63-
pkg : new DepConfig(":feature:subutil:pkg"),
64-
export: new DepConfig(":feature:subutil:export"),
65-
],
66-
67-
utilcode: [
68-
app : new DepConfig(":feature:utilcode:app"),
69-
pkg : new DepConfig(":feature:utilcode:pkg"),
70-
export: new DepConfig(":feature:utilcode:export"),
71-
],
72-
],
73-
74-
lib : [
75-
base : new DepConfig(":lib:base"),
76-
common : new DepConfig(":lib:common"),
77-
subutil : new DepConfig(":lib:subutil"),
78-
utilcode : new DepConfig(true/*是否本地调试*/, ":lib:utilcode", "com.blankj:utilcode:$versionName"),
79-
utildebug: new DepConfig(true/*是否本地调试*/, ":lib:utildebug", "com.blankj:utildebug:$versionName"),
80-
],
81-
82-
support : [
83-
appcompat : new DepConfig("androidx.appcompat:appcompat:$androidx_version"),
84-
material : new DepConfig("com.google.android.material:material:$androidx_version"),
85-
multidex : new DepConfig("com.android.support:multidex:1.0.2"),
86-
constraint: new DepConfig("com.android.support.constraint:constraint-layout:1.1.3"),
87-
],
88-
89-
kotlin : new DepConfig("org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"),
90-
91-
leakcanary : [
92-
android : new DepConfig("com.squareup.leakcanary:leakcanary-android:$leakcanary_version"),
93-
android_no_op : new DepConfig("com.squareup.leakcanary:leakcanary-android-no-op:$leakcanary_version"),
94-
support_fragment: new DepConfig("com.squareup.leakcanary:leakcanary-support-fragment:$leakcanary_version"),
95-
],
96-
97-
free_proguard : new DepConfig("com.blankj:free-proguard:1.0.1"),
98-
swipe_panel : new DepConfig("com.blankj:swipe-panel:1.1"),
99-
100-
gson : new DepConfig("com.google.code.gson:gson:2.8.2"),
101-
glide : new DepConfig("com.github.bumptech.glide:glide:4.7.1"),
102-
retrofit : new DepConfig("com.squareup.retrofit2:retrofit:2.4.0"),
103-
commons_io : new DepConfig("commons-io:commons-io:2.6"),
104-
eventbus : [
105-
lib : new DepConfig("org.greenrobot:eventbus:3.1.1"),
106-
processor: new DepConfig("org.greenrobot:eventbus-annotation-processor:3.0.1")
107-
],
108-
109-
test : [
110-
junit : new DepConfig("junit:junit:4.12"),
111-
robolectric: new DepConfig("org.robolectric:robolectric:4.2"),
112-
],
27+
/*Never delete this line*/
28+
/*Generated by "config.json"*/
29+
plugin_api_gradle_plugin : new DepConfig(false, true, ":plugin:api-gradle-plugin"),
30+
plugin_bus_gradle_plugin : new DepConfig(false, true, ":plugin:bus-gradle-plugin"),
31+
feature_mock : new DepConfig(false, true, ":feature:mock"),
32+
feature_launcher_app : new DepConfig(true, true, ":feature:launcher:app"),
33+
feature_main_app : new DepConfig(false, true, ":feature:main:app"),
34+
feature_main_pkg : new DepConfig(true, true, ":feature:main:pkg"),
35+
feature_subutil_app : new DepConfig(false, true, ":feature:subutil:app"),
36+
feature_subutil_pkg : new DepConfig(true, true, ":feature:subutil:pkg"),
37+
feature_subutil_export : new DepConfig(true, true, ":feature:subutil:export"),
38+
feature_utilcode_app : new DepConfig(false, true, ":feature:utilcode:app"),
39+
feature_utilcode_pkg : new DepConfig(true, true, ":feature:utilcode:pkg"),
40+
feature_utilcode_export : new DepConfig(true, true, ":feature:utilcode:export"),
41+
lib_base : new DepConfig(true, true, ":lib:base"),
42+
lib_common : new DepConfig(true, true, ":lib:common"),
43+
lib_subutil : new DepConfig(true, true, ":lib:subutil"),
44+
lib_utilcode : new DepConfig(true, true, ":lib:utilcode", "com.blankj:utilcode:1.25.10-alpha5"),
45+
lib_utildebug : new DepConfig(true, true, ":lib:utildebug", "com.blankj:utildebug:1.25.10-alpha5"),
46+
lib_utildebug_no_op : new DepConfig(true, true, ":lib:utildebug-no-op", "com.blankj:utildebug-no-op:1.25.10-alpha5"),
47+
/*Never delete this line*/
48+
plugin_gradle : new DepConfig(pluginPath: "com.android.tools.build:gradle:3.5.2"),
49+
plugin_kotlin : new DepConfig(pluginPath: "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"),
50+
plugin_maven : new DepConfig(pluginPath: "com.github.dcendents:android-maven-gradle-plugin:2.1", pluginId: "com.github.dcendents.android-maven"),// 上传到 maven
51+
plugin_bintray : new DepConfig(pluginPath: "com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4", pluginId: "com.jfrog.bintray"),// 上传到 bintray
52+
plugin_traute : new DepConfig(pluginPath: "tech.harmonysoft:traute-gradle:1.1.10", pluginId: "tech.harmonysoft.oss.traute"),// 注解转非空判断
53+
54+
// 本地第一次上传插件新的版本需设置 useLocal = true, isApply = false
55+
// 本地上传成功之后 isApply = true 即可应用插件来调试,后续版本更新无需设置 isApply = false
56+
// 发布版本的话把 useLocal = false, isApply = false,更新版本号,发布成功后 isApply = true 即可使用远程库版本
57+
plugin_api : new DepConfig(isApply: true, useLocal: false, pluginPath: "com.blankj:api-gradle-plugin:1.1", pluginId: "com.blankj.api"),
58+
plugin_bus : new DepConfig(isApply: true, useLocal: false, pluginPath: "com.blankj:bus-gradle-plugin:2.3", pluginId: "com.blankj.bus"),
59+
60+
support_appcompat : new DepConfig("androidx.appcompat:appcompat:$androidx_version"),
61+
support_material : new DepConfig("com.google.android.material:material:$androidx_version"),
62+
support_multidex : new DepConfig("com.android.support:multidex:1.0.2"),
63+
support_constraint : new DepConfig("com.android.support.constraint:constraint-layout:1.1.3"),
64+
65+
kotlin : new DepConfig("org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"),
66+
67+
leakcanary_android : new DepConfig("com.squareup.leakcanary:leakcanary-android:$leakcanary_version"),
68+
leakcanary_android_no_op : new DepConfig("com.squareup.leakcanary:leakcanary-android-no-op:$leakcanary_version"),
69+
leakcanary_support_fragment: new DepConfig("com.squareup.leakcanary:leakcanary-support-fragment:$leakcanary_version"),
70+
71+
free_proguard : new DepConfig("com.blankj:free-proguard:1.0.1"),
72+
swipe_panel : new DepConfig("com.blankj:swipe-panel:1.2"),
73+
74+
gson : new DepConfig("com.google.code.gson:gson:2.8.6"),
75+
glide : new DepConfig("com.github.bumptech.glide:glide:4.7.1"),
76+
retrofit : new DepConfig("com.squareup.retrofit2:retrofit:2.4.0"),
77+
commons_io : new DepConfig("commons-io:commons-io:2.6"),
78+
79+
eventbus_lib : new DepConfig("org.greenrobot:eventbus:3.1.1"),
80+
eventbus_processor : new DepConfig("org.greenrobot:eventbus-annotation-processor:3.0.1"),
81+
82+
photo_view : new DepConfig("com.github.chrisbanes:PhotoView:2.0.0"),
83+
84+
test_junit : new DepConfig("junit:junit:4.12"),
85+
test_robolectric : new DepConfig("org.robolectric:robolectric:4.2"),
11386
]
11487
}
11588
//./gradlew clean :lib:utilcode:bintrayUpload

0 commit comments

Comments
 (0)