Skip to content

Commit

Permalink
反射注入方式改成AnnotationProcessor方式注入
Browse files Browse the repository at this point in the history
  • Loading branch information
yuzhijun committed Jun 22, 2017
1 parent 05234de commit 910e435
Show file tree
Hide file tree
Showing 55 changed files with 524 additions and 444 deletions.
2 changes: 2 additions & 0 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,6 @@ dependencies {
compile project(':bussiness-module-b')
compile project(':basemodel')
compile project(':rxlrouter-api')
compile project(':lrouter-annotation')
annotationProcessor project(':lrouter-compiler')
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.lenovohit.lrouter;

import com.lenovohit.lrouter_api.annotation.ioc.Interceptor;
import com.lenovohit.annotation.Interceptor;
import com.lenovohit.lrouter_api.intercept.AopInterceptor;

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.lenovohit.lrouter;

import com.lenovohit.lrouter_api.annotation.ioc.Interceptor;
import com.lenovohit.annotation.Interceptor;
import com.lenovohit.lrouter_api.intercept.AopInterceptor;

/**
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/com/lenovohit/lrouter/MainAction.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import android.content.Context;
import android.text.TextUtils;

import com.lenovohit.lrouter_api.annotation.ioc.Action;
import com.lenovohit.annotation.Action;
import com.lenovohit.lrouter_api.core.LRAction;
import com.lenovohit.lrouter_api.core.LRActionResult;
import com.lenovohit.lrouter_api.core.LRouterRequest;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.lenovohit.lrouter;

import com.lenovohit.lrouter_api.annotation.ioc.Application;
import com.lenovohit.annotation.Application;
import com.lenovohit.lrouter_api.base.AnologyApplication;

/**
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/com/lenovohit/lrouter/MainProvider.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.lenovohit.lrouter;

import com.lenovohit.lrouter_api.annotation.ioc.Provider;
import com.lenovohit.annotation.Provider;
import com.lenovohit.lrouter_api.core.LRAction;
import com.lenovohit.lrouter_api.core.LRProvider;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.lenovohit.lrouter;

import com.lenovohit.lrouter_api.annotation.ioc.Service;
import com.lenovohit.annotation.Service;
import com.lenovohit.lrouter_api.core.LocalRouterService;

/**
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/java/com/lenovohit/lrouter/SocketAction.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.lenovohit.lrouter;

import com.lenovohit.lrouter_api.annotation.ioc.Action;
import com.lenovohit.annotation.Action;
import com.lenovohit.lrouter_api.core.socket.server.LRSocketAction;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import android.content.Intent;

import com.lenovohit.lrouter_api.annotation.ioc.IntentInterceptor;
import com.lenovohit.annotation.IntentInterceptor;
import com.lenovohit.lrouter_api.intercept.StartupInterceptor;

/**
Expand Down
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ buildscript {
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.2'
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.2'
classpath 'com.github.dcendents:android-maven-gradle-plugin:1.5'
// NOTE: Do not place your application dependencies here; they belong
Expand Down
2 changes: 2 additions & 0 deletions bussiness-module-a/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,6 @@ dependencies {
//module依赖路由module
compile project(':lrouter-api')
compile project(':basemodel')
compile project(':lrouter-annotation')
annotationProcessor project(':lrouter-compiler')
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.lenovohit.bussiness_module_a;

import com.lenovohit.lrouter_api.annotation.ioc.Service;
import com.lenovohit.annotation.Service;
import com.lenovohit.lrouter_api.core.LocalRouterService;

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.lenovohit.bussiness_module_a;

import com.lenovohit.lrouter_api.annotation.ioc.Application;
import com.lenovohit.annotation.Application;
import com.lenovohit.lrouter_api.base.AnologyApplication;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import android.content.Context;
import android.text.TextUtils;

import com.lenovohit.lrouter_api.annotation.ioc.Action;
import com.lenovohit.annotation.Action;
import com.lenovohit.lrouter_api.core.LRAction;
import com.lenovohit.lrouter_api.core.LRActionResult;
import com.lenovohit.lrouter_api.core.LRouterRequest;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.lenovohit.bussiness_module_a;

import com.lenovohit.lrouter_api.annotation.ioc.Provider;
import com.lenovohit.annotation.Provider;
import com.lenovohit.lrouter_api.core.LRAction;
import com.lenovohit.lrouter_api.core.LRProvider;

Expand Down
2 changes: 2 additions & 0 deletions bussiness-module-b/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,6 @@ dependencies {
testCompile 'junit:junit:4.12'
compile project(':lrouter-api')
compile project(':basemodel')
compile project(':lrouter-annotation')
annotationProcessor project(':lrouter-compiler')
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.lenovohit.bussiness_module_b;

import com.lenovohit.lrouter_api.annotation.ioc.Application;
import com.lenovohit.annotation.Application;
import com.lenovohit.lrouter_api.base.AnologyApplication;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import android.content.Context;
import android.text.TextUtils;

import com.lenovohit.annotation.Action;
import com.lenovohit.basemodel.User;
import com.lenovohit.lrouter_api.annotation.ioc.Action;
import com.lenovohit.lrouter_api.core.LRAction;
import com.lenovohit.lrouter_api.core.LRActionResult;
import com.lenovohit.lrouter_api.core.LRouterRequest;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.lenovohit.bussiness_module_b;

import com.lenovohit.lrouter_api.annotation.ioc.Provider;
import com.lenovohit.annotation.Provider;
import com.lenovohit.lrouter_api.core.LRAction;
import com.lenovohit.lrouter_api.core.LRProvider;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.lenovohit.bussiness_module_b;

import com.lenovohit.lrouter_api.annotation.ioc.Service;
import com.lenovohit.annotation.Service;
import com.lenovohit.lrouter_api.core.LocalRouterService;

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package com.lenovohit.bussiness_module_b;

import com.lenovohit.lrouter_api.annotation.ioc.Action;
import com.lenovohit.annotation.Action;
import com.lenovohit.lrouter_api.core.socket.server.LRSocketAction;

/**
Expand Down
1 change: 1 addition & 0 deletions lrouter-annotation/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
8 changes: 8 additions & 0 deletions lrouter-annotation/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
apply plugin: 'java'

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
}

sourceCompatibility = "1.7"
targetCompatibility = "1.7"
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.lenovohit.lrouter_api.annotation.ioc;
package com.lenovohit.annotation;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
Expand All @@ -8,8 +8,9 @@
/**
* Created by yuzhijun on 2017/6/2.
*/
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)

@Target({ElementType.TYPE})
@Retention(RetentionPolicy.CLASS)
public @interface Action {
String name();
String provider();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.lenovohit.lrouter_api.annotation.ioc;
package com.lenovohit.annotation;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
Expand All @@ -9,7 +9,7 @@
* Created by yuzhijun on 2017/6/2.
*/
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
@Retention(RetentionPolicy.CLASS)
public @interface Application {
String name();
int priority();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.lenovohit.lrouter_api.annotation.ioc;
package com.lenovohit.annotation;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
Expand All @@ -9,6 +9,6 @@
* Created by yuzhijun on 2017/6/12.
*/
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
@Retention(RetentionPolicy.CLASS)
public @interface IntentInterceptor {
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.lenovohit.lrouter_api.annotation.ioc;
package com.lenovohit.annotation;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
Expand All @@ -9,6 +9,6 @@
* Created by yuzhijun on 2017/6/5.
*/
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
@Retention(RetentionPolicy.CLASS)
public @interface Interceptor {
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.lenovohit.lrouter_api.annotation.ioc;
package com.lenovohit.annotation;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
Expand All @@ -10,7 +10,7 @@
* Created by yuzhijun on 2017/6/2.
*/
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
@Retention(RetentionPolicy.CLASS)
public @interface Provider {
String name();
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.lenovohit.lrouter_api.annotation.ioc;
package com.lenovohit.annotation;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
Expand All @@ -9,7 +9,7 @@
* Created by yuzhijun on 2017/6/2.
*/
@Target(ElementType.TYPE)
@Retention(RetentionPolicy.RUNTIME)
@Retention(RetentionPolicy.CLASS)
public @interface Service {
String name();
}
1 change: 1 addition & 0 deletions lrouter-api/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile 'com.android.support:appcompat-v7:25.1.0'
compile 'org.aspectj:aspectjrt:1.8.1'
compile project(':lrouter-annotation')
}

android.libraryVariants.all { variant ->
Expand Down
Loading

0 comments on commit 910e435

Please sign in to comment.