Add support to build hermes from a specific commit (#36681)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/36681

This change is needed to add some E2E tests on the Hermes repo so that we can test Hermes against iOS other than android.

## Changelog:
[Internal][Added] - Add possibility to download Hermes from a specific commit

Reviewed By: cortinico

Differential Revision: D44460479

fbshipit-source-id: 89c196aa7c38533e4904444f7f17eb3236fc6356
This commit is contained in:
Riccardo Cipolleschi
2023-03-28 10:06:26 -07:00
committed by Facebook GitHub Bot
parent 4a5f55031c
commit 6668e7bd03
@@ -35,6 +35,8 @@ def compute_hermes_source(build_from_source, hermestag_file, git, version, build
if ENV.has_key?('HERMES_ENGINE_TARBALL_PATH')
use_tarball(source)
elsif ENV.has_key?('HERMES_COMMIT')
build_hermes_from_commit(source, git, ENV['HERMES_COMMIT'])
elsif build_from_source
if File.exist?(hermestag_file)
build_from_tagfile(source, git, hermestag_file)
@@ -131,6 +133,12 @@ def build_hermes_from_source(source, git)
source[:commit] = `git ls-remote https://github.com/facebook/hermes main | cut -f 1`.strip
end
def build_hermes_from_commit(source, git, commit)
putsIfPodPresent("[Hermes] Installing hermes-engine from commit #{commit}. It may take a while.")
source[:git] = git
source[:commit] = commit
end
# This function checks that Hermes artifact exists.
# As of now it should check it on the Maven repo.
#