Skip to content
This repository has been archived by the owner on Jun 11, 2018. It is now read-only.

Updates for Xcode 9 #29

Merged
merged 11 commits into from
Sep 14, 2017
8 changes: 3 additions & 5 deletions .ci/buildkite/pipeline.template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,19 @@ steps:
name: "Lint"
command: .ci/scripts/lint
agents:
iOS-Simulator: false
xcode: "$BUILDKITE_AGENT_META_DATA_XCODE"

-
name: "Mac"
command: .ci/scripts/test-osx
agents:
iOS-Simulator: false
xcode: "$BUILDKITE_AGENT_META_DATA_XCODE"
-
name: "iOS"
command: .ci/scripts/test-ios
agents:
iOS-Simulator: true
queue: "iOS-Simulator"
xcode: "$BUILDKITE_AGENT_META_DATA_XCODE"
env:
FL_SLATHER_BUILDKITE_ENABLED: true
FL_SLATHER_COVERALLS_ENABLED: true
FL_SLATHER_COVERALLS_ENABLED: true
14 changes: 7 additions & 7 deletions .fastlane/Fastfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
lane :lint do

swiftLint(
mode: :lint,
mode: :lint,
config_file: '.swiftlint.yml'
)
end
Expand All @@ -11,26 +11,26 @@ platform :ios do

desc "Runs all the tests"
lane :test do

scan(
project: "ValueCoding.xcodeproj",
scheme: "ValueCoding",
destination: "platform=iOS Simulator,OS=10.0,name=iPhone 5s",
scheme: "ValueCoding",
destination: "platform=iOS Simulator,OS=11.0,name=iPhone SE",
code_coverage: true
)

end
end

platform :mac do

desc "Runs all the tests"
lane :test do

scan(
project: "ValueCoding.xcodeproj",
scheme: "ValueCoding",
device: "My Mac"
scheme: "ValueCoding",
device: "My Mac"
)

end
Expand Down
9 changes: 5 additions & 4 deletions Sources/ValueCoding.swift
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
//
// ValueCoding.swift
// ValueCoding
// ValueCoding
// File created on 11/10/2015.
//
// Created by Daniel Thorpe on 11/10/2015.
// Copyright (c) 2015-2017 Daniel Thorpe
//
// ValueCoding is licensed under the MIT License. Read the full license at
// https://github.com/danthorpe/ValueCoding/blob/master/LICENSE
//

import Foundation
Expand All @@ -23,7 +25,6 @@ public protocol CodedValue {
var value: Value { get }
}


/**
A generic protocol for classes which can
encode/decode value types.
Expand Down
2 changes: 1 addition & 1 deletion Supporting Files/ValueCoding.xcconfig
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ APPLICATION_EXTENSION_API_ONLY_xctest = NO
APPLICATION_EXTENSION_API_ONLY = $(APPLICATION_EXTENSION_API_ONLY_$(WRAPPER_EXTENSION))

// Build Settings
SWIFT_VERSION = 3.0
SWIFT_VERSION = 3.2
SUPPORTED_PLATFORMS = macosx iphoneos appletvos watchos appletvsimulator iphonesimulator watchsimulator
CLANG_ENABLE_CODE_COVERAGE = YES

Expand Down
20 changes: 11 additions & 9 deletions Tests/Support.swift
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
//
// Support.swift
// ValueCoding
// ValueCoding
// File created on 11/10/2015.
//
// Created by Daniel Thorpe on 11/10/2015.
// Copyright (c) 2015-2017 Daniel Thorpe
//
// ValueCoding is licensed under the MIT License. Read the full license at
// https://github.com/danthorpe/ValueCoding/blob/master/LICENSE
//

import Foundation
Expand All @@ -17,7 +19,7 @@ struct Foo: ValueCoding {
class FooCoder: NSObject, NSCoding, CodingProtocol {

enum Keys: String {
case Bar = "bar"
case bar
}

let value: Foo
Expand All @@ -27,12 +29,12 @@ class FooCoder: NSObject, NSCoding, CodingProtocol {
}

required init?(coder aDecoder: NSCoder) {
let bar = aDecoder.decodeObject(forKey: Keys.Bar.rawValue) as? String
let bar = aDecoder.decodeObject(forKey: Keys.bar.rawValue) as? String
value = Foo(bar: bar!)
}

func encode(with aCoder: NSCoder) {
aCoder.encode(value.bar, forKey: Keys.Bar.rawValue)
aCoder.encode(value.bar, forKey: Keys.bar.rawValue)
}
}

Expand All @@ -56,7 +58,7 @@ func == (lhs: Baz, rhs: Baz) -> Bool {
class BazCoder: NSObject, NSCoding, CodingProtocol {

enum Keys: String {
case Bat = "bat"
case baz
}

let value: Baz
Expand All @@ -66,11 +68,11 @@ class BazCoder: NSObject, NSCoding, CodingProtocol {
}

required init?(coder aDecoder: NSCoder) {
let bat = aDecoder.decodeObject(forKey: Keys.Bat.rawValue) as? String
let bat = aDecoder.decodeObject(forKey: Keys.baz.rawValue) as? String
value = Baz(bat: bat!)
}

func encode(with aCoder: NSCoder) {
aCoder.encode(value.bat, forKey: Keys.Bat.rawValue)
aCoder.encode(value.bat, forKey: Keys.baz.rawValue)
}
}
11 changes: 6 additions & 5 deletions Tests/ValueCodingTests.swift
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
//
// ValueCodingTests.swift
// ValueCoding
// ValueCoding
// File created on 11/10/2015.
//
// Created by Daniel Thorpe on 11/10/2015.
// Copyright (c) 2015-2017 Daniel Thorpe
//
// ValueCoding is licensed under the MIT License. Read the full license at
// https://github.com/danthorpe/ValueCoding/blob/master/LICENSE
//

import Foundation
import XCTest
@testable import ValueCoding


class ValueCodingTests: XCTestCase {

var item: Foo!
Expand All @@ -36,7 +37,7 @@ class ValueCodingTests: XCTestCase {
Foo(bar: "Bonjour le monde"),
Foo(bar: "Hallo Welt"),
Foo(bar: "हैलो वर्ल्ड"),
Foo(bar: "こんにちは世界"),
Foo(bar: "こんにちは世界")
]
nested = [
items
Expand Down
16 changes: 16 additions & 0 deletions ValueCoding.xcodeproj/xcshareddata/IDETemplateMacros.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>FILEHEADER</key>
<string>
// ___PROJECTNAME___
// File created on ___DATE___.
//
// Copyright (c) 2015-___YEAR___ Daniel Thorpe
//
// ValueCoding is licensed under the MIT License. Read the full license at
// https://github.com/danthorpe/ValueCoding/blob/master/LICENSE
//</string>
</dict>
</plist>