Skip to content

Commit 5e4bab1

Browse files
committed
[futurepress#105] v0.15.0: Upgrade to [email protected] (Android)
1 parent 55edd51 commit 5e4bab1

File tree

19 files changed

+1475
-2749
lines changed

19 files changed

+1475
-2749
lines changed

android/src/newarch/ReactNativeStaticServerSpec.kt

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,6 @@ package com.drpogodin.reactnativestaticserver
22

33
import com.facebook.react.bridge.ReactApplicationContext
44

5-
abstract class ReactNativeStaticServerSpec(context: ReactApplicationContext?) : NativeReactNativeStaticServerSpec(context)
5+
abstract class ReactNativeStaticServerSpec internal constructor(context: ReactApplicationContext) :
6+
NativeReactNativeStaticServerSpec(context) {
7+
}

android/src/oldarch/ReactNativeStaticServerSpec.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package com.drpogodin.reactnativestaticserver
22

3-
import com.facebook.react.bridge.Promise
43
import com.facebook.react.bridge.ReactApplicationContext
54
import com.facebook.react.bridge.ReactContextBaseJavaModule
5+
import com.facebook.react.bridge.Promise
66

77
abstract class ReactNativeStaticServerSpec internal constructor(context: ReactApplicationContext) :
88
ReactContextBaseJavaModule(context) {

example/android/app/build.gradle

-1
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,6 @@ android {
113113
dependencies {
114114
// The version of react-native is set by the React Native Gradle Plugin
115115
implementation("com.facebook.react:react-android")
116-
implementation("com.facebook.react:flipper-integration")
117116

118117
if (hermesEnabled.toBoolean()) {
119118
implementation("com.facebook.react:hermes-android")

example/android/app/src/main/java/com/reactnativestaticserverexample/MainApplication.kt

+1-3
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import com.facebook.react.ReactPackage
99
import com.facebook.react.defaults.DefaultNewArchitectureEntryPoint.load
1010
import com.facebook.react.defaults.DefaultReactHost.getDefaultReactHost
1111
import com.facebook.react.defaults.DefaultReactNativeHost
12-
import com.facebook.react.flipper.ReactNativeFlipper
1312
import com.facebook.soloader.SoLoader
1413

1514
class MainApplication : Application(), ReactApplication {
@@ -31,7 +30,7 @@ class MainApplication : Application(), ReactApplication {
3130
}
3231

3332
override val reactHost: ReactHost
34-
get() = getDefaultReactHost(this.applicationContext, reactNativeHost)
33+
get() = getDefaultReactHost(applicationContext, reactNativeHost)
3534

3635
override fun onCreate() {
3736
super.onCreate()
@@ -40,6 +39,5 @@ class MainApplication : Application(), ReactApplication {
4039
// If you opted-in for the New Architecture, we load the native entry point for this app.
4140
load()
4241
}
43-
ReactNativeFlipper.initializeFlipper(this, reactNativeHost.reactInstanceManager)
4442
}
4543
}

example/android/app/src/main/res/drawable/rn_edit_text_material.xml

+2-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
android:insetLeft="@dimen/abc_edit_text_inset_horizontal_material"
1818
android:insetRight="@dimen/abc_edit_text_inset_horizontal_material"
1919
android:insetTop="@dimen/abc_edit_text_inset_top_material"
20-
android:insetBottom="@dimen/abc_edit_text_inset_bottom_material">
20+
android:insetBottom="@dimen/abc_edit_text_inset_bottom_material"
21+
>
2122

2223
<selector>
2324
<!--

example/android/build.gradle

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
buildscript {
22
ext {
3-
minSdkVersion = 28
43
buildToolsVersion = "34.0.0"
4+
minSdkVersion = 28
55
compileSdkVersion = 34
66
targetSdkVersion = 34
7-
ndkVersion = "25.1.8937393"
8-
kotlinVersion = "1.8.0"
7+
ndkVersion = "26.1.10909125"
8+
kotlinVersion = "1.9.22"
99
}
1010
repositories {
1111
google()

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

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

example/android/gradlew

+7-7
Original file line numberDiff line numberDiff line change
@@ -145,15 +145,15 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
145145
case $MAX_FD in #(
146146
max*)
147147
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
148-
# shellcheck disable=SC3045
148+
# shellcheck disable=SC2039,SC3045
149149
MAX_FD=$( ulimit -H -n ) ||
150150
warn "Could not query maximum file descriptor limit"
151151
esac
152152
case $MAX_FD in #(
153153
'' | soft) :;; #(
154154
*)
155155
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
156-
# shellcheck disable=SC3045
156+
# shellcheck disable=SC2039,SC3045
157157
ulimit -n "$MAX_FD" ||
158158
warn "Could not set maximum file descriptor limit to $MAX_FD"
159159
esac
@@ -202,11 +202,11 @@ fi
202202
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
203203
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
204204

205-
# Collect all arguments for the java command;
206-
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
207-
# shell script including quotes and variable substitutions, so put them in
208-
# double quotes to make sure that they get re-expanded; and
209-
# * put everything else in single quotes, so that it's not re-expanded.
205+
# Collect all arguments for the java command:
206+
# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
207+
# and any embedded shellness will be escaped.
208+
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
209+
# treated as '${Hostname}' itself on the command line.
210210

211211
set -- \
212212
"-Dorg.gradle.appname=$APP_BASE_NAME" \

example/android/gradlew.bat

+10-10
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/ios/Podfile

+1-16
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,6 @@ require Pod::Executable.execute_command('node', ['-p',
88
platform :ios, min_ios_version_supported
99
prepare_react_native_project!
1010

11-
# If you are using a `react-native-flipper` your iOS build will fail when `NO_FLIPPER=1` is set.
12-
# because `react-native-flipper` depends on (FlipperKit,...) that will be excluded
13-
#
14-
# To fix this you can also exclude `react-native-flipper` using a `react-native.config.js`
15-
# ```js
16-
# module.exports = {
17-
# dependencies: {
18-
# ...(process.env.NO_FLIPPER ? { 'react-native-flipper': { platforms: { ios: null } } } : {}),
19-
# ```
20-
flipper_config = ENV['NO_FLIPPER'] == "1" ? FlipperConfiguration.disabled : FlipperConfiguration.enabled
21-
2211
linkage = ENV['USE_FRAMEWORKS']
2312
if linkage != nil
2413
Pod::UI.puts "Configuring Pod with #{linkage}ally linked Frameworks".green
@@ -30,11 +19,6 @@ target 'ReactNativeStaticServerExample' do
3019

3120
use_react_native!(
3221
:path => config[:reactNativePath],
33-
# Enables Flipper.
34-
#
35-
# Note that if you have use_frameworks! enabled, Flipper will not work and
36-
# you should disable the next line.
37-
:flipper_configuration => flipper_config,
3822
# An absolute path to your application root.
3923
:app_path => "#{Pod::Config.instance.installation_root}/.."
4024
)
@@ -50,6 +34,7 @@ target 'ReactNativeStaticServerExample' do
5034
installer,
5135
config[:reactNativePath],
5236
:mac_catalyst_enabled => ENV['MAC_CATALYST'] == '1'
37+
# :ccache_enabled => true
5338
)
5439
end
5540
end

0 commit comments

Comments
 (0)