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

Load Android Gradle Plugin conditionally #459

Merged
merged 1 commit into from
Jul 6, 2020
Merged

Load Android Gradle Plugin conditionally #459

merged 1 commit into from
Jul 6, 2020

Conversation

SaeedZhiany
Copy link
Contributor

Summary

This wraps the Android Gradle plugin dependency in the buildscripts section of android/build.gradle in a conditional:

if (project == rootProject) {
    // ... (dependency here)
}

The Android Gradle plugin is only required when opening the project stand-alone, not when it is included as a dependency. By doing this, the project opens correctly in Android Studio, and it can also be consumed as a native module dependency from an application project without affecting the app project (avoiding unnecessary downloads/conflicts/etc).

for more info, you can refer to this thread and especially this comment.

Test Plan

Suppose you use this library on a project that has a different AGP version than this library's AGP version and the latter one is not installed on the OS. by this change, the library's AGP will not download during the build process (which it shouldn't be)

What's required for testing (prerequisites)?

An OS that has not installed the Android Gradle Plugin version that this library already using.

What are the steps to reproduce (after prerequisites)?

Just import this library in a project and run it on an Android emulator or a real device

Compatibility

OS Implemented
iOS
Android

Checklist

  • I have tested this on a device and a simulator
  • I added the documentation in README.md
  • I mentioned this change in CHANGELOG.md
  • I updated the typed files (TS and Flow)
  • I added a sample use of the API in the example project (example/App.js)

@SaeedZhiany
Copy link
Contributor Author

@jakub-gonet

Please review and merge this.

Thanks

Copy link
Member

@jakub-gonet jakub-gonet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool, thanks!

@WoLewicki WoLewicki merged commit 6ecf71b into software-mansion:master Jul 6, 2020
@SaeedZhiany SaeedZhiany deleted the patch-1 branch July 6, 2020 13:18
@SaeedZhiany
Copy link
Contributor Author

@jakub-gonet

can you please publish a new version to include this? Thanks

@WoLewicki
Copy link
Member

@SaeedZhiany Do you need it right now?

@SaeedZhiany
Copy link
Contributor Author

Yes, please @WoLewicki

@WoLewicki
Copy link
Member

If you need it in your project, you can use patch-package and make a change with this in your node_modules.

@SaeedZhiany
Copy link
Contributor Author

Thanks, but I prefer not to do it. if it's not possible for you to publish a new version, I get it and I have to wait.

@WoLewicki
Copy link
Member

We would like to add some more commits to master before publishing a new version.

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

Successfully merging this pull request may close these issues.

3 participants