Skip to content

Commit 2351757

Browse files
authored
Merge pull request #3557 from StoDevX/rn0_59
Upgrade to React-Native v0.59
2 parents bacf8a6 + 7f58c0b commit 2351757

File tree

151 files changed

+7487
-8322
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

151 files changed

+7487
-8322
lines changed

.circleci/config.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,8 +322,10 @@ jobs:
322322
- run:
323323
name: Download Android dependencies
324324
command: cd android && ./gradlew androidDependencies --console=plain
325-
environment: {TERM: xterm-256color}
325+
environment:
326+
TERM: xterm-256color
326327
- gradle-cache
328+
- run: echo 'org.gradle.workers.max=2' >> ./android/gradle.properties
327329
- run:
328330
name: Run Fastlane
329331
command: bundle exec fastlane android ci-run | tee ./logs/build

.flowconfig

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,14 @@
99
; remove this after rn-linear-gradient fixes their @flow/no type arguments issue
1010
.*/node_modules/react-native-linear-gradient/.*
1111

12-
; remove after github.com/react-native-community/react-native-safe-area-view/pull/57 is merged
13-
.*/node_modules/react-native-safe-area-view/.*
12+
.*/node_modules/@callstack/react-theme-provider/.*
13+
.*/node_modules/react-native-paper/.*
1414

1515
[include]
1616

1717
[libs]
1818
node_modules/react-native/Libraries/react-native/react-native-interface.js
1919
node_modules/react-native/flow/
20-
node_modules/react-native/flow-github/
2120
flow-typed/
2221

2322
[options]
@@ -58,10 +57,10 @@ suppress_type=$FlowFixMeProps
5857
suppress_type=$FlowFixMeState
5958
suppress_type=$FixMe
6059

