Skip to content

Commit 664c61c

Browse files
committed
Upgrade to RN61 - app is running
1 parent 1907f3c commit 664c61c

File tree

71 files changed

+6864
-7666
lines changed

Some content is hidden

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

71 files changed

+6864
-7666
lines changed

.gitignore

+12-1
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,14 @@ ios/info.plist
4343
# Carthage/Checkouts
4444

4545
Carthage/Build
46+
/ios/Pods/
4647

4748
# fastlane
4849
#
4950
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
5051
# screenshots whenever they are needed.
5152
# For more information about the recommended setup visit:
52-
# https://github.com/fastlane/fastlane/blob/master/fastlane/docs/Gitignore.md
53+
# https://docs.fastlane.tools/best-practices/source-control/
5354

5455
fastlane/report.xml
5556
fastlane/screenshots
@@ -91,6 +92,11 @@ project.xcworkspace
9192
.idea
9293
.gradle
9394
local.properties
95+
android/.project
96+
android/.settings/*
97+
android/app/.project
98+
android/app/.classpath
99+
android/app/.settings/*
94100

95101
# node.js
96102
#
@@ -102,4 +108,9 @@ buck-out/
102108
\.buckd/
103109
android/app/libs
104110
*.keystore
111+
!debug.keystore
105112
yarn.lock
113+
114+
#vscoe
115+
.vscode/*
116+

ReactNativeKeyboardInput.podspec

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
require 'json'
2+
3+
package = JSON.parse(File.read(File.join(__dir__, 'package.json')))
4+
5+
Pod::Spec.new do |s|
6+
s.name = "ReactNativeKeyboardInput"
7+
s.version = package['version']
8+
s.summary = package['description']
9+
10+
s.authors = package['author']
11+
s.homepage = package['homepage']
12+
s.license = package['license']
13+
s.platforms = { :ios => "9.0", :tvos => "9.2" }
14+
15+
s.module_name = 'ReactNativeKeyboardInput'
16+
17+
s.source = { :git => "https://github.com/wix/react-native-autogrow-textinput", :tag => "#{s.version}" }
18+
s.source_files = "./ios/**/*.{h,m}"
19+
20+
s.dependency 'React'
21+
s.frameworks = 'UIKit'
22+
end

android/app/BUCK

+28-39
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import re
2-
31
# To learn about Buck see [Docs](https://buckbuild.com/).
42
# To run your application with Buck:
53
# - install Buck
@@ -10,57 +8,48 @@ import re
108
# - `buck install -r android/app` - compile, install and run application
119
#
1210

11+
load(":build_defs.bzl", "create_aar_targets", "create_jar_targets")
12+
1313
lib_deps = []
14-
for jarfile in glob(['libs/*.jar']):
15-
name = 'jars__' + re.sub(r'^.*/([^/]+)\.jar$', r'\1', jarfile)
16-
lib_deps.append(':' + name)
17-
prebuilt_jar(
18-
name = name,
19-
binary_jar = jarfile,
20-
)
2114

22-
for aarfile in glob(['libs/*.aar']):
23-
name = 'aars__' + re.sub(r'^.*/([^/]+)\.aar$', r'\1', aarfile)
24-
lib_deps.append(':' + name)
25-
android_prebuilt_aar(
26-
name = name,
27-
aar = aarfile,
28-
)
15+
create_aar_targets(glob(["libs/*.aar"]))
16+
17+
create_jar_targets(glob(["libs/*.jar"]))
2918

3019
android_library(
31-
name = 'all-libs',
32-
exported_deps = lib_deps
20+
name = "all-libs",
21+
exported_deps = lib_deps,
3322
)
3423

3524
android_library(
36-
name = 'app-code',
37-
srcs = glob([
38-
'src/main/java/**/*.java',
39-
]),
40-
deps = [
41-
':all-libs',
42-
':build_config',
43-
':res',
44-
],
25+
name = "app-code",
26+
srcs = glob([
27+
"src/main/java/**/*.java",
28+
]),
29+
deps = [
30+
":all-libs",
31+
":build_config",
32+
":res",
33+
],
4534
)
4635

4736
android_build_config(
48-
name = 'build_config',
49-
package = 'com.awesomeproject',
37+
name = "build_config",
38+
package = "com.keyboardinput",
5039
)
5140

