Skip to content

Commit da10fe9

Browse files
coolsoftwaretylerdominicstop
authored andcommitted
chore: upgrade example-expo to SDK 52
1 parent 1a10a67 commit da10fe9

File tree

30 files changed

+3382
-3598
lines changed

30 files changed

+3382
-3598
lines changed

example-expo/.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,4 +79,5 @@ lib/
7979

8080
# React Native Codegen
8181
ios/generated
82-
android/generated
82+
android/generated
83+
expo-env.d.ts

example-expo/android/app/build.gradle

Lines changed: 11 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -4,27 +4,6 @@ apply plugin: "com.facebook.react"
44

55
def projectRoot = rootDir.getAbsoluteFile().getParentFile().getAbsolutePath()
66

7-
static def versionToNumber(major, minor, patch) {
8-
return patch * 100 + minor * 10000 + major * 1000000
9-
}
10-
11-
def getRNVersion() {
12-
def version = providers.exec {
13-
workingDir(projectDir)
14-
commandLine("node", "-e", "console.log(require('react-native/package.json').version);")
15-
}.standardOutput.asText.get().trim()
16-
17-
def coreVersion = version.split("-")[0]
18-
def (major, minor, patch) = coreVersion.tokenize('.').collect { it.toInteger() }
19-
20-
return versionToNumber(
21-
major,
22-
minor,
23-
patch
24-
)
25-
}
26-
def rnVersion = getRNVersion()
27-
287
/**
298
* This is the configuration block to customize your React Native Android app.
309
* By default you don't need to apply any configuration, just uncomment the lines you need.
@@ -41,12 +20,12 @@ react {
4120
bundleCommand = "export:embed"
4221

4322
/* Folders */
44-
// The root of your project, i.e. where "package.json" lives. Default is '..'
45-
// root = file("../")
46-
// The folder where the react-native NPM package is. Default is ../node_modules/react-native
47-
// reactNativeDir = file("../node_modules/react-native")
48-
// The folder where the react-native Codegen package is. Default is ../node_modules/@react-native/codegen
49-
// codegenDir = file("../node_modules/@react-native/codegen")
23+
// The root of your project, i.e. where "package.json" lives. Default is '../..'
24+
// root = file("../../")
25+
// The folder where the react-native NPM package is. Default is ../../node_modules/react-native
26+
// reactNativeDir = file("../../node_modules/react-native")
27+
// The folder where the react-native Codegen package is. Default is ../../node_modules/@react-native/codegen
28+
// codegenDir = file("../../node_modules/@react-native/codegen")
5029

5130
/* Variants */
5231
// The list of variants to that are debuggable. For those we're going to
@@ -79,10 +58,8 @@ react {
7958
// The list of flags to pass to the Hermes compiler. By default is "-O", "-output-source-map"
8059
// hermesFlags = ["-O", "-output-source-map"]
8160

82-
if (rnVersion >= versionToNumber(0, 75, 0)) {
83-
/* Autolinking */
84-
autolinkLibrariesWithApp()
85-
}
61+
/* Autolinking */
62+
autolinkLibrariesWithApp()
8663
}
8764

