Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to React Native v0.59.0 #741

Merged
merged 26 commits into from
Mar 15, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
a17e6f5
Upgrade RN to 0.59 and React to 16.8.3
hypest Mar 12, 2019
ed54bb2
RN 0.59 uses metro-react-native-babel-transformer
hypest Mar 12, 2019
ec53385
Upgrade other packages, like RN's 0.59 init app
hypest Mar 12, 2019
b1515e0
Add JavaScriptCofre framework to the project.
SergioEstevao Mar 12, 2019
b4abcfb
Update SVG lib to latest.
SergioEstevao Mar 12, 2019
b0172f7
Update bridge to use react native version 0.59
SergioEstevao Mar 12, 2019
1574e5b
Update the android demo app
hypest Mar 12, 2019
e33ed16
Update the yarn.lock packages versions file
hypest Mar 13, 2019
b01f5f0
Fix package name mishup from copy/paste
hypest Mar 13, 2019
b9fcbfb
Update the JSC-Android version to match RN's 0.59.0
hypest Mar 13, 2019
9800cbc
Update gradle and support lib's version on Android
hypest Mar 13, 2019
26b8fa7
Upgrade gradle wrapper of the bridge project
hypest Mar 13, 2019
f7eae3d
Point to react-native-svg fork with gradle wrapper
hypest Mar 13, 2019
cb388d8
Update react-native-aztec android's gradle wrapper
hypest Mar 13, 2019
798ac8b
Update the react-native-svg fork ref
hypest Mar 13, 2019
2d351b4
Update the react-native-svg ref
hypest Mar 13, 2019
0859a08
Update to new UIManager method.
SergioEstevao Mar 13, 2019
9065eb0
Update yarn.lock file
hypest Mar 13, 2019
160690c
Match react-test-renderer version to react's
hypest Mar 14, 2019
633add2
Update flow to 0.92.0
hypest Mar 14, 2019
c2d1889
Force removeClippedSubviews to false to avoid losing focus on scroll
hypest Mar 14, 2019
3d4825c
Update JS bundles
hypest Mar 14, 2019
11220f4
Merge branch 'develop' into upgrade-to-rn-059
hypest Mar 15, 2019
8ac131c
latest yarn.lock for the same package.json
hypest Mar 15, 2019
6be29da
Merge branch 'develop' into upgrade-to-rn-059
hypest Mar 15, 2019
391f553
Build new JS bundles
hypest Mar 15, 2019
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -109,4 +109,4 @@ suppress_comment=\\(.\\|\n\\)*\\$FlowExpectedError
<PROJECT_ROOT>/node_modules/react-native-safe-area/.*

[version]
^0.67.1
^0.92.0
17 changes: 0 additions & 17 deletions android/.project

This file was deleted.

2 changes: 0 additions & 2 deletions android/.settings/org.eclipse.buildship.core.prefs

This file was deleted.

6 changes: 0 additions & 6 deletions android/app/.classpath

This file was deleted.

23 changes: 0 additions & 23 deletions android/app/.project

This file was deleted.

2 changes: 0 additions & 2 deletions android/app/.settings/org.eclipse.buildship.core.prefs

This file was deleted.

18 changes: 4 additions & 14 deletions android/app/BUCK
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,13 @@
# - `buck install -r android/app` - compile, install and run application
#

load(":build_defs.bzl", "create_aar_targets", "create_jar_targets")

lib_deps = []

for jarfile in glob(['libs/*.jar']):
name = 'jars__' + jarfile[jarfile.rindex('/') + 1: jarfile.rindex('.jar')]
lib_deps.append(':' + name)
prebuilt_jar(
name = name,
binary_jar = jarfile,
)
create_aar_targets(glob(["libs/*.aar"]))

for aarfile in glob(['libs/*.aar']):
name = 'aars__' + aarfile[aarfile.rindex('/') + 1: aarfile.rindex('.aar')]
lib_deps.append(':' + name)
android_prebuilt_aar(
name = name,
aar = aarfile,
)
create_jar_targets(glob(["libs/*.jar"]))

