Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 23 additions & 9 deletions packages/react-native/scripts/cocoapods/rncore.rb
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,10 @@ def self.podspec_source_download_prebuild_stable_tarball()
end

rncore_log("Resolved stable ReactNativeCore-prebuilt version:")
rncore_log(" #{Pathname.new(destinationDebug).relative_path_from(Pathname.pwd).to_s}")
rncore_log(" #{Pathname.new(destinationRelease).relative_path_from(Pathname.pwd).to_s}")
rncore_log(" #{destinationDebug}")
rncore_log(" #{destinationRelease}")

ensure_pods_symlink()
return {:http => URI::File.build(path: destinationDebug).to_s }
end

Expand All @@ -185,17 +186,18 @@ def self.podspec_source_download_prebuilt_nightly_tarball()
dSymsDebug = download_nightly_rncore(@@react_native_path, @@react_native_version, :debug, true)
dSymsRelease = download_nightly_rncore(@@react_native_path, @@react_native_version, :release, true)
rncore_log("Resolved nightly dSYMs")
rncore_log(" #{Pathname.new(dSymsDebug).relative_path_from(Pathname.pwd).to_s}")
rncore_log(" #{Pathname.new(dSymsRelease).relative_path_from(Pathname.pwd).to_s}")
rncore_log(" #{dSymsDebug}")
rncore_log(" #{dSymsRelease}")

# Make sure that the dSYMs are processed
process_dsyms(destinationDebug, dSymsDebug)
process_dsyms(destinationRelease, dSymsRelease)
end

rncore_log("Resolved nightly ReactNativeCore-prebuilt version:")
rncore_log(" #{Pathname.new(destinationDebug).relative_path_from(Pathname.pwd).to_s}")
rncore_log(" #{Pathname.new(destinationRelease).relative_path_from(Pathname.pwd).to_s}")
rncore_log(" #{destinationDebug}")
rncore_log(" #{destinationRelease}")
ensure_pods_symlink()
return {:http => URI::File.build(path: destinationDebug).to_s }
end

