From 8156782d1067116267a222b144ecf1399cb61f8f Mon Sep 17 00:00:00 2001 From: Arnaud Vergnet Date: Tue, 14 Jul 2020 11:19:02 +0200 Subject: [PATCH] Updated project to React Native 0.63.0 --- App.js | 4 +- android/app/build.gradle | 19 +---- android/build.gradle | 8 +- .../gradle/wrapper/gradle-wrapper.properties | 2 +- android/gradlew | 29 +++---- android/gradlew.bat | 3 + install.sh | 42 +++++++++ ios/Campus/AppDelegate.m | 4 +- ios/Podfile | 85 ++----------------- package.json | 18 ++-- 10 files changed, 82 insertions(+), 132 deletions(-) create mode 100644 install.sh diff --git a/App.js b/App.js index 802c365..ad4b18d 100644 --- a/App.js +++ b/App.js @@ -1,7 +1,7 @@ // @flow import * as React from 'react'; -import {Platform, SafeAreaView, StatusBar, View, YellowBox} from 'react-native'; +import {LogBox, Platform, SafeAreaView, StatusBar, View} from 'react-native'; import LocaleManager from './src/managers/LocaleManager'; import AsyncStorageManager from "./src/managers/AsyncStorageManager"; import CustomIntroSlider from "./src/components/Overrides/CustomIntroSlider"; @@ -23,7 +23,7 @@ import {OverflowMenuProvider} from "react-navigation-header-buttons"; // enableScreens(true); -YellowBox.ignoreWarnings([ // collapsible headers cause this warning, just ignore as it is not an issue +LogBox.ignoreLogs([ // collapsible headers cause this warning, just ignore as it is not an issue 'Non-serializable values were found in the navigation state', ]); diff --git a/android/app/build.gradle b/android/app/build.gradle index 74fbdc9..7a1a785 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -18,7 +18,7 @@ import com.android.build.OutputFile * // the entry file for bundle generation * entryFile: "index.android.js", * - * // https://facebook.github.io/react-native/docs/performance#enable-the-ram-format + * // https://reactnative.dev/docs/performance#enable-the-ram-format * bundleCommand: "ram-bundle", * * // whether to bundle JS and assets in debug mode @@ -170,28 +170,13 @@ android { } release { // Caution! In production, you need to generate your own keystore file. - // see https://facebook.github.io/react-native/docs/signed-apk-android. + // see https://reactnative.dev/docs/signed-apk-android. signingConfig signingConfigs.release minifyEnabled enableProguardInReleaseBuilds proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro" } } - packagingOptions { - pickFirst "lib/armeabi-v7a/libc++_shared.so" - pickFirst "lib/arm64-v8a/libc++_shared.so" - pickFirst "lib/x86/libc++_shared.so" - pickFirst "lib/x86_64/libc++_shared.so" - } - - // Force so_loader version to fix crash on apk release - configurations.all { - resolutionStrategy { - force "com.facebook.soloader:soloader:0.8.2" - } - } - - // applicationVariants are e.g. debug, release applicationVariants.all { variant -> variant.outputs.each { output -> diff --git a/android/build.gradle b/android/build.gradle index 00b9181..a54a300 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -2,17 +2,17 @@ buildscript { ext { - buildToolsVersion = "28.0.3" + buildToolsVersion = "29.0.2" minSdkVersion = 21 - compileSdkVersion = 28 - targetSdkVersion = 28 + compileSdkVersion = 29 + targetSdkVersion = 29 } repositories { google() jcenter() } dependencies { - classpath("com.android.tools.build:gradle:3.5.2") + classpath("com.android.tools.build:gradle:3.5.3") // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties index 1ba7206..8422670 100644 --- a/android/gradle/wrapper/gradle-wrapper.properties +++ b/android/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-6.0.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-6.2-all.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/android/gradlew b/android/gradlew index 83f2acf..2fe81a7 100755 --- a/android/gradlew +++ b/android/gradlew @@ -154,19 +154,19 @@ if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then else eval `echo args$i`="\"$arg\"" fi - i=$((i+1)) + i=`expr $i + 1` done case $i in - (0) set -- ;; - (1) set -- "$args0" ;; - (2) set -- "$args0" "$args1" ;; - (3) set -- "$args0" "$args1" "$args2" ;; - (4) set -- "$args0" "$args1" "$args2" "$args3" ;; - (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; - (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; - (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; - (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; - (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; + 0) set -- ;; + 1) set -- "$args0" ;; + 2) set -- "$args0" "$args1" ;; + 3) set -- "$args0" "$args1" "$args2" ;; + 4) set -- "$args0" "$args1" "$args2" "$args3" ;; + 5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; + 6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; + 7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; + 8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; + 9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; esac fi @@ -175,14 +175,9 @@ save () { for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done echo " " } -APP_ARGS=$(save "$@") +APP_ARGS=`save "$@"` # Collect all arguments for the java command, following the shell quoting and substitution rules eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" -# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong -if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then - cd "$(dirname "$0")" -fi - exec "$JAVACMD" "$@" diff --git a/android/gradlew.bat b/android/gradlew.bat index 9618d8d..62bd9b9 100644 --- a/android/gradlew.bat +++ b/android/gradlew.bat @@ -29,6 +29,9 @@ if "%DIRNAME%" == "" set DIRNAME=. set APP_BASE_NAME=%~n0 set APP_HOME=%DIRNAME% +@rem Resolve any "." and ".." in APP_HOME to make it shorter. +for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi + @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m" diff --git a/install.sh b/install.sh new file mode 100644 index 0000000..45dfc11 --- /dev/null +++ b/install.sh @@ -0,0 +1,42 @@ +#!/bin/bash + +echo "Creating debug android keystore..." +cd android/app && keytool -genkey -v -keystore debug.keystore -storepass android -alias androiddebugkey -keypass android -keyalg RSA -keysize 2048 -validity 10000 +echo -e "Done\n" + +cd .. +echo "Creating gradle.properties file..." +echo "# Project-wide Gradle settings. + +# IDE (e.g. Android Studio) users: +# Gradle settings configured through the IDE *will override* +# any settings specified in this file. + +# For more details on how to configure your build environment visit +# http://www.gradle.org/docs/current/userguide/build_environment.html + +# Specifies the JVM arguments used for the daemon process. +# The setting is particularly useful for tweaking memory settings. +# Default value: -Xmx10248m -XX:MaxPermSize=256m +# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 + +# When configured, Gradle will run in incubating parallel mode. +# This option should only be used with decoupled projects. More details, visit +# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects +# org.gradle.parallel=true + +# AndroidX package structure to make it clearer which packages are bundled with the +# Android operating system, and which are packaged with your app's APK +# https://developer.android.com/topic/libraries/support-library/androidx-rn +android.useAndroidX=true +# Automatically convert third-party libraries to use AndroidX +android.enableJetifier=true +# Version of flipper SDK to use with React Native +FLIPPER_VERSION=0.33.1 +# This file is not included in git because it may contain secrets concerning the release key. +# To get those secrets, please contact the author at vergnet@etud.insa-toulouse.fr +" > gradle.properties +echo -e "Done\n" + +./clear-node-cache.sh + diff --git a/ios/Campus/AppDelegate.m b/ios/Campus/AppDelegate.m index 5c69aae..d1d9db3 100644 --- a/ios/Campus/AppDelegate.m +++ b/ios/Campus/AppDelegate.m @@ -15,7 +15,7 @@ #import #import -#if DEBUG +#ifdef FB_SONARKIT_ENABLED #import #import #import @@ -46,7 +46,7 @@ static void InitializeFlipper(UIApplication *application) { - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { - #if DEBUG + #ifdef FB_SONARKIT_ENABLED InitializeFlipper(application); #endif diff --git a/ios/Podfile b/ios/Podfile index d09639f..d223344 100644 --- a/ios/Podfile +++ b/ios/Podfile @@ -1,82 +1,7 @@ -platform :ios, '9.0' +require_relative '../node_modules/react-native/scripts/react_native_pods' require_relative '../node_modules/@react-native-community/cli-platform-ios/native_modules' -def add_flipper_pods!(versions = {}) - versions['Flipper'] ||= '~> 0.33.1' - versions['DoubleConversion'] ||= '1.1.7' - versions['Flipper-Folly'] ||= '~> 2.1' - versions['Flipper-Glog'] ||= '0.3.6' - versions['Flipper-PeerTalk'] ||= '~> 0.0.4' - versions['Flipper-RSocket'] ||= '~> 1.0' - pod 'FlipperKit', versions['Flipper'], :configuration => 'Debug' - pod 'FlipperKit/FlipperKitLayoutPlugin', versions['Flipper'], :configuration => 'Debug' - pod 'FlipperKit/SKIOSNetworkPlugin', versions['Flipper'], :configuration => 'Debug' - pod 'FlipperKit/FlipperKitUserDefaultsPlugin', versions['Flipper'], :configuration => 'Debug' - pod 'FlipperKit/FlipperKitReactPlugin', versions['Flipper'], :configuration => 'Debug' - # List all transitive dependencies for FlipperKit pods - # to avoid them being linked in Release builds - pod 'Flipper', versions['Flipper'], :configuration => 'Debug' - pod 'Flipper-DoubleConversion', versions['DoubleConversion'], :configuration => 'Debug' - pod 'Flipper-Folly', versions['Flipper-Folly'], :configuration => 'Debug' - pod 'Flipper-Glog', versions['Flipper-Glog'], :configuration => 'Debug' - pod 'Flipper-PeerTalk', versions['Flipper-PeerTalk'], :configuration => 'Debug' - pod 'Flipper-RSocket', versions['Flipper-RSocket'], :configuration => 'Debug' - pod 'FlipperKit/Core', versions['Flipper'], :configuration => 'Debug' - pod 'FlipperKit/CppBridge', versions['Flipper'], :configuration => 'Debug' - pod 'FlipperKit/FBCxxFollyDynamicConvert', versions['Flipper'], :configuration => 'Debug' - pod 'FlipperKit/FBDefines', versions['Flipper'], :configuration => 'Debug' - pod 'FlipperKit/FKPortForwarding', versions['Flipper'], :configuration => 'Debug' - pod 'FlipperKit/FlipperKitHighlightOverlay', versions['Flipper'], :configuration => 'Debug' - pod 'FlipperKit/FlipperKitLayoutTextSearchable', versions['Flipper'], :configuration => 'Debug' - pod 'FlipperKit/FlipperKitNetworkPlugin', versions['Flipper'], :configuration => 'Debug' -end - -# Post Install processing for Flipper -def flipper_post_install(installer) - installer.pods_project.targets.each do |target| - if target.name == 'YogaKit' - target.build_configurations.each do |config| - config.build_settings['SWIFT_VERSION'] = '4.1' - end - end - end -end - target 'Campus' do - # Pods for Campus - rnPrefix = "../node_modules/react-native" - pod 'FBLazyVector', :path => "#{rnPrefix}/Libraries/FBLazyVector" - pod 'FBReactNativeSpec', :path => "#{rnPrefix}/Libraries/FBReactNativeSpec" - pod 'RCTRequired', :path => "#{rnPrefix}/Libraries/RCTRequired" - pod 'RCTTypeSafety', :path => "#{rnPrefix}/Libraries/TypeSafety" - pod 'React', :path => "#{rnPrefix}/" - pod 'React-Core', :path => "#{rnPrefix}/" - pod 'React-CoreModules', :path => "#{rnPrefix}/React/CoreModules" - pod 'React-RCTActionSheet', :path => "#{rnPrefix}/Libraries/ActionSheetIOS" - pod 'React-RCTAnimation', :path => "#{rnPrefix}/Libraries/NativeAnimation" - pod 'React-RCTBlob', :path => "#{rnPrefix}/Libraries/Blob" - pod 'React-RCTImage', :path => "#{rnPrefix}/Libraries/Image" - pod 'React-RCTLinking', :path => "#{rnPrefix}/Libraries/LinkingIOS" - pod 'React-RCTNetwork', :path => "#{rnPrefix}/Libraries/Network" - pod 'React-RCTSettings', :path => "#{rnPrefix}/Libraries/Settings" - pod 'React-RCTText', :path => "#{rnPrefix}/Libraries/Text" - pod 'React-RCTVibration', :path => "#{rnPrefix}/Libraries/Vibration" - pod 'React-Core/RCTWebSocket', :path => "#{rnPrefix}/" - - pod 'React-cxxreact', :path => "#{rnPrefix}/ReactCommon/cxxreact" - pod 'React-jsi', :path => "#{rnPrefix}/ReactCommon/jsi" - pod 'React-jsiexecutor', :path => "#{rnPrefix}/ReactCommon/jsiexecutor" - pod 'React-jsinspector', :path => "#{rnPrefix}/ReactCommon/jsinspector" - pod 'ReactCommon/callinvoker', :path => "#{rnPrefix}/ReactCommon" - pod 'ReactCommon/turbomodule/core', :path => "#{rnPrefix}/ReactCommon" - pod 'Yoga', :path => "#{rnPrefix}/ReactCommon/yoga", :modular_headers => true - - pod 'DoubleConversion', :podspec => "#{rnPrefix}/third-party-podspecs/DoubleConversion.podspec" - pod 'glog', :podspec => "#{rnPrefix}/third-party-podspecs/glog.podspec" - pod 'Folly', :podspec => "#{rnPrefix}/third-party-podspecs/Folly.podspec" - - # react-native-cli autolinking - use_native_modules! # Permissions permissions_path = '../node_modules/react-native-permissions/ios' @@ -88,9 +13,9 @@ target 'Campus' do # # Note that if you have use_frameworks! enabled, Flipper will not work and # you should disable these next few lines. - #add_flipper_pods! - #post_install do |installer| - # flipper_post_install(installer) - #end + # use_flipper! + # post_install do |installer| + # flipper_post_install(installer) + # end end diff --git a/package.json b/package.json index e2e5cf1..f617327 100644 --- a/package.json +++ b/package.json @@ -28,8 +28,8 @@ "@react-navigation/native": "^5.7.0", "@react-navigation/stack": "^5.7.0", "i18n-js": "^3.7.1", - "react": "16.11.0", - "react-native": "0.62.2", + "react": "16.13.1", + "react-native": "0.63.0", "react-native-animatable": "^1.3.3", "react-native-app-intro-slider": "^4.0.0", "react-native-appearance": "^0.3.4", @@ -57,15 +57,15 @@ "react-navigation-header-buttons": "^4.0.2" }, "devDependencies": { - "@babel/core": "^7.6.2", - "@babel/runtime": "^7.6.2", - "@react-native-community/eslint-config": "^0.0.5", - "babel-jest": "^25.5.1", + "@babel/core": "^7.8.4", + "@babel/runtime": "^7.8.4", + "@react-native-community/eslint-config": "^1.1.0", + "babel-jest": "^25.1.0", "eslint": "6.5.1", "flow-bin": "^0.123.0", - "jest": "^25.5.3", + "jest": "^25.1.0", "jest-extended": "^0.11.5", - "metro-react-native-babel-preset": "^0.58.0", - "react-test-renderer": "16.11.0" + "metro-react-native-babel-preset": "^0.59.0", + "react-test-renderer": "16.13.1" } }