lib/gym/xcodebuild_fixes/watchkit_fix.rb in gym-1.1.6 vs lib/gym/xcodebuild_fixes/watchkit_fix.rb in gym-1.2.0

- old
+ new

@@ -1,11 +1,11 @@ module Gym class XcodebuildFixes class << self # Determine whether this app has WatchKit support and manually package up the WatchKit framework def watchkit_fix - return unless watchkit? + return unless should_apply_watchkit1_fix? Helper.log.info "Adding WatchKit support" if $verbose Dir.mktmpdir do |tmpdir| # Make watchkit support directory @@ -27,9 +27,14 @@ # Does this application have a WatchKit target def watchkit? Dir["#{PackageCommandGenerator.appfile_path}/**/*.plist"].any? do |plist_path| `/usr/libexec/PlistBuddy -c 'Print WKWatchKitApp' '#{plist_path}' 2>&1`.strip == 'true' end + end + + # Should only be applied if watchkit app is not a watchkit2 app + def should_apply_watchkit1_fix? + watchkit? && !(Gym::XcodebuildFixes.watchkit2?) end end end end