From 831d895ae20c915089614cbf8e2495400abb5f14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E6=A8=9F=E5=8F=96?= Date: Sun, 2 Jul 2017 23:18:44 +0800 Subject: [PATCH] * add param project to injector --- .../replugin/gradle/plugin/injector/BaseInjector.groovy | 8 ++++++++ .../replugin/gradle/plugin/injector/IClassInjector.groovy | 6 ++++++ 2 files changed, 14 insertions(+) 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) /** * 注入器名称 */