Skip to content

Commit fc3cec6

Browse files
committed
Update Basic example to latest dependencies
Update dependency versions and project files for iOS and Android
1 parent abf323b commit fc3cec6

File tree

14 files changed

+127
-187
lines changed

14 files changed

+127
-187
lines changed

examples/Basic/.flowconfig

Lines changed: 23 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -1,71 +1,28 @@
11
[ignore]
22

33
# We fork some components by platform.
4-
.*/*.web.js
5-
.*/*.android.js
4+
.*/*[.]android.js
65

7-
# Some modules have their own node_modules with overlap
8-
.*/node_modules/node-haste/.*
9-
10-
# Ugh
11-
.*/node_modules/babel.*
12-
.*/node_modules/babylon.*
13-
.*/node_modules/invariant.*
14-
15-
# Ignore react and fbjs where there are overlaps, but don't ignore
16-
# anything that react-native relies on
17-
.*/node_modules/fbjs/lib/Map.js
18-
.*/node_modules/fbjs/lib/ErrorUtils.js
19-
20-
# Flow has a built-in definition for the 'react' module which we prefer to use
21-
# over the currently-untyped source
22-
.*/node_modules/react/react.js
23-
.*/node_modules/react/lib/React.js
24-
.*/node_modules/react/lib/ReactDOM.js
25-
26-
.*/__mocks__/.*
27-
.*/__tests__/.*
28-
29-
.*/commoner/test/source/widget/share.js
30-
31-
# Ignore commoner tests
32-
.*/node_modules/commoner/test/.*
33-
34-
# See https://github.com/facebook/flow/issues/442
35-
.*/react-tools/node_modules/commoner/lib/reader.js
36-
37-
# Ignore jest
38-
.*/node_modules/jest-cli/.*
39-
40-
# Ignore Website
41-
.*/website/.*
42-
43-
# Ignore generators
6+
# Ignore templates with `@flow` in header
447
.*/local-cli/generator.*
458

46-
# Ignore BUCK generated folders
47-
.*\.buckd/
9+
# Ignore malformed json
10+
.*/node_modules/y18n/test/.*\.json
4811

49-
# Ignore RNPM
50-
.*/local-cli/rnpm/.*
12+
# Ignore the website subdir
13+
<PROJECT_ROOT>/website/.*
5114

52-
.*/node_modules/is-my-json-valid/test/.*\.json
53-
.*/node_modules/iconv-lite/encodings/tables/.*\.json
54-
.*/node_modules/y18n/test/.*\.json
55-
.*/node_modules/spdx-license-ids/spdx-license-ids.json
56-
.*/node_modules/spdx-exceptions/index.json
57-
.*/node_modules/resolve/test/subdirs/node_modules/a/b/c/x.json
58-
.*/node_modules/resolve/lib/core.json
59-
.*/node_modules/jsonparse/samplejson/.*\.json
60-
.*/node_modules/json5/test/.*\.json
61-
.*/node_modules/ua-parser-js/test/.*\.json
62-
.*/node_modules/builtin-modules/builtin-modules.json
63-
.*/node_modules/binary-extensions/binary-extensions.json
64-
.*/node_modules/url-regex/tlds.json
65-
.*/node_modules/joi/.*\.json
66-
.*/node_modules/isemail/.*\.json
67-
.*/node_modules/tr46/.*\.json
15+
# Ignore BUCK generated dirs
16+
<PROJECT_ROOT>/\.buckd/
6817

18+
# Ignore unexpected extra @providesModule
19+
.*/node_modules/commoner/test/source/widget/share.js
20+
21+
# Ignore duplicate module providers
22+
# For RN Apps installed via npm, "Libraries" folder is inside node_modules/react-native but in the source repo it is in the root
23+
.*/Libraries/react-native/React.js
24+
.*/Libraries/react-native/ReactNative.js
25+
.*/node_modules/jest-runtime/build/__tests__/.*
6926

