-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[No QA] Fix verifyPodfile script #43154
Changes from all commits
579c5e5
f1cab06
7458515
1d97b58
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#!/usr/bin/env ruby | ||
|
||
# This file is a lightweight port of the `pod ipc spec` command. | ||
# It was built from scratch to imports some 3rd party functions before reading podspecs | ||
|
||
require 'cocoapods' | ||
require 'json' | ||
|
||
# Require 3rd party functions needed to parse podspecs. This code is copied from ios/Podfile | ||
def node_require(script) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. alternate solution: DRY this up between this file and the Podfile. Didn't go for this because it will make RN upgrades harder. The more similar our Podfile is to the standard template, the easier. alternate solution 2: import the edit: alternate solution 2 is not possible without There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks for sharing, current solution seems fine for now. |
||
# Resolve script with node to allow for hoisting | ||
require Pod::Executable.execute_command('node', ['-p', | ||
"require.resolve( | ||
'#{script}', | ||
{paths: [process.argv[1]]}, | ||
)", __dir__]).strip | ||
end | ||
node_require('react-native/scripts/react_native_pods.rb') | ||
node_require('react-native-permissions/scripts/setup.rb') | ||
|
||
# Configure pod in silent mode | ||
Pod::Config.instance.silent = true | ||
|
||
# Process command-line arguments | ||
podspec_files = ARGV | ||
|
||
# Validate each podspec file | ||
podspec_files.each do |podspec_file| | ||
begin | ||
spec = Pod::Specification.from_file(podspec_file) | ||
puts(spec.to_pretty_json) | ||
rescue => e | ||
STDERR.puts "Failed to validate #{podspec_file}: #{e.message}" | ||
end | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
worth noting that the upstream
pod ipc spec
command this is based on hasn't changed in over 8 years: https://github.com/CocoaPods/CocoaPods/blob/028af0bdfc56df9e1b221a59cf36306690cf2ce4/lib/cocoapods/command/ipc/spec.rbso this should hopefully be pretty stable code