Skip to content

Commit e8f4c74

Browse files
committed
see 11/30 log
1 parent 240020b commit e8f4c74

File tree

13 files changed

+35
-19
lines changed

13 files changed

+35
-19
lines changed

buildApp.gradle

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,16 @@ apply {
1313
configSigning()
1414
configApkName()
1515

16-
bus {
17-
onlyScanLibRegex = '^([:]|(com\\.blankj)).+$'
16+
if (Config.depConfig.plugin_bus.isApply) {
17+
bus {
18+
onlyScanLibRegex = '^([:]|(com\\.blankj)).+$'
19+
}
1820
}
1921

20-
api {
21-
onlyScanLibRegex = '^([:]|(com\\.blankj)).+$'
22+
if (Config.depConfig.plugin_api.isApply) {
23+
api {
24+
onlyScanLibRegex = '^([:]|(com\\.blankj)).+$'
25+
}
2226
}
2327

2428
android {

buildSrc/src/main/groovy/Config.groovy

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ class Config {
2525
static depConfig = [
2626
/*Never delete this line*/
2727
/*Generated by "config.json"*/
28-
plugin_api_gradle_plugin : new DepConfig(false, true, ":plugin:api-gradle-plugin"),
29-
plugin_bus_gradle_plugin : new DepConfig(false, true, ":plugin:bus-gradle-plugin"),
28+
plugin_api_gradle_plugin : new DepConfig(true, true, ":plugin:api-gradle-plugin"),
29+
plugin_bus_gradle_plugin : new DepConfig(true, true, ":plugin:bus-gradle-plugin"),
3030
feature_mock : new DepConfig(false, true, ":feature:mock"),
3131
feature_launcher_app : new DepConfig(true, true, ":feature:launcher:app"),
3232
feature_main_app : new DepConfig(false, true, ":feature:main:app"),
@@ -44,17 +44,17 @@ class Config {
4444
lib_utildebug : new DepConfig(true, true, ":lib:utildebug", "com.blankj:utildebug:1.25.10-alpha5"),
4545
lib_utildebug_no_op : new DepConfig(true, true, ":lib:utildebug-no-op", "com.blankj:utildebug-no-op:1.25.10-alpha5"),
4646
/*Never delete this line*/
47-
plugin_gradle : new DepConfig(pluginPath: "com.android.tools.build:gradle:3.4.2"),
47+
plugin_gradle : new DepConfig(pluginPath: "com.android.tools.build:gradle:3.5.2"),
4848
plugin_kotlin : new DepConfig(pluginPath: "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"),
4949
plugin_maven : new DepConfig(pluginPath: "com.github.dcendents:android-maven-gradle-plugin:2.1", pluginId: "com.github.dcendents.android-maven"),// 上传到 maven
5050
plugin_bintray : new DepConfig(pluginPath: "com.jfrog.bintray.gradle:gradle-bintray-plugin:1.8.4", pluginId: "com.jfrog.bintray"),// 上传到 bintray
5151
plugin_traute : new DepConfig(pluginPath: "tech.harmonysoft:traute-gradle:1.1.10", pluginId: "tech.harmonysoft.oss.traute"),// 注解转非空判断
5252

53-
// 本地第一次上传插件新的版本需设置 useLocal = true, isApply = false
53+
// 本地第一次上传插件新的版本需设置 isApply = false, useLocal = true
5454
// 本地上传成功之后 isApply = true 即可应用插件来调试,后续版本更新无需设置 isApply = false
55-
// 发布版本的话把 useLocal = false, isApply = false,更新版本号,发布成功后 isApply = true 即可使用远程库版本
56-
plugin_api : new DepConfig(isApply: true, useLocal: false, pluginPath: "com.blankj:api-gradle-plugin:1.1", pluginId: "com.blankj.api"),
57-
plugin_bus : new DepConfig(isApply: true, useLocal: false, pluginPath: "com.blankj:bus-gradle-plugin:2.3", pluginId: "com.blankj.bus"),
55+
// 发布版本的话把 isApply = false, useLocal = false,更新版本号,发布成功后 isApply = true 即可使用远程库版本
56+
plugin_api : new DepConfig(isApply: true, useLocal: false, pluginPath: "com.blankj:api-gradle-plugin:1.2", pluginId: "com.blankj.api"),
57+
plugin_bus : new DepConfig(isApply: false, useLocal: false, pluginPath: "com.blankj:bus-gradle-plugin:2.4", pluginId: "com.blankj.bus"),
5858

5959
support_appcompat_v7 : new DepConfig("com.android.support:appcompat-v7:$support_version"),
6060
support_design : new DepConfig("com.android.support:design:$support_version"),

buildSrc/src/main/groovy/ConfigUtils.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ class ConfigUtils {
7474
static getApplyPlugins() {
7575
def plugins = [:]
7676
for (Map.Entry<String, DepConfig> entry : Config.depConfig.entrySet()) {
77-
if (entry.value.isApply && entry.key.startsWith("plugin_")) {
77+
if (entry.value.isApply && entry.value.pluginPath != null) {
7878
plugins.put(entry.key, entry.value)
7979
}
8080
}

buildSrc/src/main/groovy/DepConfig.groovy

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,11 @@ class DepConfig {
5050
this.remotePath = remotePath
5151
}
5252

53+
void setPluginPath(String pluginPath){
54+
this.pluginPath = pluginPath
55+
this.remotePath = pluginPath
56+
}
57+
5358
String getPath() {
5459
if (pluginPath != null) return pluginPath
5560
return useLocal ? localPath : remotePath

config.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
"pkgConfig": [],
66
"proConfigDesc": "proConfig 配置的是使用本地还是仓库,优先级低于 appConfig 和 pkgConfig",
77
"proConfig": [
8-
{"isApply": false, "useLocal": true, "localPath": ":plugin:api-gradle-plugin"},
9-
{"isApply": false, "useLocal": true, "localPath": ":plugin:bus-gradle-plugin"},
8+
{"isApply": true, "useLocal": true, "localPath": ":plugin:api-gradle-plugin"},
9+
{"isApply": true, "useLocal": true, "localPath": ":plugin:bus-gradle-plugin"},
1010
{"isApply": true, "useLocal": true, "localPath": ":feature:mock"},
1111
{"isApply": true, "useLocal": true, "localPath": ":feature:launcher:app"},
1212
{"isApply": true, "useLocal": true, "localPath": ":feature:main:app"},

lib/utilcode/src/test/java/com/blankj/utilcode/util/BaseTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,5 @@ public void execute(@NonNull Runnable command) {
4040
@Test
4141
public void test() throws Exception {
4242
}
43+
4344
}

plugin/api-gradle-plugin/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Change Log
22

3+
## v1.2
4+
去除 gradle 版本依赖的问题
5+
36
## v1.1(2019/10/30)
47
新增 onlyScanLibRegex, jumpScanLibRegex 的 DSL
58

plugin/api-gradle-plugin/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
buildscript {
2929
dependencies {
3030
...
31-
classpath 'com.blankj:api-gradle-plugin:1.1'
31+
classpath 'com.blankj:api-gradle-plugin:1.2'
3232
}
3333
}
3434
```

plugin/api-gradle-plugin/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ gradlePlugin {
2424
}
2525

2626
dependencies {
27-
implementation Config.depConfig.plugin_gradle.dep
27+
compileOnly Config.depConfig.plugin_gradle.dep
2828
implementation Config.depConfig.commons_io.dep
2929
implementation gradleApi()
3030
implementation localGroovy()

plugin/bus-gradle-plugin/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Change Log
22

3+
## v2.4
4+
去除 gradle 版本依赖的问题
5+
36
## v2.3
47
新增 onlyScanLibRegex, jumpScanLibRegex 的 DSL
58

plugin/bus-gradle-plugin/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
buildscript {
2020
dependencies {
2121
...
22-
classpath 'com.blankj:bus-gradle-plugin:2.3'
22+
classpath 'com.blankj:bus-gradle-plugin:2.4'
2323
}
2424
}
2525
```

plugin/bus-gradle-plugin/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ gradlePlugin {
2424
}
2525

2626
dependencies {
27-
implementation Config.depConfig.plugin_gradle.dep
27+
compileOnly Config.depConfig.plugin_gradle.dep
2828
implementation Config.depConfig.commons_io.dep
2929
implementation gradleApi()
3030
implementation localGroovy()

plugin/bus-gradle-plugin/src/main/java/com/blankj/bus/BusPlugin.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class BusPlugin implements Plugin<Project> {
1212
void apply(Project project) {
1313
if (project.plugins.hasPlugin(AppPlugin)) {
1414
LogUtils.init(project)
15-
LogUtils.l('project(' + project.toString() + ') apply api gradle plugin!')
15+
LogUtils.l('project(' + project.toString() + ') apply bus gradle plugin!')
1616
project.extensions.create(Config.EXT_NAME, BusExtension)
1717
def android = project.extensions.getByType(AppExtension)
1818
android.registerTransform(new BusTransform(project))

0 commit comments

Comments
 (0)