Skip to content

Commit 81a6b6e

Browse files
B27facebook-github-bot
authored andcommitted
fix build with hermes on windows (#26556)
Summary: On the Windows platform, with hermes-engine enabled, the assembly crashes with an error: ![image](https://user-images.githubusercontent.com/8634793/65568495-ab11d980-df8c-11e9-83a0-2a2d26447860.png) The problem lies in calling hermes command without the leading arguments `"cmd", "/c"` ([react.gradle, line: 152](https://github.com/facebook/react-native/blob/e028ac7af2d5b48860f01055f3bbacf91f6b6956/react.gradle#L152) ) ## Changelog [General] [Fixed] - Added a platform check and running commandLine with the corresponding arguments Pull Request resolved: #26556 Test Plan: Under Windows, enable hermes-engine in _build.gradle_ and run the `gradlew assembleRelease` or `gradlew bundleRelease` command Also check assembly on other available platforms Differential Revision: D17587023 Pulled By: cpojer fbshipit-source-id: bab10213b23fac5ab6a46ac4929759dcd43e39c2
1 parent f0bcfbe commit 81a6b6e

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

react.gradle

+6-1
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,12 @@ afterEvaluate {
149149
hermesFlags = config.hermesFlagsDebug
150150
if (hermesFlags == null) hermesFlags = []
151151
}
152-
commandLine(getHermesCommand(), "-emit-binary", "-out", hbcTempFile, jsBundleFile, *hermesFlags)
152+
153+
if (Os.isFamily(Os.FAMILY_WINDOWS)) {
154+
commandLine("cmd", "/c", getHermesCommand(), "-emit-binary", "-out", hbcTempFile, jsBundleFile, *hermesFlags)
155+
} else {
156+
commandLine(getHermesCommand(), "-emit-binary", "-out", hbcTempFile, jsBundleFile, *hermesFlags)
157+
}
153158
}
154159
ant.move(
155160
file: hbcTempFile,

0 commit comments

Comments
 (0)