Skip to content

Commit 998234d

Browse files
committed
chore(demo): update demo to react-native 0.58
1 parent 3ad019d commit 998234d

37 files changed

+349
-302
lines changed

.circleci/config.yml

Whitespace-only changes.

Demo/.babelrc

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

Demo/.flowconfig

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,23 @@ flow/
2424
[options]
2525
emoji=true
2626

27+
esproposal.optional_chaining=enable
28+
esproposal.nullish_coalescing=enable
29+
2730
module.system=haste
31+
module.system.haste.use_name_reducers=true
32+
# get basename
33+
module.system.haste.name_reducers='^.*/\([a-zA-Z0-9$_.-]+\.js\(\.flow\)?\)$' -> '\1'
34+
# strip .js or .js.flow suffix
35+
module.system.haste.name_reducers='^\(.*\)\.js\(\.flow\)?$' -> '\1'
36+
# strip .ios suffix
37+
module.system.haste.name_reducers='^\(.*\)\.ios$' -> '\1'
38+
module.system.haste.name_reducers='^\(.*\)\.android$' -> '\1'
39+
module.system.haste.name_reducers='^\(.*\)\.native$' -> '\1'
40+
module.system.haste.paths.blacklist=.*/__tests__/.*
41+
module.system.haste.paths.blacklist=.*/__mocks__/.*
42+
module.system.haste.paths.blacklist=<PROJECT_ROOT>/node_modules/react-native/Libraries/Animated/src/polyfills/.*
43+
module.system.haste.paths.whitelist=<PROJECT_ROOT>/node_modules/react-native/Libraries/.*
2844

2945
munge_underscores=true
3046

