-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Had to follow steps here: facebook/react-native#3874 (comment)
- Loading branch information
1 parent
4a34609
commit 5f68263
Showing
15 changed files
with
330 additions
and
58 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
[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-haste/.*/__tests__/.* | ||
.*/node_modules/fbjs-haste/__forks__/Map.js | ||
.*/node_modules/fbjs-haste/__forks__/Promise.js | ||
.*/node_modules/fbjs-haste/__forks__/fetch.js | ||
.*/node_modules/fbjs-haste/core/ExecutionEnvironment.js | ||
.*/node_modules/fbjs-haste/core/isEmpty.js | ||
.*/node_modules/fbjs-haste/crypto/crc32.js | ||
.*/node_modules/fbjs-haste/stubs/ErrorUtils.js | ||
.*/node_modules/react-haste/React.js | ||
.*/node_modules/react-haste/renderers/dom/ReactDOM.js | ||
.*/node_modules/react-haste/renderers/shared/event/eventPlugins/ResponderEventPlugin.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/.* | ||
|
||
[include] | ||
|
||
[libs] | ||
node_modules/react-native/Libraries/react-native/react-native-interface.js | ||
|
||
[options] | ||
module.system=haste | ||
|
||
munge_underscores=true | ||
|
||
module.name_mapper='^image![a-zA-Z0-9$_-]+$' -> 'GlobalImageStub' | ||
module.name_mapper='^[./a-zA-Z0-9$_-]+\.png$' -> 'RelativeImageStub' | ||
|
||
suppress_type=$FlowIssue | ||
suppress_type=$FlowFixMe | ||
suppress_type=$FixMe | ||
|
||
suppress_comment=\\(.\\|\n\\)*\\$FlowFixMe\\($\\|[^(]\\|(\\(>=0\\.\\(1[0-8]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\) | ||
suppress_comment=\\(.\\|\n\\)*\\$FlowIssue\\((\\(>=0\\.\\(1[0-8]\\|[0-9]\\).[0-9]\\)? *\\(site=[a-z,_]*react_native[a-z,_]*\\)?)\\)? #[0-9]+ | ||
suppress_comment=\\(.\\|\n\\)*\\$FlowFixedInNextDeploy | ||
|
||
[version] | ||
0.18.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
import org.apache.tools.ant.taskdefs.condition.Os | ||
|
||
def config = project.hasProperty("react") ? project.react : []; | ||
|
||
def bundleAssetName = config.bundleAssetName ?: "index.android.bundle" | ||
def entryFile = config.entryFile ?: "index.android.js" | ||
|
||
// because elvis operator | ||
def elvisFile(thing) { | ||
return thing ? file(thing) : null; | ||
} | ||
|
||
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 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 | ||
} | ||
|
||
gradle.projectsEvaluated { | ||
// hook bundleDebugJsAndAssets into the android build process | ||
bundleDebugJsAndAssets.dependsOn mergeDebugResources | ||
bundleDebugJsAndAssets.dependsOn mergeDebugAssets | ||
processDebugResources.dependsOn bundleDebugJsAndAssets | ||
|
||
// hook bundleReleaseJsAndAssets into the android build process | ||
bundleReleaseJsAndAssets.dependsOn mergeReleaseResources | ||
bundleReleaseJsAndAssets.dependsOn mergeReleaseAssets | ||
processReleaseResources.dependsOn bundleReleaseJsAndAssets | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.