From 1779bcc9bfef8cdc72c7ffed01439bc61a8ec788 Mon Sep 17 00:00:00 2001 From: Kyle Fleming Date: Wed, 6 Nov 2019 09:22:33 +0900 Subject: [PATCH 01/11] Use Xcode 10.2 in Travis for Swift 4.2 and 5 support --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 9327854..4e05118 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,4 @@ -osx_image: xcode9.3 +osx_image: xcode10.2 language: objective-c cache: - cocoapods From 6412421bd459587df00ea8f3e7e91978dfba55d2 Mon Sep 17 00:00:00 2001 From: Kyle Fleming Date: Wed, 6 Nov 2019 09:36:02 +0900 Subject: [PATCH 02/11] Specify RxCocoa to 4.x for tests --- test/change_podfile.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/change_podfile.py b/test/change_podfile.py index 5f31510..95b5098 100644 --- a/test/change_podfile.py +++ b/test/change_podfile.py @@ -53,7 +53,7 @@ def addSwiftPod(): """ keep_source_code_for_prebuilt_frameworks! -pod "RxCocoa", :binary => true +pod "RxCocoa", "~> 4.0", :binary => true pod "Literal", :binary => true """), """ @@ -70,7 +70,7 @@ def revertToSourceCode(): """ keep_source_code_for_prebuilt_frameworks! -pod "RxCocoa", :binary => true +pod "RxCocoa", "~> 4.0", :binary => true pod "Literal" """), """ From 751959d9a741c7cbfb683c29d14721f60be8f656 Mon Sep 17 00:00:00 2001 From: Kyle Fleming Date: Wed, 6 Nov 2019 10:19:33 +0900 Subject: [PATCH 03/11] Remove version restriction on Bundler 1.x --- cocoapods-binary.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocoapods-binary.gemspec b/cocoapods-binary.gemspec index 697aeb2..de525fb 100644 --- a/cocoapods-binary.gemspec +++ b/cocoapods-binary.gemspec @@ -22,6 +22,6 @@ Gem::Specification.new do |spec| spec.add_dependency "fourflusher", "~> 2.0" spec.add_dependency "xcpretty", "~> 0.3.0" - spec.add_development_dependency 'bundler', '~> 1.3' + spec.add_development_dependency 'bundler', '> 1.3' spec.add_development_dependency 'rake' end From 148b9fb83e0891130b4e281028333ccda2f26b4d Mon Sep 17 00:00:00 2001 From: Kyle Fleming Date: Thu, 7 Nov 2019 08:42:19 +0900 Subject: [PATCH 04/11] Set gemfile in Travis to test/Gemfile --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 4e05118..dc9743d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,6 +3,7 @@ language: objective-c cache: - cocoapods - bundler +gemfile: test/Gemfile before_install: - gem install cocoapods script: From 4887114163bf967fa73272de48ed91bb6420ec15 Mon Sep 17 00:00:00 2001 From: Kyle Fleming Date: Thu, 7 Nov 2019 08:43:30 +0900 Subject: [PATCH 05/11] Remove extraneous gem install cocoapods --- .travis.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index dc9743d..9b60d5f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,8 +4,6 @@ cache: - cocoapods - bundler gemfile: test/Gemfile -before_install: -- gem install cocoapods script: - rake install - cd test From e7febad2300f38eb9acc55eab12969767324e2f5 Mon Sep 17 00:00:00 2001 From: Kyle Fleming Date: Thu, 7 Nov 2019 08:44:04 +0900 Subject: [PATCH 06/11] Add pod setup to travis script --- .travis.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.travis.yml b/.travis.yml index 9b60d5f..decdf6a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,6 +4,9 @@ cache: - cocoapods - bundler gemfile: test/Gemfile +install: +- bundle install --jobs=3 --retry=3 --path=${BUNDLE_PATH:-vendor/bundle} +- bundle exec pod setup script: - rake install - cd test From b1b5d501030acec49492cc7cd1ce2561f4972325 Mon Sep 17 00:00:00 2001 From: Kyle Fleming Date: Thu, 7 Nov 2019 11:00:58 +0900 Subject: [PATCH 07/11] Enable command output in test script --- test/test.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test.sh b/test/test.sh index 4aa46dc..99e6466 100644 --- a/test/test.sh +++ b/test/test.sh @@ -1,5 +1,5 @@ #!/bin/sh -set -e +set -ex build() { xcodebuild -workspace Binary.xcworkspace -scheme Binary ONLY_ACTIVE_ARCH=YES CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO CODE_SIGNING_ALLOWED=NO -quiet || exit 1 From 13225c2854df74a8993463cdcbbe05f35e91ed02 Mon Sep 17 00:00:00 2001 From: Kyle Fleming Date: Thu, 7 Nov 2019 11:02:28 +0900 Subject: [PATCH 08/11] Make test.sh file executable --- test/test.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 test/test.sh diff --git a/test/test.sh b/test/test.sh old mode 100644 new mode 100755 From 3290f934d3c268a6940fa56f974e2785c14ea3f1 Mon Sep 17 00:00:00 2001 From: Kyle Fleming Date: Thu, 7 Nov 2019 11:39:56 +0900 Subject: [PATCH 09/11] Unset CPATH env variable in Travis --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index decdf6a..59e818b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,6 +4,8 @@ cache: - cocoapods - bundler gemfile: test/Gemfile +before_install: +- unset CPATH install: - bundle install --jobs=3 --retry=3 --path=${BUNDLE_PATH:-vendor/bundle} - bundle exec pod setup From 94a3e3c269026c905fa43cbeede167f6a2fd0884 Mon Sep 17 00:00:00 2001 From: Kyle Fleming Date: Thu, 11 Jul 2019 17:55:06 -0700 Subject: [PATCH 10/11] Add test for rebuilding when pod version updates --- test/change_podfile.py | 33 +++++++++++++++++++++++++++++++++ test/test.sh | 2 +- 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/test/change_podfile.py b/test/change_podfile.py index 95b5098..0ea88f0 100644 --- a/test/change_podfile.py +++ b/test/change_podfile.py @@ -233,6 +233,39 @@ class A { """ ) +def oldPodVersion(): + return (wrapper( +""" +pod "ReactiveSwift", "= 3.0.0", :binary => true +""") , +""" +import ReactiveSwift +class A { + // Works on 3.x but not 4.x + let a = A.b(SignalProducer.empty) + static func b(_ b: U) -> Bool { + return true + } +} +""" +) + +def upgradePodVersion(): + return (wrapper( +""" +pod "ReactiveSwift", "= 4.0.0", :binary => true +""") , +""" +import ReactiveSwift +class A { + func b() { + // Works on 4.x but not 3.x + Lifetime.make().token.dispose() + } +} +""" +) + if __name__ == "__main__": arg = sys.argv[1] diff --git a/test/test.sh b/test/test.sh index 99e6466..6dbbc01 100755 --- a/test/test.sh +++ b/test/test.sh @@ -7,7 +7,7 @@ build() { rm -rf Pods -cases=("initial" "addSwiftPod" "revertToSourceCode" "addDifferentNamePod" "addSubPod" "deleteAPod" "addVendoredLibPod" "universalFlag" "multiplePlatforms" "multiplePlatformsWithALLFlag") +cases=("initial" "addSwiftPod" "revertToSourceCode" "addDifferentNamePod" "addSubPod" "deleteAPod" "addVendoredLibPod" "universalFlag" "multiplePlatforms" "multiplePlatformsWithALLFlag" "oldPodVersion" "upgradePodVersion") for action in ${cases[@]}; do python change_podfile.py ${action} bundle exec pod install From ae248423d553c589fbec295d14b669506c8641d7 Mon Sep 17 00:00:00 2001 From: Kyle Fleming Date: Thu, 11 Jul 2019 15:42:56 -0700 Subject: [PATCH 11/11] Fix copying framework when building a new version Fixes an issue where copying the generated framework after a build would fail if the framework already exists in the GeneratedFrameworks folder, even if that existing framework is out-of-date. --- lib/cocoapods-binary/rome/build_framework.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/cocoapods-binary/rome/build_framework.rb b/lib/cocoapods-binary/rome/build_framework.rb index 10c8571..0f87c84 100644 --- a/lib/cocoapods-binary/rome/build_framework.rb +++ b/lib/cocoapods-binary/rome/build_framework.rb @@ -42,6 +42,7 @@ def build_for_iosish_platform(sandbox, module_name = target.product_module_name device_framework_path = "#{build_dir}/#{CONFIGURATION}-#{device}/#{target_name}/#{module_name}.framework" simulator_framework_path = "#{build_dir}/#{CONFIGURATION}-#{simulator}/#{target_name}/#{module_name}.framework" + output_framework_path = "#{output_path}/#{module_name}.framework" device_binary = device_framework_path + "/#{module_name}" simulator_binary = simulator_framework_path + "/#{module_name}" @@ -86,6 +87,7 @@ def build_for_iosish_platform(sandbox, # handle the dSYM files device_dsym = "#{device_framework_path}.dSYM" + device_dsym_output_path = "#{output_framework_path}.dSYM" if File.exist? device_dsym # lipo the simulator dsym simulator_dsym = "#{simulator_framework_path}.dSYM" @@ -96,12 +98,14 @@ def build_for_iosish_platform(sandbox, FileUtils.mv tmp_lipoed_binary_path, "#{device_framework_path}.dSYM/Contents/Resources/DWARF/#{module_name}", :force => true end # move - FileUtils.mv device_dsym, output_path, :force => true + FileUtils.rm_r device_dsym_output_path if Dir.exist? device_dsym_output_path + File.rename device_dsym, device_dsym_output_path end # output output_path.mkpath unless output_path.exist? - FileUtils.mv device_framework_path, output_path, :force => true + FileUtils.rm_r output_framework_path if Dir.exist? output_framework_path + File.rename device_framework_path, output_framework_path end