Expand Down Expand Up @@ -410,11 +412,11 @@ def self.download_rncore_tarball(react_native_path, tarball_url, version, config

unless File.exist?(destination_path)
# Download to a temporary file first so we don't cache incomplete downloads.
rncore_log("Downloading ReactNativeCore-prebuilt #{dsyms ? "dSYMs " : ""}#{configuration ? configuration.to_s : ""} tarball from #{tarball_url} to #{Pathname.new(destination_path).relative_path_from(Pathname.pwd).to_s}")
rncore_log("Downloading ReactNativeCore-prebuilt #{dsyms ? "dSYMs " : ""}#{configuration ? configuration.to_s : ""} tarball from #{tarball_url} to #{destination_path}")
tmp_file = "#{artifacts_dir()}/reactnative-core.download"
`mkdir -p "#{artifacts_dir()}" && curl "#{tarball_url}" -Lo "#{tmp_file}" && mv "#{tmp_file}" "#{destination_path}"`
else
rncore_log("Using downloaded ReactNativeCore-prebuilt #{dsyms ? "dSYMs " : ""}#{configuration ? configuration.to_s : ""} tarball at #{Pathname.new(destination_path).relative_path_from(Pathname.pwd).to_s}")
rncore_log("Using downloaded ReactNativeCore-prebuilt #{dsyms ? "dSYMs " : ""}#{configuration ? configuration.to_s : ""} tarball at #{destination_path}")
end

return destination_path
Expand All @@ -429,7 +431,19 @@ def self.nightly_artifact_exists(version)
end

def self.artifacts_dir()
return File.join(Pod::Config.instance.project_pods_root, "ReactNativeCore-artifacts")
return ENV['RCT_PREBUILT_CACHE_DIR'] || "/tmp/react-native-prebuilt"
end

def self.ensure_pods_symlink()
pods_artifacts = File.join(Pod::Config.instance.project_pods_root, "ReactNativeCore-artifacts")
if File.symlink?(pods_artifacts)
return if File.readlink(pods_artifacts) == artifacts_dir()
FileUtils.rm(pods_artifacts)
elsif File.exist?(pods_artifacts)
FileUtils.rm_rf(pods_artifacts)
end
FileUtils.mkdir_p(File.dirname(pods_artifacts))
FileUtils.ln_sf(artifacts_dir(), pods_artifacts)
end

# This function checks that ReactNativeCore artifact exists on the maven repo
Expand Down
17 changes: 15 additions & 2 deletions packages/react-native/scripts/cocoapods/rndependencies.rb
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ def self.podspec_source_download_prebuild_release_tarball()
destinationDebug = download_stable_rndeps(@@react_native_path, @@react_native_version, :debug)
download_stable_rndeps(@@react_native_path, @@react_native_version, :release)

ensure_pods_symlink()
return {:http => URI::File.build(path: destinationDebug).to_s }
end

Expand Down Expand Up @@ -228,8 +229,8 @@ def self.podspec_source_download_prebuilt_nightly_tarball(version)
destinationDebug = download_nightly_rndeps(@@react_native_path, @@react_native_version, :debug)
download_nightly_rndeps(@@react_native_path, @@react_native_version, :release)

ensure_pods_symlink()
return {:http => URI::File.build(path: destinationDebug).to_s }
return {:http => url}
end

def self.download_rndeps_tarball(react_native_path, tarball_url, version, configuration)
Expand All @@ -255,7 +256,19 @@ def self.nightly_artifact_exists(version)
end

def self.artifacts_dir()
return File.join(Pod::Config.instance.project_pods_root, "ReactNativeDependencies-artifacts")
return ENV['RCT_PREBUILT_CACHE_DIR'] || "/tmp/react-native-prebuilt"
end

def self.ensure_pods_symlink()
pods_artifacts = File.join(Pod::Config.instance.project_pods_root, "ReactNativeDependencies-artifacts")
if File.symlink?(pods_artifacts)
return if File.readlink(pods_artifacts) == artifacts_dir()
FileUtils.rm(pods_artifacts)
elsif File.exist?(pods_artifacts)
FileUtils.rm_rf(pods_artifacts)
end
FileUtils.mkdir_p(File.dirname(pods_artifacts))
FileUtils.ln_sf(artifacts_dir(), pods_artifacts)
end

# This function checks that ReactNativeDependencies artifact exists on the maven repo
Expand Down
15 changes: 14 additions & 1 deletion packages/react-native/sdks/hermes-engine/hermes-utils.rb
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ def podspec_source_download_prebuild_release_tarball(react_native_path, version)
hermes_log("Using release tarball from URL: #{url}")
download_stable_hermes(react_native_path, version, :debug)
download_stable_hermes(react_native_path, version, :release)
ensure_hermes_pods_symlink()
return {:http => url}
end

Expand All @@ -206,7 +207,19 @@ def podspec_source_download_prebuilt_nightly_tarball(version)
# HELPERS

def artifacts_dir()
return File.join(Pod::Config.instance.project_pods_root, "hermes-engine-artifacts")
return ENV['RCT_PREBUILT_CACHE_DIR'] || "/tmp/react-native-prebuilt"
end

def ensure_hermes_pods_symlink()
pods_artifacts = File.join(Pod::Config.instance.project_pods_root, "hermes-engine-artifacts")
if File.symlink?(pods_artifacts)
return if File.readlink(pods_artifacts) == artifacts_dir()
FileUtils.rm(pods_artifacts)
elsif File.exist?(pods_artifacts)
FileUtils.rm_rf(pods_artifacts)
end
FileUtils.mkdir_p(File.dirname(pods_artifacts))
FileUtils.ln_sf(artifacts_dir(), pods_artifacts)
end

def hermestag_file(react_native_path)
Expand Down
Loading