Skip to content

Commit 99bc31c

Browse files
robertyingkelset
authored andcommittedJun 28, 2019
Fix regression of improper assets copy (revert #24518 #24778) (#25363)
Summary: Pull requests #24518 #24778 make Gradle copy all **generated** assets and resources into `android/app/src/res`, which is a bad behavior, because `src/res` goes into version control and should hold only those **original** resource files. These changes in #24518 #24778 were merged into 0.60.0-rc release and cause regression. This pull request will: - Revert pull requests #24518 #24778 - Close #25325 ## Changelog [Android] [Fixed] - Fix regression of improper assets copy (revert #24518 #24778) Pull Request resolved: #25363 Test Plan: It is a revert pull request and the reverted script should work the same as it has in 0.59.x. Differential Revision: D15963329 Pulled By: cpojer fbshipit-source-id: 5619a318dbdb40e816e37b6e37d4fe32caa46e9e
1 parent c36c481 commit 99bc31c

File tree

1 file changed

+0
-27
lines changed

1 file changed

+0
-27
lines changed
 

‎react.gradle

-27
Original file line numberDiff line numberDiff line change
@@ -64,33 +64,6 @@ afterEvaluate {
6464
resourcesDir.mkdirs()
6565
}
6666

67-
68-
// If there are flavors, remember the current flavor for use in the resource path we move from
69-
def flavorPathSegment = ""
70-
android.productFlavors.all { flavor ->
71-
if (targetName.toLowerCase().contains(flavor.name)) {
72-
flavorPathSegment = flavor.name + "/"
73-
}
74-
}
75-
76-
// Address issue #22234 by moving generated resources into build dir so they are in one spot, not duplicated
77-
doLast {
78-
def moveFunc = { resSuffix ->
79-
File originalDir = file("$buildDir/generated/res/react/${flavorPathSegment}release/${resSuffix}")
80-
if (originalDir.exists()) {
81-
File destDir = file("$buildDir/../src/main/res/${resSuffix}")
82-
ant.move(file: originalDir, tofile: destDir);
83-
}
84-
}
85-
moveFunc.curry("drawable-ldpi").call()
86-
moveFunc.curry("drawable-mdpi").call()
87-
moveFunc.curry("drawable-hdpi").call()
88-
moveFunc.curry("drawable-xhdpi").call()
89-
moveFunc.curry("drawable-xxhdpi").call()
90-
moveFunc.curry("drawable-xxxhdpi").call()
91-
moveFunc.curry("raw").call()
92-
}
93-
9467
// Set up inputs and outputs so gradle can cache the result
9568
inputs.files fileTree(dir: reactRoot, excludes: inputExcludes)
9669
outputs.dir(jsBundleDir)

0 commit comments

Comments
 (0)
Please sign in to comment.