Skip to content

Update android build.gradle template setup #135

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

Merged
merged 1 commit into from
Sep 19, 2019

Conversation

friederbluemle
Copy link
Contributor

@friederbluemle friederbluemle commented Sep 18, 2019

This wraps the buildscripts section in the generated build.gradle file in a conditional, avoiding unnecessary downloads of/conflicts with different Android Gradle plugin distributions in application projects.

Please check facebook/react-native#25569 for a related discussion, specifically this comment: facebook/react-native#25569 (comment)

The commit also includes some minor indentation fixes in the same file.

Closes #129

Once approved, please use a normal GitHub merge (i.e. NO rebase/squash merge) to integrate the commit(s) from the PR head branch. The changes are broken up into meaningful, atomic commits, and my branch should already be up-to-date with the latest base branch. If it isn't, or if you want me to change anything, please let me know, and I will update the branch as soon as possible. Thank you!

@friederbluemle
Copy link
Contributor Author

I think the tests are failing.. How do I regenerate the test fixtures @brodybits?

@brody4hire
Copy link
Owner

I think the tests are failing.. How do I regenerate the test fixtures @brodybits?

do npx jest -u or yarn jest -u

and I have some feedback coming up

thanks @friederbluemle for the nice contribution!

@friederbluemle
Copy link
Contributor Author

Thanks @brodybits - Updated and rebased.

Copy link
Owner

@brody4hire brody4hire left a comment

Choose a reason for hiding this comment

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

Really nice, overall

I think there are some changes that should be in separate PRs, which I have already raised. I would be happy to merge the separate PRs in order to help unblock this proposal.

I also raised some comments on some items that I don't really understand here.

@friederbluemle I would also really appreciate it if you would update the title and probably the commit message to better describe the actual change. The purpose is to help people like myself, evidently not a Maven or Gradle expert, to understand what the change does and why.

I will now respond to the recent comments from @friederbluemle.

maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
// Matches recent template from React Native 0.59 / 0.60
Copy link
Owner

Choose a reason for hiding this comment

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

Why remove the comments here?

// https://github.com/facebook/react-native/blob/0.59-stable/template/android/build.gradle#L30
// https://github.com/facebook/react-native/blob/0.60-stable/template/android/build.gradle#L28
url "$projectDir/../node_modules/react-native/android"
url "$rootDir/../node_modules/react-native/android"
Copy link
Owner

Choose a reason for hiding this comment

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

additional comment would be nice for people like me who evidently don't understand Gradle and Maven so well

Copy link
Contributor Author

Choose a reason for hiding this comment

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

These changes are taken from the official RN template. I did not make any modification, since this is the file that will end up in an end user's generated project. I did not see any comments or reasons for this to be different here. If additional documentation/comments are necessary I'd suggest we go to the source (react-native) first to update it there.

}
mavenCentral()
google()
Copy link
Owner

Choose a reason for hiding this comment

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

Looks like there is some reordering. Explanation would be helpful for people like me.

@friederbluemle
Copy link
Contributor Author

@brodybits - As you requested, I lowered the Android Gradle plugin version to 3.4.1 again. We can make the update separately. What do you suggest as a PR title and commit message subject line?

This wraps the buildscripts dependencies in a conditional.

More information here:
facebook/react-native#25569 (comment)
@friederbluemle
Copy link
Contributor Author

Resolved conflicts and rebased.

Copy link
Owner

@brody4hire brody4hire left a comment

Choose a reason for hiding this comment

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

I would appreciate it if we could fix a few more things before merging:

One step further may be for you to open a new, clean PR with your proposed solution, after I have finished testing and merging PR #139.

I am sorry for all of this holdup, I just want to get this update as clean and understandable as possible for the sake of people like myself.

Copy link
Owner

@brody4hire brody4hire left a comment

Choose a reason for hiding this comment

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

I just tested the following cases:

  • generate a view module with example using [email protected] (default) & run the example on Android
  • generate a non-view module with example using [email protected] (default) & run the example on Android
  • generate a non-view module with example using react-native@latest (0.60) & run the example on Android
  • generate a non-view module with example using react-native@next (0.61-rc) & run the example on Android

followup items will be tracked in a new issue, merging now

thanks again to @friederbluemle for the nice work!

@brody4hire brody4hire merged commit 453bc19 into brody4hire:dev Sep 19, 2019
@brody4hire
Copy link
Owner

I just published version 0.11.0 with this update included.

I think some followup fixes will be needed, will raise one or more issues for the tracking purposes.

/cc @SaeedZhiany

@SaeedZhiany
Copy link
Contributor

Wonderful update!
Thanks, @friederbluemle, and @brodybits.

I think some followup fixes will be needed

What kind of followup is needed?

@brody4hire
Copy link
Owner

What kind of followup is needed?

see #143

brody4hire pushed a commit that referenced this pull request Sep 22, 2019
as a followup to updates from PR #135
brody4hire pushed a commit that referenced this pull request Nov 15, 2019
as a followup to updates from PR #135

* move the other recommended references

* remove react-native template reference no longer needed
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