Skip to content

Commit 0fac351

Browse files
committed
see 05/31 log
1 parent ddc432f commit 0fac351

File tree

6 files changed

+25
-21
lines changed

6 files changed

+25
-21
lines changed

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,7 @@ class BusTransform extends Transform {
8484
)
8585
FileUtils.copyFile(jar, dest)
8686

87-
if (jarName.startsWith("com.blankj:utilcode:")
88-
|| jarName.startsWith("com.blankj:utilcodex:")
89-
|| jarName.contains("utilcode-lib")) {
87+
if (jarName.contains("utilcode")) {
9088
busScan.busJar = dest
9189
LogUtils.l("bus jar: $jarName [$dest]")
9290
return

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

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@ import com.google.common.base.Preconditions
99
import org.apache.commons.io.FileUtils
1010
import org.gradle.api.Project
1111

12-
import java.util.function.Predicate
13-
1412
class BusTransformAsm extends Transform {
1513

1614
Project mProject;
@@ -36,7 +34,7 @@ class BusTransformAsm extends Transform {
3634

3735
@Override
3836
boolean isIncremental() {
39-
return true
37+
return false
4038
}
4139

4240
@Override
@@ -116,9 +114,7 @@ class BusTransformAsm extends Transform {
116114
)
117115
FileUtils.copyFile(jar, dest)
118116

119-
if (jarName.startsWith("com.blankj:utilcode:")
120-
|| jarName.startsWith("com.blankj:utilcodex:")
121-
|| jarName.contains("utilcode-lib")) {
117+
if (jarName.contains("utilcode")) {
122118
busScan.busJar = dest
123119
LogUtils.l("bus jar: $jarName [$dest]")
124120
return

gradle/config/config.gradle

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import java.text.SimpleDateFormat
2-
31
apply from: "${rootDir.path}/gradle/util/utils.gradle"
42

53
gradle.ext {

utilcode/lib/src/main/java/com/blankj/utilcode/util/BusUtils.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,20 +51,20 @@ public final class BusUtils {
5151
private static final Map<String, Set<Bus>> BUSES_MAP = new HashMap<>();
5252
private static final Set<Sticky> STICKIES = new HashSet<>();
5353

54+
private static Object injectShell(final String name, final Object[] objects) {
55+
return NULL;
56+
}
57+
5458
public static <T> T postStatic(final String name, final Object... objects) {
5559
if (name == null || name.length() == 0) return null;
5660
Object o = injectShell(name, objects);
5761
if (NULL.equals(o)) {
58-
Log.e("BusUtils", "static bus of <" + name + "> didn\'t exist.");
62+
com.blankj.utilcode.util.LogUtils.e("BusUtils", "static bus of <" + name + "> didn\'t exist.");
5963
return null;
6064
}
6165
return (T) o;
6266
}
6367

64-
private static Object injectShell(final String name, final Object[] objects) {
65-
return NULL;
66-
}
67-
6868

6969
public static void register(final Object subscriber) {
7070
if (subscriber == null) return;

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

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public void execute(@NonNull Runnable command) {
3939

4040
@Test
4141
public void test() throws Exception {
42-
ThreadUtils.executeBySingleAtFixRate(new ThreadUtils.SimpleTask<Void>() {
42+
ThreadUtils.Task<Void> task = new ThreadUtils.Task<Void>() {
4343
@Override
4444
public Void doInBackground() throws Throwable {
4545
System.out.println("haha");
@@ -50,7 +50,18 @@ public Void doInBackground() throws Throwable {
5050
public void onSuccess(Void result) {
5151
System.out.println("onSuccess");
5252
}
53-
}, 1, TimeUnit.SECONDS);
53+
54+
@Override
55+
public void onCancel() {
56+
System.out.println("onCancel");
57+
}
58+
59+
@Override
60+
public void onFail(Throwable t) {
61+
System.out.println(t.toString());
62+
}
63+
};
64+
ThreadUtils.executeBySingleAtFixRate(task, 1, 1, TimeUnit.SECONDS);
5465

5566

5667
final CountDownLatch countDownLatch = new CountDownLatch(1);
@@ -85,9 +96,8 @@ public void onSuccess(Void result) {
8596
// ThreadUtils.executeBySingle(task);
8697
//
8798
//// }
88-
// Thread.sleep(100);
89-
// task.cancel();
90-
Thread.sleep(1000000);
99+
Thread.sleep(100);
100+
task.cancel();
91101
countDownLatch.countDown();
92102
countDownLatch.await();
93103

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,8 @@ static class Result<T> {
9393
static class Person {
9494

9595
String name;
96+
int gender;
97+
String address;
9698

9799
Person(String name) {
98100
this.name = name;

0 commit comments

Comments
 (0)