Skip to content

Commit be26d30

Browse files
committed
[anno] [add missing junit dependency & DIcomponent]
1 parent 3e1af2c commit be26d30

File tree

28 files changed

+341
-4
lines changed

28 files changed

+341
-4
lines changed

app/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ android {
2727
dependencies {
2828
compile project(':componentservice')
2929

30-
annotationProcessor project(':router-anno-compiler')
30+
// annotationProcessor project(':router-anno-compiler')
3131
}
3232

3333
combuild {

app/gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ org.gradle.jvmargs=-Xmx1536m
1313
# org.gradle.parallel=true
1414
isRunAlone=true
1515
debugComponent=readercomponent,com.mrzhang.share:sharecomponent
16-
compileComponent=readercomponent,sharecomponent,jsoncomponent
16+
compileComponent=readercomponent,sharecomponent,jsoncomponent,dicomponent
1717

1818

basicres/build.gradle

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,8 @@ android {
2525

2626
dependencies {
2727
compile project(':basiclib')
28+
testCompile 'junit:junit:4.12'
29+
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
30+
exclude group: 'com.android.support', module: 'support-annotations'
31+
})
2832
}

componentlib/build.gradle

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,11 @@ android {
2727
dependencies {
2828
compile fileTree(dir: 'libs', include: ['*.jar'])
2929
compile 'com.android.support:appcompat-v7:26.+'
30+
31+
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
32+
exclude group: 'com.android.support', module: 'support-annotations'
33+
})
34+
testCompile 'junit:junit:4.12'
3035
}
3136

3237

componentlib/src/main/java/com/mrzhang/component/componentlib/router/Router.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
import java.util.HashMap;
99

1010
/**
11+
* Center router, works for component-dynamic-load/remove and services add/remove/get
1112
* Created by mrzhang on 2017/6/15.
1213
*/
13-
1414
public class Router {
1515

1616
private HashMap<String, Object> services = new HashMap<>();
@@ -33,6 +33,7 @@ public static Router getInstance() {
3333
return instance;
3434
}
3535

36+
3637
public synchronized void addService(String serviceName, Object serviceImpl) {
3738
if (serviceName == null || serviceImpl == null) {
3839
return;
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
package com.mrzhang.component.componentlib.router;
2+
3+
/**
4+
* <p><b>Package:</b> com.mrzhang.component.componentlib.router </p>
5+
* <p><b>Project:</b> DDComponentForAndroid </p>
6+
* <p><b>Classname:</b> RouterConstants </p>
7+
* <p><b>Description:</b> TODO </p>
8+
* Created by leobert on 2017/9/18.
9+
*/
10+
11+
public class RouterConstants {
12+
public static final String SDK_NAME = "Router";
13+
public static final String TAG = SDK_NAME + "::";
14+
public static final String SEPARATOR = "$$";
15+
public static final String SUFFIX_ROOT = "Root";
16+
public static final String SUFFIX_INTERCEPTORS = "Interceptors";
17+
public static final String SUFFIX_PROVIDERS = "Providers";
18+
public static final String SUFFIX_AUTOWIRED = SEPARATOR + SDK_NAME + SEPARATOR + "Autowired";
19+
public static final String DOT = ".";
20+
21+
// public static final String ROUTE_ROOT_PAKCAGE = "com.alibaba.android.arouter.routes";
22+
//
23+
// public static final String AROUTER_SP_CACHE_KEY = "SP_AROUTER_CACHE";
24+
// public static final String AROUTER_SP_KEY_MAP = "ROUTER_MAP";
25+
//
26+
// public static final String LAST_VERSION_NAME = "LAST_VERSION_NAME";
27+
// public static final String LAST_VERSION_CODE = "LAST_VERSION_CODE";
28+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package com.mrzhang.component.componentlib.router.facade;
2+
3+
/**
4+
* <p><b>Package:</b> com.mrzhang.component.componentlib.router.facade </p>
5+
* <p><b>Project:</b> DDComponentForAndroid </p>
6+
* <p><b>Classname:</b> ISyringe </p>
7+
* <p><b>Description:</b> TODO </p>
8+
* Created by leobert on 2017/9/18.
9+
*/
10+
11+
public interface ISyringe {
12+
void inject(Object self);
13+
}

componentservice/build.gradle

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,9 @@ dependencies {
2525
compile project(':componentlib')
2626
compile project(':basicres')
2727
compile fileTree(dir: 'libs', include: ['*.jar'])
28+
29+
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
30+
exclude group: 'com.android.support', module: 'support-annotations'
31+
})
32+
testCompile 'junit:junit:4.12'
2833
}
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
package com.mrzhang.componentservice.di;
2+
3+
/**
4+
* <p><b>Package:</b> com.mrzhang.componentservice.di </p>
5+
* <p><b>Project:</b> DDComponentForAndroid </p>
6+
* <p><b>Classname:</b> AutowiredService </p>
7+
* <p><b>Description:</b> Autowired Dependency inject </p>
8+
* Created by leobert on 2017/9/18.
9+
*/
10+
11+
public interface AutowiredService {
12+
13+
/**
14+
* Autowired core.
15+
* @param instance the instance who need autowired.
16+
*/
17+
void autowire(Object instance);
18+
}

dicomponent/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/build

0 commit comments

Comments
 (0)