Skip to content

TestFairy tasks are not created if plugin is applied before Android Application plugin #70

@rkoliver311

Description

@rkoliver311

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions