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 #2860

Closed
wants to merge 2 commits into from
Closed

Load Android Gradle Plugin conditionally #2860

wants to merge 2 commits into from

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.

Checklist

  • Supports Android
  • Supports iOS
  • e2e tests added or updated in packages/**/e2e
  • Flow types updated
  • Typescript types updated

Test Plan

Release Plan

[INTERNAL] [ENHANCEMENT] [ALL MODULES] - Load Android Gradle Plugin only when the android projects of each module opened as a stand-alone project in Android Studio.

@SaeedZhiany SaeedZhiany changed the title Load agp conditionally Load Android Gradle Plugin conditionally Nov 12, 2019
@codecov
Copy link

codecov bot commented Nov 12, 2019

Codecov Report

Merging #2860 into master will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff           @@
##           master    #2860   +/-   ##
=======================================
  Coverage   88.95%   88.95%           
=======================================
  Files         111      111           
  Lines        3436     3436           
=======================================
  Hits         3056     3056           
  Misses        380      380

@CLAassistant
Copy link

CLAassistant commented Nov 12, 2019

CLA assistant check
All committers have signed the CLA.

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.

2 participants