Skip to content
This repository was archived by the owner on Aug 14, 2024. It is now read-only.

Commit 535d252

Browse files
committed
Upgrade SampleApp to RN 0.59.3
1 parent 75a31d0 commit 535d252

File tree

26 files changed

+206
-126
lines changed

26 files changed

+206
-126
lines changed

SampleApp/.babelrc

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

SampleApp/.flowconfig

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,13 @@
2424
[libs]
2525
node_modules/react-native/Libraries/react-native/react-native-interface.js
2626
node_modules/react-native/flow/
27-
node_modules/react-native/flow-github/
2827

2928
[options]
3029
emoji=true
3130

31+
esproposal.optional_chaining=enable
32+
esproposal.nullish_coalescing=enable
33+
3234
module.system=haste
3335
module.system.haste.use_name_reducers=true
3436
# get basename
@@ -64,4 +66,4 @@ suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
6466
suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError
6567

6668
[version]
67-
^0.75.0
69+
^0.92.0
Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
/**
2+
* @format
3+
*/
4+
15
import 'react-native';
26
import React from 'react';
37
import App from '../App';
@@ -6,7 +10,5 @@ import App from '../App';
610
import renderer from 'react-test-renderer';
711

812
it('renders correctly', () => {
9-
const tree = renderer.create(
10-
<App />
11-
);
13+
renderer.create(<App />);
1214
});

SampleApp/android/app/BUCK

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,13 @@
88
# - `buck install -r android/app` - compile, install and run application
99
#
1010

11+
load(":build_defs.bzl", "create_aar_targets", "create_jar_targets")
12+
1113
lib_deps = []
1214

13-
for jarfile in glob(['libs/*.jar']):
14-
name = 'jars__' + jarfile[jarfile.rindex('/') + 1: jarfile.rindex('.jar')]
15-
lib_deps.append(':' + name)
16-
prebuilt_jar(
17-
name = name,
18-
binary_jar = jarfile,
19-
)
15+
create_aar_targets(glob(["libs/*.aar"]))
2016

21-
for aarfile in glob(['libs/*.aar']):
22-
name = 'aars__' + aarfile[aarfile.rindex('/') + 1: aarfile.rindex('.aar')]
23-
lib_deps.append(':' + name)
24-
android_prebuilt_aar(
25-
name = name,
26-
aar = aarfile,
27-
)
17+
create_jar_targets(glob(["libs/*.jar"]))
2818