61-
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(7[0-8]\\|[1-6][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)
62-
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(7[0-8]\\|[1-6][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+
60+
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(9[0-2]\\|[1-8][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)
61+
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(9[0-2]\\|[1-8][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+
6362
suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
6463
suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError
6564

6665
[version]
67-
^0.78.0
66+
^0.92.0

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
4646
- Updated to CircleCI 2.1 configuration syntax (#3512)
4747
- Adjusted how we present the BonApp ultimatum on first visiting the Balances tab (#3515)
4848
- Changed the `data` prop on fancy-menu to be `extraData` (#3528)
49+
- Upgraded to RN 0.59 (#3557)
4950

5051
### Fixed
5152
- Fixed an issue where Fastlane was reporting build failures despite having skipped the build (#3215)

android/app/BUCK

Lines changed: 0 additions & 65 deletions
This file was deleted.

android/app/build.gradle

Lines changed: 38 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
apply plugin: "com.android.application"
1+
// this includes the onesignal gradle plugin
2+
apply plugin: 'com.onesignal.androidsdk.onesignal-gradle-plugin'
3+
// this plugin adapts the gradle build for android apps
4+
apply plugin: 'com.android.application'
25

36
/**
47
* The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets
@@ -94,18 +97,19 @@ def enableSeparateBuildPerCPUArchitecture = false
9497
*/
9598
def enableProguardInReleaseBuilds = false
9699

97-
def COMPILE_SDK_VERSION = 28
98-
def TARGET_SDK_VERSION = 28
99-
def ANDROID_SUPPORT_LIBRARY_VERSION = '27.1.1'
100-
101100
android {
102-
compileSdkVersion COMPILE_SDK_VERSION
101+
compileSdkVersion rootProject.ext.compileSdkVersion
102+
103+
compileOptions {
104+
sourceCompatibility JavaVersion.VERSION_1_8
105+
targetCompatibility JavaVersion.VERSION_1_8
106+
}
103107

104108
defaultConfig {
105109
applicationId "com.allaboutolaf"
106110

107-
minSdkVersion 21
108-
targetSdkVersion TARGET_SDK_VERSION
111+
minSdkVersion rootProject.ext.minSdkVersion
112+
targetSdkVersion rootProject.ext.targetSdkVersion
109113

110114
versionCode 1
111115
versionName "1.0.0"
@@ -115,16 +119,6 @@ android {
115119
BUGSNAG_KEY: System.getenv("BUGSNAG_KEY") ?: "",
116120
onesignal_google_project_number: "REMOTE",
117121
]
118-
119-
ndk {
120-
abiFilters "armeabi-v7a", "x86"
121-
}
122-
}
123-
124-
ext {
125-
compileSdkVersion = COMPILE_SDK_VERSION
126-
targetSdkVersion = TARGET_SDK_VERSION
127-
androidSupportLibraryVersion = ANDROID_SUPPORT_LIBRARY_VERSION
128122
}
129123

130124
signingConfigs {
@@ -137,7 +131,7 @@ android {
137131
reset()
138132
enable enableSeparateBuildPerCPUArchitecture
139133
universalApk false // If true, also generate a universal APK
140-
include "armeabi-v7a", "x86"
134+
include "armeabi-v7a", "x86", "arm64-v8a", "x86_64"
141135
}
142136
}
143137

@@ -163,7 +157,7 @@ android {
163157

164158
// For each separate APK per architecture, set a unique version code as described here:
165159
// http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits
166-
// def versionCodes = ["armeabi-v7a":1, "x86":2, nil:2]
160+
// def versionCodes = ["armeabi-v7a":1, "x86":2, nil:2, "arm64-v8a": 3, "x86_64": 4]
167161

168162
// `abi` is null for the universal-debug, universal-release variants
169163
// def abi = output.getFilter(OutputFile.ABI)
@@ -183,10 +177,10 @@ android {
183177
}
184178

185179
configurations.all {
186-
resolutionStrategy.force "com.android.support:appcompat-v7:$ANDROID_SUPPORT_LIBRARY_VERSION"
187-
resolutionStrategy.force "com.android.support:customtabs:$ANDROID_SUPPORT_LIBRARY_VERSION"
188-
resolutionStrategy.force "com.android.support:support-media-compat:$ANDROID_SUPPORT_LIBRARY_VERSION"
189-
resolutionStrategy.force "com.android.support:support-v4:$ANDROID_SUPPORT_LIBRARY_VERSION"
180+
resolutionStrategy.force "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
181+
resolutionStrategy.force "com.android.support:customtabs:${rootProject.ext.supportLibVersion}"
182+
resolutionStrategy.force "com.android.support:support-media-compat:${rootProject.ext.supportLibVersion}"
183+
resolutionStrategy.force "com.android.support:support-v4:${rootProject.ext.supportLibVersion}"
190184

191185
resolutionStrategy.force 'org.webkit:android-jsc:r236355'
192186
}
@@ -197,12 +191,13 @@ def propFile = new File('android/app/signing.properties')
197191
if (propFile.canRead()) {
198192
Properties props = new Properties()
199193
props.load(new FileInputStream(propFile))
200-
if (props != null
201-
&& props.containsKey('STORE_FILE')
202-
&& props.containsKey('STORE_PASSWORD')
203-
&& props.containsKey('KEY_ALIAS')
204-
&& props.containsKey('KEY_PASSWORD')
205-
) {
194+
195+
bool hasFile = props != null && props.containsKey('STORE_FILE');
196+
bool hasPassword = props != null && props.containsKey('STORE_PASSWORD');
197+
bool hasAlias = props != null && props.containsKey('KEY_ALIAS');
198+
bool hasKeyPass = props != null && props.containsKey('KEY_PASSWORD');
199+
200+
if (hasFile && hasPassword && hasAlias && hasKeyPass) {
206201
logger.info 'android/app/signing.properties is fully functional.'
207202
android.signingConfigs.release.storeFile = file(props['STORE_FILE'])
208203
android.signingConfigs.release.storePassword = props['STORE_PASSWORD']
@@ -213,10 +208,10 @@ if (propFile.canRead()) {
213208
if (props == null) {
214209
logger.warn '`props` was null'
215210
} else {
216-
logger.warn "has STORE_FILE: ${props.containsKey('STORE_FILE')}"
217-
logger.warn "has STORE_PASSWORD: ${props.containsKey('STORE_PASSWORD')}"
218-
logger.warn "has KEY_ALIAS: ${props.containsKey('KEY_ALIAS')}"
219-
logger.warn "has KEY_PASSWORD: ${props.containsKey('KEY_PASSWORD')}"
211+
logger.warn "has STORE_FILE [y/n]: ${props.containsKey('STORE_FILE')}"
212+
logger.warn "has STORE_PASSWORD [y/n]: ${props.containsKey('STORE_PASSWORD')}"
213+
logger.warn "has KEY_ALIAS [y/n]: ${props.containsKey('KEY_ALIAS')}"
214+
logger.warn "has KEY_PASSWORD [y/n]: ${props.containsKey('KEY_PASSWORD')}"
220215
}
221216
android.buildTypes.release.signingConfig = null
222217
}
@@ -240,20 +235,15 @@ dependencies {
240235
implementation project(':react-native-onesignal')
241236
implementation project(':react-native-restart')
242237
implementation project(':react-native-vector-icons')
238+
243239
// this is for react-native itself
244240
implementation fileTree(dir: "libs", include: ["*.jar"])
245-
implementation "com.android.support:appcompat-v7:$ANDROID_SUPPORT_LIBRARY_VERSION"
241+
implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
242+
246243
//noinspection GradleDynamicVersion
247244
implementation "com.facebook.react:react-native:+" // From node_modules
248245
}
249246

250-
// Run this once to be able to run the application with BUCK
251-
// puts all compile dependencies into folder libs for BUCK to use
252-
task copyDownloadableDepsToLibs(type: Copy) {
253-
from configurations.compile
254-
into 'libs'
255-
}
256-
257247
// Bundles the app's data for the build process
258248
task bundleData(type: Exec) {
259249
workingDir '../../'
@@ -262,6 +252,10 @@ task bundleData(type: Exec) {
262252

263253
gradle.projectsEvaluated {
264254
// hook bundleData into the android build process
265-
bundleDebugJsAndAssets.dependsOn bundleData
266-
bundleReleaseJsAndAssets.dependsOn bundleData
255+
if (project.hasProperty('bundleDebugJsAndAssets')) {
256+
bundleDebugJsAndAssets.dependsOn bundleData
257+
}
258+
if (project.hasProperty('bundleReleaseJsAndAssets')) {
259+
bundleReleaseJsAndAssets.dependsOn bundleData
260+
}
267261
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
3+
xmlns:tools="http://schemas.android.com/tools">
4+
5+
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
6+
7+
<application tools:targetApi="28" tools:ignore="GoogleAppIndexingWarning" android:networkSecurityConfig="@xml/react_native_config" />
8+
</manifest>
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<network-security-config>
3+
<domain-config cleartextTrafficPermitted="true">
4+
<domain includeSubdomains="false">localhost</domain>
5+
<domain includeSubdomains="false">10.0.2.2</domain>
6+
<domain includeSubdomains="false">10.0.3.2</domain>
7+
</domain-config>
8+
</network-security-config>

android/app/src/main/AndroidManifest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
88
<!-- FINE_LOCATION is used for wifi reporting -->
99
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
10-
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
1110

1211
<application
1312
android:name=".MainApplication"
1413
android:allowBackup="true"
1514
android:label="@string/app_name"
1615
android:icon="@mipmap/ic_launcher"
16+
android:roundIcon="@mipmap/ic_launcher_round"
1717
android:theme="@style/AppTheme"
1818
android:usesCleartextTraffic="${isDebug}"
1919
>

android/app/src/main/java/com/allaboutolaf/MainApplication.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
import android.app.Application;
44
import android.net.http.HttpResponseCache;
5-
import android.os.Bundle;
65
import android.util.Log;
76

87
// keep these sorted alphabetically
@@ -11,7 +10,6 @@
1110
import com.BV.LinearGradient.LinearGradientPackage;
1211
import com.calendarevents.CalendarEventsPackage;
1312
import com.facebook.react.ReactApplication;
14-
import com.facebook.react.ReactInstanceManager;
1513
import com.facebook.react.ReactNativeHost;
1614
import com.facebook.react.ReactPackage;
1715
import com.facebook.react.shell.MainReactPackage;
@@ -40,7 +38,7 @@ public boolean getUseDeveloperSupport() {
4038

4139
@Override
4240
protected List<ReactPackage> getPackages() {
43-
return Arrays.<ReactPackage>asList(
41+
return Arrays.asList(
4442
new MainReactPackage(),
4543
// please keep these sorted alphabetically
4644
BugsnagReactNative.getPackage(),
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ic_launcher.png

0 commit comments

Comments
 (0)