Skip to content

Commit 8a8f1b8

Browse files
etodanikmeta-codesync[bot]
authored andcommitted
Update file paths to use rootProject reference (#55992)
Summary: A recent commit created a regression in what can be done with `build.gradle.kts` by what looks like non intentional usage of File() over rootProject.file(). It is very useful for out-of-tree platforms (such as my react native for unreal engine) to be able to wrap this build gradle file, and using File() breaks things because it breaks lookup in that use case. This PR fixes this unintentional regression by using `rootProject.file`, as it is used elsewhere in this file. ## Changelog: Changed `File()` to `rootProject.file()` in lines introduced by new commit (076e6a1) Pick one each for the category and type tags: [GENERAL] [FIXED] - Fix build regression by using rootProject.file Pull Request resolved: #55992 Test Plan: Build project as usual. Reviewed By: NickGerleman Differential Revision: D95823119 Pulled By: cortinico fbshipit-source-id: 6882802439c3683d3cc7507e55bb3513e2300ecc
1 parent 3612f53 commit 8a8f1b8

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

build.gradle.kts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,15 +116,15 @@ var hermesSubstitution: Pair<String, String>? = null
116116
if (project.findProperty("react.internal.useHermesStable")?.toString()?.toBoolean() == true) {
117117
val hermesVersions = java.util.Properties()
118118
val hermesVersionPropertiesFile =
119-
File("./packages/react-native/sdks/hermes-engine/version.properties")
119+
rootProject.file("./packages/react-native/sdks/hermes-engine/version.properties")
120120
hermesVersionPropertiesFile.inputStream().use { hermesVersions.load(it) }
121121
val selectedHermesVersion = hermesVersions["HERMES_V1_VERSION_NAME"] as String
122122

123123
hermesSubstitution = selectedHermesVersion to "Users opted to use stable hermes release"
124124
} else if (
125125
project.findProperty("react.internal.useHermesNightly")?.toString()?.toBoolean() == true
126126
) {
127-
val reactNativePackageJson = File("./packages/react-native/package.json")
127+
val reactNativePackageJson = rootProject.file("./packages/react-native/package.json")
128128
val reactNativePackageJsonContent = reactNativePackageJson.readText()
129129
val packageJson = groovy.json.JsonSlurper().parseText(reactNativePackageJsonContent) as Map<*, *>
130130

0 commit comments

Comments
 (0)