Skip to content

Commit

Permalink
Update Demo
Browse files Browse the repository at this point in the history
  • Loading branch information
ldn0x7dc committed Jul 27, 2016
1 parent 6ab2e4d commit c3767fa
Show file tree
Hide file tree
Showing 14 changed files with 135 additions and 140 deletions.
70 changes: 7 additions & 63 deletions Demo/.flowconfig
Original file line number Diff line number Diff line change
@@ -1,71 +1,13 @@
[ignore]

# We fork some components by platform.
.*/*.web.js
.*/*.android.js

# Some modules have their own node_modules with overlap
.*/node_modules/node-haste/.*

# Ugh
.*/node_modules/babel.*
.*/node_modules/babylon.*
.*/node_modules/invariant.*

# Ignore react and fbjs where there are overlaps, but don't ignore
# anything that react-native relies on
.*/node_modules/fbjs/lib/Map.js
.*/node_modules/fbjs/lib/ErrorUtils.js

# Flow has a built-in definition for the 'react' module which we prefer to use
# over the currently-untyped source
.*/node_modules/react/react.js
.*/node_modules/react/lib/React.js
.*/node_modules/react/lib/ReactDOM.js

.*/__mocks__/.*
.*/__tests__/.*

.*/commoner/test/source/widget/share.js

# Ignore commoner tests
.*/node_modules/commoner/test/.*

# See https://github.com/facebook/flow/issues/442
.*/react-tools/node_modules/commoner/lib/reader.js

# Ignore jest
.*/node_modules/jest-cli/.*

# Ignore Website
.*/website/.*

# Ignore generators
# Ignore templates with `@flow` in header
.*/local-cli/generator.*

# Ignore BUCK generated folders
.*\.buckd/

# Ignore RNPM
.*/local-cli/rnpm/.*

.*/node_modules/is-my-json-valid/test/.*\.json
.*/node_modules/iconv-lite/encodings/tables/.*\.json
# Ignore malformed json
.*/node_modules/y18n/test/.*\.json
.*/node_modules/spdx-license-ids/spdx-license-ids.json
.*/node_modules/spdx-exceptions/index.json
.*/node_modules/resolve/test/subdirs/node_modules/a/b/c/x.json
.*/node_modules/resolve/lib/core.json
.*/node_modules/jsonparse/samplejson/.*\.json
.*/node_modules/json5/test/.*\.json
.*/node_modules/ua-parser-js/test/.*\.json
.*/node_modules/builtin-modules/builtin-modules.json
.*/node_modules/binary-extensions/binary-extensions.json
.*/node_modules/url-regex/tlds.json
.*/node_modules/joi/.*\.json
.*/node_modules/isemail/.*\.json
.*/node_modules/tr46/.*\.json


[include]

Expand All @@ -80,6 +22,8 @@ module.system=haste
esproposal.class_static_fields=enable
esproposal.class_instance_fields=enable

experimental.strict_type_args=true

munge_underscores=true

module.name_mapper='^image![a-zA-Z0-9$_-]+$' -> 'GlobalImageStub'
Expand All @@ -89,9 +33,9 @@ suppress_type=$FlowIssue
suppress_type=$FlowFixMe
suppress_type=$FixMe

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

[version]
^0.25.0
^0.27.0
41 changes: 41 additions & 0 deletions Demo/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# OSX
#
.DS_Store

# Xcode
#
build/
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3
xcuserdata
*.xccheckout
*.moved-aside
DerivedData
*.hmap
*.ipa
*.xcuserstate
project.xcworkspace

# Android/IJ
#
*.iml
.idea
.gradle
local.properties

# node.js
#
node_modules/
npm-debug.log

# BUCK
buck-out/
\.buckd/
android/app/libs
android/keystores/debug.keystore
8 changes: 7 additions & 1 deletion Demo/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,13 @@ import com.android.build.OutputFile
* // date; if you have any other folders that you want to ignore for performance reasons (gradle
* // indexes the entire tree), add them here. Alternatively, if you have JS files in android/
* // for example, you might want to remove it from here.
* inputExcludes: ["android/**", "ios/**"]
* inputExcludes: ["android/**", "ios/**"],
*
* // override which node gets called and with what additional arguments
* nodeExecutableAndArgs: ["node"]
*
* // supply additional arguments to the packager
* extraPackagerArgs: []
* ]
*/

Expand Down
3 changes: 3 additions & 0 deletions Demo/android/app/proguard-rules.pro
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,14 @@
# 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 * {
Expand Down
1 change: 1 addition & 0 deletions Demo/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
android:targetSdkVersion="22" />

