From 303f9726e72efecb973861d5ab03514d900d8b32 Mon Sep 17 00:00:00 2001 From: Antonino Urbano Date: Sat, 24 Aug 2019 13:39:00 -0400 Subject: [PATCH 1/3] Shell-escaped the project path that we use for xcodebuild. --- lib/cocoapods-binary/rome/build_framework.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/cocoapods-binary/rome/build_framework.rb b/lib/cocoapods-binary/rome/build_framework.rb index 10c8571..f6283b0 100644 --- a/lib/cocoapods-binary/rome/build_framework.rb +++ b/lib/cocoapods-binary/rome/build_framework.rb @@ -1,5 +1,6 @@ require 'fourflusher' require 'xcpretty' +require 'shellwords' CONFIGURATION = "Release" PLATFORMS = { 'iphonesimulator' => 'iOS', @@ -106,7 +107,7 @@ def build_for_iosish_platform(sandbox, end def xcodebuild(sandbox, target, sdk='macosx', deployment_target=nil, other_options=[]) - args = %W(-project #{sandbox.project_path.realdirpath} -scheme #{target} -configuration #{CONFIGURATION} -sdk #{sdk} ) + args = %W(-project #{sandbox.project_path.realdirpath.shellescape} -scheme #{target} -configuration #{CONFIGURATION} -sdk #{sdk} ) platform = PLATFORMS[sdk] args += Fourflusher::SimControl.new.destination(:oldest, platform, deployment_target) unless platform.nil? args += other_options From ace4fb50fc59a58453301f6b05e2556d0a038903 Mon Sep 17 00:00:00 2001 From: Antonino Urbano Date: Sat, 24 Aug 2019 14:22:00 -0400 Subject: [PATCH 2/3] Added shell escapes to lipo commands. --- lib/cocoapods-binary/rome/build_framework.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/cocoapods-binary/rome/build_framework.rb b/lib/cocoapods-binary/rome/build_framework.rb index f6283b0..78edabe 100644 --- a/lib/cocoapods-binary/rome/build_framework.rb +++ b/lib/cocoapods-binary/rome/build_framework.rb @@ -51,7 +51,7 @@ def build_for_iosish_platform(sandbox, # the device_lib path is the final output file path # combine the binaries tmp_lipoed_binary_path = "#{build_dir}/#{target_name}" - lipo_log = `lipo -create -output #{tmp_lipoed_binary_path} #{device_binary} #{simulator_binary}` + lipo_log = `lipo -create -output #{tmp_lipoed_binary_path.shellescape} #{device_binary.shellescape} #{simulator_binary.shellescape}` puts lipo_log unless File.exist?(tmp_lipoed_binary_path) FileUtils.mv tmp_lipoed_binary_path, device_binary, :force => true @@ -92,7 +92,7 @@ def build_for_iosish_platform(sandbox, simulator_dsym = "#{simulator_framework_path}.dSYM" if File.exist? simulator_dsym tmp_lipoed_binary_path = "#{output_path}/#{module_name}.draft" - lipo_log = `lipo -create -output #{tmp_lipoed_binary_path} #{device_dsym}/Contents/Resources/DWARF/#{module_name} #{simulator_dsym}/Contents/Resources/DWARF/#{module_name}` + lipo_log = `lipo -create -output #{tmp_lipoed_binary_path.shellescape} #{device_dsym.shellescape}/Contents/Resources/DWARF/#{module_name.shellescape} #{simulator_dsym.shellescape}/Contents/Resources/DWARF/#{module_name.shellescape}` puts lipo_log unless File.exist?(tmp_lipoed_binary_path) FileUtils.mv tmp_lipoed_binary_path, "#{device_framework_path}.dSYM/Contents/Resources/DWARF/#{module_name}", :force => true end From 021357b70ebdc9a442f1f30cc80a94b21f43a1a9 Mon Sep 17 00:00:00 2001 From: Antonino Urbano Date: Sat, 31 Aug 2019 13:48:33 -0400 Subject: [PATCH 3/3] Update Integration.rb --- lib/cocoapods-binary/Integration.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/cocoapods-binary/Integration.rb b/lib/cocoapods-binary/Integration.rb index dab6aa7..1f61dd9 100644 --- a/lib/cocoapods-binary/Integration.rb +++ b/lib/cocoapods-binary/Integration.rb @@ -269,11 +269,11 @@ class EmbedFrameworksScript # If the path isn't an absolute path, we add a realtive prefix. old_read_link=`which readlink` readlink () { - path=`$old_read_link $1`; + path=`$old_read_link "$1"`; if [ $(echo "$path" | cut -c 1-1) = '/' ]; then echo $path; else - echo "`dirname $1`/$path"; + echo "`dirname "$1"`/$path"; fi } # --- @@ -286,4 +286,4 @@ class EmbedFrameworksScript end end end -end \ No newline at end of file +end