Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tvOS targets #59

Merged
merged 1 commit into from
Nov 30, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
language: objective-c
osx_image: xcode7.1
before_install:
- sudo easy_install cpp-coveralls

Expand All @@ -7,6 +8,7 @@ before_script:
script:
- xcodebuild test -scheme 'ISO8601ForCocoa' SRCROOT=../build OBJROOT=../build SHARED_PRECOMPS_DIR=../build
- xcodebuild test -scheme 'ISO8601ForCocoaTouch' -destination 'name=iPhone 5s' SRCROOT=../build OBJROOT=../build SHARED_PRECOMPS_DIR=../build
- xcodebuild test -scheme 'ISO8601ForCocoaTouch' -destination 'name=Apple TV 1080p' SRCROOT=../build OBJROOT=../build SHARED_PRECOMPS_DIR=../build
after_success:
- cd ..
- coveralls -x '.m'
4 changes: 4 additions & 0 deletions ISO8601ForCocoa/ISO8601ForCocoa.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -643,6 +643,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = iphoneos;
SKIP_INSTALL = YES;
SUPPORTED_PLATFORMS = "iphonesimulator iphoneos appletvsimulator appletvos";
};
name = Debug;
};
Expand All @@ -662,6 +663,7 @@
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = iphoneos;
SKIP_INSTALL = YES;
SUPPORTED_PLATFORMS = "iphonesimulator iphoneos appletvsimulator appletvos";
VALIDATE_PRODUCT = YES;
};
name = Release;
Expand All @@ -685,6 +687,7 @@
IPHONEOS_DEPLOYMENT_TARGET = 5.0;
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = "iphonesimulator iphoneos appletvsimulator appletvos";
};
name = Debug;
};
Expand All @@ -707,6 +710,7 @@
IPHONEOS_DEPLOYMENT_TARGET = 5.0;
PRODUCT_NAME = "$(TARGET_NAME)";
SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = "iphonesimulator iphoneos appletvsimulator appletvos";
VALIDATE_PRODUCT = YES;
};
name = Release;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@
#import "PRHNamedCharacter.h"
#include <vis.h>

#ifndef TARGET_OS_TV
#define TARGET_OS_TV 0
#endif

static const NSTimeInterval gSecondsPerHour = 3600.0;

@interface ISO8601ForCocoaCalendarDateTests ()
Expand Down Expand Up @@ -306,7 +310,11 @@ - (void) testParsingDateWithTimeOnly {
- (void) testUnparsingDatesWithoutTime {
_iso8601DateFormatter.includeTime = false;

#if TARGET_OS_TV
NSCalendar *calendar = [[NSCalendar alloc] initWithCalendarIdentifier:NSCalendarIdentifierGregorian];
#else
NSCalendar *calendar = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar];
#endif
XCTAssertNotNil(calendar, @"Couldn't create Gregorian calendar with which to set up date-unparsing tests");
NSLocale *locale = [[NSLocale alloc] initWithLocaleIdentifier:@"en_US_POSIX"];
XCTAssertNotNil(calendar, @"Couldn't create C/POSIX locale with which to set up date-unparsing tests");
Expand Down