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

[RNMobile] Upgrade Gradle to 8.2.1 and AGP to 8.1.0 #52872

Merged
Merged
Show file tree
Hide file tree
Changes from 38 commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
cc1ca68
Build: Move android related gradle properties to its own group for aztec
ParaskP7 Jul 19, 2023
eb29afb
Deps: Extract agp version to settings build gradle for aztec
ParaskP7 Jul 19, 2023
22ed356
Deps: Extract publish to s3 version to settings build gradle for aztec
ParaskP7 Jul 19, 2023
3c2cd6f
Deps: Add versions groups to root build gradle for aztec
ParaskP7 Jul 19, 2023
dd97556
Deps: Extract androidx legacy version to root build gradle for aztec
ParaskP7 Jul 19, 2023
2a66c7a
Deps: Extract androidx gridlayout version to root build gradle for aztec
ParaskP7 Jul 19, 2023
0767c4e
Deps: Extract androidx cardview version to root build gradle for aztec
ParaskP7 Jul 19, 2023
d9af77e
Deps: Extract androidx appcompat version to root build gradle for aztec
ParaskP7 Jul 19, 2023
7c2c07b
Deps: Extract androidx recyclerview version to root bld gradle for aztec
ParaskP7 Jul 19, 2023
3569054
Deps: Extract junit version to root build gradle for aztec
ParaskP7 Jul 19, 2023
62ac0b8
Build: Upgrade gradle to 8.1.1 for aztec (1/2)
ParaskP7 Jul 19, 2023
f63df55
Build: Upgrade agp to 8.0.2 for aztec
ParaskP7 Jul 19, 2023
57acd33
Build: Move package from android manifest to build files for aztec
ParaskP7 Jul 19, 2023
ba72061
Build: Upgrade gradle to 8.1.1 for aztec (2/2)
ParaskP7 Jul 19, 2023
c0d9c1a
Build: Migrate dsl properties from lint options to lint for aztec
ParaskP7 Jul 19, 2023
c106962
Build: Upgrade gradle to 8.2.1 for aztec
ParaskP7 Jul 19, 2023
ab9d379
Build: Move android related gradle prop. to its own group for bridge
ParaskP7 Jul 19, 2023
60a411f
Deps: Extract agp version to settings build gradle for bridge
ParaskP7 Jul 19, 2023
9ceb140
Deps: Extract publish to s3 version to settings build gradle for bridge
ParaskP7 Jul 19, 2023
143c768
Deps: Extract facebook fresco react native related version for bridge
ParaskP7 Jul 19, 2023
e60fa86
Deps: Extract google material version to root build gradle for bridge
ParaskP7 Jul 19, 2023
fc5ad2a
Deps: Extract wordpress utils version to root build gradle for bridge
ParaskP7 Jul 19, 2023
ab4ba07
Deps: Extract junit version to root build gradle for bridge
ParaskP7 Jul 19, 2023
61b8972
Build: Upgrade gradle to 8.1.1 for bridge (1/2)
ParaskP7 Jul 19, 2023
565f0b8
Build: Upgrade agp to 8.0.2 for bridge
ParaskP7 Jul 19, 2023
4592d13
Build: Move package from android manifest to build files for bridge
ParaskP7 Jul 19, 2023
41ba3ac
Build: Enable build config build feature for bridge
ParaskP7 Jul 19, 2023
f80c182
Build: Upgrade gradle to 8.1.1 for bridge (2/2)
ParaskP7 Jul 19, 2023
47210b7
Build: Migrate dsl properties from lint options to lint for bridge
ParaskP7 Jul 19, 2023
fb26a88
Build: Upgrade gradle to 8.2.1 for bridge
ParaskP7 Jul 19, 2023
1d6ffba
Build: Upgrade gradle to 8.2.1 for editor
fluiddot Jul 21, 2023
a3ce586
Build: Upgrade agp to 8.0.2 for editor
fluiddot Jul 21, 2023
7f6f343
Build: Move package from android manifest to build files for editor
fluiddot Jul 21, 2023
9469e37
Build: Enable build config build feature for editor
fluiddot Jul 21, 2023
4794892
Patch `react-native-gradle` package
fluiddot Jul 21, 2023
6eba537
Include correct `react-native-aztec` project in bridge
fluiddot Jul 21, 2023
693c0fe
Use newer version of React Native Gradle plugin
fluiddot Jul 24, 2023
bf340a4
Make `else` statement one-line format in editor's `settings.gradle`
fluiddot Jul 24, 2023
66a02f9
Remove aztec project inclusion when publishing bridge binaries
fluiddot Jul 25, 2023
f1738ff
Use Java 17 in Android E2E tests
fluiddot Jul 25, 2023
86c5dc2
Update publish-to-s3 Gradle plugin to 0.8.0
fluiddot Jul 25, 2023
ced1fc9
Revert removing package from AndroidManifest
fluiddot Jul 25, 2023
67ca6bd
Add inline comment to remind updating package name
fluiddot Jul 25, 2023
0cf7e42
Add `.java-version` file to use Java 17
fluiddot Jul 26, 2023
d031dfd
Merge branch 'trunk' into rnmobile/0.69.4-upgrade-gradle-to-8.2.1-and…
fluiddot Jul 28, 2023
1ba4251
Bump Android Gradle Plugin to `8.1.0`
fluiddot Jul 28, 2023
665c586
Remove `react-native-gradle` patch
fluiddot Jul 27, 2023
7fead25
Update `react-native-editor` changelog
fluiddot Jul 28, 2023
6300536
Merge branch 'trunk' into rnmobile/0.69.4-upgrade-gradle-to-8.2.1-and…
fluiddot Jul 28, 2023
0f7ee31
Remove TODO inline comment in `build.gradle`
fluiddot Jul 28, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 24 additions & 8 deletions packages/react-native-aztec/android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,15 +1,28 @@
buildscript {
ext {
// node modules
supportLibVersion = '29.0.2'
tagSoupVersion = '1.2.1'
glideVersion = '3.7.0'
picassoVersion = '2.5.2'
robolectricVersion = '3.5.1'
jUnitVersion = '4.12'
jSoupVersion = '1.10.3'
wordpressUtilsVersion = '3.3.0'
espressoVersion = '3.0.1'

// libs
aztecVersion = 'v1.6.4'
wordpressUtilsVersion = '3.3.0'

// main
androidxAppcompatVersion = '1.2.0'
androidxCardviewVersion = '1.0.0'
androidxGridlayoutVersion = '1.0.0'
androidxLegacyVersion = '1.0.0'
androidxRecyclerviewVersion = '1.1.0'

// test
junitAztecVersion = '4.13' // TODO: Align 'junit' versions.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@ParaskP7 should be this version aligned with WordPress-Android or AztecEditor-Android?

Copy link
Contributor

Choose a reason for hiding this comment

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

Just checking whether this question was answered in another thread, or is it still outstanding? If it's correct that we should use the WordPress-Android version, should we remove the TODO?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nope, it hasn't been answered yet. I assume aligning the versions is not critical and only a matter of keeping version consistency across libraries. In any case, I'll let @ParaskP7 and @oguzkocer share insights about this. In the meantime, I'll remove the TODO. If we need to follow up on this, we could do it in a GitHub issue.

}
}

