Skip to content

Commit

Permalink
Fix copying fonts when product flavor specifie (oblador#261)
Browse files Browse the repository at this point in the history
Tested the following scenarios:
1. Product flavor specified, e.g. - `devDebug` and `devRelease`
2. No product flavor specified e.g. - `debug` and `release`

You cans specify the variant using the `--variant` flag, e.g. - `react-native run-android --variant=devDebug`
  • Loading branch information
satya164 authored and oblador committed Aug 5, 2016
1 parent 38af2b2 commit fdb484c
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions fonts.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,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}"
Expand All @@ -35,10 +37,11 @@ gradle.projectsEvaluated {
}

currentFontTask.dependsOn("merge${targetName}Resources")
currentFontTask.dependsOn("merge${targetName}Assets")

[
"processArmeabi-v7a${targetName}Resources",
"processX86${targetName}Resources",
"process${flavorNameCapitalized}Armeabi-v7a${buildNameCapitalized}Resources",
"process${flavorNameCapitalized}X86${buildNameCapitalized}Resources",
"processUniversal${targetName}Resources",
"process${targetName}Resources"
].each { name ->
Expand Down

0 comments on commit fdb484c

Please sign in to comment.