Sha256: a142a8c38c5a36e1ed18461077df083976ad29f551bc86121f7c74fe1d077c8f

Contents?: true

Size: 1.27 KB

Versions: 231

Compression:

Stored size: 1.27 KB

Contents

module Gym
  class XcodebuildFixes
    class << self
      # Determine whether this app has WatchKit2 support and manually package up the WatchKit2 framework
      def watchkit2_fix
        return unless watchkit2?

        UI.verbose "Adding WatchKit2 support"

        Dir.mktmpdir do |tmpdir|
          # Make watchkit support directory
          watchkit_support = File.join(tmpdir, "WatchKitSupport2")
          Dir.mkdir(watchkit_support)

          # Copy WK from Xcode into WatchKitSupport2
          FileUtils.copy_file("#{Xcode.xcode_path}/Platforms/WatchOS.platform/Developer/SDKs/WatchOS.sdk/Library/Application Support/WatchKit/WK", File.join(watchkit_support, "WK"))

          # Add "WatchKitSupport2" to the .ipa archive
          Dir.chdir(tmpdir) do
            abort unless system %(zip --recurse-paths "#{PackageCommandGenerator.ipa_path}" "WatchKitSupport2" > /dev/null)
          end

          UI.verbose "Successfully added WatchKit2 support"
        end
      end

      # Does this application have a WatchKit target
      def watchkit2?
        Dir["#{PackageCommandGenerator.appfile_path}/**/*.plist"].any? do |plist_path|
          `/usr/libexec/PlistBuddy -c 'Print DTSDKName' '#{plist_path}' 2>&1`.match(/^\s*watchos2\.\d+\s*$/)
        end
      end
    end
  end
end

Version data entries

231 entries across 231 versions & 2 rubygems

Version Path
fastlane-2.42.0 gym/lib/gym/xcodebuild_fixes/watchkit2_fix.rb
fastlane-2.42.0.beta.20170628010031 gym/lib/gym/xcodebuild_fixes/watchkit2_fix.rb
fastlane-2.42.0.beta.20170627010007 gym/lib/gym/xcodebuild_fixes/watchkit2_fix.rb
fastlane-2.42.0.beta.20170626010017 gym/lib/gym/xcodebuild_fixes/watchkit2_fix.rb
fastlane-2.42.0.beta.20170625010032 gym/lib/gym/xcodebuild_fixes/watchkit2_fix.rb
fastlane-2.42.0.beta.20170624010047 gym/lib/gym/xcodebuild_fixes/watchkit2_fix.rb
fastlane-2.41.0 gym/lib/gym/xcodebuild_fixes/watchkit2_fix.rb
fastlane-2.41.0.beta.20170623010027 gym/lib/gym/xcodebuild_fixes/watchkit2_fix.rb
fastlane-2.40.0 gym/lib/gym/xcodebuild_fixes/watchkit2_fix.rb
fastlane-2.40.0.beta.20170622010014 gym/lib/gym/xcodebuild_fixes/watchkit2_fix.rb
fastlane-2.40.0.beta.20170621010038 gym/lib/gym/xcodebuild_fixes/watchkit2_fix.rb
fastlane-2.40.0.beta.20170620010029 gym/lib/gym/xcodebuild_fixes/watchkit2_fix.rb
fastlane-2.39.2 gym/lib/gym/xcodebuild_fixes/watchkit2_fix.rb
fastlane-2.40.0.beta.20170619010029 gym/lib/gym/xcodebuild_fixes/watchkit2_fix.rb
fastlane-2.40.0.beta.20170618010039 gym/lib/gym/xcodebuild_fixes/watchkit2_fix.rb
fastlane-2.40.0.beta.20170617010037 gym/lib/gym/xcodebuild_fixes/watchkit2_fix.rb
fastlane-2.39.1 gym/lib/gym/xcodebuild_fixes/watchkit2_fix.rb
fastlane-2.40.0.beta.20170616010015 gym/lib/gym/xcodebuild_fixes/watchkit2_fix.rb
fastlane-2.39.0 gym/lib/gym/xcodebuild_fixes/watchkit2_fix.rb
fastlane-2.39.0.beta.20170615010031 gym/lib/gym/xcodebuild_fixes/watchkit2_fix.rb