@@ -666,11 +666,14 @@ def use_react_native_codegen!(spec, options={})
666
666
667
667
def downloadAndConfigureHermesSource ( react_native_path )
668
668
hermes_tarball_base_url = "https://github.com/facebook/hermes/tarball/"
669
- sdks_dir = "#{ react_native_path } /sdks"
670
- download_dir = "#{ sdks_dir } /download"
671
- hermes_dir = "#{ sdks_dir } /hermes"
672
- hermes_tag_file = "#{ sdks_dir } /.hermesversion"
673
- system ( "mkdir -p #{ hermes_dir } #{ download_dir } " )
669
+
670
+ sdks_dir = Pod ::Config . instance . installation_root . join ( react_native_path , "sdks" )
671
+ download_dir = sdks_dir . join ( "download" )
672
+ hermes_dir = sdks_dir . join ( "hermes" )
673
+ hermes_tag_file = sdks_dir . join ( ".hermesversion" )
674
+
675
+ hermes_dir . mkpath
676
+ download_dir . mkpath
674
677
675
678
if ( File . exist? ( hermes_tag_file ) )
676
679
hermes_tag = File . read ( hermes_tag_file ) . strip
@@ -680,19 +683,19 @@ def downloadAndConfigureHermesSource(react_native_path)
680
683
681
684
hermes_tarball_url = hermes_tarball_base_url + hermes_tag
682
685
hermes_tag_sha = %x[git ls-remote https://github.com/facebook/hermes #{ hermes_tag } | cut -f 1] . strip
683
- hermes_tarball_path = " #{ download_dir } / hermes-#{ hermes_tag_sha } .tar.gz"
686
+ hermes_tarball_path = download_dir . join ( " hermes-#{ hermes_tag_sha } .tar.gz")
684
687
685
688
if ( !File . exist? ( hermes_tarball_path ) )
686
689
Pod ::UI . puts "[Hermes] Downloading Hermes source code..."
687
- system ( "curl #{ hermes_tarball_url } -Lo #{ hermes_tarball_path } " )
690
+ system ( "curl #{ hermes_tarball_url } -Lo #{ hermes_tarball_path . to_s } " )
688
691
end
689
692
Pod ::UI . puts "[Hermes] Extracting Hermes tarball (#{ hermes_tag_sha . slice ( 0 , 6 ) } )"
690
- system ( "tar -zxf #{ hermes_tarball_path } --strip-components=1 --directory #{ hermes_dir } " )
693
+ system ( "tar -zxf #{ hermes_tarball_path . to_s } --strip-components=1 --directory #{ hermes_dir . to_s } " )
691
694
692
695
# TODO: Integrate this temporary hermes-engine.podspec into the actual one located in facebook/hermes
693
- system ( "cp #{ sdks_dir } / hermes-engine.podspec #{ hermes_dir } / hermes-engine.podspec")
696
+ FileUtils . cp ( sdks_dir . join ( " hermes-engine.podspec" ) , hermes_dir . join ( " hermes-engine.podspec") )
694
697
695
- hermes_dir
698
+ hermes_dir . relative_path_from ( Pod :: Config . instance . installation_root ) . to_s
696
699
end
697
700
698
701
# This provides a post_install workaround for build issues related Xcode 12.5 and Apple Silicon (M1) machines.
0 commit comments