Skip to content

Commit fc50b27

Browse files
committed
init codebase
0 parents  commit fc50b27

Some content is hidden

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

44 files changed

+2473
-0
lines changed

.editorconfig

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# EditorConfig is awesome: http://EditorConfig.org
2+
3+
# top-most EditorConfig file
4+
root = true
5+
6+
# Unix-style newlines with a newline ending every file
7+
[*]
8+
charset = utf-8
9+
end_of_line = lf
10+
indent_style = space
11+
indent_size = 4
12+
trim_trailing_whitespace = true
13+
insert_final_newline = true

.gitattributes

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Auto detect text files and perform LF normalization
2+
* text=auto
3+
4+
# Custom for Visual Studio
5+
*.cs diff=csharp
6+
7+
# Standard to msysgit
8+
*.doc diff=astextplain
9+
*.DOC diff=astextplain
10+
*.docx diff=astextplain
11+
*.DOCX diff=astextplain
12+
*.dot diff=astextplain
13+
*.DOT diff=astextplain
14+
*.pdf diff=astextplain
15+
*.PDF diff=astextplain
16+
*.rtf diff=astextplain
17+
*.RTF diff=astextplain

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules/
2+
.idea/

Example/.flowconfig

+65
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
[ignore]
2+
3+
# We fork some components by platform.
4+
.*/*.web.js
5+
.*/*.android.js
6+
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/Promise.js
19+
.*/node_modules/fbjs/lib/fetch.js
20+
.*/node_modules/fbjs/lib/ExecutionEnvironment.js
21+
.*/node_modules/fbjs/lib/isEmpty.js
22+
.*/node_modules/fbjs/lib/crc32.js
23+
.*/node_modules/fbjs/lib/ErrorUtils.js
24+
25+
# Flow has a built-in definition for the 'react' module which we prefer to use
26+
# over the currently-untyped source
27+
.*/node_modules/react/react.js
28+
.*/node_modules/react/lib/React.js
29+
.*/node_modules/react/lib/ReactDOM.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+
[include]
44+
45+
[libs]
46+
node_modules/react-native/Libraries/react-native/react-native-interface.js
47+
48+
[options]
49+
module.system=haste
50+
51+
munge_underscores=true
52+
53+
module.name_mapper='^image![a-zA-Z0-9$_-]+$' -> 'GlobalImageStub'
54+
module.name_mapper='^[./a-zA-Z0-9$_-]+\.\(bmp\|gif\|jpg\|jpeg\|png\|psd\|svg\|webp\|m4v\|mov\|mp4\|mpeg\|mpg\|webm\|aac\|aiff\|caf\|m4a\|mp3\|wav\|html\)$' -> 'RelativeImageStub'
55+
56+
suppress_type=$FlowIssue
57+
suppress_type=$FlowFixMe
58+
suppress_type=$FixMe
59+
60+
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(2[0-1]\\|1[0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)
61+
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(2[0-1]\\|1[0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+
62+
suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
63+
64+
[version]
65+
0.21.0

Example/.gitignore

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# OSX
2+
#
3+
.DS_Store
4+
5+
# Xcode
6+
#
7+
build/
8+
*.pbxuser
9+
!default.pbxuser
10+
*.mode1v3
11+
!default.mode1v3
12+
*.mode2v3
13+
!default.mode2v3
14+
*.perspectivev3
15+
!default.perspectivev3
16+
xcuserdata
17+
*.xccheckout
18+
*.moved-aside
19+
DerivedData
20+
*.hmap
21+
*.ipa
22+
*.xcuserstate
23+
project.xcworkspace
24+
25+
# Android/IJ
26+
#
27+
.idea
28+
.gradle
29+
local.properties
30+
31+
# node.js
32+
#
33+
node_modules/
34+
npm-debug.log

Example/.watchmanconfig

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

Example/android/app/build.gradle

+125
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
apply plugin: "com.android.application"
2+
3+
import com.android.build.OutputFile
4+
5+
/**
6+
* The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets
7+
* and bundleReleaseJsAndAssets).
8+
* These basically call `react-native bundle` with the correct arguments during the Android build
9+
* cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the
10+
* bundle directly from the development server. Below you can see all the possible configurations
11+
* and their defaults. If you decide to add a configuration block, make sure to add it before the
12+
* `apply from: "react.gradle"` line.
13+
*
14+
* project.ext.react = [
15+
* // the name of the generated asset file containing your JS bundle
16+
* bundleAssetName: "index.android.bundle",
17+
*
18+
* // the entry file for bundle generation
19+
* entryFile: "index.android.js",
20+
*
21+
* // whether to bundle JS and assets in debug mode
22+
* bundleInDebug: false,
23+
*
24+
* // whether to bundle JS and assets in release mode
25+
* bundleInRelease: true,
26+
*
27+
* // whether to bundle JS and assets in another build variant (if configured).
28+
* // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants
29+
* // The configuration property is in the format 'bundleIn${productFlavor}${buildType}'
30+
* // bundleInFreeDebug: true,
31+
* // bundleInPaidRelease: true,
32+
* // bundleInBeta: true,
33+
*
34+
* // the root of your project, i.e. where "package.json" lives
35+
* root: "../../",
36+
*
37+
* // where to put the JS bundle asset in debug mode
38+
* jsBundleDirDebug: "$buildDir/intermediates/assets/debug",
39+
*
40+
* // where to put the JS bundle asset in release mode
41+
* jsBundleDirRelease: "$buildDir/intermediates/assets/release",
42+
*
43+
* // where to put drawable resources / React Native assets, e.g. the ones you use via
44+
* // require('./image.png')), in debug mode
45+
* resourcesDirDebug: "$buildDir/intermediates/res/merged/debug",
46+
*
47+
* // where to put drawable resources / React Native assets, e.g. the ones you use via
48+
* // require('./image.png')), in release mode
49+
* resourcesDirRelease: "$buildDir/intermediates/res/merged/release",
50+
*
51+
* // by default the gradle tasks are skipped if none of the JS files or assets change; this means
52+
* // that we don't look at files in android/ or ios/ to determine whether the tasks are up to
53+
* // date; if you have any other folders that you want to ignore for performance reasons (gradle
54+
* // indexes the entire tree), add them here. Alternatively, if you have JS files in android/
55+
* // for example, you might want to remove it from here.
56+
* inputExcludes: ["android/**", "ios/**"]
57+
* ]
58+
*/
59+
60+
apply from: "react.gradle"
61+
62+
/**
63+
* Set this to true to create three separate APKs instead of one:
64+
* - A universal APK that works on all devices
65+
* - An APK that only works on ARM devices
66+
* - An APK that only works on x86 devices
67+
* The advantage is the size of the APK is reduced by about 4MB.
68+
* Upload all the APKs to the Play Store and people will download
69+
* the correct one based on the CPU architecture of their device.
70+
*/
71+
def enableSeparateBuildPerCPUArchitecture = false
72+
73+
/**
74+
* Run Proguard to shrink the Java bytecode in release builds.
75+
*/
76+
def enableProguardInReleaseBuilds = false
77+
78+
android {
79+
compileSdkVersion 23
80+
buildToolsVersion "23.0.1"
81+
82+
defaultConfig {
83+
applicationId "com.reactnativeroottoast"
84+
minSdkVersion 16
85+
targetSdkVersion 22
86+
versionCode 1
87+
versionName "1.0"
88+
ndk {
89+
abiFilters "armeabi-v7a", "x86"
90+
}
91+
}
92+
splits {
93+
abi {
94+
enable enableSeparateBuildPerCPUArchitecture
95+
universalApk false
96+
reset()
97+
include "armeabi-v7a", "x86"
98+
}
99+
}
100+
buildTypes {
101+
release {
102+
minifyEnabled enableProguardInReleaseBuilds
103+
proguardFiles getDefaultProguardFile("proguard-android.txt"), "proguard-rules.pro"
104+
}
105+
}
106+
// applicationVariants are e.g. debug, release
107+
applicationVariants.all { variant ->
108+
variant.outputs.each { output ->
109+
// For each separate APK per architecture, set a unique version code as described here:
110+
// http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits
111+
def versionCodes = ["armeabi-v7a":1, "x86":2]
112+
def abi = output.getFilter(OutputFile.ABI)
113+
if (abi != null) { // null for the universal-debug, universal-release variants
114+
output.versionCodeOverride =
115+
versionCodes.get(abi) * 1048576 + defaultConfig.versionCode
116+
}
117+
}
118+
}
119+
}
120+
121+
dependencies {
122+
compile fileTree(dir: "libs", include: ["*.jar"])
123+
compile "com.android.support:appcompat-v7:23.0.1"
124+
compile "com.facebook.react:react-native:0.20.+"
125+
}
+67
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
# Add project specific ProGuard rules here.
2+
# By default, the flags in this file are appended to flags specified
3+
# in /usr/local/Cellar/android-sdk/24.3.3/tools/proguard/proguard-android.txt
4+
# You can edit the include path and order by changing the proguardFiles
5+
# directive in build.gradle.
6+
#
7+
# For more details, see
8+
# http://developer.android.com/guide/developing/tools/proguard.html
9+
10+
# 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+
30+
# Do not strip any method/class that is annotated with @DoNotStrip
31+
-keep @com.facebook.proguard.annotations.DoNotStrip class *
32+
-keepclassmembers class * {
33+
@com.facebook.proguard.annotations.DoNotStrip *;
34+
}
35+
36+
-keepclassmembers @com.facebook.proguard.annotations.KeepGettersAndSetters class * {
37+
void set*(***);
38+
*** get*();
39+
}
40+
41+
-keep class * extends com.facebook.react.bridge.JavaScriptModule { *; }
42+
-keep class * extends com.facebook.react.bridge.NativeModule { *; }
43+
-keepclassmembers,includedescriptorclasses class * { native <methods>; }
44+
-keepclassmembers class * { @com.facebook.react.uimanager.UIProp <fields>; }
45+
-keepclassmembers class * { @com.facebook.react.uimanager.annotations.ReactProp <methods>; }
46+
-keepclassmembers class * { @com.facebook.react.uimanager.annotations.ReactPropGroup <methods>; }
47+
48+
-dontwarn com.facebook.react.**
49+
50+
# okhttp
51+
52+
-keepattributes Signature
53+
-keepattributes *Annotation*
54+
-keep class com.squareup.okhttp.** { *; }
55+
-keep interface com.squareup.okhttp.** { *; }
56+
-dontwarn com.squareup.okhttp.**
57+
58+
# okio
59+
60+
-keep class sun.misc.Unsafe { *; }
61+
-dontwarn java.nio.file.*
62+
-dontwarn org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement
63+
-dontwarn okio.**
64+
65+
# stetho
66+
67+
-dontwarn com.facebook.stetho.**

0 commit comments

Comments
 (0)