Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix regression of improper assets copy (revert #24518 #24778) #25363

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 0 additions & 27 deletions react.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -64,33 +64,6 @@ afterEvaluate {
resourcesDir.mkdirs()
}


// If there are flavors, remember the current flavor for use in the resource path we move from
def flavorPathSegment = ""
android.productFlavors.all { flavor ->
if (targetName.toLowerCase().contains(flavor.name)) {
flavorPathSegment = flavor.name + "/"
}
}

// Address issue #22234 by moving generated resources into build dir so they are in one spot, not duplicated
doLast {
def moveFunc = { resSuffix ->
File originalDir = file("$buildDir/generated/res/react/${flavorPathSegment}release/${resSuffix}")
if (originalDir.exists()) {
File destDir = file("$buildDir/../src/main/res/${resSuffix}")
ant.move(file: originalDir, tofile: destDir);
}
}
moveFunc.curry("drawable-ldpi").call()
moveFunc.curry("drawable-mdpi").call()
moveFunc.curry("drawable-hdpi").call()
moveFunc.curry("drawable-xhdpi").call()
moveFunc.curry("drawable-xxhdpi").call()
moveFunc.curry("drawable-xxxhdpi").call()
moveFunc.curry("raw").call()
}

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