diff --git a/.travis.yml b/.travis.yml index 9fd899c..48cbd20 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,4 @@ language: objective-c -osx_image: xcode8.3 sudo: false # Only do a shallow clone of our Git repo. @@ -17,14 +16,33 @@ branches: xcode_project: MDFInternationalization.xcodeproj xcode_scheme: MDFInternationalizationTests -xcode_sdk: iphonesimulator10.3 -env: - matrix: - - DESTINATION="platform=iOS Simulator,name=iPhone 4s,OS=8.3" - - DESTINATION="platform=iOS Simulator,name=iPad Air 2,OS=9.2" - - DESTINATION="platform=iOS Simulator,name=iPhone 7 Plus,OS=10.3.1" + +matrix: + include: + - osx_image: xcode9 + # The iPhone X was chosen because it is a device with a strange screen size and + # the 'notch'. + # OS 11.0 was chosen as the latest generally available iOS version. + env: DESTINATION="platform=iOS Simulator,name=iPhone X,OS=11.0" SDK="iphonesimulator11.0" + - osx_image: xcode9 + # The iPhone 7 Plus was chosen because it is a device with a 3x screen and also changes + # its size category trait on rotation. + # OS 10.3.1 was chosen to represent iOS 10. + env: DESTINATION="platform=iOS Simulator,name=iPhone 7 Plus,OS=10.3.1" SDK="iphonesimulator11.0" + - osx_image: xcode8.3 + # The iPad Pro 12.9 was chosen because it is the largest resolution we can test on. + # OS 9.3 was chosen to round out the range of iOS versions we are testing on. + env: DESTINATION="platform=iOS Simulator,name=iPad Pro (12.9-inch),OS=9.3" SDK="iphonesimulator10.3" + - osx_image: xcode8.3 + # The iPhone 5 was chosen because it is a 32-bit device. + # OS 8.1 was chosen because it is the earliest iOS offered here. + env: DESTINATION="platform=iOS Simulator,name=iPhone 5,OS=8.1" SDK="iphonesimulator10.3" # Test Execution -script: - - xcodebuild -project "$TRAVIS_XCODE_PROJECT" -scheme "$TRAVIS_XCODE_SCHEME" -sdk "$TRAVIS_XCODE_SDK" -destination "$DESTINATION" test | xcpretty +# TODO Enable set -euo pipefail +script: + - env + - set -o pipefail + - echo xcodebuild -project "$TRAVIS_XCODE_PROJECT" -scheme "$TRAVIS_XCODE_SCHEME" -sdk "$SDK" -destination "$DESTINATION" test + - xcodebuild -project "$TRAVIS_XCODE_PROJECT" -scheme "$TRAVIS_XCODE_SCHEME" -sdk "$SDK" -destination "$DESTINATION" test | xcpretty diff --git a/CHANGELOG.md b/CHANGELOG.md index d419805..7ed156c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +# 1.0.2 + +* [Update Project and Scheme to latest recommended settings](https://github.com/material-foundation/material-internationalization-ios/8a0317501403463fab8c1d541eddf0f649df2fc6) (Ian Gordon) +* [Update Travis-CI build environments and simulators (#24)](https://github.com/material-foundation/material-internationalization-ios/25521a9733fea64a2c9cde737d1037d2ec5eee74) (ianegordon) +* [Disable warnings added in Xcode 9 (#23)](https://github.com/material-foundation/material-internationalization-ios/6909be2fcde579116d7e454ae308dac777b740bb) (ianegordon) + # 1.0.1 * [Modify sharedApplication call to avoid extension error (#17)](https://github.com/material-foundation/material-internationalization-ios/commit/902e392e78c11e8ae5169135dd7a0077bcf37d48) (ianegordon) diff --git a/Examples/Flags/Flags.xcodeproj/project.pbxproj b/Examples/Flags/Flags.xcodeproj/project.pbxproj index db20a97..33ec355 100644 --- a/Examples/Flags/Flags.xcodeproj/project.pbxproj +++ b/Examples/Flags/Flags.xcodeproj/project.pbxproj @@ -222,7 +222,7 @@ 4096E61E1D78ED7600389ECD /* Project object */ = { isa = PBXProject; attributes = { - LastUpgradeCheck = 0800; + LastUpgradeCheck = 0900; ORGANIZATIONNAME = Google; TargetAttributes = { 4096E6251D78ED7600389ECD = { @@ -361,14 +361,20 @@ CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; @@ -410,14 +416,20 @@ CLANG_CXX_LIBRARY = "libc++"; CLANG_ENABLE_MODULES = YES; CLANG_ENABLE_OBJC_ARC = YES; + CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; CLANG_WARN_BOOL_CONVERSION = YES; + CLANG_WARN_COMMA = YES; CLANG_WARN_CONSTANT_CONVERSION = YES; CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; CLANG_WARN_EMPTY_BODY = YES; CLANG_WARN_ENUM_CONVERSION = YES; CLANG_WARN_INFINITE_RECURSION = YES; CLANG_WARN_INT_CONVERSION = YES; + CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; + CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; + CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; + CLANG_WARN_STRICT_PROTOTYPES = YES; CLANG_WARN_SUSPICIOUS_MOVE = YES; CLANG_WARN_UNREACHABLE_CODE = YES; CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; diff --git a/Examples/Flags/Flags.xcodeproj/xcshareddata/xcschemes/Flags.xcscheme b/Examples/Flags/Flags.xcodeproj/xcshareddata/xcschemes/Flags.xcscheme index 4c8c4f6..57b6bf6 100644 --- a/Examples/Flags/Flags.xcodeproj/xcshareddata/xcschemes/Flags.xcscheme +++ b/Examples/Flags/Flags.xcodeproj/xcshareddata/xcschemes/Flags.xcscheme @@ -1,6 +1,6 @@ diff --git a/Examples/Flags/Flags.xcodeproj/xcshareddata/xcschemes/FlagsUITests.xcscheme b/Examples/Flags/Flags.xcodeproj/xcshareddata/xcschemes/FlagsUITests.xcscheme index ec4ee7c..c686c3f 100644 --- a/Examples/Flags/Flags.xcodeproj/xcshareddata/xcschemes/FlagsUITests.xcscheme +++ b/Examples/Flags/Flags.xcodeproj/xcshareddata/xcschemes/FlagsUITests.xcscheme @@ -1,6 +1,6 @@ diff --git a/MDFInternationalization.podspec b/MDFInternationalization.podspec index ba97e61..2bfa04a 100644 --- a/MDFInternationalization.podspec +++ b/MDFInternationalization.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |s| s.name = "MDFInternationalization" - s.version = "1.0.1" + s.version = "1.0.2" s.authors = "The Material Foundation Authors" s.summary = "Internationalization tools." s.homepage = "https://github.com/material-foundation/material-internationalization-ios" diff --git a/MDFInternationalization.xcodeproj/xcshareddata/xcschemes/MDFInternationalization.xcscheme b/MDFInternationalization.xcodeproj/xcshareddata/xcschemes/MDFInternationalization.xcscheme index 03d32c2..a011913 100644 --- a/MDFInternationalization.xcodeproj/xcshareddata/xcschemes/MDFInternationalization.xcscheme +++ b/MDFInternationalization.xcodeproj/xcshareddata/xcschemes/MDFInternationalization.xcscheme @@ -1,6 +1,6 @@ @@ -31,6 +32,7 @@ buildConfiguration = "Debug" selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" + language = "" launchStyle = "0" useCustomWorkingDirectory = "NO" ignoresPersistentStateOnLaunch = "NO" diff --git a/Sources/Info.plist b/Sources/Info.plist index 7a84553..9645e5d 100644 --- a/Sources/Info.plist +++ b/Sources/Info.plist @@ -15,7 +15,7 @@ CFBundlePackageType FMWK CFBundleShortVersionString - 1.0.1 + 1.0.2 CFBundleSignature ???? CFBundleVersion diff --git a/Sources/UIImage+MaterialRTL.m b/Sources/UIImage+MaterialRTL.m index a854380..65e24c2 100644 --- a/Sources/UIImage+MaterialRTL.m +++ b/Sources/UIImage+MaterialRTL.m @@ -127,16 +127,22 @@ - (UIImage *)mdf_imageWithHorizontallyFlippedOrientation { // On iOS 10 and above, UIImage supports the imageWithHorizontallyFlippedOrientation method. // Otherwise, we manually manipulate the image. if ([self respondsToSelector:@selector(imageWithHorizontallyFlippedOrientation)]) { + //TODO(#22): Replace with @availability when we adopt Xcode 9 as our minimum supported version. +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wpartial-availability" return [self imageWithHorizontallyFlippedOrientation]; +#pragma clang diagnostic pop } else { UIImage *mirroredImage; UIImageOrientation mirroredOrientation = MDFRTLMirroredOrientation(self.imageOrientation); if (self.CGImage) { - mirroredImage = [[self class] imageWithCGImage:self.CGImage + CGImageRef _Nonnull image = (CGImageRef _Nonnull)self.CGImage; + mirroredImage = [[self class] imageWithCGImage:image scale:self.scale orientation:mirroredOrientation]; } else if (self.CIImage) { - mirroredImage = [[self class] imageWithCIImage:self.CIImage + CIImage * _Nonnull image = (CIImage * _Nonnull)self.CIImage; + mirroredImage = [[self class] imageWithCIImage:image scale:self.scale orientation:mirroredOrientation]; } diff --git a/Sources/UIView+MaterialRTL.h b/Sources/UIView+MaterialRTL.h index 8ea451a..8e21957 100644 --- a/Sources/UIView+MaterialRTL.h +++ b/Sources/UIView+MaterialRTL.h @@ -23,8 +23,16 @@ `+[UIView userInterfaceLayoutDirectionForSemanticContentAttribute:relativeToLayoutDirection:]`. */ + + @interface UIView (MaterialRTL) +// UISemanticContentAttribute was added in iOS SDK 9.0 but is available on devices running earlier +// version of iOS. We ignore the partial-availability warning that gets thrown on our use of this +// symbol. +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wpartial-availability" + /** A semantic description of the view's contents, used to determine whether the view should be flipped when switching between left-to-right and right-to-left layouts. @@ -77,4 +85,6 @@ relativeToLayoutDirection: (UIUserInterfaceLayoutDirection)layoutDirection; +#pragma clang diagnostic pop + @end diff --git a/Sources/UIView+MaterialRTL.m b/Sources/UIView+MaterialRTL.m index 309ca29..ca0394a 100644 --- a/Sources/UIView+MaterialRTL.m +++ b/Sources/UIView+MaterialRTL.m @@ -21,6 +21,12 @@ #define MDF_BASE_SDK_EQUAL_OR_ABOVE(x) \ (defined(__IPHONE_##x) && (__IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_##x)) +// UISemanticContentAttribute was added in iOS SDK 9.0 but is available on devices running earlier +// version of iOS. We ignore the partial-availability warning that gets thrown on our use of this +// symbol. +#pragma clang diagnostic push +#pragma clang diagnostic ignored "-Wpartial-availability" + static inline UIUserInterfaceLayoutDirection MDFUserInterfaceLayoutDirectionForSemanticContentAttributeRelativeToLayoutDirection( UISemanticContentAttribute semanticContentAttribute, @@ -158,3 +164,5 @@ - (void)mdf_setAssociatedSemanticContentAttribute: } @end + +#pragma clang diagnostic pop