7027
[include]
7128

@@ -80,6 +37,8 @@ module.system=haste
8037
esproposal.class_static_fields=enable
8138
esproposal.class_instance_fields=enable
8239

40+
experimental.strict_type_args=true
41+
8342
munge_underscores=true
8443

8544
module.name_mapper='^image![a-zA-Z0-9$_-]+$' -> 'GlobalImageStub'
@@ -89,9 +48,11 @@ suppress_type=$FlowIssue
8948
suppress_type=$FlowFixMe
9049
suppress_type=$FixMe
9150

92-
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(2[0-5]\\|1[0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)
93-
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(2[0-5]\\|1[0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+
51+
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(3[0-3]\\|[1-2][0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)
52+
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(3[0-3]\\|1[0-9]\\|[1-2][0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+
9453
suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
9554

55+
unsafe.enable_getters_and_setters=true
56+
9657
[version]
97-
^0.25.0
58+
^0.33.0

examples/Basic/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ project.xcworkspace
2424

2525
# Android/IJ
2626
#
27+
*.iml
2728
.idea
2829
.gradle
2930
local.properties

examples/Basic/android/app/BUCK

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import re
55
# - install Buck
66
# - `npm start` - to start the packager
77
# - `cd android`
8-
# - `keytool -genkey -v -keystore keystores/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname "CN=Android Debug,O=Android,C=US`
8+
# - `keytool -genkey -v -keystore keystores/debug.keystore -storepass android -alias androiddebugkey -keypass android -dname "CN=Android Debug,O=Android,C=US"`
99
# - `./gradlew :app:copyDownloadableDepsToLibs` - make all Gradle compile dependencies available to Buck
1010
# - `buck install -r android/app` - compile, install and run application
1111
#

examples/Basic/android/app/build.gradle

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,13 @@ import com.android.build.OutputFile
5555
* // date; if you have any other folders that you want to ignore for performance reasons (gradle
5656
* // indexes the entire tree), add them here. Alternatively, if you have JS files in android/
5757
* // for example, you might want to remove it from here.
58-
* inputExcludes: ["android/**", "ios/**"]
58+
* inputExcludes: ["android/**", "ios/**"],
59+
*
60+
* // override which node gets called and with what additional arguments
61+
* nodeExecutableAndArgs: ["node"]
62+
*
63+
* // supply additional arguments to the packager
64+
* extraPackagerArgs: []
5965
* ]
6066
*/
6167

@@ -89,7 +95,7 @@ android {
8995
ndk {
9096
abiFilters "armeabi-v7a", "x86"
9197
}
92-
renderscriptTargetApi 20
98+
renderscriptTargetApi 21
9399
renderscriptSupportModeEnabled true
94100
}
95101
splits {
@@ -126,10 +132,10 @@ repositories {
126132
}
127133

128134
dependencies {
135+
compile project(':react-native-blur')
129136
compile fileTree(dir: "libs", include: ["*.jar"])
130137
compile "com.android.support:appcompat-v7:23.4.0"
131-
compile "com.facebook.react:react-native:+" // From node_modules
132-
compile project(':react-native-blur')
138+
compile "com.facebook.react:react-native:0.36.0" // From node_modules
133139
}
134140

135141
buildscript {

examples/Basic/android/app/proguard-rules.pro

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,14 @@
2626
# See http://sourceforge.net/p/proguard/bugs/466/
2727
-keep,allowobfuscation @interface com.facebook.proguard.annotations.DoNotStrip
2828
-keep,allowobfuscation @interface com.facebook.proguard.annotations.KeepGettersAndSetters
29+
-keep,allowobfuscation @interface com.facebook.common.internal.DoNotStrip
2930

3031
# Do not strip any method/class that is annotated with @DoNotStrip
3132
-keep @com.facebook.proguard.annotations.DoNotStrip class *
33+
-keep @com.facebook.common.internal.DoNotStrip class *
3234
-keepclassmembers class * {
3335
@com.facebook.proguard.annotations.DoNotStrip *;
36+
@com.facebook.common.internal.DoNotStrip *;
3437
}
3538

3639
-keepclassmembers @com.facebook.proguard.annotations.KeepGettersAndSetters class * {

examples/Basic/android/app/src/main/AndroidManifest.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,13 @@
44
<uses-permission android:name="android.permission.INTERNET" />
55

66
<application
7+
android:name=".MainApplication"
78
android:allowBackup="true"
89
android:label="@string/app_name"
910
android:icon="@mipmap/ic_launcher"
1011
android:theme="@style/AppTheme">
1112
<activity
12-
android:name=".MainActivity"
13+
android:name="com.basic.MainActivity"
1314
android:label="@string/app_name">
1415
<intent-filter>
1516
<action android:name="android.intent.action.MAIN" />
Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
package com.basic;
22

33
import com.facebook.react.ReactActivity;
4-
import com.cmcewen.blurview.BlurViewPackage;
5-
import com.facebook.react.ReactPackage;
6-
import com.facebook.react.shell.MainReactPackage;
7-
8-
import java.util.Arrays;
9-
import java.util.List;
104

115
public class MainActivity extends ReactActivity {
126

@@ -18,25 +12,4 @@ public class MainActivity extends ReactActivity {
1812
protected String getMainComponentName() {
1913
return "Basic";
2014
}
21-
22-
/**
23-
* Returns whether dev mode should be enabled.
24-
* This enables e.g. the dev menu.
25-
*/
26-
@Override
27-
protected boolean getUseDeveloperSupport() {
28-
return BuildConfig.DEBUG;
29-
}
30-
31-
/**
32-
* A list of packages used by the app. If the app uses additional views
33-
* or modules besides the default ones, add more packages here.
34-
*/
35-
@Override
36-
protected List<ReactPackage> getPackages() {
37-
return Arrays.<ReactPackage>asList(
38-
new MainReactPackage(),
39-
new BlurViewPackage()
40-
);
41-
}
4215
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
package com.basic;
2+
3+
import android.app.Application;
4+
import android.util.Log;
5+
6+
import com.facebook.react.ReactApplication;
7+
import com.cmcewen.blurview.BlurViewPackage;
8+
import com.facebook.react.ReactInstanceManager;
9+
import com.facebook.react.ReactNativeHost;
10+
import com.facebook.react.ReactPackage;
11+
import com.facebook.react.shell.MainReactPackage;
12+
13+
import java.util.Arrays;
14+
import java.util.List;
15+
16+
public class MainApplication extends Application implements ReactApplication {
17+
18+
private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
19+
@Override
20+
protected boolean getUseDeveloperSupport() {
21+
return BuildConfig.DEBUG;
22+
}
23+
24+
@Override
25+
protected List<ReactPackage> getPackages() {
26+
return Arrays.<ReactPackage>asList(
27+
new MainReactPackage(),
28+
new BlurViewPackage()
29+
);
30+
}
31+
};
32+
33+
@Override
34+
public ReactNativeHost getReactNativeHost() {
35+
return mReactNativeHost;
36+
}
37+
}

examples/Basic/android/build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ buildscript {
55
jcenter()
66
}
77
dependencies {
8-
classpath 'com.android.tools.build:gradle:2.1.2'
8+
classpath 'com.android.tools.build:gradle:2.2.2'
99

1010
// NOTE: Do not place your application dependencies here; they belong
1111
// in the individual module build.gradle files
@@ -18,7 +18,7 @@ allprojects {
1818
jcenter()
1919
maven {
2020
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
21-
url "$projectDir/../../node_modules/react-native/android"
21+
url "$rootDir/../node_modules/react-native/android"
2222
}
2323
}
2424
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#Mon Jun 13 16:36:53 EDT 2016
1+
#Tue Nov 08 01:08:08 CET 2016
22
distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip

0 commit comments

Comments
 (0)