Skip to content

Commit

Permalink
Merge pull request #1550 from hannojg/build/android-flatten-cpp-files…
Browse files Browse the repository at this point in the history
…-prefab

chore: android prefab flatten cpp files
  • Loading branch information
chrfalch authored May 4, 2023
2 parents a698d52 + 5103bac commit 8a0e399
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions package/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -272,11 +272,24 @@ task extractJNIFiles {
extractJNIFiles.mustRunAfter extractAARHeaders

if (ENABLE_PREFAB) {
// Package everything with the original file structure
// Package all the cpp code in a flattened directory structure
task prepareHeaders(type: Copy) {
from('./cpp')
from("./cpp")
into "${project.buildDir}/headers/rnskia/"
includeEmptyDirs = false
include "**/*.h"
eachFile {
String path = it.path

// Skip flattening third_party dir
if (path.contains("api/third_party")) {
path = path.substring("api/".length())
} else {
// flatten anything else
path = path.substring(path.lastIndexOf("/") + 1)
}
it.path = path
}
}
preBuild.dependsOn(prepareHeaders)
}
Expand Down

0 comments on commit 8a0e399

Please sign in to comment.