5241
android_resource(
53-
name = 'res',
54-
res = 'src/main/res',
55-
package = 'com.awesomeproject',
42+
name = "res",
43+
package = "com.keyboardinput",
44+
res = "src/main/res",
5645
)
5746

5847
android_binary(
59-
name = 'app',
60-
package_type = 'debug',
61-
manifest = 'src/main/AndroidManifest.xml',
62-
keystore = '//android/keystores:debug',
63-
deps = [
64-
':app-code',
65-
],
48+
name = "app",
49+
keystore = "//android/keystores:debug",
50+
manifest = "src/main/AndroidManifest.xml",
51+
package_type = "debug",
52+
deps = [
53+
":app-code",
54+
],
6655
)

android/app/build.gradle

+74-12
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ import com.android.build.OutputFile
1818
* // the entry file for bundle generation
1919
* entryFile: "index.android.js",
2020
*
21+
* // https://facebook.github.io/react-native/docs/performance#enable-the-ram-format
22+
* bundleCommand: "ram-bundle",
23+
*
2124
* // whether to bundle JS and assets in debug mode
2225
* bundleInDebug: false,
2326
*
@@ -33,6 +36,13 @@ import com.android.build.OutputFile
3336
* // bundleInPaidRelease: true,
3437
* // bundleInBeta: true,
3538
*
39+
* // whether to disable dev mode in custom build variants (by default only disabled in release)
40+
* // for example: to disable dev mode in the staging build type (if configured)
41+
* devDisabledInStaging: true,
42+
* // The configuration property can be in the following formats
43+
* // 'devDisabledIn${productFlavor}${buildType}'
44+
* // 'devDisabledIn${buildType}'
45+
*
3646
* // the root of your project, i.e. where "package.json" lives
3747
* root: "../../",
3848
*
@@ -58,13 +68,18 @@ import com.android.build.OutputFile
5868
* inputExcludes: ["android/**", "ios/**"],
5969
*
6070
* // override which node gets called and with what additional arguments
61-
* nodeExecutableAndArgs: ["node"]
71+
* nodeExecutableAndArgs: ["node"],
6272
*
6373
* // supply additional arguments to the packager
6474
* extraPackagerArgs: []
6575
* ]
6676
*/
6777

78+
project.ext.react = [
79+
entryFile: "index.js",
80+
enableHermes: false, // clean and rebuild if changing
81+
]
82+
6883
apply from: "../../node_modules/react-native/react.gradle"
6984

7085
/**
@@ -82,30 +97,68 @@ def enableSeparateBuildPerCPUArchitecture = false
8297
*/
8398
def enableProguardInReleaseBuilds = false
8499

