If Gradle applies the TestFairy plugin before the Android Application plugin the TestFairy plugin fails to create any tasks.
Even if the Android Application plugin appears before the TestFairy plugin:
plugins {
'com.android.application'
'testfairy'
}
a plugin developer cannot assume that the Android Application plugin will be applied before the TestFairy plugin. The PluginManager interface provides a mechanism for delaying apply logic until the necessary plugins have also been applied:
class TestFairyPlugin implements Plugin<Project> {
@Override
void apply(Project project) {
// create an extension where the apiKey and such settings reside
def extension = project.extensions.create("testfairyConfig", TestFairyExtension, project)
project.pluginManager.withPlugin("com.android.application") {
// ...
}
}
The closure provided to PluginManager.withPlugin() will be executed once the specified plugin ("com.android.application") is applied.
Thanks.
If Gradle applies the TestFairy plugin before the Android Application plugin the TestFairy plugin fails to create any tasks.
Even if the Android Application plugin appears before the TestFairy plugin:
a plugin developer cannot assume that the Android Application plugin will be applied before the TestFairy plugin. The
PluginManagerinterface provides a mechanism for delaying apply logic until the necessary plugins have also been applied:The closure provided to
PluginManager.withPlugin()will be executed once the specified plugin ("com.android.application") is applied.Thanks.