Commit c3dac7f9 authored by Samuel E. Giddins's avatar Samuel E. Giddins

Merge pull request #3681 from CocoaPods/watchapp2

Support for the new `watchos` platform
parents 3cd3de40 336ef48c
......@@ -88,6 +88,10 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
[Samuel Giddins](https://github.com/segiddins)
[#3689](https://github.com/CocoaPods/CocoaPods/issues/3689)
* Support for the new `watchos` platform.
[Boris Bügling](https://github.com/neonichu)
[#3681](https://github.com/CocoaPods/CocoaPods/pull/3681)
##### Bug Fixes
* Added recursive support to the public headers of vendored frameworks
......
......@@ -7,7 +7,7 @@ GIT
GIT
remote: https://github.com/CocoaPods/Core.git
revision: 977fd7d2a19b9f9a861af7a76b8af64136f574fc
revision: 5dd8f9604ebbe0e96d22bf094bd70701fce15e58
branch: master
specs:
cocoapods-core (0.37.2)
......@@ -24,12 +24,13 @@ GIT
GIT
remote: https://github.com/CocoaPods/Xcodeproj.git
revision: 4af2c666f8515d1dc292516281796e16b7969dca
revision: fc53251683b0738c67cb362a8d0a4b459148e2cb
branch: master
specs:
xcodeproj (0.24.2)
activesupport (>= 3)
colored (~> 1.2)
liferaft (~> 0.0.4)
GIT
remote: https://github.com/CocoaPods/cocoapods-downloader.git
......@@ -116,6 +117,7 @@ GEM
kicker (3.0.0)
listen (~> 1.3.0)
notify (~> 0.5.2)
liferaft (0.0.4)
listen (1.3.1)
rb-fsevent (>= 0.9.3)
rb-inotify (>= 0.9)
......@@ -200,4 +202,4 @@ DEPENDENCIES
xcodeproj!
BUNDLED WITH
1.10.4
1.10.5
......@@ -249,6 +249,7 @@ begin
Bundler.require 'xcodeproj', :development
Dir['examples/*'].each do |dir|
Dir.chdir(dir) do
next if dir == 'examples/watchOS Example'
puts "Example: #{dir}"
puts ' Installing Pods'
......
## CocoaPods
Pods
## Node
node_modules
## OS X
.DS_Store
## Other
.gutter.json
.pt
## Xcode
*.xccheckout
xcuserdata
Gemfile.lock
Podfile.lock
use_frameworks!
target 'watchOSsample' do
pod 'Alamofire', :git => 'git@github.com:neonichu/Alamofire.git', :branch => 'watchos'
end
target 'watchOSsample WatchKit Extension' do
platform :watchos, '2.0'
pod 'Alamofire', :git => 'git@github.com:neonichu/Alamofire.git', :branch => 'watchos'
end
{
"images" : [
{
"size" : "24x24",
"idiom" : "watch",
"scale" : "2x",
"role" : "notificationCenter",
"subtype" : "38mm"
},
{
"size" : "27.5x27.5",
"idiom" : "watch",
"scale" : "2x",
"role" : "notificationCenter",
"subtype" : "42mm"
},
{
"size" : "29x29",
"idiom" : "watch",
"role" : "companionSettings",
"scale" : "2x"
},
{
"size" : "29x29",
"idiom" : "watch",
"role" : "companionSettings",
"scale" : "3x"
},
{
"size" : "40x40",
"idiom" : "watch",
"scale" : "2x",
"role" : "appLauncher",
"subtype" : "38mm"
},
{
"size" : "44x44",
"idiom" : "watch",
"scale" : "2x",
"role" : "longLook",
"subtype" : "42mm"
},
{
"size" : "86x86",
"idiom" : "watch",
"scale" : "2x",
"role" : "quickLook",
"subtype" : "38mm"
},
{
"size" : "98x98",
"idiom" : "watch",
"scale" : "2x",
"role" : "quickLook",
"subtype" : "42mm"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder.WatchKit.Storyboard" version="3.0" toolsVersion="6221" systemVersion="13E28" targetRuntime="watchKit" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="AgC-eL-Hgc">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6213"/>
<plugIn identifier="com.apple.InterfaceBuilder.IBWatchKitPlugin" version="3733"/>
</dependencies>
<scenes>
<!--Interface Controller-->
<scene sceneID="aou-V4-d1y">
<objects>
<controller id="AgC-eL-Hgc" customClass="InterfaceController" customModuleProvider="target"/>
</objects>
</scene>
</scenes>
</document>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleDisplayName</key>
<string>watchOSsample WatchKit App</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
<string>UIInterfaceOrientationPortraitUpsideDown</string>
</array>
<key>WKCompanionAppBundleIdentifier</key>
<string>org.vu0.watchOSsample</string>
<key>WKWatchKitApp</key>
<true/>
</dict>
</plist>
//
// ExtensionDelegate.swift
// watchOSsample WatchKit Extension
//
// Created by Boris Bügling on 13/06/15.
// Copyright © 2015 Boris Bügling. All rights reserved.
//
import WatchKit
class ExtensionDelegate: NSObject, WKExtensionDelegate {
func applicationDidFinishLaunching() {
// Perform any final initialization of your application.
}
func applicationDidBecomeActive() {
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
}
func applicationWillResignActive() {
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
// Use this method to pause ongoing tasks, disable timers, etc.
}
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleDisplayName</key>
<string>watchOSsample WatchKit Extension</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>XPC!</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>NSExtension</key>
<dict>
<key>NSExtensionAttributes</key>
<dict>
<key>WKAppBundleIdentifier</key>
<string>org.vu0.watchOSsample.watchkitapp</string>
</dict>
<key>NSExtensionPointIdentifier</key>
<string>com.apple.watchkit</string>
</dict>
<key>RemoteInterfacePrincipalClass</key>
<string>$(PRODUCT_MODULE_NAME).InterfaceController</string>
<key>WKExtensionDelegateClassName</key>
<string>$(PRODUCT_MODULE_NAME).ExtensionDelegate</string>
</dict>
</plist>
//
// InterfaceController.swift
// watchOSsample WatchKit Extension
//
// Created by Boris Bügling on 13/06/15.
// Copyright © 2015 Boris Bügling. All rights reserved.
//
import WatchKit
import Foundation
class InterfaceController: WKInterfaceController {
override func awakeWithContext(context: AnyObject?) {
super.awakeWithContext(context)
// Configure interface objects here.
}
override func willActivate() {
// This method is called when watch view controller is about to be visible to user
super.willActivate()
}
override func didDeactivate() {
// This method is called when watch view controller is no longer visible
super.didDeactivate()
}
}
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">
<FileRef
location = "group:watchOSsample.xcodeproj">
</FileRef>
<FileRef
location = "group:Pods/Pods.xcodeproj">
</FileRef>
</Workspace>
{
"DVTSourceControlWorkspaceBlueprintPrimaryRemoteRepositoryKey" : "9B3204A8D3160EB3616BC7CB1D3FCCFBB4BF3F2C",
"DVTSourceControlWorkspaceBlueprintWorkingCopyRepositoryLocationsKey" : {
},
"DVTSourceControlWorkspaceBlueprintWorkingCopyStatesKey" : {
"9B3204A8D3160EB3616BC7CB1D3FCCFBB4BF3F2C" : 0,
"9F9800D332981B4632368512DE7ED0F103520D36" : 0
},
"DVTSourceControlWorkspaceBlueprintIdentifierKey" : "95524A63-AE69-4DE3-89B6-1E907B56AA69",
"DVTSourceControlWorkspaceBlueprintWorkingCopyPathsKey" : {
"9B3204A8D3160EB3616BC7CB1D3FCCFBB4BF3F2C" : "CocoaPods\/",
"9F9800D332981B4632368512DE7ED0F103520D36" : ""
},
"DVTSourceControlWorkspaceBlueprintNameKey" : "watchOSsample",
"DVTSourceControlWorkspaceBlueprintVersion" : 203,
"DVTSourceControlWorkspaceBlueprintRelativePathToProjectKey" : "examples\/watchOS Example\/watchOSsample.xcworkspace",
"DVTSourceControlWorkspaceBlueprintRemoteRepositoriesKey" : [
{
"DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "github.com:CocoaPods\/CocoaPods.git",
"DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git",
"DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "9B3204A8D3160EB3616BC7CB1D3FCCFBB4BF3F2C"
},
{
"DVTSourceControlWorkspaceBlueprintRemoteRepositoryURLKey" : "github.com:CocoaPods\/Rainforest.git",
"DVTSourceControlWorkspaceBlueprintRemoteRepositorySystemKey" : "com.apple.dt.Xcode.sourcecontrol.Git",
"DVTSourceControlWorkspaceBlueprintRemoteRepositoryIdentifierKey" : "9F9800D332981B4632368512DE7ED0F103520D36"
}
]
}
\ No newline at end of file
//
// AppDelegate.swift
// watchOSsample
//
// Created by Boris Bügling on 13/06/15.
// Copyright © 2015 Boris Bügling. All rights reserved.
//
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
var window: UIWindow?
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
// Override point for customization after application launch.
return true
}
func applicationWillResignActive(application: UIApplication) {
// Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
// Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
}
func applicationDidEnterBackground(application: UIApplication) {
// Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
// If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
}
func applicationWillEnterForeground(application: UIApplication) {
// Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
}
func applicationDidBecomeActive(application: UIApplication) {
// Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
}
func applicationWillTerminate(application: UIApplication) {
// Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:.
}
}
{
"images" : [
{
"idiom" : "iphone",
"size" : "29x29",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "29x29",
"scale" : "3x"
},
{
"idiom" : "iphone",
"size" : "40x40",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "40x40",
"scale" : "3x"
},
{
"idiom" : "iphone",
"size" : "60x60",
"scale" : "2x"
},
{
"idiom" : "iphone",
"size" : "60x60",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="8076" systemVersion="14D121" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" initialViewController="01J-lp-oVM">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="8063"/>
<capability name="Constraints with non-1.0 multipliers" minToolsVersion="5.1"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="EHf-IW-A2E">
<objects>
<viewController id="01J-lp-oVM" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="Llm-lL-Icb"/>
<viewControllerLayoutGuide type="bottom" id="xb3-aO-Qok"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text=" Copyright © 2015 Boris Bügling. All rights reserved." textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" minimumFontSize="9" translatesAutoresizingMaskIntoConstraints="NO" id="obG-Y5-kRd">
<rect key="frame" x="20" y="559" width="560" height="21"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="watchOSsample" textAlignment="center" lineBreakMode="middleTruncation" baselineAdjustment="alignBaselines" minimumFontSize="18" translatesAutoresizingMaskIntoConstraints="NO" id="GJd-Yh-RWb">
<rect key="frame" x="20" y="180" width="560" height="43"/>
<fontDescription key="fontDescription" type="boldSystem" pointSize="36"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<constraints>
<constraint firstAttribute="centerX" secondItem="obG-Y5-kRd" secondAttribute="centerX" id="5cz-MP-9tL"/>
<constraint firstAttribute="centerX" secondItem="GJd-Yh-RWb" secondAttribute="centerX" id="Q3B-4B-g5h"/>
<constraint firstItem="obG-Y5-kRd" firstAttribute="leading" secondItem="Ze5-6b-2t3" secondAttribute="leading" constant="20" symbolic="YES" id="SfN-ll-jLj"/>
<constraint firstAttribute="bottom" secondItem="obG-Y5-kRd" secondAttribute="bottom" constant="20" id="Y44-ml-fuU"/>
<constraint firstItem="GJd-Yh-RWb" firstAttribute="centerY" secondItem="Ze5-6b-2t3" secondAttribute="bottom" multiplier="1/3" constant="1" id="moa-c2-u7t"/>
<constraint firstItem="GJd-Yh-RWb" firstAttribute="leading" secondItem="Ze5-6b-2t3" secondAttribute="leading" constant="20" symbolic="YES" id="x7j-FC-K8j"/>
</constraints>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="53" y="375"/>
</scene>
</scenes>
</document>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="6211" systemVersion="14A298i" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" initialViewController="BYZ-38-t0r">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="6204"/>
</dependencies>
<scenes>
<!--View Controller-->
<scene sceneID="tne-QT-ifu">
<objects>
<viewController id="BYZ-38-t0r" customClass="ViewController" customModuleProvider="target" sceneMemberID="viewController">
<layoutGuides>
<viewControllerLayoutGuide type="top" id="y3c-jy-aDJ"/>
<viewControllerLayoutGuide type="bottom" id="wfy-db-euE"/>
</layoutGuides>
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC">
<rect key="frame" x="0.0" y="0.0" width="600" height="600"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/>
</objects>
</scene>
</scenes>
</document>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1</string>
<key>LSRequiresIPhoneOS</key>
<true/>
<key>UILaunchStoryboardName</key>
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
<string>Main</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
</array>
<key>UISupportedInterfaceOrientations</key>
<array>
<string>UIInterfaceOrientationPortrait</string>
</array>
</dict>
</plist>
//
// ViewController.swift
// watchOSsample
//
// Created by Boris Bügling on 13/06/15.
// Copyright © 2015 Boris Bügling. All rights reserved.
//
import UIKit
class ViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
}
......@@ -177,6 +177,7 @@ Pod::Spec.new do |s|
# When using multiple platforms
# s.ios.deployment_target = "5.0"
# s.osx.deployment_target = "10.7"
# s.watchos.deployment_target = "2.0"
# ――― Source Location ―――――――――――――――――――――――――――――――――――――――――――――――――――――――――― #
......
......@@ -51,6 +51,7 @@ module Pod
EXTERNAL_STRINGS_FILE_MIMINUM_DEPLOYMENT_TARGET = {
:ios => Version.new('6.0'),
:osx => Version.new('10.8'),
:watchos => Version.new('2.0'),
}
# @return [Bool] Whether the external strings file is supported by the
......
......@@ -82,7 +82,11 @@ module Pod
# @return [String]
#
def generate_platform_import_header
"#import #{platform == :ios ? '<UIKit/UIKit.h>' : '<Cocoa/Cocoa.h>'}\n"
case platform.name
when :ios then "#import <UIKit/UIKit.h>\n"
when :osx then "#import <Cocoa/Cocoa.h>\n"
else "#import <Foundation/Foundation.h>\n"
end
end
end
end
......
......@@ -189,7 +189,7 @@ module Pod
search_paths = xcconfig.attributes['FRAMEWORK_SEARCH_PATHS'] ||= ''
search_paths_to_add = []
search_paths_to_add << '$(inherited)'
if platform == :ios
if platform == :ios || platform == :watchos
search_paths_to_add << '"$(SDKROOT)/Developer/Library/Frameworks"'
else
search_paths_to_add << '"$(DEVELOPER_LIBRARY_DIR)/Frameworks"'
......
......@@ -509,9 +509,11 @@ module Pod
platforms = aggregate_targets.map(&:platform)
osx_deployment_target = platforms.select { |p| p.name == :osx }.map(&:deployment_target).min
ios_deployment_target = platforms.select { |p| p.name == :ios }.map(&:deployment_target).min
watchos_deployment_target = platforms.select { |p| p.name == :watchos }.map(&:deployment_target).min
@pods_project.build_configurations.each do |build_configuration|
build_configuration.build_settings['MACOSX_DEPLOYMENT_TARGET'] = osx_deployment_target.to_s if osx_deployment_target
build_configuration.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = ios_deployment_target.to_s if ios_deployment_target
build_configuration.build_settings['WATCHOS_DEPLOYMENT_TARGET'] = watchos_deployment_target.to_s if watchos_deployment_target
build_configuration.build_settings['STRIP_INSTALLED_PRODUCT'] = 'NO'
build_configuration.build_settings['CLANG_ENABLE_OBJC_ARC'] = 'YES'
end
......
......@@ -66,7 +66,7 @@ module Pod
#
attr_accessor :specs
# @return [Symbol] The platform (either `:ios` or `:osx`).
# @return [Symbol] The platform (either `:ios`, `:watchos` or `:osx`).
#
attr_accessor :platform_name
......
......@@ -186,6 +186,7 @@ module Pod
ENABLE_OBJECT_USE_OBJC_FROM = {
:ios => Version.new('6'),
:osx => Version.new('10.8'),
:watchos => Version.new('2.0'),
}
# Returns the compiler flags for the source files of the given specification.
......
......@@ -92,6 +92,8 @@ module Pod
platform_message = '[iOS] '
elsif result.platforms == [:osx]
platform_message = '[OSX] '
elsif result.platforms == [:watchos]
platform_message = '[watchOS] '
end
subspecs_message = ''
......
......@@ -127,6 +127,7 @@ module Pod
it 'validates specs as frameworks by default' do
Validator.any_instance.expects(:podfile_from_spec).with(:ios, nil, true).times(3)
Validator.any_instance.expects(:podfile_from_spec).with(:osx, nil, true).twice
Validator.any_instance.expects(:podfile_from_spec).with(:watchos, nil, true).twice
cmd = command('repo', 'push', 'master')
Dir.chdir(temporary_directory) { cmd.run }
......@@ -135,6 +136,7 @@ module Pod
it 'validates specs as libraries if requested' do
Validator.any_instance.expects(:podfile_from_spec).with(:ios, nil, false).times(3)
Validator.any_instance.expects(:podfile_from_spec).with(:osx, nil, false).twice
Validator.any_instance.expects(:podfile_from_spec).with(:watchos, nil, false).twice
cmd = command('repo', 'push', 'master', '--use-libraries')
Dir.chdir(temporary_directory) { cmd.run }
......
......@@ -35,6 +35,11 @@ module Pod
@gen.generate.should.include?('#import <Cocoa/Cocoa.h>')
end
it 'imports Foundation for watchOS platforms' do
@gen.stubs(:platform).returns(Pod::Platform.watchos)
@gen.generate.should.include?('#import <Foundation/Foundation.h>')
end
it 'writes the header file to the disk' do
path = temporary_directory + 'Test.h'
@gen.save_as(path)
......
......@@ -267,9 +267,9 @@ module Pod
file = write_podspec(stub_podspec)
validator = Validator.new(file, SourcesManager.master.map(&:url))
validator.stubs(:validate_url)
validator.expects(:install_pod).twice
validator.expects(:build_pod).twice
validator.expects(:check_file_patterns).twice
validator.expects(:install_pod).times(3)
validator.expects(:build_pod).times(3)
validator.expects(:check_file_patterns).times(3)
validator.validate
end
......@@ -309,6 +309,7 @@ module Pod
validator.expects(:podfile_from_spec).with(:osx, nil, nil).once
validator.expects(:podfile_from_spec).with(:ios, nil, nil).once
validator.expects(:podfile_from_spec).with(:ios, '7.0', nil).once
validator.expects(:podfile_from_spec).with(:watchos, nil, nil).once
validator.send(:perform_extensive_analysis, validator.spec)
end
......@@ -377,7 +378,7 @@ module Pod
validator = Validator.new(podspec_path, SourcesManager.master.map(&:url))
validator.stubs(:check_file_patterns)
validator.stubs(:validate_url)
validator.expects(:`).with('which xcodebuild').twice.returns('/usr/bin/xcodebuild')
validator.expects(:`).with('which xcodebuild').times(3).returns('/usr/bin/xcodebuild')
status = mock
status.stubs(:success?).returns(false)
validator.stubs(:_xcodebuild).returns(['Output', status])
......@@ -392,9 +393,9 @@ module Pod
validator = Validator.new(podspec_path, SourcesManager.master.map(&:url))
validator.stubs(:check_file_patterns)
validator.stubs(:validate_url)
validator.expects(:`).with('which xcodebuild').twice.returns('/usr/bin/xcodebuild')
validator.expects(:`).with('which xcodebuild').times(3).returns('/usr/bin/xcodebuild')
command = 'xcodebuild clean build -target Pods'
validator.expects(:`).with("#{command} 2>&1").once.returns('')
validator.expects(:`).with("#{command} 2>&1").twice.returns('')
validator.expects(:`).with("#{command} CODE_SIGN_IDENTITY=- -sdk iphonesimulator 2>&1").once.returns('')
validator.validate
end
......@@ -514,6 +515,7 @@ module Pod
@validator.expects(:podfile_from_spec).with(:osx, nil, true).once
@validator.expects(:podfile_from_spec).with(:ios, nil, true).once
@validator.expects(:podfile_from_spec).with(:watchos, nil, true).once
@validator.send(:perform_extensive_analysis, @validator.spec)
end
......@@ -524,6 +526,7 @@ module Pod
@validator.expects(:podfile_from_spec).with(:osx, nil, false).once
@validator.expects(:podfile_from_spec).with(:ios, nil, false).once
@validator.expects(:podfile_from_spec).with(:watchos, nil, false).once
@validator.send(:perform_extensive_analysis, @validator.spec)
end
end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment