android - Gradle plugin, running tasks twice during build -
i'm trying extend functionality of gradle android plugin. point is, need run same tasks twice on 1 build (in fact whole chain of tasks till connectedinstrumenttest), , couldn't manage how using gradle, decided write own plugin extention existing android plugin. so, i'm trying use functionality of android plugin in my, using such groovy code:
void apply(project project) { project.plugins.apply(javaplugin.class) project.plugins.apply(androidplugin.class) this.project = project this.logger = project.logger androidplugin = new androidplugin() a.apply(project)
but, trying compile it, error:
import com.jvoegele.gradle.plugins.android.androidplugin
i'm using such build.gradle compile plugin:
buildscript { repositories { mavencentral() } dependencies { classpath 'com.android.tools.build:gradle:0.4.2' } } apply plugin: 'groovy' dependencies { compile gradleapi() compile localgroovy() }
also, i'm first time using groovy, have difficulties overriding methods. tried this, doesn't seem work:
metamethod proces = androidpackagetask.metaclass.pickmethod("process") proces = { println("ggggggg") }
so, can tell wrong compiling plugin, or how use tasks twice during 1 build?
it isn't possible run task twice in same build. can create 2 tasks same type , configuration (note multiple tasks can configured in 1 go), or (as last resort) launch 2 embedded builds (task type gradlebuild
) share build script.
Comments
Post a Comment