Skip to content

Commit f6a5042

Browse files
authored
Make Hermes source archive extraction repository-agnostic (#59589)
Summary: Download Hermes sources from the canonical `meta/hermes` repository and strip the archive’s top-level directory without matching its owner or repository name. This keeps `CMakeLists.txt` at the expected source root after repository moves; exclude empty directories so the archive wrapper is not recreated. Changelog: [Android][Fixed] - Fix Hermes source builds after the Hermes repository move Differential Revision: D128177063
1 parent 8b61724 commit f6a5042

1 file changed

Lines changed: 3 additions & 8 deletions

File tree

‎packages/react-native/ReactAndroid/hermes-engine/build.gradle.kts‎

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ val downloadHermes by
104104
tasks.registering(Download::class) {
105105
src(
106106
providers.provider {
107-
"https://github.com/facebook/hermes/tarball/${hermesVersionProvider.get()}"
107+
"https://github.com/meta/hermes/tarball/${hermesVersionProvider.get()}"
108108
},
109109
)
110110
onlyIfModified(true)
@@ -119,13 +119,8 @@ val unzipHermes by
119119
tasks.registering(Copy::class) {
120120
dependsOn(downloadHermes)
121121
from(tarTree(downloadHermesDest)) {
122-
eachFile {
123-
// We flatten the unzip as the tarball contains a `facebook-hermes-<SHA>`
124-
// folder at the top level.
125-
if (this.path.startsWith("facebook-hermes-")) {
126-
this.path = this.path.substringAfter("/")
127-
}
128-
}
122+
eachFile { path = path.substringAfter("/") }
123+
includeEmptyDirs = false
129124
}
130125
into(hermesDir)
131126
}

0 commit comments

Comments
 (0)