diff --git a/.travis.yml b/.travis.yml index a978ab13..b105ef28 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,5 @@ language: objective-c -osx_image: xcode8 +osx_image: xcode9 #xcode_project: mogenerator.xcodeproj #xcode_scheme: mogenerator script: cd test && rake diff --git a/mogenerator.m b/mogenerator.m index 784f8c87..4533f987 100644 --- a/mogenerator.m +++ b/mogenerator.m @@ -558,8 +558,23 @@ - (NSString*)objectAttributeClassName { result = gSwift ? @"AnyObject" : @"NSObject"; } } else { - result = [self attributeValueClassName]; + // Forcibly generate the correct class name in case we are + // running on macOS < 10.13 + switch ([self attributeType]) { +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wpartial-availability" + case NSURIAttributeType: + result = @"NSURL"; + break; + case NSUUIDAttributeType: + result = @"NSUUID"; + break; +#pragma clang diagnostic pop + default: + result = [self attributeValueClassName]; + } } + if (gSwift) { if ([result isEqualToString:@"NSString"]) { result = @"String"; @@ -567,6 +582,10 @@ - (NSString*)objectAttributeClassName { result = @"Date"; } else if ([result isEqualToString:@"NSData"]) { result = @"Data"; + } else if ([result isEqualToString:@"NSURL"]) { + result = @"URL"; + } else if ([result isEqualToString:@"NSUUID"]) { + result = @"UUID"; } } return result; diff --git a/momcom/NSAttributeDescription+momcom.m b/momcom/NSAttributeDescription+momcom.m index 60c4bd2f..63dda0ba 100644 --- a/momcom/NSAttributeDescription+momcom.m +++ b/momcom/NSAttributeDescription+momcom.m @@ -30,6 +30,11 @@ + (void)initialize @"Float" : @(NSFloatAttributeType), @"String" : @(NSStringAttributeType), @"Transformable" : @(NSTransformableAttributeType), +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wpartial-availability" + @"URI" : @(NSURIAttributeType), + @"UUID" : @(NSUUIDAttributeType), +#pragma clang diagnostic pop }; }); } diff --git a/test/Rakefile b/test/Rakefile index a203ba88..6f04d33f 100644 --- a/test/Rakefile +++ b/test/Rakefile @@ -12,7 +12,7 @@ end #============================== # Variables #============================== -OSX_SDK="/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.12.sdk" +OSX_SDK="/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.sdk" OSX_VERSION="10.10" LINKED_FRAMEWORKS="-framework Foundation -framework AppKit -framework CoreData"