Skip to content

Commit

Permalink
react duplicate file issue fix
Browse files Browse the repository at this point in the history
  • Loading branch information
pritamsadhu committed Apr 26, 2019
1 parent b46eda7 commit 8218e4d
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions react.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,24 @@ afterEvaluate {
resourcesDir.mkdirs()
}

// duplicate assets check

doLast {
def moveFunc = { resSuffix ->
File originalDir = file("$buildDir/generated/res/react/release/drawable-${resSuffix}");
if (originalDir.exists()) {
File destDir = file("$buildDir/../src/main/res/drawable-${resSuffix}");
ant.move(file: originalDir, tofile: destDir);
}
}
moveFunc.curry("ldpi").call()
moveFunc.curry("mdpi").call()
moveFunc.curry("hdpi").call()
moveFunc.curry("xhdpi").call()
moveFunc.curry("xxhdpi").call()
moveFunc.curry("xxxhdpi").call()
}

// Set up inputs and outputs so gradle can cache the result
inputs.files fileTree(dir: reactRoot, excludes: inputExcludes)
outputs.dir(jsBundleDir)
Expand Down

0 comments on commit 8218e4d

Please sign in to comment.