Skip to content

Commit 786e5f0

Browse files
authored
Merge pull request #15 from LoopKit/merge-from-tidepool
Merge from tidepool
2 parents 68ea5d0 + babe5e7 commit 786e5f0

File tree

10 files changed

+309
-11
lines changed

10 files changed

+309
-11
lines changed

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
language: objective-c
2-
osx_image: xcode11
2+
osx_image: xcode11.6
33

44
before_script:
55
- carthage bootstrap

Cartfile.resolved

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
github "LoopKit/LoopKit" "8bc6e4b4ed4d8a7e98d8dcf539238b98c83ed3d1"
1+
github "LoopKit/LoopKit" "7ed70cb9bffc340d36234c4a1d93fc64d5362f67"
2+
github "i-schuetz/SwiftCharts" "0.6.5"

ShareClient.xcodeproj/project.pbxproj

Lines changed: 154 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@
4444
A9ED4D9E225EB4D30080DEBA /* ShareClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 432B0E8B1CDFC3C50045347B /* ShareClient.h */; settings = {ATTRIBUTES = (Public, ); }; };
4545
A9ED4DA0225EB4D30080DEBA /* Localizable.strings in Resources */ = {isa = PBXBuildFile; fileRef = 43AB5125213315D300B3D58D /* Localizable.strings */; };
4646
A9ED4DAF225EB93A0080DEBA /* HealthKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = A9ED4DAE225EB9390080DEBA /* HealthKit.framework */; };
47+
B40BF26623ABD4E700A43CEE /* ShareClientPlugin.swift in Sources */ = {isa = PBXBuildFile; fileRef = B40BF26523ABD4E700A43CEE /* ShareClientPlugin.swift */; };
48+
B40BF26823ABD55200A43CEE /* OSLog.swift in Sources */ = {isa = PBXBuildFile; fileRef = B40BF26723ABD55200A43CEE /* OSLog.swift */; };
49+
B40BF26923ABD55200A43CEE /* OSLog.swift in Sources */ = {isa = PBXBuildFile; fileRef = B40BF26723ABD55200A43CEE /* OSLog.swift */; };
4750
C17D3CC62184CC26003458C8 /* LoopKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 43A8EC7B210E661400A81379 /* LoopKit.framework */; };
4851
/* End PBXBuildFile section */
4952

@@ -62,6 +65,13 @@
6265
remoteGlobalIDString = 432B0E871CDFC3C50045347B;
6366
remoteInfo = ShareClient;
6467
};
68+
B40BF26A23ABD5E100A43CEE /* PBXContainerItemProxy */ = {
69+
isa = PBXContainerItemProxy;
70+
containerPortal = 432B0E7F1CDFC3C50045347B /* Project object */;
71+
proxyType = 1;
72+
remoteGlobalIDString = 43A8EC81210E664300A81379;
73+
remoteInfo = ShareClientUI;
74+
};
6575
/* End PBXContainerItemProxy section */
6676

6777
/* Begin PBXFileReference section */
@@ -126,6 +136,11 @@
126136
7D9BF1302336FFAF005DCFD6 /* da */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = da; path = da.lproj/Localizable.strings; sourceTree = "<group>"; };
127137
A9ED4DA4225EB4D30080DEBA /* ShareClient.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = ShareClient.framework; sourceTree = BUILT_PRODUCTS_DIR; };
128138
A9ED4DAE225EB9390080DEBA /* HealthKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = HealthKit.framework; path = Platforms/WatchOS.platform/Developer/SDKs/WatchOS.sdk/System/Library/Frameworks/HealthKit.framework; sourceTree = DEVELOPER_DIR; };
139+
B40BF25E23ABD47400A43CEE /* ShareClientPlugin.loopplugin */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = ShareClientPlugin.loopplugin; sourceTree = BUILT_PRODUCTS_DIR; };
140+
B40BF26023ABD47400A43CEE /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
141+
B40BF26423ABD4E600A43CEE /* ShareClientPlugin-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "ShareClientPlugin-Bridging-Header.h"; sourceTree = "<group>"; };
142+
B40BF26523ABD4E700A43CEE /* ShareClientPlugin.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ShareClientPlugin.swift; sourceTree = "<group>"; };
143+
B40BF26723ABD55200A43CEE /* OSLog.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OSLog.swift; sourceTree = "<group>"; };
129144
/* End PBXFileReference section */
130145

131146
/* Begin PBXFrameworksBuildPhase section */
@@ -167,6 +182,13 @@
167182
);
168183
runOnlyForDeploymentPostprocessing = 0;
169184
};
185+
B40BF25B23ABD47400A43CEE /* Frameworks */ = {
186+
isa = PBXFrameworksBuildPhase;
187+
buildActionMask = 2147483647;
188+
files = (
189+
);
190+
runOnlyForDeploymentPostprocessing = 0;
191+
};
170192
/* End PBXFrameworksBuildPhase section */
171193

