Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build for latest iOS/watchOS #642

Closed
wants to merge 16 commits into from
Closed
31 changes: 21 additions & 10 deletions .github/workflows/swift.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,32 @@ on:
pull_request:
branches: [ main ]


jobs:

test:

runs-on: macos-11

runs-on: macos-12
strategy:
matrix:
destination: ['platform=iOS\ Simulator,OS=15.0,name=iPhone\ 11\ Pro\ Max']
scheme: ['CareKit\ iOS', 'CareKitStore\ iOS', 'CareKitUI\ iOS', 'CareKitFHIR']

destination: ['platform=iOS\ Simulator,OS=16.0,name=iPhone\ 11\ Pro\ Max test', 'platform=watchOS\ Simulator,OS=9.0,name=Apple\ Watch\ Series\ 5\ \(40mm\)']
scheme: ['CareKit\ iOS', 'CareKitStore\ iOS', 'CareKitUI\ iOS', 'CareKitFHIR', 'CareKit\ Watch', 'CareKitStore\ Watch', 'CareKitUI\ Watch']
exclude:
- destination: 'platform=iOS\ Simulator,OS=16.0,name=iPhone\ 11\ Pro\ Max test'
scheme: 'CareKit\ Watch'
- destination: 'platform=iOS\ Simulator,OS=16.0,name=iPhone\ 11\ Pro\ Max test'
scheme: 'CareKitStore\ Watch'
- destination: 'platform=iOS\ Simulator,OS=16.0,name=iPhone\ 11\ Pro\ Max test'
scheme: 'CareKitUI\ Watch'
- destination: 'platform=watchOS\ Simulator,OS=9.0,name=Apple\ Watch\ Series\ 5\ \(40mm\)'
scheme: 'CareKit\ iOS'
- destination: 'platform=watchOS\ Simulator,OS=9.0,name=Apple\ Watch\ Series\ 5\ \(40mm\)'
scheme: 'CareKitStore\ iOS'
- destination: 'platform=watchOS\ Simulator,OS=9.0,name=Apple\ Watch\ Series\ 5\ \(40mm\)'
scheme: 'CareKitUI\ iOS'
- destination: 'platform=watchOS\ Simulator,OS=9.0,name=Apple\ Watch\ Series\ 5\ \(40mm\)'
scheme: 'CareKitFHIR'
steps:
- uses: actions/checkout@v2
- name: Set Xcode Version
run: sudo xcode-select -s /Applications/Xcode_13.0.app
run: sudo xcode-select -s /Applications/Xcode_14.0.1.app
- name: Build
run: set -o pipefail && env NSUnbufferedIO=YES xcodebuild -verbose -workspace CKWorkspace.xcworkspace -scheme ${{ matrix.scheme }} -destination ${{ matrix.destination }} build test | xcpretty
run: set -o pipefail && env NSUnbufferedIO=YES xcodebuild -verbose -workspace CKWorkspace.xcworkspace -scheme ${{ matrix.scheme }} -destination ${{ matrix.destination }} | xcpretty

8 changes: 8 additions & 0 deletions .spi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
version: 1
builder:
configs:
- platform: ios
scheme: "CareKit iOS"
- platform: watchos
scheme: "CareKit Watch"

14 changes: 9 additions & 5 deletions CareKit/CareKit.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,8 @@
64EABE022321B1AF00CFBB9F /* OCKSynchronizedStoreManager+Publishers.swift in Sources */ = {isa = PBXBuildFile; fileRef = 64EABDBF2321B1AF00CFBB9F /* OCKSynchronizedStoreManager+Publishers.swift */; };
64EABE0B2321B1AF00CFBB9F /* OCKContactUtility.swift in Sources */ = {isa = PBXBuildFile; fileRef = 64EABDCB2321B1AF00CFBB9F /* OCKContactUtility.swift */; };
64EABE202321B1AF00CFBB9F /* locversion.plist in Resources */ = {isa = PBXBuildFile; fileRef = 64EABDE72321B1AF00CFBB9F /* locversion.plist */; };
7079CFAE27C3DEA200BFAEB5 /* OCKCalendarController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 514FDE382356362B0044E3B8 /* OCKCalendarController.swift */; };
7079CFAF27C3DEB600BFAEB5 /* OCKWeekCalendarController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 51127315235E5728007B18DF /* OCKWeekCalendarController.swift */; };
70F79B5526434F4A00731C46 /* UIImage+Asset.swift in Sources */ = {isa = PBXBuildFile; fileRef = 70F79B5426434F4A00731C46 /* UIImage+Asset.swift */; };
70F79B5626434F4A00731C46 /* UIImage+Asset.swift in Sources */ = {isa = PBXBuildFile; fileRef = 70F79B5426434F4A00731C46 /* UIImage+Asset.swift */; };
/* End PBXBuildFile section */
Expand Down Expand Up @@ -1033,6 +1035,7 @@
51178E0323AA95270068BAB1 /* OCKChecklistTaskController.swift in Sources */,
70F79B5626434F4A00731C46 /* UIImage+Asset.swift in Sources */,
51355EEA2499852D009DE0A4 /* OCKTaskEvents+Extension.swift in Sources */,
7079CFAE27C3DEA200BFAEB5 /* OCKCalendarController.swift in Sources */,
51178E0123AA95270068BAB1 /* OCKTaskController.swift in Sources */,
51178E1023AAAA2A0068BAB1 /* OCKSynchronizedStoreManager+Publishers.swift in Sources */,
515C0A1723BF9D46009A9774 /* OCKTaskControllerProtocol+Extension.swift in Sources */,
Expand All @@ -1041,6 +1044,7 @@
51178E0423AA95270068BAB1 /* OCKSimpleTaskController.swift in Sources */,
51E76F2224004FA1008B09E7 /* OCKScheduleUtility.swift in Sources */,
51178E0023AA95270068BAB1 /* OCKTaskEvents.swift in Sources */,
7079CFAF27C3DEB600BFAEB5 /* OCKWeekCalendarController.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -1245,7 +1249,7 @@
SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = 4;
WATCHOS_DEPLOYMENT_TARGET = 6.1;
WATCHOS_DEPLOYMENT_TARGET = 6.0;
};
name = Debug;
};
Expand Down Expand Up @@ -1276,7 +1280,7 @@
SWIFT_OPTIMIZATION_LEVEL = "-O";
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = 4;
WATCHOS_DEPLOYMENT_TARGET = 6.1;
WATCHOS_DEPLOYMENT_TARGET = 6.0;
};
name = Release;
};
Expand Down Expand Up @@ -1356,7 +1360,7 @@
TARGETED_DEVICE_FAMILY = "1,2";
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
WATCHOS_DEPLOYMENT_TARGET = 2.1;
WATCHOS_DEPLOYMENT_TARGET = 6.0;
};
name = Debug;
};
Expand Down Expand Up @@ -1436,7 +1440,7 @@
8605A5CF1C4F04EC00DD65FF /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
BUILD_LIBRARY_FOR_DISTRIBUTION = YES;
BUILD_LIBRARY_FOR_DISTRIBUTION = NO;
CODE_SIGN_IDENTITY = "";
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
CODE_SIGN_STYLE = Automatic;
Expand Down Expand Up @@ -1467,7 +1471,7 @@
8605A5D01C4F04EC00DD65FF /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
BUILD_LIBRARY_FOR_DISTRIBUTION = YES;
BUILD_LIBRARY_FOR_DISTRIBUTION = NO;
CODE_SIGN_IDENTITY = "";
"CODE_SIGN_IDENTITY[sdk=macosx*]" = "Apple Development";
CODE_SIGN_STYLE = Automatic;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,12 @@
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#if canImport(UIKit) && !os(watchOS)

import CareKitStore
import CareKitUI
import Combine
import CoreGraphics
import Foundation
import UIKit

/// A basic controller capable of updating a calendar.
open class OCKCalendarController: ObservableObject {
Expand Down Expand Up @@ -147,4 +146,3 @@ private extension DateInterval {
return dates
}
}
#endif
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#if !os(watchOS)

import Combine
import Foundation
Expand Down Expand Up @@ -56,5 +55,3 @@ open class OCKWeekCalendarController: OCKCalendarController {
return weekInterval.start == dateInterval.start && weekInterval.end == dateInterval.end
}
}

#endif
8 changes: 4 additions & 4 deletions CareKitFHIR/CareKitFHIR.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
031B45692474A1100063E717 /* OCKFHIRContentType.swift in Sources */ = {isa = PBXBuildFile; fileRef = 031B45682474A1100063E717 /* OCKFHIRContentType.swift */; };
031B456B2474A1380063E717 /* OCKFHIRResource.swift in Sources */ = {isa = PBXBuildFile; fileRef = 031B456A2474A1380063E717 /* OCKFHIRResource.swift */; };
031D4B662374E1D900199EFC /* FHIRModels+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 031D4B652374E1D900199EFC /* FHIRModels+Extensions.swift */; };
033FF82024B51A2600070941 /* ModelsR4 in Frameworks */ = {isa = PBXBuildFile; productRef = 033FF81F24B51A2600070941 /* ModelsR4 */; };
033FF82224B51A2600070941 /* ModelsDSTU2 in Frameworks */ = {isa = PBXBuildFile; productRef = 033FF82124B51A2600070941 /* ModelsDSTU2 */; };
0364BB6423C421E30047F952 /* CareKitStore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0364BB6323C421E30047F952 /* CareKitStore.framework */; };
0396EF40233D187800C28FC0 /* CareKitFHIR.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0396EF36233D187800C28FC0 /* CareKitFHIR.framework */; };
03AFA92B233E697C0091DD45 /* OCKFHIRCodingError.swift in Sources */ = {isa = PBXBuildFile; fileRef = 03AFA92A233E697C0091DD45 /* OCKFHIRCodingError.swift */; };
Expand Down Expand Up @@ -483,7 +481,7 @@
0396EF4B233D187800C28FC0 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
BUILD_LIBRARY_FOR_DISTRIBUTION = YES;
BUILD_LIBRARY_FOR_DISTRIBUTION = NO;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_STYLE = Automatic;
DEFINES_MODULE = YES;
Expand All @@ -494,6 +492,7 @@
GCC_TREAT_WARNINGS_AS_ERRORS = NO;
INFOPLIST_FILE = CareKitFHIR/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand All @@ -512,7 +511,7 @@
0396EF4C233D187800C28FC0 /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
BUILD_LIBRARY_FOR_DISTRIBUTION = YES;
BUILD_LIBRARY_FOR_DISTRIBUTION = NO;
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_STYLE = Automatic;
DEFINES_MODULE = YES;
Expand All @@ -523,6 +522,7 @@
GCC_TREAT_WARNINGS_AS_ERRORS = NO;
INFOPLIST_FILE = CareKitFHIR/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/Frameworks",
Expand Down
4 changes: 2 additions & 2 deletions CareKitStore/CareKitStore.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1213,7 +1213,7 @@
SKIP_INSTALL = YES;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = 4;
WATCHOS_DEPLOYMENT_TARGET = 6.1;
WATCHOS_DEPLOYMENT_TARGET = 6.0;
};
name = Debug;
};
Expand All @@ -1240,7 +1240,7 @@
SKIP_INSTALL = YES;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = 4;
WATCHOS_DEPLOYMENT_TARGET = 6.1;
WATCHOS_DEPLOYMENT_TARGET = 6.0;
};
name = Release;
};
Expand Down
8 changes: 4 additions & 4 deletions CareKitStore/CareKitStore/CoreData/OCKStore+CarePlans.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import Foundation