8865
/**
@@ -144,6 +121,9 @@ android {
144121
useLegacyPackaging (findProperty('expo.useLegacyPackaging')?.toBoolean() ?: false)
145122
}
146123
}
124+
androidResources {
125+
ignoreAssetsPattern '!.svn:!.git:!.ds_store:!*.scc:!CVS:!thumbs.db:!picasa.ini:!*~'
126+
}
147127
}
148128

149129
// Apply static values from `gradle.properties` to the `android.packagingOptions`
@@ -194,8 +174,3 @@ dependencies {
194174
implementation jscFlavor
195175
}
196176
}
197-
198-
if (rnVersion < versionToNumber(0, 75, 0)) {
199-
apply from: new File(["node", "--print", "require.resolve('@react-native-community/cli-platform-android/package.json', { paths: [require.resolve('react-native/package.json')] })"].execute(null, rootDir).text.trim(), "../native_modules.gradle");
200-
applyNativeModulesAppBuildGradle(project)
201-
}

example-expo/android/app/src/main/AndroidManifest.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,12 @@
1818
</intent>
1919
</queries>
2020

21-
<application android:name=".MainApplication" android:label="@string/app_name" android:icon="@mipmap/ic_launcher" android:roundIcon="@mipmap/ic_launcher_round" android:allowBackup="false" android:theme="@style/AppTheme">
21+
<application android:name=".MainApplication" android:label="@string/app_name" android:icon="@mipmap/ic_launcher" android:roundIcon="@mipmap/ic_launcher_round" android:allowBackup="false" android:theme="@style/AppTheme" android:supportsRtl="true">
2222
<activity android:name=".MainActivity" android:configChanges="keyboard|keyboardHidden|orientation|screenSize|screenLayout|uiMode" android:launchMode="singleTask" android:windowSoftInputMode="adjustResize" android:theme="@style/Theme.App.SplashScreen" android:exported="true">
2323
<intent-filter>
2424
<action android:name="android.intent.action.MAIN"/>
2525
<category android:name="android.intent.category.LAUNCHER"/>
2626
</intent-filter>
2727
</activity>
28-
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" android:exported="false"/>
2928
</application>
3029
</manifest>

example-expo/android/app/src/main/java/com/rnicontextmenuexample/MainApplication.kt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import com.facebook.react.ReactPackage
1010
import com.facebook.react.ReactHost
1111
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.load
1212
import com.facebook.react.defaults.DefaultReactNativeHost
13+
import com.facebook.react.soloader.OpenSourceMergedSoMapping
1314
import com.facebook.soloader.SoLoader
1415

1516
import expo.modules.ApplicationLifecycleDispatcher
@@ -21,9 +22,10 @@ class MainApplication : Application(), ReactApplication {
2122
this,
2223
object : DefaultReactNativeHost(this) {
2324
override fun getPackages(): List<ReactPackage> {
25+
val packages = PackageList(this).packages
2426
// Packages that cannot be autolinked yet can be added manually here, for example:
2527
// packages.add(new MyReactNativePackage());
26-
return PackageList(this).packages
28+
return packages
2729
}
2830

2931
override fun getJSMainModuleName(): String = ".expo/.virtual-metro-entry"
@@ -40,7 +42,7 @@ class MainApplication : Application(), ReactApplication {
4042

4143
override fun onCreate() {
4244
super.onCreate()
43-
SoLoader.init(this, false)
45+
SoLoader.init(this, OpenSourceMergedSoMapping)
4446
if (BuildConfig.IS_NEW_ARCHITECTURE_ENABLED) {
4547
// If you opted-in for the New Architecture, we load the native entry point for this app.
4648
load()
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
22
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
33
<item android:drawable="@color/splashscreen_background"/>
4-
</layer-list>
4+
<item>
5+
<bitmap android:gravity="center" android:src="@drawable/splashscreen_logo"/>
6+
</item>
7+
</layer-list>

example-expo/android/app/src/main/res/values/styles.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,6 @@
1111
</style>
1212
<style name="Theme.App.SplashScreen" parent="AppTheme">
1313
<item name="android:windowBackground">@drawable/splashscreen</item>
14+
<item name="android:windowBackground">@drawable/splashscreen_logo</item>
1415
</style>
1516
</resources>

example-expo/android/build.gradle

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
buildscript {
44
ext {
5-
buildToolsVersion = findProperty('android.buildToolsVersion') ?: '34.0.0'
6-
minSdkVersion = Integer.parseInt(findProperty('android.minSdkVersion') ?: '23')
7-
compileSdkVersion = Integer.parseInt(findProperty('android.compileSdkVersion') ?: '34')
8-
targetSdkVersion = Integer.parseInt(findProperty('android.targetSdkVersion') ?: '34')
9-
kotlinVersion = findProperty('android.kotlinVersion') ?: '1.9.23'
5+
buildToolsVersion = findProperty('android.buildToolsVersion') ?: '35.0.0'
6+
minSdkVersion = Integer.parseInt(findProperty('android.minSdkVersion') ?: '24')
7+
compileSdkVersion = Integer.parseInt(findProperty('android.compileSdkVersion') ?: '35')
8+
targetSdkVersion = Integer.parseInt(findProperty('android.targetSdkVersion') ?: '35')
9+
kotlinVersion = findProperty('android.kotlinVersion') ?: '1.9.24'
1010

1111
ndkVersion = "26.1.10909125"
1212
}

example-expo/android/gradle.properties

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,6 @@ org.gradle.jvmargs=-Xmx2048m -XX:MaxMetaspaceSize=512m
2222
# https://developer.android.com/topic/libraries/support-library/androidx-rn
2323
android.useAndroidX=true
2424

25-
# Automatically convert third-party libraries to use AndroidX
26-
android.enableJetifier=true
27-
2825
# Enable AAPT2 PNG crunching
2926
android.enablePngCrunchInReleaseBuilds=true
3027

example-expo/android/gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-all.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-all.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

example-expo/android/gradlew

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
# See the License for the specific language governing permissions and
1616
# limitations under the License.
1717
#
18+
# SPDX-License-Identifier: Apache-2.0
19+
#
1820

1921
##############################################################################
2022
#
@@ -55,7 +57,7 @@
5557
# Darwin, MinGW, and NonStop.
5658
#
5759
# (3) This script is generated from the Groovy template
58-
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
60+
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
5961
# within the Gradle project.
6062
#
6163
# You can find Gradle at https://github.com/gradle/gradle/.
@@ -84,7 +86,8 @@ done
8486
# shellcheck disable=SC2034
8587
APP_BASE_NAME=${0##*/}
8688
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
87-
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
89+
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
90+
' "$PWD" ) || exit
8891

8992
# Use the maximum available, or set MAX_FD != -1 to use that value.
9093
MAX_FD=maximum

0 commit comments

Comments
 (0)