172194
/* Begin PBXGroup section */
@@ -177,6 +199,7 @@
177199
432B0E8A1CDFC3C50045347B /* ShareClient */,
178200
432B0E961CDFC3C50045347B /* ShareClientTests */,
179201
43A8EC83210E664300A81379 /* ShareClientUI */,
202+
B40BF25F23ABD47400A43CEE /* ShareClientPlugin */,
180203
432B0E891CDFC3C50045347B /* Products */,
181204
43A8EC7A210E661300A81379 /* Frameworks */,
182205
);
@@ -189,6 +212,7 @@
189212
432B0E921CDFC3C50045347B /* ShareClientTests.xctest */,
190213
43A8EC82210E664300A81379 /* ShareClientUI.framework */,
191214
A9ED4DA4225EB4D30080DEBA /* ShareClient.framework */,
215+
B40BF25E23ABD47400A43CEE /* ShareClientPlugin.loopplugin */,
192216
);
193217
name = Products;
194218
sourceTree = "<group>";
@@ -205,6 +229,7 @@
205229
4325E9D0210E6A3D00969CE5 /* TimeInterval.swift */,
206230
432B0E8B1CDFC3C50045347B /* ShareClient.h */,
207231
432B0E8D1CDFC3C50045347B /* Info.plist */,
232+
B40BF26723ABD55200A43CEE /* OSLog.swift */,
208233
);
209234
path = ShareClient;
210235
sourceTree = "<group>";
@@ -253,6 +278,16 @@
253278
path = Common;
254279
sourceTree = "<group>";
255280
};
281+
B40BF25F23ABD47400A43CEE /* ShareClientPlugin */ = {
282+
isa = PBXGroup;
283+
children = (
284+
B40BF26023ABD47400A43CEE /* Info.plist */,
285+
B40BF26523ABD4E700A43CEE /* ShareClientPlugin.swift */,
286+
B40BF26423ABD4E600A43CEE /* ShareClientPlugin-Bridging-Header.h */,
287+
);
288+
path = ShareClientPlugin;
289+
sourceTree = "<group>";
290+
};
256291
/* End PBXGroup section */
257292

258293
/* Begin PBXHeadersBuildPhase section */
@@ -357,6 +392,24 @@
357392
productReference = A9ED4DA4225EB4D30080DEBA /* ShareClient.framework */;
358393
productType = "com.apple.product-type.framework";
359394
};
395+
B40BF25D23ABD47400A43CEE /* ShareClientPlugin */ = {
396+
isa = PBXNativeTarget;
397+
buildConfigurationList = B40BF26323ABD47400A43CEE /* Build configuration list for PBXNativeTarget "ShareClientPlugin" */;
398+
buildPhases = (
399+
B40BF25A23ABD47400A43CEE /* Sources */,
400+
B40BF25B23ABD47400A43CEE /* Frameworks */,
401+
B40BF25C23ABD47400A43CEE /* Resources */,
402+
);
403+
buildRules = (
404+
);
405+
dependencies = (
406+
B40BF26B23ABD5E100A43CEE /* PBXTargetDependency */,
407+
);
408+
name = ShareClientPlugin;
409+
productName = ShareClientPlugin;
410+
productReference = B40BF25E23ABD47400A43CEE /* ShareClientPlugin.loopplugin */;
411+
productType = "com.apple.product-type.bundle";
412+
};
360413
/* End PBXNativeTarget section */
361414

362415
/* Begin PBXProject section */
@@ -380,13 +433,19 @@
380433
LastSwiftMigration = 1020;
381434
ProvisioningStyle = Automatic;
382435
};
436+
B40BF25D23ABD47400A43CEE = {
437+
CreatedOnToolsVersion = 11.0;
438+
LastSwiftMigration = 1100;
439+
ProvisioningStyle = Automatic;
440+
};
383441
};
384442
};
385443
buildConfigurationList = 432B0E821CDFC3C50045347B /* Build configuration list for PBXProject "ShareClient" */;
386444
compatibilityVersion = "Xcode 3.2";
387445
developmentRegion = en;
388446
hasScannedForEncodings = 0;
389447
knownRegions = (
448+
English,
390449
en,
391450
Base,
392451
fr,
@@ -415,6 +474,7 @@
415474
A9ED4D91225EB4D30080DEBA /* ShareClient-watchOS */,
416475
432B0E911CDFC3C50045347B /* ShareClientTests */,
417476
43A8EC81210E664300A81379 /* ShareClientUI */,
477+
B40BF25D23ABD47400A43CEE /* ShareClientPlugin */,
418478
);
419479
};
420480
/* End PBXProject section */
@@ -451,6 +511,13 @@
451511
);
452512
runOnlyForDeploymentPostprocessing = 0;
453513
};
514+
B40BF25C23ABD47400A43CEE /* Resources */ = {
515+
isa = PBXResourcesBuildPhase;
516+
buildActionMask = 2147483647;
517+
files = (
518+
);
519+
runOnlyForDeploymentPostprocessing = 0;
520+
};
454521
/* End PBXResourcesBuildPhase section */
455522

456523
/* Begin PBXShellScriptBuildPhase section */
@@ -483,6 +550,7 @@
483550
files = (
484551
4325E9CF210E6A0A00969CE5 /* HKUnit.swift in Sources */,
485552
4325E9D1210E6A3D00969CE5 /* TimeInterval.swift in Sources */,
553+
B40BF26823ABD55200A43CEE /* OSLog.swift in Sources */,
486554
43A8EC9D210E68CE00A81379 /* ShareClientManager.swift in Sources */,
487555
43AB51362133177800B3D58D /* LocalizedString.swift in Sources */,
488556
43A8EC9B210E68BA00A81379 /* ShareGlucose+GlucoseKit.swift in Sources */,
@@ -527,6 +595,15 @@
527595
);
528596
runOnlyForDeploymentPostprocessing = 0;
529597
};
598+
B40BF25A23ABD47400A43CEE /* Sources */ = {
599+
isa = PBXSourcesBuildPhase;
600+
buildActionMask = 2147483647;
601+
files = (
602+
B40BF26923ABD55200A43CEE /* OSLog.swift in Sources */,
603+
B40BF26623ABD4E700A43CEE /* ShareClientPlugin.swift in Sources */,
604+
);
605+
runOnlyForDeploymentPostprocessing = 0;
606+
};
530607
/* End PBXSourcesBuildPhase section */
531608

532609
/* Begin PBXTargetDependency section */
@@ -540,6 +617,11 @@
540617
target = 432B0E871CDFC3C50045347B /* ShareClient */;
541618
targetProxy = A9E521F6225E949400EDDEF2 /* PBXContainerItemProxy */;
542619
};
620+
B40BF26B23ABD5E100A43CEE /* PBXTargetDependency */ = {
621+
isa = PBXTargetDependency;
622+
target = 43A8EC81210E664300A81379 /* ShareClientUI */;
623+
targetProxy = B40BF26A23ABD5E100A43CEE /* PBXContainerItemProxy */;
624+
};
543625
/* End PBXTargetDependency section */
544626

545627
/* Begin PBXVariantGroup section */
@@ -643,7 +725,7 @@
643725
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
644726
GCC_WARN_UNUSED_FUNCTION = YES;
645727
GCC_WARN_UNUSED_VARIABLE = YES;
646-
IPHONEOS_DEPLOYMENT_TARGET = 11.1;
728+
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
647729
LOCALIZED_STRING_MACRO_NAMES = (
648730
NSLocalizedString,
649731
CFLocalizedString,
@@ -704,7 +786,7 @@
704786
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
705787
GCC_WARN_UNUSED_FUNCTION = YES;
706788
GCC_WARN_UNUSED_VARIABLE = YES;
707-
IPHONEOS_DEPLOYMENT_TARGET = 11.1;
789+
IPHONEOS_DEPLOYMENT_TARGET = 13.0;
708790
LOCALIZED_STRING_MACRO_NAMES = (
709791
NSLocalizedString,
710792
CFLocalizedString,
@@ -886,6 +968,7 @@
886968
SKIP_INSTALL = YES;
887969
SUPPORTED_PLATFORMS = "watchos watchsimulator";
888970
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
971+
SWIFT_VERSION = 4.2;
889972
TARGETED_DEVICE_FAMILY = 4;
890973
};
891974
name = Debug;
@@ -917,6 +1000,66 @@
9171000
};
9181001
name = Release;
9191002
};
1003+
B40BF26123ABD47400A43CEE /* Debug */ = {
1004+
isa = XCBuildConfiguration;
1005+
buildSettings = {
1006+
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
1007+
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
1008+
CLANG_ENABLE_MODULES = YES;
1009+
CLANG_ENABLE_OBJC_WEAK = YES;
1010+
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
1011+
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
1012+
CODE_SIGN_STYLE = Automatic;
1013+
COMBINE_HIDPI_IMAGES = YES;
1014+
GCC_C_LANGUAGE_STANDARD = gnu11;
1015+
INFOPLIST_FILE = ShareClientPlugin/Info.plist;
1016+
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Bundles";
1017+
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
1018+
MACH_O_TYPE = mh_dylib;
1019+
MACOSX_DEPLOYMENT_TARGET = 10.15;
1020+
MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE;
1021+
MTL_FAST_MATH = YES;
1022+
PRODUCT_BUNDLE_IDENTIFIER = com.loopkit.ShareClientPlugin;
1023+
PRODUCT_NAME = "$(TARGET_NAME)";
1024+
SDKROOT = iphoneos;
1025+
SKIP_INSTALL = YES;
1026+
SWIFT_OBJC_BRIDGING_HEADER = "ShareClientPlugin/ShareClientPlugin-Bridging-Header.h";
1027+
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
1028+
SWIFT_VERSION = 5.0;
1029+
TARGETED_DEVICE_FAMILY = 1;
1030+
WRAPPER_EXTENSION = loopplugin;
1031+
};
1032+
name = Debug;
1033+
};
1034+
B40BF26223ABD47400A43CEE /* Release */ = {
1035+
isa = XCBuildConfiguration;
1036+
buildSettings = {
1037+
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
1038+
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14";
1039+
CLANG_ENABLE_MODULES = YES;
1040+
CLANG_ENABLE_OBJC_WEAK = YES;
1041+
CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
1042+
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;
1043+
CODE_SIGN_STYLE = Automatic;
1044+
COMBINE_HIDPI_IMAGES = YES;
1045+
GCC_C_LANGUAGE_STANDARD = gnu11;
1046+
INFOPLIST_FILE = ShareClientPlugin/Info.plist;
1047+
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Bundles";
1048+
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
1049+
MACH_O_TYPE = mh_dylib;
1050+
MACOSX_DEPLOYMENT_TARGET = 10.15;
1051+
MTL_FAST_MATH = YES;
1052+
PRODUCT_BUNDLE_IDENTIFIER = com.loopkit.ShareClientPlugin;
1053+
PRODUCT_NAME = "$(TARGET_NAME)";
1054+
SDKROOT = iphoneos;
1055+
SKIP_INSTALL = YES;
1056+
SWIFT_OBJC_BRIDGING_HEADER = "ShareClientPlugin/ShareClientPlugin-Bridging-Header.h";
1057+
SWIFT_VERSION = 5.0;
1058+
TARGETED_DEVICE_FAMILY = 1;
1059+
WRAPPER_EXTENSION = loopplugin;
1060+
};
1061+
name = Release;
1062+
};
9201063
/* End XCBuildConfiguration section */
9211064

