diff --git a/.travis.yml b/.travis.yml index 9327854..59e818b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,10 +1,14 @@ -osx_image: xcode9.3 +osx_image: xcode10.2 language: objective-c cache: - cocoapods - bundler +gemfile: test/Gemfile before_install: -- gem install cocoapods +- unset CPATH +install: +- bundle install --jobs=3 --retry=3 --path=${BUNDLE_PATH:-vendor/bundle} +- bundle exec pod setup script: - rake install - cd test 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 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 diff --git a/test/change_podfile.py b/test/change_podfile.py index 5f31510..0ea88f0 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" """), """ @@ -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 old mode 100644 new mode 100755 index 4aa46dc..6dbbc01 --- 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 @@ -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