diff --git a/replugin-plugin-gradle/src/main/groovy/com/qihoo360/replugin/gradle/plugin/injector/BaseInjector.groovy b/replugin-plugin-gradle/src/main/groovy/com/qihoo360/replugin/gradle/plugin/injector/BaseInjector.groovy index fa9a8dd..a755a6f 100644 --- a/replugin-plugin-gradle/src/main/groovy/com/qihoo360/replugin/gradle/plugin/injector/BaseInjector.groovy +++ b/replugin-plugin-gradle/src/main/groovy/com/qihoo360/replugin/gradle/plugin/injector/BaseInjector.groovy @@ -17,13 +17,21 @@ package com.qihoo360.replugin.gradle.plugin.injector +import org.gradle.api.Project + /** * @author RePlugin Team */ public abstract class BaseInjector implements IClassInjector { + protected Project project + @Override public Object name() { return getClass().getSimpleName() } + + public void setProject(Project project) { + this.project = project; + } } diff --git a/replugin-plugin-gradle/src/main/groovy/com/qihoo360/replugin/gradle/plugin/injector/IClassInjector.groovy b/replugin-plugin-gradle/src/main/groovy/com/qihoo360/replugin/gradle/plugin/injector/IClassInjector.groovy index 60ced4d..2b0391b 100644 --- a/replugin-plugin-gradle/src/main/groovy/com/qihoo360/replugin/gradle/plugin/injector/IClassInjector.groovy +++ b/replugin-plugin-gradle/src/main/groovy/com/qihoo360/replugin/gradle/plugin/injector/IClassInjector.groovy @@ -18,12 +18,18 @@ package com.qihoo360.replugin.gradle.plugin.injector import javassist.ClassPool +import org.gradle.api.Project /** * @author RePlugin Team */ interface IClassInjector { + /** + * 设置project对象 + * @param project + */ + void setProject(Project project) /** * 注入器名称 */