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

Update link command for Android project #20853

Closed
wants to merge 1 commit into from
Closed

Update link command for Android project #20853

wants to merge 1 commit into from

Conversation

matei-radu
Copy link
Contributor

@matei-radu matei-radu commented Aug 25, 2018

Motivation:

PR #20767 bumped the version of the Android Gradle Plugin to v3 which uses the newer Gradle dependency configurations implementation and api which make compile obsolete.

While the PR updated the template Gradle configuration, it did not cover the link command which will still link native modules using compile resulting in a warning message beeing displayed during an app build.

Since compile will be eventually removed by Gradle, this commit updates the link command to attach native modules using implementation.

Test Plan:

Ran the tests on my branch:

screenshot from 2018-08-26 12-37-28

Note: test_android, test_detox_end_to_end and test_objc seem to fail for other reasons discussed in #20854.

then,

  1. Initialized a new RN project using the most recent candidate which is necessary for the project to understand the new implementation dependency configuration keyword
react-native init demoProject --version="0.57.0-rc.3"
  1. Added a RN native module that targets Android as a dependency
yarn add react-native-custom-tabs
  1. Copied the local-cli/link folder from my branch into demoProject/node_modules/react-native/local-cli
  2. Followed the additional step in the module guide (added a repository).
  3. Linked the added module using the local modified react-native
yarn run react-native link react-native-custom-tabs

screenshot from 2018-08-26 12-47-58

  1. Checked that android/app/build.gradle has been patched correctly with implementation.

screenshot from 2018-08-26 12-53-41

  1. Checked that android/settings.gradle and MainApplication.java have been patched as usual.
  2. Built and installed successfully on a physical device without the deprecation warning (ignore the ones in the screenshot as they are related to the custom-tabs module as itself is not using the new configurations).
yarn run react-native run-android

screenshot from 2018-08-26 13-13-18

  1. Unlinked and checked that is was successful.

Related PRs:

Release Notes:

[CLI] [ENHANCEMENT] [local-cli/link] - Updated link to link Android modules as implementation dependencies.

PR #20767 bumped the version of the Android Gradle Plugin to v3 which
uses the newer Gradle dependency configurations `implementation` and
`api` which make `compile` obsolete.

While the PR updated the template Gradle configuration, it did not
cover the `link` command which will still link native modules using
`compile` which will result in a warning message during app build.

Since `compile` will be eventually removed by Gradle, this commit
updates the `link` command to attach native modules using
`implementation`.
@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Aug 25, 2018
@dulmandakh
Copy link
Contributor

@facebook-github-bot shipit

@facebook-github-bot facebook-github-bot added the Import Started This pull request has been imported. This does not imply the PR has been approved. label Sep 8, 2018
Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

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

dulmandakh is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@react-native-bot
Copy link
Collaborator

@matt-block merged commit 4dfdec9 into facebook:master.


Once this commit is added to a release, you will see the corresponding version tag below the description at 4dfdec9. If the commit has a single master tag, it is not yet part of a release.

@facebook facebook locked as resolved and limited conversation to collaborators Sep 8, 2018
@react-native-bot react-native-bot added the Merged This PR has been merged. label Sep 8, 2018
@matei-radu matei-radu deleted the fix/gradle-compile-config-deprecation branch September 8, 2018 11:44
gengjiawen pushed a commit to gengjiawen/react-native that referenced this pull request Sep 14, 2018
Summary:
Motivation:
--------------
PR facebook#20767 bumped the version of the Android Gradle Plugin to v3 which uses the newer Gradle dependency configurations `implementation` and `api` which make `compile` obsolete.

While the PR updated the template Gradle configuration, it did not cover the `link` command which will still link native modules using `compile` resulting in a warning message beeing displayed during an app build.

Since `compile` will be eventually removed by Gradle, this commit updates the `link` command to attach native modules using `implementation`.
Pull Request resolved: facebook#20853

Differential Revision: D9733888

Pulled By: hramos

fbshipit-source-id: 22853480d7ba7be65e3387effda2fd6c72b6906a
grabbou pushed a commit to react-native-community/cli that referenced this pull request Sep 26, 2018
Summary:
Motivation:
--------------
PR #20767 bumped the version of the Android Gradle Plugin to v3 which uses the newer Gradle dependency configurations `implementation` and `api` which make `compile` obsolete.

While the PR updated the template Gradle configuration, it did not cover the `link` command which will still link native modules using `compile` resulting in a warning message beeing displayed during an app build.

Since `compile` will be eventually removed by Gradle, this commit updates the `link` command to attach native modules using `implementation`.
Pull Request resolved: facebook/react-native#20853

Differential Revision: D9733888

Pulled By: hramos

fbshipit-source-id: 22853480d7ba7be65e3387effda2fd6c72b6906a
@hramos hramos removed Import Started This pull request has been imported. This does not imply the PR has been approved. labels Feb 6, 2019
t-nanava pushed a commit to microsoft/react-native-macos that referenced this pull request Jun 17, 2019
Summary:
Motivation:
--------------
PR facebook#20767 bumped the version of the Android Gradle Plugin to v3 which uses the newer Gradle dependency configurations `implementation` and `api` which make `compile` obsolete.

While the PR updated the template Gradle configuration, it did not cover the `link` command which will still link native modules using `compile` resulting in a warning message beeing displayed during an app build.

Since `compile` will be eventually removed by Gradle, this commit updates the `link` command to attach native modules using `implementation`.
Pull Request resolved: facebook#20853

Differential Revision: D9733888

Pulled By: hramos

fbshipit-source-id: 22853480d7ba7be65e3387effda2fd6c72b6906a
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged This PR has been merged. Platform: Android Android applications.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants