Skip to content

Commit 4f361e6

Browse files
committed
Update example
1 parent e395f5f commit 4f361e6

File tree

13 files changed

+3092
-2605
lines changed

13 files changed

+3092
-2605
lines changed

example/.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
.xcode.env
1010
Pods/
1111
build/
12-
dist/
12+
dist/*
13+
!dist/.gitignore
1314
local.properties
1415
msbuild.binlog
1516
node_modules/

example/android/build.gradle

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
buildscript {
2-
def androidTestAppDir = "../node_modules/react-native-test-app/android"
3-
apply(from: "${androidTestAppDir}/dependencies.gradle")
2+
apply(from: {
3+
def searchDir = rootDir.toPath()
4+
do {
5+
def p = searchDir.resolve("node_modules/react-native-test-app/android/dependencies.gradle")
6+
if (p.toFile().exists()) {
7+
return p.toRealPath().toString()
8+
}
9+
} while (searchDir = searchDir.getParent())
10+
throw new GradleException("Could not find `react-native-test-app`");
11+
}())
412

513
repositories {
614
mavenCentral()
@@ -18,7 +26,16 @@ allprojects {
1826
repositories {
1927
maven {
2028
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
21-
url("${rootDir}/../node_modules/react-native/android")
29+
url({
30+
def searchDir = rootDir.toPath()
31+
do {
32+
def p = searchDir.resolve("node_modules/react-native/android")
33+
if (p.toFile().exists()) {
34+
return p.toRealPath().toString()
35+
}
36+
} while (searchDir = searchDir.getParent())
37+
throw new GradleException("Could not find `react-native`");
38+
}())
2239
}
2340
mavenCentral()
2441
google()

example/android/gradle.properties

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,26 +26,28 @@ org.gradle.jvmargs=-Xmx2g -XX:MaxMetaspaceSize=512m -XX:+HeapDumpOnOutOfMemoryEr
2626
android.useAndroidX=true
2727
# Automatically convert third-party libraries to use AndroidX
2828
android.enableJetifier=true
29-
30-
# Version of Flipper to use with React Native. Default value is whatever React
31-
# Native defaults to. To enable Flipper, set the value to `X.Y.Z` (version you want to use).
32-
# To disable Flipper, set it to `false`.
33-
FLIPPER_VERSION=false
29+
# Jetifier randomly fails on these libraries
30+
android.jetifier.ignorelist=hermes-android
3431

3532
# Use this property to specify which architecture you want to build.
3633
# You can also override it from the CLI using
3734
# ./gradlew <task> -PreactNativeArchitectures=x86_64
3835
reactNativeArchitectures=armeabi-v7a,arm64-v8a,x86,x86_64
3936

40-
# Enable Fabric at runtime.
41-
#USE_FABRIC=1
42-
43-
# Enable new architecture, i.e. Fabric + TurboModule - implies USE_FABRIC=1.
37+
# Use this property to enable support to the new architecture.
38+
# This will allow you to use TurboModules and the Fabric render in
39+
# your application. You should enable this flag either if you want
40+
# to write custom TurboModules/Fabric components OR use libraries that
41+
# are providing them.
4442
# Note that this is incompatible with web debugging.
4543
#newArchEnabled=true
44+
#bridgelessEnabled=true
45+
46+
# Uncomment the line below to build React Native from source.
47+
#react.buildFromSource=true
4648

47-
# Uncomment the line below if building react-native from source
48-
#ANDROID_NDK_VERSION=23.1.7779620
49+
# Version of Android NDK to build against.
50+
#ANDROID_NDK_VERSION=26.1.10909125
4951

5052
# Version of Kotlin to build against.
51-
#KOTLIN_VERSION=1.7.22
53+
#KOTLIN_VERSION=1.8.22
-19.8 KB
Binary file not shown.

example/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-7.6.3-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

example/android/gradlew.bat

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,11 @@ set JAVA_EXE=java.exe
4343
%JAVA_EXE% -version >NUL 2>&1
4444
if %ERRORLEVEL% equ 0 goto execute
4545

46-
echo.
47-
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
48-
echo.
49-
echo Please set the JAVA_HOME variable in your environment to match the
50-
echo location of your Java installation.
46+
echo. 1>&2
47+
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
48+
echo. 1>&2
49+
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
50+
echo location of your Java installation. 1>&2
5151

5252
goto fail
5353

@@ -57,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe
5757

5858
if exist "%JAVA_EXE%" goto execute
5959

60-
echo.
61-
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
62-
echo.
63-
echo Please set the JAVA_HOME variable in your environment to match the
64-
echo location of your Java installation.
60+
echo. 1>&2
61+
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
62+
echo. 1>&2
63+
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
64+
echo location of your Java installation. 1>&2
6565

6666
goto fail
6767

example/android/settings.gradle

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,14 @@ pluginManagement {
88

99
rootProject.name = "ImageEditorExample"
1010

11-
apply(from: "../node_modules/react-native-test-app/test-app.gradle")
11+
apply(from: {
12+
def searchDir = rootDir.toPath()
13+
do {
14+
def p = searchDir.resolve("node_modules/react-native-test-app/test-app.gradle")
15+
if (p.toFile().exists()) {
16+
return p.toRealPath().toString()
17+
}
18+
} while (searchDir = searchDir.getParent())
19+
throw new GradleException("Could not find `react-native-test-app`");
20+
}())
1221
applyTestAppSettings(settings)

example/babel.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module.exports = {
2-
presets: ['module:metro-react-native-babel-preset'],
2+
presets: ['module:@react-native/babel-preset'],
33
};

example/ios/Podfile

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
require_relative '../node_modules/react-native-test-app/test_app'
2-
3-
use_flipper! false unless ENV['USE_FLIPPER'] == '1'
1+
ws_dir = Pathname.new(__dir__)
2+
ws_dir = ws_dir.parent until
3+
File.exist?("#{ws_dir}/node_modules/react-native-test-app/test_app.rb") ||
4+
ws_dir.expand_path.to_s == '/'
5+
require "#{ws_dir}/node_modules/react-native-test-app/test_app.rb"
46

57
workspace 'ImageEditorExample.xcworkspace'
68

0 commit comments

Comments
 (0)