<application
android:name=".MainApplication"
android:allowBackup="true"
android:label="@string/app_name"
android:icon="@mipmap/ic_launcher"
Expand Down
27 changes: 0 additions & 27 deletions Demo/android/app/src/main/java/com/demo/MainActivity.java
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
package com.demo;

import com.facebook.react.ReactActivity;
import com.facebook.react.ReactPackage;
import com.facebook.react.shell.MainReactPackage;
import com.greatdroid.reactnative.media.MediaKitPackage;

import java.util.Arrays;
import java.util.List;

public class MainActivity extends ReactActivity {

Expand All @@ -18,25 +12,4 @@ public class MainActivity extends ReactActivity {
protected String getMainComponentName() {
return "Demo";
}

/**
* Returns whether dev mode should be enabled.
* This enables e.g. the dev menu.
*/
@Override
protected boolean getUseDeveloperSupport() {
return BuildConfig.DEBUG;
}

/**
* A list of packages used by the app. If the app uses additional views
* or modules besides the default ones, add more packages here.
*/
@Override
protected List<ReactPackage> getPackages() {
return Arrays.<ReactPackage>asList(
new MainReactPackage(),
new MediaKitPackage()
);
}
}
38 changes: 38 additions & 0 deletions Demo/android/app/src/main/java/com/demo/MainApplication.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
package com.demo;

import android.app.Application;
import android.util.Log;

import com.facebook.react.ReactApplication;
import com.facebook.react.ReactInstanceManager;
import com.facebook.react.ReactNativeHost;
import com.facebook.react.ReactPackage;
import com.facebook.react.shell.MainReactPackage;

import java.util.Arrays;
import java.util.List;

import com.greatdroid.reactnative.media.MediaKitPackage;

public class MainApplication extends Application implements ReactApplication {

private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
@Override
protected boolean getUseDeveloperSupport() {
return BuildConfig.DEBUG;
}

@Override
protected List<ReactPackage> getPackages() {
return Arrays.<ReactPackage>asList(
new MainReactPackage(),
new MediaKitPackage()
);
}
};

@Override
public ReactNativeHost getReactNativeHost() {
return mReactNativeHost;
}
}
2 changes: 1 addition & 1 deletion Demo/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ allprojects {
jcenter()
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url "$projectDir/../../node_modules/react-native/android"
url "$rootDir/../node_modules/react-native/android"
}
}
}
1 change: 1 addition & 0 deletions Demo/android/settings.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
rootProject.name = 'Demo'

include ':app'

include ':react-native-media-kit'
project(':react-native-media-kit').projectDir = new File('../node_modules/react-native-media-kit/android')
28 changes: 16 additions & 12 deletions Demo/ios/Demo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,9 @@
13B07FBD1A68108700A75B9A /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB11A68108700A75B9A /* LaunchScreen.xib */; };
13B07FBF1A68108700A75B9A /* Images.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 13B07FB51A68108700A75B9A /* Images.xcassets */; };
13B07FC11A68108700A75B9A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 13B07FB71A68108700A75B9A /* main.m */; };
140ED2AC1D01E1AD002B40FF /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 146834041AC3E56700842450 /* libReact.a */; };
146834051AC3E58100842450 /* libReact.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 146834041AC3E56700842450 /* libReact.a */; };
5F6A19DA1D2F971900C2E85D /* libreact-native-media-kit.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5F6A19D91D2F971200C2E85D /* libreact-native-media-kit.a */; };
5F5493631D40F4C800E267B3 /* libreact-native-media-kit.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 5F5493611D40F4BD00E267B3 /* libreact-native-media-kit.a */; };
832341BD1AAA6AB300B99B32 /* libRCTText.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 832341B51AAA6A8300B99B32 /* libRCTText.a */; };
/* End PBXBuildFile section */

