From 47b2130d15a57656c8e192b7b8948f65aaf5e613 Mon Sep 17 00:00:00 2001 From: James Date: Mon, 19 Nov 2018 18:05:16 -0500 Subject: [PATCH 1/5] Use swift-tools-version:4.2 --- Package.resolved | 13 +++++++++++-- Package.swift | 2 +- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/Package.resolved b/Package.resolved index 22a2e19..db2c454 100644 --- a/Package.resolved +++ b/Package.resolved @@ -6,16 +6,25 @@ "repositoryURL": "https://github.com/dn-m/Math", "state": { "branch": "master", - "revision": "d1284e043377c0b924cba2ffa2ab0b9aa9dd246f", + "revision": "075ebb5a934251ed7acbe4feace925ed7e322d0f", "version": null } }, + { + "package": "PerformanceTesting", + "repositoryURL": "https://github.com/dn-m/PerformanceTesting", + "state": { + "branch": null, + "revision": "d48417c837b1a029dd9567dfa7b5ee3cfa9a0ec7", + "version": "0.3.0" + } + }, { "package": "Structure", "repositoryURL": "https://github.com/dn-m/Structure", "state": { "branch": "master", - "revision": "81d894ed931864734c73f9507e5d2f147b40a363", + "revision": "11e920b1b883fe169c5ebb58e6489c0f28e9ad90", "version": null } } diff --git a/Package.swift b/Package.swift index 4aac7b4..7dcafc2 100644 --- a/Package.swift +++ b/Package.swift @@ -1,4 +1,4 @@ -// swift-tools-version:4.0 +// swift-tools-version:4.2 // The swift-tools-version declares the minimum version of Swift required to build this package. import PackageDescription From 3d751ccbdb3bd372c80456771f49db0dc47fdcaf Mon Sep 17 00:00:00 2001 From: James Date: Mon, 19 Nov 2018 18:13:27 -0500 Subject: [PATCH 2/5] Update code --- Sources/Timeline/Action.swift | 4 ++-- Sources/Timeline/Schedule.swift | 1 - Sources/Timeline/SubSchedule.swift | 4 ++-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/Sources/Timeline/Action.swift b/Sources/Timeline/Action.swift index c3f8ff5..faffbda 100644 --- a/Sources/Timeline/Action.swift +++ b/Sources/Timeline/Action.swift @@ -5,7 +5,6 @@ // Created by James Bean on 8/3/17. // -import Structure import DataStructures import Time @@ -51,6 +50,7 @@ public class Action { } func hasAnyIdentifiers (_ identifiers: S) -> Bool where S: Sequence, S.Element == String { - return identifiers.any(satisfy: hasIdentifier) + for target in identifiers where self.identifiers.contains(target) { return true } + return false } } diff --git a/Sources/Timeline/Schedule.swift b/Sources/Timeline/Schedule.swift index 2c7387f..2025125 100644 --- a/Sources/Timeline/Schedule.swift +++ b/Sources/Timeline/Schedule.swift @@ -7,7 +7,6 @@ // import Foundation -import StructureWrapping import DataStructures import Time diff --git a/Sources/Timeline/SubSchedule.swift b/Sources/Timeline/SubSchedule.swift index 19d160f..c0428fa 100644 --- a/Sources/Timeline/SubSchedule.swift +++ b/Sources/Timeline/SubSchedule.swift @@ -30,7 +30,7 @@ internal class SubSchedule { private func bump(_ actions: [Action], from offset: Seconds) { (actions as! [Action.Looping]) .map { action in (offset + action.interval, action) } - .forEach { offset, action in base.safelyAppend(action, toArrayWith: offset) } + .forEach { insert($1, at: $0) } base[offset] = nil } } @@ -60,7 +60,7 @@ internal class SubSchedule { /// Add the given `action` at the given `offset`. internal func insert(_ action: Action, at offset: Seconds) { - base.safelyAppend(action, toArrayWith: offset) + base.safelyAppend(action, forKey: offset) } /// Insert the contents of the given `schedule` into this one. From d90901be572686f0adbeb2e0d4080a755d914448 Mon Sep 17 00:00:00 2001 From: James Date: Mon, 19 Nov 2018 18:15:01 -0500 Subject: [PATCH 3/5] Streamline logic in hasAnyIdentifiers --- Sources/Timeline/Action.swift | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Sources/Timeline/Action.swift b/Sources/Timeline/Action.swift index faffbda..8ce77eb 100644 --- a/Sources/Timeline/Action.swift +++ b/Sources/Timeline/Action.swift @@ -50,7 +50,6 @@ public class Action { } func hasAnyIdentifiers (_ identifiers: S) -> Bool where S: Sequence, S.Element == String { - for target in identifiers where self.identifiers.contains(target) { return true } - return false + return self.identifiers.contains(where: identifiers.contains) } } From 6a141bbceb4b790011215028a33876df3f9c243e Mon Sep 17 00:00:00 2001 From: James Date: Mon, 19 Nov 2018 18:16:03 -0500 Subject: [PATCH 4/5] Update Travis CI configuration --- .travis.yml | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index afea3a0..2935295 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,9 +1,19 @@ os: - osx + - linux language: generic sudo: required dist: trusty -osx_image: xcode9 +osx_image: xcode10 +install: + - eval "$(curl -sL https://swiftenv.fuller.li/install.sh)" +env: + - SWIFT_VERSION=4.2 script: - - swift build - - swift test + - swift package update + - swift test -c release +after_success: + - git clone https://github.com/dn-m/Documentarian && cd Documentarian + - swift build -c release -Xswiftc -static-stdlib + - cd ../ + - Documentarian/.build/Release/Documentarian From b1395f6889163fa897408249b7bc0ec5e434bfc2 Mon Sep 17 00:00:00 2001 From: James Date: Mon, 19 Nov 2018 18:22:02 -0500 Subject: [PATCH 5/5] Don't ask Travis to test in release configuration --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 2935295..d312762 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,7 +11,7 @@ env: - SWIFT_VERSION=4.2 script: - swift package update - - swift test -c release + - swift test after_success: - git clone https://github.com/dn-m/Documentarian && cd Documentarian - swift build -c release -Xswiftc -static-stdlib