9221065
/* Begin XCConfigurationList section */
@@ -965,6 +1108,15 @@
9651108
defaultConfigurationIsVisible = 0;
9661109
defaultConfigurationName = Release;
9671110
};
1111+
B40BF26323ABD47400A43CEE /* Build configuration list for PBXNativeTarget "ShareClientPlugin" */ = {
1112+
isa = XCConfigurationList;
1113+
buildConfigurations = (
1114+
B40BF26123ABD47400A43CEE /* Debug */,
1115+
B40BF26223ABD47400A43CEE /* Release */,
1116+
);
1117+
defaultConfigurationIsVisible = 0;
1118+
defaultConfigurationName = Release;
1119+
};
9681120
/* End XCConfigurationList section */
9691121
};
9701122
rootObject = 432B0E7F1CDFC3C50045347B /* Project object */;

ShareClient/OSLog.swift

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
//
2+
// OSLog.swift
3+
// ShareClient
4+
//
5+
// Created by Nathaniel Hamming on 2019-12-19.
6+
// Copyright © 2019 Mark Wilson. All rights reserved.
7+
//
8+
9+
import os.log
10+
11+
12+
extension OSLog {
13+
convenience init(category: String) {
14+
self.init(subsystem: "com.loopkit.ShareClient", category: category)
15+
}
16+
17+
func debug(_ message: StaticString, _ args: CVarArg...) {
18+
log(message, type: .debug, args)
19+
}
20+
21+
func info(_ message: StaticString, _ args: CVarArg...) {
22+
log(message, type: .info, args)
23+
}
24+
25+
func `default`(_ message: StaticString, _ args: CVarArg...) {
26+
log(message, type: .default, args)
27+
}
28+
29+
func error(_ message: StaticString, _ args: CVarArg...) {
30+
log(message, type: .error, args)
31+
}
32+
33+
private func log(_ message: StaticString, type: OSLogType, _ args: [CVarArg]) {
34+
switch args.count {
35+
case 0:
36+
os_log(message, log: self, type: type)
37+
case 1:
38+
os_log(message, log: self, type: type, args[0])
39+
case 2:
40+
os_log(message, log: self, type: type, args[0], args[1])
41+
case 3:
42+
os_log(message, log: self, type: type, args[0], args[1], args[2])
43+
case 4:
44+
os_log(message, log: self, type: type, args[0], args[1], args[2], args[3])
45+
case 5:
46+
os_log(message, log: self, type: type, args[0], args[1], args[2], args[3], args[4])
47+
default:
48+
os_log(message, log: self, type: type, args)
49+
}
50+
}
51+
}

0 commit comments

Comments
 (0)