Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
rkoliver311 opened this issue Mar 10, 2023 · 0 comments

Comments

@rkoliver311
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant