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

android build: Upgrade Gradle to 6.5.1 #4228

Closed
wants to merge 1 commit into from
Closed

android build: Upgrade Gradle to 6.5.1 #4228

wants to merge 1 commit into from

Conversation

darkshredder
Copy link

@darkshredder darkshredder changed the title android build: Upgrade Gradle to 6.5.1, the latest. android build: Upgrade Gradle to 6.5.1 Aug 14, 2020
@chrisbobbe
Copy link
Contributor

Thanks for the PR! For it to be more complete, could you please take note, in the commit message, of any large or breaking changes that might affect us, or make a note that says you haven't found any?

Also, at the top of that file is a command that looks like it's meant to be run from the android directory to upgrade Gradle; looks like Greg added it in 3dce40d. Is this PR the result of running that command? 🙂

@darkshredder
Copy link
Author

darkshredder commented Aug 27, 2020

I haven’t found any thing that will affect us but I have found benefits like it add supports to newer versions of JDK as in its documentation . And yeah it will upgrade the gradle as a result of that command . @chrisbobbe

@chrisbobbe
Copy link
Contributor

chrisbobbe commented Aug 27, 2020

And yeah it will upgrade the gradle as a result of that command

I'm not asking whether that command will upgrade Gradle or not 😉.

The suggestion was introduced, with the comment "How to upgrade Gradle:", in 3dce40d. Looking at some commits indicated in that commit message—6dcb57357 and a1c9f1b—it looks like the suggested command, in its current form, is basically what the release notes recommend, plus a flag that helps us do the recommended thing without having to go through a banner in Android Studio.

We should do what's been accepted as the correct thing to do, or provide a reason not to (with an update to the suggestion).

I see a few other changes that happen when I run that command:

diff --git android/gradlew android/gradlew
index b0d6d0ab5..8e25e6c19 100755
--- android/gradlew
+++ android/gradlew
@@ -7,7 +7,7 @@
 # you may not use this file except in compliance with the License.
 # You may obtain a copy of the License at
 #
-#      http://www.apache.org/licenses/LICENSE-2.0
+#      https://www.apache.org/licenses/LICENSE-2.0
 #
 # Unless required by applicable law or agreed to in writing, software
 # distributed under the License is distributed on an "AS IS" BASIS,
diff --git android/gradlew.bat android/gradlew.bat
index 15e1ee37a..24467a141 100644
--- android/gradlew.bat
+++ android/gradlew.bat
@@ -5,7 +5,7 @@
 @rem you may not use this file except in compliance with the License.
 @rem You may obtain a copy of the License at
 @rem
-@rem      http://www.apache.org/licenses/LICENSE-2.0
+@rem      https://www.apache.org/licenses/LICENSE-2.0^M
 @rem
 @rem Unless required by applicable law or agreed to in writing, software
 @rem distributed under the License is distributed on an "AS IS" BASIS,

These look pretty tiny and not very important. Still, I see no reason not to include them.

Hmm, but I've recently been working on a Gradle upgrade (just to v6.0.1, though) to go along with the React Native v0.61 -> v0.62 upgrade (#3782). React Native updates Gradle in the template app multiple times, in smaller increments. I find that when they do it, the changes pretty much match what happens if you run our suggested command (with one exception where they obviously added some comments in manually, in the same commit). And in one of these upgrades (facebook/react-native@b1c954b1f), there are some more of these automated changes, but they look more important (and I replicate these automatic changes if I try the same upgrade):

diff --git gradlew gradlew
index 8e25e6c19..83f2acfdc 100755
--- gradlew
+++ gradlew
@@ -125,8 +125,8 @@ if $darwin; then
     GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
 fi
 
-# For Cygwin, switch paths to Windows format before running java
-if $cygwin ; then
+# For Cygwin or MSYS, switch paths to Windows format before running java
+if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
     APP_HOME=`cygpath --path --mixed "$APP_HOME"`
     CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
     JAVACMD=`cygpath --unix "$JAVACMD"`

If you like, you can see the list of React Native commits where they update Gradle with this command, run in a clone of the react-native repo:

git log --stat -p v0.61.5..v0.62.2 --full-diff -- template/android/gradle/wrapper/gradle-wrapper.properties

(or git log --oneline, to get the output below)

701e66bde bump gradle to 6.0.1 (#27290)
928f4434b Update Gradle wrapper to 5.6.4 (#27092)
ff6b2ff32 Update Gradle wrapper to 5.6.3 (#26915)
b1c954b1f Update Gradle wrapper to 5.6.2 (#26349)
be2a2529a Update Gradle wrapper to 5.6 (#26079)

@chrisbobbe
Copy link
Contributor

chrisbobbe commented Aug 27, 2020

Hmm, but I've recently been working on a Gradle upgrade (just to v6.0.1, though) to go along with the React Native v0.61 -> v0.62 upgrade (#3782).

Since I've already been working on replicating React Native's more incremental approach (getting us to v6.0.1), and with a bit more detail, I think I'll see it through until the dust settles from the RN v0.62 upgrade, and close this in the meantime. Once #3782 is resolved, though, please feel free to open a new PR to get us all the way to v6.5.1. 🙂

@chrisbobbe chrisbobbe closed this Aug 27, 2020
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.

None yet

2 participants