mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Clean up hermes-engine Pod
Summary: Aside from the log output, these changes do not change the behavior of the hermes-engine Pod. Removed unused git branch checks. Use react_native_path var to build filepaths. Edit Hermes build from source log message to be consistent with other logs. Changelog: [Internal] Reviewed By: cipolleschi Differential Revision: D39699165 fbshipit-source-id: 7e389eb5315fc5a2510b84eddac2f499a3e65157
This commit is contained in:
committed by
Facebook GitHub Bot
parent
ce4aa93173
commit
3046ce2421
@@ -4,22 +4,25 @@
|
||||
# LICENSE file in the root directory of this source tree.
|
||||
|
||||
require "json"
|
||||
require "open3"
|
||||
|
||||
# sdks/hermesc/osx-bin/ImportHermesc.cmake
|
||||
import_hermesc_file=File.join(__dir__, "..", "hermesc", "osx-bin", "ImportHermesc.cmake")
|
||||
module HermesHelper
|
||||
BUILD_TYPE = :debug
|
||||
# BUILD_TYPE = :release
|
||||
end
|
||||
|
||||
react_native_path = File.join(__dir__, "..", "..")
|
||||
|
||||
# package.json
|
||||
package_file = File.join(__dir__, "..", "..", "package.json")
|
||||
package_file = File.join(react_native_path, "package.json")
|
||||
package = JSON.parse(File.read(package_file))
|
||||
version = package['version']
|
||||
isInCI = ENV['CI'] == true
|
||||
hermestag_file = File.join(__dir__, "..", ".hermesversion")
|
||||
|
||||
# We need to check the current git branch/remote to verify if
|
||||
# we're on a React Native release branch to actually build Hermes.
|
||||
currentbranch, err = Open3.capture3("git rev-parse --abbrev-ref HEAD")
|
||||
currentremote, err = Open3.capture3("git config --get remote.origin.url")
|
||||
# sdks/.hermesversion
|
||||
hermestag_file = File.join(react_native_path, "sdks", ".hermesversion")
|
||||
isInCI = ENV['CI'] == true
|
||||
|
||||
# sdks/hermesc/osx-bin/ImportHermesc.cmake
|
||||
import_hermesc_file=File.join(react_native_path, "sdks", "hermesc", "osx-bin", "ImportHermesc.cmake")
|
||||
|
||||
source = {}
|
||||
git = "https://github.com/facebook/hermes.git"
|
||||
@@ -28,7 +31,7 @@ if ENV.has_key?('HERMES_ENGINE_TARBALL_PATH')
|
||||
Pod::UI.puts '[Hermes] Using pre-built Hermes binaries from local path.' if Object.const_defined?("Pod::UI")
|
||||
source[:http] = "file://#{ENV['HERMES_ENGINE_TARBALL_PATH']}"
|
||||
elsif version == '1000.0.0'
|
||||
Pod::UI.puts '[Hermes] Hermes needs to be compiled, installing hermes-engine may take a while...'.yellow if Object.const_defined?("Pod::UI")
|
||||
Pod::UI.puts '[Hermes] Installing hermes-engine may take a while, building Hermes from source...'.yellow if Object.const_defined?("Pod::UI")
|
||||
source[:git] = git
|
||||
source[:commit] = `git ls-remote https://github.com/facebook/hermes main | cut -f 1`.strip
|
||||
elsif File.exists?(hermestag_file) && isInCI
|
||||
@@ -40,18 +43,13 @@ else
|
||||
source[:http] = "https://github.com/facebook/react-native/releases/download/v#{version}/hermes-runtime-darwin-v#{version}.tar.gz"
|
||||
end
|
||||
|
||||
module HermesHelper
|
||||
BUILD_TYPE = :debug
|
||||
# BUILD_TYPE = :release
|
||||
end
|
||||
|
||||
Pod::Spec.new do |spec|
|
||||
spec.name = "hermes-engine"
|
||||
spec.version = version
|
||||
spec.summary = "Hermes is a small and lightweight JavaScript engine optimized for running React Native."
|
||||
spec.description = "Hermes is a JavaScript engine optimized for fast start-up of React Native apps. It features ahead-of-time static optimization and compact bytecode."
|
||||
spec.homepage = "https://hermesengine.dev"
|
||||
spec.license = package["license"]
|
||||
spec.license = package['license']
|
||||
spec.author = "Facebook"
|
||||
spec.source = source
|
||||
spec.platforms = { :osx => "10.13", :ios => "12.4" }
|
||||
|
||||
Reference in New Issue
Block a user