Expand All @@ -34,6 +47,8 @@ List<String> dirs = [
'template'] // boilerplate code that is generated by the sample template process

android {
namespace "org.wordpress.mobile.ReactNativeAztec"

compileSdkVersion 33

defaultConfig {
Expand All @@ -59,7 +74,7 @@ android {
androidTest.java.srcDirs = ['tests/src']
}

lintOptions {
lint {
disable 'GradleCompatible'
abortOnError false
}
Expand Down Expand Up @@ -91,12 +106,13 @@ dependencies {
api "org.wordpress.aztec:glide-loader:$aztecVersion"
implementation "org.wordpress:utils:$wordpressUtilsVersion"

implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.gridlayout:gridlayout:1.0.0'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.recyclerview:recyclerview:1.1.0'
testImplementation 'junit:junit:4.13'
implementation "androidx.legacy:legacy-support-v4:$androidxLegacyVersion"
implementation "androidx.gridlayout:gridlayout:$androidxGridlayoutVersion"
implementation "androidx.cardview:cardview:$androidxCardviewVersion"
implementation "androidx.appcompat:appcompat:$androidxAppcompatVersion"
implementation "androidx.recyclerview:recyclerview:$androidxRecyclerviewVersion"

testImplementation "junit:junit:$junitAztecVersion"

def rnVersion = readReactNativeVersion('../../../package.json', 'devDependencies')
println "react-native version for react-native-aztec: $rnVersion"
Expand Down
9 changes: 8 additions & 1 deletion packages/react-native-aztec/android/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Project-wide Gradle settings.

org.gradle.jvmargs=-Xmx2g -XX:+HeapDumpOnOutOfMemoryError

# React Native Aztec properties.

android.useAndroidX=true
android.enableJetifier=false
shouldPublishBinary=false

# React Native Aztec publishing settings.

shouldPublishBinary=false
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-all.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
24 changes: 16 additions & 8 deletions packages/react-native-aztec/android/gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
Expand All @@ -80,13 +80,10 @@ do
esac
done

APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit

APP_NAME="Gradle"
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
Expand Down Expand Up @@ -133,22 +130,29 @@ location of your Java installation."
fi
else
JAVACMD=java
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
if ! command -v java >/dev/null 2>&1
then
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.

Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
fi

# Increase the maximum file descriptors if we can.
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
Expand Down Expand Up @@ -193,6 +197,10 @@ if "$cygwin" || "$msys" ; then
done
fi


# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
Expand Down
15 changes: 9 additions & 6 deletions packages/react-native-aztec/android/gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
@rem limitations under the License.
@rem

@if "%DEBUG%" == "" @echo off
@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
Expand All @@ -25,7 +25,8 @@
if "%OS%"=="Windows_NT" setlocal

set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
if "%DIRNAME%"=="" set DIRNAME=.
@rem This is normally unused
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%

Expand All @@ -40,7 +41,7 @@ if defined JAVA_HOME goto findJavaFromJavaHome

set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto execute
if %ERRORLEVEL% equ 0 goto execute

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Expand Down Expand Up @@ -75,13 +76,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar

:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
if %ERRORLEVEL% equ 0 goto mainEnd

:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
set EXIT_CODE=%ERRORLEVEL%
if %EXIT_CODE% equ 0 set EXIT_CODE=1
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
exit /b %EXIT_CODE%

:mainEnd
if "%OS%"=="Windows_NT" endlocal
Expand Down
6 changes: 4 additions & 2 deletions packages/react-native-aztec/android/settings.gradle
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
pluginManagement {
gradle.ext.kotlinVersion = '1.6.10'
gradle.ext.agpVersion = '8.0.2'
gradle.ext.automatticPublishToS3Version = '0.7.0'

plugins {
id "com.android.library" version "7.2.1"
id "com.android.library" version gradle.ext.agpVersion
id "org.jetbrains.kotlin.android" version gradle.ext.kotlinVersion
id "com.automattic.android.publish-to-s3" version "0.7.0"
id "com.automattic.android.publish-to-s3" version gradle.ext.automatticPublishToS3Version
}
repositories {
maven {
Expand Down
20 changes: 0 additions & 20 deletions packages/react-native-aztec/android/src/main/AndroidManifest.xml

This file was deleted.

6 changes: 5 additions & 1 deletion packages/react-native-bridge/android/gradle.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# Project-wide Gradle settings.

org.gradle.jvmargs=-Xmx2g -XX:+HeapDumpOnOutOfMemoryError

# React Native Bridge properties.

android.useAndroidX=true
android.enableJetifier=false

Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.2.1-all.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
24 changes: 16 additions & 8 deletions packages/react-native-bridge/android/gradlew
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
# within the Gradle project.
#
# You can find Gradle at https://github.com/gradle/gradle/.
Expand All @@ -80,13 +80,10 @@ do
esac
done

APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit

APP_NAME="Gradle"
# This is normally unused
# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}

# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit

# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
Expand Down Expand Up @@ -133,22 +130,29 @@ location of your Java installation."
fi
else
JAVACMD=java
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
if ! command -v java >/dev/null 2>&1
then
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.

Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
fi

# Increase the maximum file descriptors if we can.
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
case $MAX_FD in #(
max*)
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
MAX_FD=$( ulimit -H -n ) ||
warn "Could not query maximum file descriptor limit"
esac
case $MAX_FD in #(
'' | soft) :;; #(
*)
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
# shellcheck disable=SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
Expand Down Expand Up @@ -193,6 +197,10 @@ if "$cygwin" || "$msys" ; then
done
fi


# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'

# Collect all arguments for the java command;
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
# shell script including quotes and variable substitutions, so put them in
Expand Down
Loading
Loading