android_library(
name = "all-libs",
Expand Down
45 changes: 15 additions & 30 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -94,29 +94,26 @@ def enableSeparateBuildPerCPUArchitecture = false
def enableProguardInReleaseBuilds = false

android {
compileSdkVersion 27
buildToolsVersion "27.0.3"
compileSdkVersion rootProject.ext.compileSdkVersion

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}

defaultConfig {
applicationId "com.gutenberg"
minSdkVersion 21
targetSdkVersion 26
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1
versionName "1.0"
ndk {
abiFilters "armeabi-v7a", "x86"
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
splits {
abi {
reset()
enable enableSeparateBuildPerCPUArchitecture
universalApk false // If true, also generate a universal APK
include "armeabi-v7a", "x86"
include "armeabi-v7a", "x86", "arm64-v8a", "x86-64"
}
}
buildTypes {
Expand All @@ -130,7 +127,7 @@ android {
variant.outputs.each { output ->
// For each separate APK per architecture, set a unique version code as described here:
// http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits
def versionCodes = ["armeabi-v7a":1, "x86":2]
def versionCodes = ["armeabi-v7a":1, "x86":2, "arm64-v8a": 3, "x86-64": 4]
def abi = output.getFilter(OutputFile.ABI)
if (abi != null) { // null for the universal-debug, universal-release variants
output.versionCodeOverride =
Expand All @@ -140,17 +137,6 @@ android {
}
}

buildscript {
repositories {
google()
jcenter()
}

dependencies {
classpath 'com.android.tools.build:gradle:3.1.0'
}
}

repositories {
google()
jcenter()
Expand All @@ -159,19 +145,18 @@ repositories {

configurations.all {
resolutionStrategy {
force 'org.webkit:android-jsc:r224109'
force 'org.webkit:android-jsc:r236355'
}
}

dependencies {
implementation project(':react-native-svg')
implementation project(':react-native-aztec')
implementation project(':react-native-recyclerview-list')
implementation project(':react-native-aztec')
implementation project(':react-native-recyclerview-list')
implementation project(':react-native-gutenberg-bridge')
// compile fileTree(dir: "libs", include: ["*.jar"])
implementation "com.android.support:appcompat-v7:$supportLibVersion"
implementation "org.wordpress:utils:$wordpressUtilsVersion"
implementation "com.facebook.react:react-native:+" // From node_modules.
implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
implementation "com.facebook.react:react-native:+" // From node_modules
}

// Run this once to be able to run the application with BUCK
Expand Down
19 changes: 19 additions & 0 deletions android/app/build_defs.bzl
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
"""Helper definitions to glob .aar and .jar targets"""

def create_aar_targets(aarfiles):
for aarfile in aarfiles:
name = "aars__" + aarfile[aarfile.rindex("/") + 1:aarfile.rindex(".aar")]
lib_deps.append(":" + name)
android_prebuilt_aar(
name = name,
aar = aarfile,
)

def create_jar_targets(jarfiles):
for jarfile in jarfiles:
name = "jars__" + jarfile[jarfile.rindex("/") + 1:jarfile.rindex(".jar")]
lib_deps.append(":" + name)
prebuilt_jar(
name = name,
binary_jar = jarfile,
)
53 changes: 0 additions & 53 deletions android/app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -15,56 +15,3 @@
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}

# Disabling obfuscation is useful if you collect stack traces from production crashes
# (unless you are using a system that supports de-obfuscate the stack traces).
-dontobfuscate

# React Native

# Keep our interfaces so they can be used by other ProGuard rules.
# See http://sourceforge.net/p/proguard/bugs/466/
-keep,allowobfuscation @interface com.facebook.proguard.annotations.DoNotStrip
-keep,allowobfuscation @interface com.facebook.proguard.annotations.KeepGettersAndSetters
-keep,allowobfuscation @interface com.facebook.common.internal.DoNotStrip

# Do not strip any method/class that is annotated with @DoNotStrip
-keep @com.facebook.proguard.annotations.DoNotStrip class *
-keep @com.facebook.common.internal.DoNotStrip class *
-keepclassmembers class * {
@com.facebook.proguard.annotations.DoNotStrip *;
@com.facebook.common.internal.DoNotStrip *;
}

-keepclassmembers @com.facebook.proguard.annotations.KeepGettersAndSetters class * {
void set*(***);
*** get*();
}

-keep class * extends com.facebook.react.bridge.JavaScriptModule { *; }
-keep class * extends com.facebook.react.bridge.NativeModule { *; }
-keepclassmembers,includedescriptorclasses class * { native <methods>; }
-keepclassmembers class * { @com.facebook.react.uimanager.UIProp <fields>; }
-keepclassmembers class * { @com.facebook.react.uimanager.annotations.ReactProp <methods>; }
-keepclassmembers class * { @com.facebook.react.uimanager.annotations.ReactPropGroup <methods>; }

-dontwarn com.facebook.react.**

# TextLayoutBuilder uses a non-public Android constructor within StaticLayout.
# See libs/proxy/src/main/java/com/facebook/fbui/textlayoutbuilder/proxy for details.
-dontwarn android.text.StaticLayout

# okhttp

-keepattributes Signature
-keepattributes *Annotation*
-keep class okhttp3.** { *; }
-keep interface okhttp3.** { *; }
-dontwarn okhttp3.**

# okio

-keep class sun.misc.Unsafe { *; }
-dontwarn java.nio.file.*
-dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement
-dontwarn okio.**
5 changes: 5 additions & 0 deletions android/app/src/debug/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools">
<application tools:targetApi="28" tools:ignore="GoogleAppIndexingWarning" android:networkSecurityConfig="@xml/react_native_config" />
</manifest>
8 changes: 8 additions & 0 deletions android/app/src/debug/res/xml/react_native_config.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
<domain-config cleartextTrafficPermitted="true">
<domain includeSubdomains="false">localhost</domain>
<domain includeSubdomains="false">10.0.2.2</domain>
<domain includeSubdomains="false">10.0.3.2</domain>
</domain-config>
</network-security-config>
7 changes: 2 additions & 5 deletions android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,12 @@
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW"/>

<uses-sdk
android:minSdkVersion="16"
android:targetSdkVersion="22" />

<application
android:name=".MainApplication"
android:allowBackup="true"
android:label="@string/app_name"
android:icon="@mipmap/ic_launcher"
android:roundIcon="@mipmap/ic_launcher_round"
android:allowBackup="true"
android:theme="@style/AppTheme">
<activity
android:name=".MainActivity"
Expand Down
Binary file modified android/app/src/main/res/mipmap-hdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/mipmap-mdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/mipmap-xhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 7 additions & 12 deletions android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,23 +1,18 @@
buildscript {
ext {
gradlePluginVersion = '3.1.0'
kotlinVersion = '1.2.31'
supportLibVersion = '27.1.1'
tagSoupVersion = '1.2.1'
glideVersion = '3.7.0'
picassoVersion = '2.5.2'
robolectricVersion = '3.5.1'
jUnitVersion = '4.12'
jSoupVersion = '1.10.3'
gradlePluginVersion = '3.3.1'
kotlinVersion = '1.3.0'
buildToolsVersion = "28.0.3"
minSdkVersion = 21
compileSdkVersion = 28
targetSdkVersion = 28
supportLibVersion = '28.0.0'
wordpressUtilsVersion = '1.22'
espressoVersion = '3.0.1'
}

repositories {
google()
jcenter()
}

dependencies {
classpath "com.android.tools.build:gradle:$gradlePluginVersion"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
Expand Down
2 changes: 0 additions & 2 deletions android/gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,3 @@
# 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

android.useDeprecatedNdk=true
Binary file modified android/gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
3 changes: 1 addition & 2 deletions android/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#Mon Sep 08 13:53:18 PDT 2014
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.4-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.2-all.zip
Loading