2919
android_library(
3020
name = "all-libs",

SampleApp/android/app/build.gradle

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -95,24 +95,25 @@ def enableProguardInReleaseBuilds = false
9595

9696
android {
9797
compileSdkVersion rootProject.ext.compileSdkVersion
98-
buildToolsVersion rootProject.ext.buildToolsVersion
98+
99+
compileOptions {
100+
sourceCompatibility JavaVersion.VERSION_1_8
101+
targetCompatibility JavaVersion.VERSION_1_8
102+
}
99103

100104
defaultConfig {
101105
applicationId "com.sampleapp"
102106
minSdkVersion rootProject.ext.minSdkVersion
103107
targetSdkVersion rootProject.ext.targetSdkVersion
104108
versionCode 1
105109
versionName "1.0"
106-
ndk {
107-
abiFilters "armeabi-v7a", "x86"
108-
}
109110
}
110111
splits {
111112
abi {
112113
reset()
113114
enable enableSeparateBuildPerCPUArchitecture
114115
universalApk false // If true, also generate a universal APK
115-
include "armeabi-v7a", "x86"
116+
include "armeabi-v7a", "x86", "arm64-v8a", "x86_64"
116117
}
117118
}
118119
buildTypes {
@@ -126,7 +127,7 @@ android {
126127
variant.outputs.each { output ->
127128
// For each separate APK per architecture, set a unique version code as described here:
128129
// http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits
129-
def versionCodes = ["armeabi-v7a":1, "x86":2]
130+
def versionCodes = ["armeabi-v7a":1, "x86":2, "arm64-v8a": 3, "x86_64": 4]
130131
def abi = output.getFilter(OutputFile.ABI)
131132
if (abi != null) { // null for the universal-debug, universal-release variants
132133
output.versionCodeOverride =
@@ -137,9 +138,9 @@ android {
137138
}
138139

139140
dependencies {
140-
compile fileTree(dir: "libs", include: ["*.jar"])
141-
compile "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
142-
compile "com.facebook.react:react-native:+" // From node_modules
141+
implementation fileTree(dir: "libs", include: ["*.jar"])
142+
implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
143+
implementation "com.facebook.react:react-native:+" // From node_modules
143144
}
144145

145146
// Run this once to be able to run the application with BUCK
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
"""Helper definitions to glob .aar and .jar targets"""
2+
3+
def create_aar_targets(aarfiles):
4+
for aarfile in aarfiles:
5+
name = "aars__" + aarfile[aarfile.rindex("/") + 1:aarfile.rindex(".aar")]
6+
lib_deps.append(":" + name)
7+
android_prebuilt_aar(
8+
name = name,
9+
aar = aarfile,
10+
)
11+
12+
def create_jar_targets(jarfiles):
13+
for jarfile in jarfiles:
14+
name = "jars__" + jarfile[jarfile.rindex("/") + 1:jarfile.rindex(".jar")]
15+
lib_deps.append(":" + name)
16+
prebuilt_jar(
17+
name = name,
18+
binary_jar = jarfile,
19+
)
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 android:usesCleartextTraffic="true" tools:targetApi="28" tools:ignore="GoogleAppIndexingWarning" />
8+
</manifest>

SampleApp/android/app/src/main/AndroidManifest.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2-
package="com.sampleapp">
2+
package="com.sampleapp">
33

44
<uses-permission android:name="android.permission.INTERNET" />
5-
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
65

76
<application
87
android:name=".MainApplication"
98
android:label="@string/app_name"
109
android:icon="@mipmap/ic_launcher"
10+
android:roundIcon="@mipmap/ic_launcher_round"
1111
android:allowBackup="false"
1212
android:theme="@style/AppTheme">
1313
<activity

SampleApp/android/build.gradle

Lines changed: 10 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,19 @@
11
// Top-level build file where you can add configuration options common to all sub-projects/modules.
22

33
buildscript {
4+
ext {
5+
buildToolsVersion = "28.0.3"
6+
minSdkVersion = 16
7+
compileSdkVersion = 28
8+
targetSdkVersion = 28
9+
supportLibVersion = "28.0.0"
10+
}
411
repositories {
12+
google()
513
jcenter()
6-
maven {
7-
url 'https://maven.google.com/'
8-
name 'Google'
9-
}
1014
}
1115
dependencies {
12-
classpath 'com.android.tools.build:gradle:2.3.3'
16+
classpath 'com.android.tools.build:gradle:3.3.1'
1317

1418
// NOTE: Do not place your application dependencies here; they belong
1519
// in the individual module build.gradle files
@@ -19,22 +23,11 @@ buildscript {
1923
allprojects {
2024
repositories {
2125
mavenLocal()
26+
google()
2227
jcenter()
2328
maven {
2429
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
2530
url "$rootDir/../node_modules/react-native/android"
2631
}
27-
maven {
28-
url 'https://maven.google.com/'
29-
name 'Google'
30-
}
3132
}
3233
}
33-
34-
ext {
35-
buildToolsVersion = "26.0.3"
36-
minSdkVersion = 16
37-
compileSdkVersion = 26
38-
targetSdkVersion = 26
39-
supportLibVersion = "26.1.0"
40-
}

SampleApp/android/gradle.properties

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,3 @@
1616
# This option should only be used with decoupled projects. More details, visit
1717
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
1818
# org.gradle.parallel=true
19-
20-
android.useDeprecatedNdk=true

0 commit comments

Comments
 (0)