Expand Down Expand Up @@ -89,9 +90,9 @@
remoteGlobalIDString = 83CBBA2E1A601D0E00E9B192;
remoteInfo = React;
};
5F6A19D81D2F971200C2E85D /* PBXContainerItemProxy */ = {
5F5493601D40F4BD00E267B3 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 5F6A19D41D2F971100C2E85D /* react-native-media-kit.xcodeproj */;
containerPortal = 5F5493531D40F4BD00E267B3 /* react-native-media-kit.xcodeproj */;
proxyType = 2;
remoteGlobalIDString = 5FDB0B6A1CBB7ACA00EDD727;
remoteInfo = "react-native-media-kit";
Expand Down Expand Up @@ -132,7 +133,7 @@
13B07FB61A68108700A75B9A /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; name = Info.plist; path = Demo/Info.plist; sourceTree = "<group>"; };
13B07FB71A68108700A75B9A /* main.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = main.m; path = Demo/main.m; sourceTree = "<group>"; };
146833FF1AC3E56700842450 /* React.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = React.xcodeproj; path = "../node_modules/react-native/React/React.xcodeproj"; sourceTree = "<group>"; };
5F6A19D41D2F971100C2E85D /* react-native-media-kit.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = "react-native-media-kit.xcodeproj"; path = "../node_modules/react-native-media-kit/ios/react-native-media-kit.xcodeproj"; sourceTree = "<group>"; };
5F5493531D40F4BD00E267B3 /* react-native-media-kit.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = "react-native-media-kit.xcodeproj"; path = "../node_modules/react-native-media-kit/ios/react-native-media-kit.xcodeproj"; sourceTree = "<group>"; };
78C398B01ACF4ADC00677621 /* RCTLinking.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTLinking.xcodeproj; path = "../node_modules/react-native/Libraries/LinkingIOS/RCTLinking.xcodeproj"; sourceTree = "<group>"; };
832341B01AAA6A8300B99B32 /* RCTText.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = RCTText.xcodeproj; path = "../node_modules/react-native/Libraries/Text/RCTText.xcodeproj"; sourceTree = "<group>"; };
/* End PBXFileReference section */
Expand All @@ -142,14 +143,15 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
140ED2AC1D01E1AD002B40FF /* libReact.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
13B07F8C1A680F5B00A75B9A /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
5F6A19DA1D2F971900C2E85D /* libreact-native-media-kit.a in Frameworks */,
5F5493631D40F4C800E267B3 /* libreact-native-media-kit.a in Frameworks */,
146834051AC3E58100842450 /* libReact.a in Frameworks */,
00C302E51ABCBA2D00DB3ED1 /* libRCTActionSheet.a in Frameworks */,
00C302E71ABCBA2D00DB3ED1 /* libRCTGeolocation.a in Frameworks */,
Expand Down Expand Up @@ -261,10 +263,10 @@
name = Products;
sourceTree = "<group>";
};
5F6A19D51D2F971100C2E85D /* Products */ = {
5F5493541D40F4BD00E267B3 /* Products */ = {
isa = PBXGroup;
children = (
5F6A19D91D2F971200C2E85D /* libreact-native-media-kit.a */,
5F5493611D40F4BD00E267B3 /* libreact-native-media-kit.a */,
);
name = Products;
sourceTree = "<group>";
Expand All @@ -280,7 +282,7 @@
832341AE1AAA6A7D00B99B32 /* Libraries */ = {
isa = PBXGroup;
children = (
5F6A19D41D2F971100C2E85D /* react-native-media-kit.xcodeproj */,
5F5493531D40F4BD00E267B3 /* react-native-media-kit.xcodeproj */,
146833FF1AC3E56700842450 /* React.xcodeproj */,
00C302A71ABCB8CE00DB3ED1 /* RCTActionSheet.xcodeproj */,
00C302B51ABCB90400DB3ED1 /* RCTGeolocation.xcodeproj */,
Expand Down Expand Up @@ -427,8 +429,8 @@
ProjectRef = 139FDEE61B06529A00C62182 /* RCTWebSocket.xcodeproj */;
},
{
ProductGroup = 5F6A19D51D2F971100C2E85D /* Products */;
ProjectRef = 5F6A19D41D2F971100C2E85D /* react-native-media-kit.xcodeproj */;
ProductGroup = 5F5493541D40F4BD00E267B3 /* Products */;
ProjectRef = 5F5493531D40F4BD00E267B3 /* react-native-media-kit.xcodeproj */;
},
{
ProductGroup = 146834001AC3E56700842450 /* Products */;
Expand Down Expand Up @@ -500,11 +502,11 @@
remoteRef = 146834031AC3E56700842450 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
5F6A19D91D2F971200C2E85D /* libreact-native-media-kit.a */ = {
5F5493611D40F4BD00E267B3 /* libreact-native-media-kit.a */ = {
isa = PBXReferenceProxy;
fileType = archive.ar;
path = "libreact-native-media-kit.a";
remoteRef = 5F6A19D81D2F971200C2E85D /* PBXContainerItemProxy */;
remoteRef = 5F5493601D40F4BD00E267B3 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
78C398B91ACF4ADC00677621 /* libRCTLinking.a */ = {
Expand Down Expand Up @@ -642,6 +644,7 @@
INFOPLIST_FILE = Demo/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
"-lc++",
);
Expand All @@ -661,6 +664,7 @@
INFOPLIST_FILE = Demo/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
OTHER_LDFLAGS = (
"$(inherited)",
"-ObjC",
"-lc++",
);
Expand Down
Loading

0 comments on commit c3767fa

Please sign in to comment.