I'm trying to inject a custom task into the normal build chain. Doing things I shouldn't... as usual.
def debugVariants = android.applicationVariants.matching { variant ->
variant.buildType.debuggable
}
debugVariants.each { variant ->
task chatty(dependsOn: variant.dexTask.dependsOn) << {
println "hey"
}
variant.dexTask.dependsOn = chatty
}
* What went wrong:
A problem occurred evaluating project ':foo'.
> Could not find property 'dexTask' on com.android.build.gradle.internal.api.ApplicationVariantImpl_Decorated@1ef05b9b.
Which I find strange because BasePlugin.groovy has this (emphasis added):
// Add a dex task
def dexTaskName = "dex${variantData.name}"
def dexTask = project.tasks.create(dexTaskName, Dex)
variantData.dexTask = dexTask
if (variantData.proguardTask != null) {
dexTask.dependsOn variantData.proguardTask
} else {
dexTask.dependsOn variantData.javaCompileTask
}
Any ideas?
Jake Wharton
http://about.me/jakewharton
--
You received this message because you are subscribed to the Google Groups "adt-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to adt-dev+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
--
You received this message because you are subscribed to the Google Groups "adt-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to adt-dev+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.