100+
/**
101+
* The preferred build flavor of JavaScriptCore.
102+
*
103+
* For example, to use the international variant, you can use:
104+
* `def jscFlavor = 'org.webkit:android-jsc-intl:+'`
105+
*
106+
* The international variant includes ICU i18n library and necessary data
107+
* allowing to use e.g. `Date.toLocaleString` and `String.localeCompare` that
108+
* give correct results when using with locales other than en-US. Note that
109+
* this variant is about 6MiB larger per architecture than default.
110+
*/
111+
def jscFlavor = 'org.webkit:android-jsc:+'
112+
113+
/**
114+
* Whether to enable the Hermes VM.
115+
*
116+
* This should be set on project.ext.react and mirrored here. If it is not set
117+
* on project.ext.react, JavaScript will not be compiled to Hermes Bytecode
118+
* and the benefits of using Hermes will therefore be sharply reduced.
119+
*/
120+
def enableHermes = project.ext.react.get("enableHermes", false);
121+
85122
android {
86123
compileSdkVersion rootProject.ext.compileSdkVersion
87-
buildToolsVersion rootProject.ext.buildToolsVersion
124+
125+
compileOptions {
126+
sourceCompatibility JavaVersion.VERSION_1_8
127+
targetCompatibility JavaVersion.VERSION_1_8
128+
}
88129

89130
defaultConfig {
90-
applicationId "com.awesomeproject"
131+
applicationId "com.keyboardinput"
91132
minSdkVersion rootProject.ext.minSdkVersion
92133
targetSdkVersion rootProject.ext.targetSdkVersion
134+
missingDimensionStrategy "RNN.reactNativeVersion", "reactNative60"
93135
versionCode 1
94136
versionName "1.0"
95-
ndk {
96-
abiFilters "armeabi-v7a", "x86"
97-
}
98137
}
99138
splits {
100139
abi {
101140
reset()
102141
enable enableSeparateBuildPerCPUArchitecture
103142
universalApk false // If true, also generate a universal APK
104-
include "armeabi-v7a", "x86"
143+
include "armeabi-v7a", "x86", "arm64-v8a", "x86_64"
144+
}
145+
}
146+
signingConfigs {
147+
debug {
148+
storeFile file('debug.keystore')
149+
storePassword 'android'
150+
keyAlias 'androiddebugkey'
151+
keyPassword 'android'
105152
}
106153
}
107154
buildTypes {
155+
debug {
156+
signingConfig signingConfigs.debug
157+
}
108158
release {
159+
// Caution! In production, you need to generate your own keystore file.
160+
// see https://facebook.github.io/react-native/docs/signed-apk-android.
161+
signingConfig signingConfigs.debug
109162
minifyEnabled enableProguardInReleaseBuilds
110163
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
111164
}
@@ -114,24 +167,31 @@ android {
114167
applicationVariants.all { variant ->
115168
variant.outputs.each { output ->
116169
// For each separate APK per architecture, set a unique version code as described here:
117-
// http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits
118-
def versionCodes = ["armeabi-v7a":1, "x86":2]
170+
// https://developer.android.com/studio/build/configure-apk-splits.html
171+
def versionCodes = ["armeabi-v7a": 1, "x86": 2, "arm64-v8a": 3, "x86_64": 4]
119172
def abi = output.getFilter(OutputFile.ABI)
120173
if (abi != null) { // null for the universal-debug, universal-release variants
121174
output.versionCodeOverride =
122175
versionCodes.get(abi) * 1048576 + defaultConfig.versionCode
123176
}
177+
124178
}
125179
}
126180
}
127181

128182
dependencies {
129183
implementation fileTree(dir: "libs", include: ["*.jar"])
130-
implementation "com.android.support:appcompat-v7:${rootProject.ext.supportLibVersion}"
131184
implementation "com.facebook.react:react-native:+" // From node_modules
132-
133185
implementation project(":reactnativekeyboardinput")
134-
implementation project(":react-native-navigation")
186+
implementation project(':react-native-navigation')
187+
188+
if (enableHermes) {
189+
def hermesPath = "../../node_modules/hermes-engine/android/";
190+
debugImplementation files(hermesPath + "hermes-debug.aar")
191+
releaseImplementation files(hermesPath + "hermes-release.aar")
192+
} else {
193+
implementation jscFlavor
194+
}
135195
}
136196

137197
// Run this once to be able to run the application with BUCK
@@ -140,3 +200,5 @@ task copyDownloadableDepsToLibs(type: Copy) {
140200
from configurations.compile
141201
into 'libs'
142202
}
203+
204+
apply from: file("../../node_modules/@react-native-community/cli-platform-android/native_modules.gradle"); applyNativeModulesAppBuildGradle(project)

android/app/build_defs.bzl

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

android/app/debug.keystore

2.2 KB
Binary file not shown.

android/app/proguard-rules.pro

-56
Original file line numberDiff line numberDiff line change
@@ -8,59 +8,3 @@
88
# http://developer.android.com/guide/developing/tools/proguard.html
99

1010
# Add any project specific keep options here:
11-
12-
# If your project uses WebView with JS, uncomment the following
13-
# and specify the fully qualified class name to the JavaScript interface
14-
# class:
15-
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
16-
# public *;
17-
#}
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-
# okhttp
54-
55-
-keepattributes Signature
56-
-keepattributes *Annotation*
57-
-keep class okhttp3.** { *; }
58-
-keep interface okhttp3.** { *; }
59-
-dontwarn okhttp3.**
60-
61-
# okio
62-
63-
-keep class sun.misc.Unsafe { *; }
64-
-dontwarn java.nio.file.*
65-
-dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement
66-
-dontwarn okio.**

0 commit comments

Comments
 (0)