Permalink
Browse files

Fixed the issue due to which js assets are not bundled in the apk whe…

…n separate build for different CPU architectures is enabled

Summary:
This PR tries to fix a minor bug in `react.gradle` due to which task that bundles JS into the assets folder of the APK is not run when separate build per CPU architecture is enabled and we are using different product flavors.
Closes #8675

Differential Revision: D3541348

fbshipit-source-id: 4c84f21a06a45046f84bdd8ae5c5d834ec080476
  • Loading branch information...
1 parent 65ff819 commit c0316c695d679ba2d8157904014e1d3849a811fa @kgritesh kgritesh committed with Facebook Github Bot 8 Jul 10, 2016
Showing with 5 additions and 3 deletions.
  1. +5 −3 react.gradle
View
@@ -31,7 +31,9 @@ gradle.projectsEvaluated {
productFlavors.each { productFlavorName ->
buildTypes.each { buildTypeName ->
// Create variant and target names
- def targetName = "${productFlavorName.capitalize()}${buildTypeName.capitalize()}"
+ def flavorNameCapitalized = "${productFlavorName.capitalize()}"
+ def buildNameCapitalized = "${buildTypeName.capitalize()}"
+ def targetName = "${flavorNameCapitalized}${buildNameCapitalized}"
def targetPath = productFlavorName ?
"${productFlavorName}/${buildTypeName}" :
"${buildTypeName}"
@@ -92,8 +94,8 @@ gradle.projectsEvaluated {
currentBundleTask.dependsOn("merge${targetName}Resources")
currentBundleTask.dependsOn("merge${targetName}Assets")
- runBefore("processArmeabi-v7a${targetName}Resources", currentBundleTask)
- runBefore("processX86${targetName}Resources", currentBundleTask)
+ runBefore("process${flavorNameCapitalized}Armeabi-v7a${buildNameCapitalized}Resources", currentBundleTask)
+ runBefore("process${flavorNameCapitalized}X86${buildNameCapitalized}Resources", currentBundleTask)
runBefore("processUniversal${targetName}Resources", currentBundleTask)
runBefore("process${targetName}Resources", currentBundleTask)
}

0 comments on commit c0316c6

Please sign in to comment.