ignore examples
This commit is contained in:
parent
c34e546839
commit
2d50d45167
|
@ -51,15 +51,15 @@ module.system=haste
|
||||||
munge_underscores=true
|
munge_underscores=true
|
||||||
|
|
||||||
module.name_mapper='^image![a-zA-Z0-9$_-]+$' -> 'GlobalImageStub'
|
module.name_mapper='^image![a-zA-Z0-9$_-]+$' -> 'GlobalImageStub'
|
||||||
module.name_mapper='^[./a-zA-Z0-9$_-]+\.png$' -> 'RelativeImageStub'
|
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'
|
||||||
|
|
||||||
suppress_type=$FlowIssue
|
suppress_type=$FlowIssue
|
||||||
suppress_type=$FlowFixMe
|
suppress_type=$FlowFixMe
|
||||||
suppress_type=$FixMe
|
suppress_type=$FixMe
|
||||||
|
|
||||||
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(2[0-0]\\|1[0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)
|
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(2[0-1]\\|1[0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)
|
||||||
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(2[0-0]\\|1[0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+
|
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(2[0-1]\\|1[0-9]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)?:? #[0-9]+
|
||||||
suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
|
suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy
|
||||||
|
|
||||||
[version]
|
[version]
|
||||||
0.20.1
|
0.21.0
|
||||||
|
|
|
@ -3,7 +3,8 @@ apply plugin: "com.android.application"
|
||||||
import com.android.build.OutputFile
|
import com.android.build.OutputFile
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The react.gradle file registers two tasks: bundleDebugJsAndAssets and bundleReleaseJsAndAssets.
|
* The react.gradle file registers a task for each build variant (e.g. bundleDebugJsAndAssets
|
||||||
|
* and bundleReleaseJsAndAssets).
|
||||||
* These basically call `react-native bundle` with the correct arguments during the Android build
|
* These basically call `react-native bundle` with the correct arguments during the Android build
|
||||||
* cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the
|
* cycle. By default, bundleDebugJsAndAssets is skipped, as in debug/dev mode we prefer to load the
|
||||||
* bundle directly from the development server. Below you can see all the possible configurations
|
* bundle directly from the development server. Below you can see all the possible configurations
|
||||||
|
@ -23,6 +24,13 @@ import com.android.build.OutputFile
|
||||||
* // whether to bundle JS and assets in release mode
|
* // whether to bundle JS and assets in release mode
|
||||||
* bundleInRelease: true,
|
* bundleInRelease: true,
|
||||||
*
|
*
|
||||||
|
* // whether to bundle JS and assets in another build variant (if configured).
|
||||||
|
* // See http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Build-Variants
|
||||||
|
* // The configuration property is in the format 'bundleIn${productFlavor}${buildType}'
|
||||||
|
* // bundleInFreeDebug: true,
|
||||||
|
* // bundleInPaidRelease: true,
|
||||||
|
* // bundleInBeta: true,
|
||||||
|
*
|
||||||
* // the root of your project, i.e. where "package.json" lives
|
* // the root of your project, i.e. where "package.json" lives
|
||||||
* root: "../../",
|
* root: "../../",
|
||||||
*
|
*
|
||||||
|
@ -84,7 +92,7 @@ android {
|
||||||
splits {
|
splits {
|
||||||
abi {
|
abi {
|
||||||
enable enableSeparateBuildPerCPUArchitecture
|
enable enableSeparateBuildPerCPUArchitecture
|
||||||
universalApk true
|
universalApk false
|
||||||
reset()
|
reset()
|
||||||
include "armeabi-v7a", "x86"
|
include "armeabi-v7a", "x86"
|
||||||
}
|
}
|
||||||
|
@ -110,14 +118,8 @@ android {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
repositories {
|
|
||||||
maven { url "https://jitpack.io" }
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compile fileTree(dir: "libs", include: ["*.jar"])
|
compile fileTree(dir: "libs", include: ["*.jar"])
|
||||||
compile "com.android.support:appcompat-v7:23.0.1"
|
compile "com.android.support:appcompat-v7:23.0.1"
|
||||||
compile "com.facebook.react:react-native:0.18.+"
|
compile "com.facebook.react:react-native:0.20.+"
|
||||||
compile project(':react-native-dialogs')
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,8 +42,8 @@
|
||||||
-keep class * extends com.facebook.react.bridge.NativeModule { *; }
|
-keep class * extends com.facebook.react.bridge.NativeModule { *; }
|
||||||
-keepclassmembers,includedescriptorclasses class * { native <methods>; }
|
-keepclassmembers,includedescriptorclasses class * { native <methods>; }
|
||||||
-keepclassmembers class * { @com.facebook.react.uimanager.UIProp <fields>; }
|
-keepclassmembers class * { @com.facebook.react.uimanager.UIProp <fields>; }
|
||||||
-keepclassmembers class * { @com.facebook.react.uimanager.ReactProp <methods>; }
|
-keepclassmembers class * { @com.facebook.react.uimanager.annotations.ReactProp <methods>; }
|
||||||
-keepclassmembers class * { @com.facebook.react.uimanager.ReactPropGroup <methods>; }
|
-keepclassmembers class * { @com.facebook.react.uimanager.annotations.ReactPropGroup <methods>; }
|
||||||
|
|
||||||
-dontwarn com.facebook.react.**
|
-dontwarn com.facebook.react.**
|
||||||
|
|
||||||
|
|
|
@ -11,69 +11,8 @@ def elvisFile(thing) {
|
||||||
}
|
}
|
||||||
|
|
||||||
def reactRoot = elvisFile(config.root) ?: file("../../")
|
def reactRoot = elvisFile(config.root) ?: file("../../")
|
||||||
def jsBundleDirDebug = elvisFile(config.jsBundleDirDebug) ?:
|
|
||||||
file("$buildDir/intermediates/assets/debug")
|
|
||||||
def jsBundleDirRelease = elvisFile(config.jsBundleDirRelease) ?:
|
|
||||||
file("$buildDir/intermediates/assets/release")
|
|
||||||
def resourcesDirDebug = elvisFile(config.resourcesDirDebug) ?:
|
|
||||||
file("$buildDir/intermediates/res/merged/debug")
|
|
||||||
def resourcesDirRelease = elvisFile(config.resourcesDirRelease) ?:
|
|
||||||
file("$buildDir/intermediates/res/merged/release")
|
|
||||||
def inputExcludes = config.inputExcludes ?: ["android/**", "ios/**"]
|
def inputExcludes = config.inputExcludes ?: ["android/**", "ios/**"]
|
||||||
|
|
||||||
def jsBundleFileDebug = file("$jsBundleDirDebug/$bundleAssetName")
|
|
||||||
def jsBundleFileRelease = file("$jsBundleDirRelease/$bundleAssetName")
|
|
||||||
|
|
||||||
task bundleDebugJsAndAssets(type: Exec) {
|
|
||||||
// create dirs if they are not there (e.g. the "clean" task just ran)
|
|
||||||
doFirst {
|
|
||||||
jsBundleDirDebug.mkdirs()
|
|
||||||
resourcesDirDebug.mkdirs()
|
|
||||||
}
|
|
||||||
|
|
||||||
// set up inputs and outputs so gradle can cache the result
|
|
||||||
inputs.files fileTree(dir: reactRoot, excludes: inputExcludes)
|
|
||||||
outputs.dir jsBundleDirDebug
|
|
||||||
outputs.dir resourcesDirDebug
|
|
||||||
|
|
||||||
// set up the call to the react-native cli
|
|
||||||
workingDir reactRoot
|
|
||||||
if (Os.isFamily(Os.FAMILY_WINDOWS)) {
|
|
||||||
commandLine "cmd", "/c", "react-native", "bundle", "--platform", "android", "--dev", "true", "--entry-file",
|
|
||||||
entryFile, "--bundle-output", jsBundleFileDebug, "--assets-dest", resourcesDirDebug
|
|
||||||
} else {
|
|
||||||
commandLine "react-native", "bundle", "--platform", "android", "--dev", "true", "--entry-file",
|
|
||||||
entryFile, "--bundle-output", jsBundleFileDebug, "--assets-dest", resourcesDirDebug
|
|
||||||
}
|
|
||||||
|
|
||||||
enabled config.bundleInDebug ?: false
|
|
||||||
}
|
|
||||||
|
|
||||||
task bundleReleaseJsAndAssets(type: Exec) {
|
|
||||||
// create dirs if they are not there (e.g. the "clean" task just ran)
|
|
||||||
doFirst {
|
|
||||||
jsBundleDirRelease.mkdirs()
|
|
||||||
resourcesDirRelease.mkdirs()
|
|
||||||
}
|
|
||||||
|
|
||||||
// set up inputs and outputs so gradle can cache the result
|
|
||||||
inputs.files fileTree(dir: reactRoot, excludes: inputExcludes)
|
|
||||||
outputs.dir jsBundleDirRelease
|
|
||||||
outputs.dir resourcesDirRelease
|
|
||||||
|
|
||||||
// set up the call to the react-native cli
|
|
||||||
workingDir reactRoot
|
|
||||||
if (Os.isFamily(Os.FAMILY_WINDOWS)) {
|
|
||||||
commandLine "cmd","/c", "react-native", "bundle", "--platform", "android", "--dev", "false", "--entry-file",
|
|
||||||
entryFile, "--bundle-output", jsBundleFileRelease, "--assets-dest", resourcesDirRelease
|
|
||||||
} else {
|
|
||||||
commandLine "react-native", "bundle", "--platform", "android", "--dev", "false", "--entry-file",
|
|
||||||
entryFile, "--bundle-output", jsBundleFileRelease, "--assets-dest", resourcesDirRelease
|
|
||||||
}
|
|
||||||
|
|
||||||
enabled config.bundleInRelease ?: true
|
|
||||||
}
|
|
||||||
|
|
||||||
void runBefore(String dependentTaskName, Task task) {
|
void runBefore(String dependentTaskName, Task task) {
|
||||||
Task dependentTask = tasks.findByPath(dependentTaskName);
|
Task dependentTask = tasks.findByPath(dependentTaskName);
|
||||||
if (dependentTask != null) {
|
if (dependentTask != null) {
|
||||||
|
@ -82,25 +21,76 @@ void runBefore(String dependentTaskName, Task task) {
|
||||||
}
|
}
|
||||||
|
|
||||||
gradle.projectsEvaluated {
|
gradle.projectsEvaluated {
|
||||||
|
// Grab all build types and product flavors
|
||||||
|
def buildTypes = android.buildTypes.collect { type -> type.name }
|
||||||
|
def productFlavors = android.productFlavors.collect { flavor -> flavor.name }
|
||||||
|
|
||||||
// hook bundleDebugJsAndAssets into the android build process
|
// When no product flavors defined, use empty
|
||||||
|
if (!productFlavors) productFlavors.add('')
|
||||||
|
|
||||||
bundleDebugJsAndAssets.dependsOn mergeDebugResources
|
productFlavors.each { productFlavorName ->
|
||||||
bundleDebugJsAndAssets.dependsOn mergeDebugAssets
|
buildTypes.each { buildTypeName ->
|
||||||
|
// Create variant and source names
|
||||||
|
def sourceName = "${buildTypeName}"
|
||||||
|
def targetName = "${sourceName.capitalize()}"
|
||||||
|
if (productFlavorName) {
|
||||||
|
sourceName = "${productFlavorName}${targetName}"
|
||||||
|
}
|
||||||
|
|
||||||
runBefore('processArmeabi-v7aDebugResources', bundleDebugJsAndAssets)
|
// React js bundle directories
|
||||||
runBefore('processX86DebugResources', bundleDebugJsAndAssets)
|
def jsBundleDirConfigName = "jsBundleDir${targetName}"
|
||||||
runBefore('processUniversalDebugResources', bundleDebugJsAndAssets)
|
def jsBundleDir = elvisFile(config."$jsBundleDirConfigName") ?:
|
||||||
runBefore('processDebugResources', bundleDebugJsAndAssets)
|
file("$buildDir/intermediates/assets/${sourceName}")
|
||||||
|
|
||||||
// hook bundleReleaseJsAndAssets into the android build process
|
def resourcesDirConfigName = "jsBundleDir${targetName}"
|
||||||
|
def resourcesDir = elvisFile(config."${resourcesDirConfigName}") ?:
|
||||||
|
file("$buildDir/intermediates/res/merged/${sourceName}")
|
||||||
|
def jsBundleFile = file("$jsBundleDir/$bundleAssetName")
|
||||||
|
|
||||||
bundleReleaseJsAndAssets.dependsOn mergeReleaseResources
|
// Bundle task name for variant
|
||||||
bundleReleaseJsAndAssets.dependsOn mergeReleaseAssets
|
def bundleJsAndAssetsTaskName = "bundle${targetName}JsAndAssets"
|
||||||
|
|
||||||
runBefore('processArmeabi-v7aReleaseResources', bundleReleaseJsAndAssets)
|
def currentBundleTask = tasks.create(
|
||||||
runBefore('processX86ReleaseResources', bundleReleaseJsAndAssets)
|
name: bundleJsAndAssetsTaskName,
|
||||||
runBefore('processUniversalReleaseResources', bundleReleaseJsAndAssets)
|
type: Exec) {
|
||||||
runBefore('processReleaseResources', bundleReleaseJsAndAssets)
|
group = "react"
|
||||||
|
description = "bundle JS and assets for ${targetName}."
|
||||||
|
|
||||||
|
// Create dirs if they are not there (e.g. the "clean" task just ran)
|
||||||
|
doFirst {
|
||||||
|
jsBundleDir.mkdirs()
|
||||||
|
resourcesDir.mkdirs()
|
||||||
|
}
|
||||||
|
|
||||||
|
// Set up inputs and outputs so gradle can cache the result
|
||||||
|
inputs.files fileTree(dir: reactRoot, excludes: inputExcludes)
|
||||||
|
outputs.dir jsBundleDir
|
||||||
|
outputs.dir resourcesDir
|
||||||
|
|
||||||
|
// Set up the call to the react-native cli
|
||||||
|
workingDir reactRoot
|
||||||
|
|
||||||
|
// Set up dev mode
|
||||||
|
def devEnabled = !targetName.toLowerCase().contains("release")
|
||||||
|
if (Os.isFamily(Os.FAMILY_WINDOWS)) {
|
||||||
|
commandLine "cmd", "/c", "react-native", "bundle", "--platform", "android", "--dev", "${devEnabled}",
|
||||||
|
"--entry-file", entryFile, "--bundle-output", jsBundleFile, "--assets-dest", resourcesDir
|
||||||
|
} else {
|
||||||
|
commandLine "react-native", "bundle", "--platform", "android", "--dev", "${devEnabled}",
|
||||||
|
"--entry-file", entryFile, "--bundle-output", jsBundleFile, "--assets-dest", resourcesDir
|
||||||
|
}
|
||||||
|
|
||||||
|
enabled config."bundleIn${targetName}" ?: targetName.toLowerCase().contains("release")
|
||||||
|
}
|
||||||
|
|
||||||
|
// Hook bundle${productFlavor}${buildType}JsAndAssets into the android build process
|
||||||
|
currentBundleTask.dependsOn("merge${targetName}Resources")
|
||||||
|
currentBundleTask.dependsOn("merge${targetName}Assets")
|
||||||
|
|
||||||
|
runBefore("processArmeabi-v7a${targetName}Resources", currentBundleTask)
|
||||||
|
runBefore("processX86${targetName}Resources", currentBundleTask)
|
||||||
|
runBefore("processUniversal${targetName}Resources", currentBundleTask)
|
||||||
|
runBefore("process${targetName}Resources", currentBundleTask)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,6 +34,7 @@ public class MainActivity extends ReactActivity {
|
||||||
@Override
|
@Override
|
||||||
protected List<ReactPackage> getPackages() {
|
protected List<ReactPackage> getPackages() {
|
||||||
return Arrays.<ReactPackage>asList(
|
return Arrays.<ReactPackage>asList(
|
||||||
new MainReactPackage());
|
new MainReactPackage()
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
rootProject.name = 'ExampleApp2'
|
rootProject.name = 'ExampleApp2'
|
||||||
|
|
||||||
include ':app', ':react-native-dialogs'
|
include ':app'
|
||||||
project(':react-native-dialogs').projectDir = file('../node_modules/react-native-dialogs/android')
|
|
||||||
|
|
|
@ -525,7 +525,7 @@
|
||||||
);
|
);
|
||||||
runOnlyForDeploymentPostprocessing = 0;
|
runOnlyForDeploymentPostprocessing = 0;
|
||||||
shellPath = /bin/sh;
|
shellPath = /bin/sh;
|
||||||
shellScript = "../node_modules/react-native/packager/react-native-xcode.sh";
|
shellScript = "export NODE_BINARY=node\n../node_modules/react-native/packager/react-native-xcode.sh";
|
||||||
showEnvVarsInLog = 1;
|
showEnvVarsInLog = 1;
|
||||||
};
|
};
|
||||||
/* End PBXShellScriptBuildPhase section */
|
/* End PBXShellScriptBuildPhase section */
|
||||||
|
|
|
@ -6,6 +6,8 @@
|
||||||
"start": "node node_modules/react-native/local-cli/cli.js start"
|
"start": "node node_modules/react-native/local-cli/cli.js start"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"react-native": "^0.20.0",
|
||||||
|
"react-native-dialogs": "0.0.12",
|
||||||
|
"react-native-material-kit": "^0.3.0"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue