diff --git a/.bundle/config b/.bundle/config new file mode 100644 index 0000000..15e4c2e --- /dev/null +++ b/.bundle/config @@ -0,0 +1,2 @@ +--- +BUNDLE_WITHOUT: "documentation" diff --git a/.slather.yml b/.slather.yml new file mode 100644 index 0000000..2a3fe89 --- /dev/null +++ b/.slather.yml @@ -0,0 +1,7 @@ +coverage_service: coveralls +xcodeproj: Layout.xcodeproj +scheme: Layout +source_directory: Layout/* +ignore: + - Layout/Expression.swift + - LayoutTests/* diff --git a/.travis.yml b/.travis.yml index 5db6246..2b1613d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,10 +1,17 @@ -language: objective-c -osx_image: xcode8.3 - -script: xcodebuild test -project Layout.xcodeproj -scheme Layout -destination 'platform=iOS Simulator,name=iPhone 7 Plus,OS=10.3.1' -script: xcodebuild test -project Layout.xcodeproj -scheme LayoutTool -sdk macosx - -script: xcodebuild -project Layout.xcodeproj -scheme SampleApp -sdk iphonesimulator -script: xcodebuild -project Layout.xcodeproj -scheme Sandbox -sdk iphonesimulator -script: xcodebuild -project Layout.xcodeproj -scheme UIDesigner -sdk iphonesimulator +language: swift +osx_image: xcode9 +env: + - LC_CTYPE=en_US.UTF-8 LANG=en_US.UTF-8 +before_install: + - rvm install ruby-2.4.2 +install: + - bundle install --without=documentation +script: + - set -o pipefail + - xcodebuild -project Layout.xcodeproj -scheme LayoutTool -sdk macosx test + - xcodebuild -project Layout.xcodeproj -scheme SampleApp -sdk iphonesimulator + - xcodebuild -project Layout.xcodeproj -scheme Sandbox -sdk iphonesimulator + - xcodebuild -project Layout.xcodeproj -scheme UIDesigner -sdk iphonesimulator + - xcodebuild -project Layout.xcodeproj -scheme Layout -destination 'platform=iOS Simulator,name=iPhone 8 Plus,OS=11.0' clean build test | bundle exec xcpretty +after_success: bundle exec slather \ No newline at end of file diff --git a/Gemfile b/Gemfile new file mode 100755 index 0000000..035e046 --- /dev/null +++ b/Gemfile @@ -0,0 +1,4 @@ +source 'https://rubygems.org' + +gem 'slather' +gem 'xcpretty' \ No newline at end of file diff --git a/Gemfile.lock b/Gemfile.lock new file mode 100644 index 0000000..87f154b --- /dev/null +++ b/Gemfile.lock @@ -0,0 +1,47 @@ +GEM + remote: https://rubygems.org/ + specs: + CFPropertyList (2.3.5) + activesupport (4.2.10) + i18n (~> 0.7) + minitest (~> 5.1) + thread_safe (~> 0.3, >= 0.3.4) + tzinfo (~> 1.1) + claide (1.0.2) + clamp (0.6.5) + colored2 (3.1.2) + concurrent-ruby (1.0.5) + i18n (0.9.0) + concurrent-ruby (~> 1.0) + mini_portile2 (2.1.0) + minitest (5.10.3) + nanaimo (0.2.3) + nokogiri (1.6.8.1) + mini_portile2 (~> 2.1.0) + rouge (2.0.7) + slather (2.4.3) + CFPropertyList (~> 2.2) + activesupport (>= 4.0.2, < 5) + clamp (~> 0.6) + nokogiri (>= 1.6, < 1.7) + xcodeproj (~> 1.4) + thread_safe (0.3.6) + tzinfo (1.2.3) + thread_safe (~> 0.1) + xcodeproj (1.5.3) + CFPropertyList (~> 2.3.3) + claide (>= 1.0.2, < 2.0) + colored2 (~> 3.1) + nanaimo (~> 0.2.3) + xcpretty (0.2.8) + rouge (~> 2.0.7) + +PLATFORMS + ruby + +DEPENDENCIES + slather + xcpretty + +BUNDLED WITH + 1.15.4 diff --git a/Layout.xcodeproj/xcshareddata/xcschemes/Layout.xcscheme b/Layout.xcodeproj/xcshareddata/xcschemes/Layout.xcscheme index adeb5b2..dc29bbf 100644 --- a/Layout.xcodeproj/xcshareddata/xcschemes/Layout.xcscheme +++ b/Layout.xcodeproj/xcshareddata/xcschemes/Layout.xcscheme @@ -27,7 +27,8 @@ selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB" selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB" language = "" - shouldUseLaunchSchemeArgsEnv = "YES"> + shouldUseLaunchSchemeArgsEnv = "YES" + codeCoverageEnabled = "YES"> diff --git a/Layout/RuntimeType.swift b/Layout/RuntimeType.swift index 078d808..782549d 100644 --- a/Layout/RuntimeType.swift +++ b/Layout/RuntimeType.swift @@ -124,9 +124,15 @@ public class RuntimeType: NSObject { assertionFailure("Empty objCType") return nil } + print(OBJC_BOOL_IS_BOOL) self.availability = availability switch first { - case "c" where OBJC_BOOL_IS_BOOL == 0, "B": + case "B": + type = .any(Bool.self) + case "c": + if OBJC_BOOL_IS_BOOL == 1 { + fallthrough + } type = .any(Bool.self) case "c", "i", "s", "l", "q": type = .any(Int.self) diff --git a/README.md b/README.md index 270ecb9..95f7689 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,5 @@ [![Travis](https://img.shields.io/travis/schibsted/layout.svg)](https://travis-ci.org/schibsted/layout) +[![Coveralls](https://coveralls.io/repos/github/schibsted/layout/badge.svg)](https://coveralls.io/github/schibsted/layout) [![Platform](https://img.shields.io/cocoapods/p/Layout.svg?style=flat)](http://cocoadocs.org/docsets/Layout) [![Swift](https://img.shields.io/badge/swift-3.1-yellow.svg?style=flat)](https://developer.apple.com/swift) [![Swift](https://img.shields.io/badge/swift-3.2-orange.svg?style=flat)](https://developer.apple.com/swift)