Hmm…! So I’m working on an android gradle plugin and I’m trying perform a custom action that hooks off of the package and compile steps of an android gradle project. I’d like to trigger this action in response to each buildType (e.g., compileRelease, compileDebug, and packageRelease, packageDebug), but I’d also like a local reference to the current buildtype’s configuration properties.
Right now I’m solving this by making a pluginRelease task and pluginDebug task (with the only difference being that one uses android.buildTypes.release.debuggable and the other uses android.buildTypes.debug.debuggable), but this seems brittle it especially won’t work well if the user adds extra build types and flavors.
Does anyone have any suggestions as to a better, less brittle, means of implementing this?