@@ -39,7 +55,5 @@ suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(4[0-9]\\|[1-3][0-9]\\|
3955
suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
4056
suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError
4157

42-
unsafe.enable_getters_and_setters=true
43-
4458
[version]
45-
^0.49.1
59+
^0.86.0

Demo/.gitignore

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ buck-out/
4848
# For more information about the recommended setup visit:
4949
# https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md
5050

51-
fastlane/report.xml
52-
fastlane/Preview.html
53-
fastlane/screenshots
51+
*/fastlane/report.xml
52+
*/fastlane/Preview.html
53+
*/fastlane/screenshots
54+
55+
# Bundle artifact
56+
*.jsbundle

Demo/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",

Demo/android/app/build.gradle

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -90,25 +90,22 @@ def enableSeparateBuildPerCPUArchitecture = false
9090
def enableProguardInReleaseBuilds = false
9191

9292
android {
93-
compileSdkVersion 23
94-
buildToolsVersion "23.0.1"
93+
compileSdkVersion rootProject.ext.compileSdkVersion
94+
buildToolsVersion rootProject.ext.buildToolsVersion
9595

9696
defaultConfig {
9797
applicationId "fr.archriss.demo.renderhtml"
98-
minSdkVersion 16
99-
targetSdkVersion 22
98+
minSdkVersion rootProject.ext.minSdkVersion
99+
targetSdkVersion rootProject.ext.targetSdkVersion
100100
versionCode 1
101101
versionName "1.0"
102-
ndk {
103-
abiFilters "armeabi-v7a", "x86"
104-
}
105102
}
106103
splits {
107104
abi {
108105
reset()
109106
enable enableSeparateBuildPerCPUArchitecture
110107
universalApk false // If true, also generate a universal APK
111-
include "armeabi-v7a", "x86"
108+
include "armeabi-v7a", "x86", "arm64-v8a"
112109
}
113110
}
114111
buildTypes {
@@ -122,7 +119,7 @@ android {
122119
variant.outputs.each { output ->
123120
// For each separate APK per architecture, set a unique version code as described here:
124121
// http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits
125-
def versionCodes = ["armeabi-v7a":1, "x86":2]
122+
def versionCodes = ["armeabi-v7a":1, "x86":2, "arm64-v8a": 3]
126123
def abi = output.getFilter(OutputFile.ABI)
127124
if (abi != null) { // null for the universal-debug, universal-release variants
128125
output.versionCodeOverride =
@@ -133,9 +130,9 @@ android {
133130
}
134131

135132
dependencies {
136-
compile fileTree(dir: "libs", include: ["*.jar"])
137-
compile "com.android.support:appcompat-v7:23.0.1"
138-
compile "com.facebook.react:react-native:+" // From node_modules
133+
implementation fileTree(dir: "libs", include: ["*.jar"])
134+
implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
135+
implementation "com.facebook.react:react-native:+" // From node_modules
139136
}
140137

141138
// Run this once to be able to run the application with BUCK

Demo/android/app/build_defs.bzl

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+
)

Demo/android/app/proguard-rules.pro

Lines changed: 0 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -15,56 +15,3 @@
1515
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
1616
# public *;
1717
#}
18-
19-
# Disabling obfuscation is useful if you collect stack traces from production crashes
20-
# (unless you are using a system that supports de-obfuscate the stack traces).
21-
-dontobfuscate
22-
23-
# React Native
24-
25-
# Keep our interfaces so they can be used by other ProGuard rules.
26-
# See http://sourceforge.net/p/proguard/bugs/466/
27-
-keep,allowobfuscation @interface com.facebook.proguard.annotations.DoNotStrip
28-
-keep,allowobfuscation @interface com.facebook.proguard.annotations.KeepGettersAndSetters
29-
-keep,allowobfuscation @interface com.facebook.common.internal.DoNotStrip
30-
31-
# Do not strip any method/class that is annotated with @DoNotStrip
32-
-keep @com.facebook.proguard.annotations.DoNotStrip class *
33-
-keep @com.facebook.common.internal.DoNotStrip class *
34-
-keepclassmembers class * {
35-
@com.facebook.proguard.annotations.DoNotStrip *;
36-
@com.facebook.common.internal.DoNotStrip *;
37-
}
38-
39-
-keepclassmembers @com.facebook.proguard.annotations.KeepGettersAndSetters class * {
40-
void set*(***);
41-
*** get*();
42-
}
43-
44-
-keep class * extends com.facebook.react.bridge.JavaScriptModule { *; }
45-
-keep class * extends com.facebook.react.bridge.NativeModule { *; }
46-
-keepclassmembers,includedescriptorclasses class * { native <methods>; }
47-
-keepclassmembers class * { @com.facebook.react.uimanager.UIProp <fields>; }
48-
-keepclassmembers class * { @com.facebook.react.uimanager.annotations.ReactProp <methods>; }
49-
-keepclassmembers class * { @com.facebook.react.uimanager.annotations.ReactPropGroup <methods>; }
50-
51-
-dontwarn com.facebook.react.**
52-
53-
# TextLayoutBuilder uses a non-public Android constructor within StaticLayout.
54-
# See libs/proxy/src/main/java/com/facebook/fbui/textlayoutbuilder/proxy for details.
55-
-dontwarn android.text.StaticLayout
56-
57-
# okhttp
58-
59-
-keepattributes Signature
60-
-keepattributes *Annotation*
61-
-keep class okhttp3.** { *; }
62-
-keep interface okhttp3.** { *; }
63-
-dontwarn okhttp3.**
64-
65-
# okio
66-
67-
-keep class sun.misc.Unsafe { *; }
68-
-dontwarn java.nio.file.*
69-
-dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement
70-
-dontwarn okio.**

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

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,12 @@
66
<uses-permission android:name="android.permission.INTERNET" />
77
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>
88

9-
<uses-sdk
10-
android:minSdkVersion="16"
11-
android:targetSdkVersion="22" />
12-
139
<application
1410
android:name=".MainApplication"
15-
android:allowBackup="true"
1611
android:label="@string/app_name"
1712
android:icon="@mipmap/ic_launcher"
13+
android:roundIcon="@mipmap/ic_launcher_round"
14+
android:allowBackup="false"
1815
android:theme="@style/AppTheme">
1916
<activity
2017
android:name=".MainActivity"
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading
Loading

Demo/android/build.gradle

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +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.2"
6+
minSdkVersion = 16
7+
compileSdkVersion = 28
8+
targetSdkVersion = 27
9+
supportLibVersion = "28.0.0"
10+
}
411
repositories {
12+
google()
513
jcenter()
614
}
715
dependencies {
8-
classpath 'com.android.tools.build:gradle:2.2.3'
16+
classpath 'com.android.tools.build:gradle:3.2.1'
917

1018
// NOTE: Do not place your application dependencies here; they belong
1119
// in the individual module build.gradle files
@@ -15,10 +23,17 @@ buildscript {
1523
allprojects {
1624
repositories {
1725
mavenLocal()
26+
google()
1827
jcenter()
1928
maven {
2029
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
2130
url "$rootDir/../node_modules/react-native/android"
2231
}
2332
}
2433
}
34+
35+
36+
task wrapper(type: Wrapper) {
37+
gradleVersion = '4.7'
38+
distributionUrl = distributionUrl.replace("bin", "all")
39+
}

Demo/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
2.01 KB
Binary file not shown.

Demo/android/gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
33
zipStoreBase=GRADLE_USER_HOME
44
zipStorePath=wrapper/dists
5-
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip
5+
distributionUrl=https\://services.gradle.org/distributions/gradle-4.7-all.zip

0 commit comments

Comments
 (0)