Skip to content

Commit

Permalink
Merge pull request #59 from neonichu/tvos-support
Browse files Browse the repository at this point in the history
Add tvOS support to existing Cocoa Touch targets.
  • Loading branch information
boredzo committed Nov 30, 2015
2 parents 43210ea + b56be72 commit 590e7cf
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
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

0 comments on commit 590e7cf

Please sign in to comment.