extension OCKStore {

open func fetchCarePlans(query: OCKCarePlanQuery = OCKCarePlanQuery(),
public func fetchCarePlans(query: OCKCarePlanQuery = OCKCarePlanQuery(),
callbackQueue: DispatchQueue = .main, completion: @escaping (Result<[OCKCarePlan], OCKStoreError>) -> Void) {
fetchValues(
predicate: buildPredicate(for: query),
Expand All @@ -47,7 +47,7 @@ extension OCKStore {
}
}

open func addCarePlans(_ plans: [OCKCarePlan], callbackQueue: DispatchQueue = .main,
public func addCarePlans(_ plans: [OCKCarePlan], callbackQueue: DispatchQueue = .main,
completion: ((Result<[OCKCarePlan], OCKStoreError>) -> Void)? = nil) {
transaction(inserts: plans, updates: [], deletes: []) { result in
callbackQueue.async {
Expand All @@ -56,7 +56,7 @@ extension OCKStore {
}
}

open func updateCarePlans(_ plans: [OCKCarePlan], callbackQueue: DispatchQueue = .main,
public func updateCarePlans(_ plans: [OCKCarePlan], callbackQueue: DispatchQueue = .main,
completion: ((Result<[OCKCarePlan], OCKStoreError>) -> Void)? = nil) {
transaction(inserts: [], updates: plans, deletes: []) { result in
callbackQueue.async {
Expand All @@ -65,7 +65,7 @@ extension OCKStore {
}
}

open func deleteCarePlans(_ plans: [OCKCarePlan], callbackQueue: DispatchQueue = .main,
public func deleteCarePlans(_ plans: [OCKCarePlan], callbackQueue: DispatchQueue = .main,
completion: ((Result<[OCKCarePlan], OCKStoreError>) -> Void)? = nil) {
transaction(inserts: [], updates: [], deletes: plans) { result in
callbackQueue.async {
Expand Down
8 changes: 4 additions & 4 deletions CareKitStore/CareKitStore/CoreData/OCKStore+Contacts.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import CoreData

extension OCKStore {

open func fetchContacts(query: OCKContactQuery = OCKContactQuery(), callbackQueue: DispatchQueue = .main,
public func fetchContacts(query: OCKContactQuery = OCKContactQuery(), callbackQueue: DispatchQueue = .main,
completion: @escaping (Result<[OCKContact], OCKStoreError>) -> Void) {
fetchValues(
predicate: buildPredicate(for: query),
Expand All @@ -46,7 +46,7 @@ extension OCKStore {
}
}

open func addContacts(_ contacts: [OCKContact], callbackQueue: DispatchQueue = .main,
public func addContacts(_ contacts: [OCKContact], callbackQueue: DispatchQueue = .main,
completion: ((Result<[OCKContact], OCKStoreError>) -> Void)? = nil) {
transaction(inserts: contacts, updates: [], deletes: []) { result in
callbackQueue.async {
Expand All @@ -55,7 +55,7 @@ extension OCKStore {
}
}

open func updateContacts(_ contacts: [OCKContact], callbackQueue: DispatchQueue = .main,
public func updateContacts(_ contacts: [OCKContact], callbackQueue: DispatchQueue = .main,
completion: OCKResultClosure<[OCKContact]>? = nil) {
transaction(inserts: [], updates: contacts, deletes: []) { result in
callbackQueue.async {
Expand All @@ -64,7 +64,7 @@ extension OCKStore {
}
}

open func deleteContacts(_ contacts: [OCKContact], callbackQueue: DispatchQueue = .main,
public func deleteContacts(_ contacts: [OCKContact], callbackQueue: DispatchQueue = .main,
completion: ((Result<[OCKContact], OCKStoreError>) -> Void)? = nil) {
transaction(inserts: [], updates: [], deletes: contacts) { result in
callbackQueue.async {
Expand Down
8 changes: 4 additions & 4 deletions CareKitStore/CareKitStore/CoreData/OCKStore+Outcomes.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import Foundation

extension OCKStore {

open func fetchOutcomes(query: OCKOutcomeQuery = OCKOutcomeQuery(), callbackQueue: DispatchQueue = .main,
public func fetchOutcomes(query: OCKOutcomeQuery = OCKOutcomeQuery(), callbackQueue: DispatchQueue = .main,
completion: @escaping (Result<[OCKOutcome], OCKStoreError>) -> Void) {
context.perform {
do {
Expand All @@ -54,7 +54,7 @@ extension OCKStore {
}
}

open func addOutcomes(_ outcomes: [OCKOutcome], callbackQueue: DispatchQueue = .main,
public func addOutcomes(_ outcomes: [OCKOutcome], callbackQueue: DispatchQueue = .main,
completion: ((Result<[OCKOutcome], OCKStoreError>) -> Void)? = nil) {
transaction(
inserts: outcomes, updates: [], deletes: [],
Expand All @@ -66,7 +66,7 @@ extension OCKStore {
}
}

open func updateOutcomes(_ outcomes: [OCKOutcome], callbackQueue: DispatchQueue = .main,
public func updateOutcomes(_ outcomes: [OCKOutcome], callbackQueue: DispatchQueue = .main,
completion: ((Result<[OCKOutcome], OCKStoreError>) -> Void)? = nil) {
transaction(inserts: [], updates: outcomes, deletes: []) { result in
callbackQueue.async {
Expand All @@ -75,7 +75,7 @@ extension OCKStore {
}
}

open func deleteOutcomes(_ outcomes: [OCKOutcome], callbackQueue: DispatchQueue = .main,
public func deleteOutcomes(_ outcomes: [OCKOutcome], callbackQueue: DispatchQueue = .main,
completion: ((Result<[OCKOutcome], OCKStoreError>) -> Void)? = nil) {
transaction(inserts: [], updates: [], deletes: outcomes) { result in
callbackQueue.async {
Expand Down
8 changes: 4 additions & 4 deletions CareKitStore/CareKitStore/CoreData/OCKStore+Patients.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import Foundation

extension OCKStore {

open func fetchPatients(query: OCKPatientQuery = OCKPatientQuery(), callbackQueue: DispatchQueue = .main,
public func fetchPatients(query: OCKPatientQuery = OCKPatientQuery(), callbackQueue: DispatchQueue = .main,
completion: @escaping (Result<[OCKPatient], OCKStoreError>) -> Void) {
fetchValues(
predicate: query.basicPredicate(enforceDateInterval: true),
Expand All @@ -46,7 +46,7 @@ extension OCKStore {
}
}

open func addPatients(_ patients: [OCKPatient], callbackQueue: DispatchQueue = .main,
public func addPatients(_ patients: [OCKPatient], callbackQueue: DispatchQueue = .main,
completion: ((Result<[OCKPatient], OCKStoreError>) -> Void)? = nil) {
transaction(
inserts: patients, updates: [], deletes: [],
Expand All @@ -58,7 +58,7 @@ extension OCKStore {
}
}

open func updatePatients(_ patients: [OCKPatient], callbackQueue: DispatchQueue = .main,
public func updatePatients(_ patients: [OCKPatient], callbackQueue: DispatchQueue = .main,
completion: ((Result<[OCKPatient], OCKStoreError>) -> Void)? = nil) {
transaction(inserts: [], updates: patients, deletes: []) { result in
callbackQueue.async {
Expand All @@ -67,7 +67,7 @@ extension OCKStore {
}
}

open func deletePatients(_ patients: [OCKPatient], callbackQueue: DispatchQueue = .main,
public func deletePatients(_ patients: [OCKPatient], callbackQueue: DispatchQueue = .main,
completion: ((Result<[OCKPatient], OCKStoreError>) -> Void)? = nil) {
transaction(inserts: [], updates: [], deletes: patients) { result in
callbackQueue.async {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,6 @@ public extension OCKAnyCarePlanStore {

// MARK: Async methods for OCKAnyReadOnlyCarePlanStore

@available(iOS 15.0, watchOS 8.0, *)
public extension OCKAnyReadOnlyCarePlanStore {

/// `fetchAnyCarePlans` asynchronously retrieves an array of care plans from the store.
Expand Down Expand Up @@ -176,7 +175,6 @@ public extension OCKAnyReadOnlyCarePlanStore {

// MARK: Async methods for OCKAnyCarePlanStore

@available(iOS 15.0, watchOS 8.0, *)
public extension OCKAnyCarePlanStore {

/// `addAnyCarePlans` asynchronously adds an array of care plans to the store.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,6 @@ public extension OCKCarePlanStore {

// MARK: Async methods for OCKReadableCarePlanStore

@available(iOS 15.0, watchOS 8.0, *)
public extension OCKReadableCarePlanStore {

/// `fetchCarePlans` asynchronously retrieves an array of care plans from the store.
Expand Down Expand Up @@ -212,7 +211,6 @@ public extension OCKReadableCarePlanStore {

// MARK: Async methods for OCKCarePlanStore

@available(iOS 15.0, watchOS 8.0, *)
public extension OCKCarePlanStore {

/// `addCarePlans` asynchronously adds an array of care plans to the store.
Expand Down
Loading