Skip to content

Commit 984aced

Browse files
committed
添加watchOS支持 增加Demo-Watch
1 parent 87f8d54 commit 984aced

File tree

26 files changed

+1440
-20
lines changed

26 files changed

+1440
-20
lines changed

.github/workflows/build.yaml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -43,18 +43,18 @@ jobs:
4343
# - uses: actions/checkout@v2
4444
# - name: tvOS - ${{ matrix.destination }}
4545
# run: set -o pipefail && env NSUnbufferedIO=YES xcodebuild -project "AttributedString.xcodeproj" -scheme "AttributedString-tvOS" -destination "${{ matrix.destination }}" clean test | xcpretty
46-
# watchOS:
47-
# name: Build watchOS
48-
# runs-on: macOS-latest
49-
# env:
50-
# DEVELOPER_DIR: /Applications/Xcode_11.4.app/Contents/Developer
51-
# strategy:
52-
# matrix:
53-
# destination: ["OS=6.2,name=Apple Watch Series 5 - 44mm"] #, "OS=4.2,name=Apple Watch Series 3 - 42mm", "OS=3.2,name=Apple Watch Series 2 - 42mm"]
54-
# steps:
55-
# - uses: actions/checkout@v2
56-
# - name: watchOS - ${{ matrix.destination }}
57-
# run: set -o pipefail && env NSUnbufferedIO=YES xcodebuild -project "AttributedString.xcodeproj" -scheme "AttributedString-watchOS" -destination "${{ matrix.destination }}" clean build | xcpretty
46+
watchOS:
47+
name: Build watchOS
48+
runs-on: macOS-latest
49+
env:
50+
DEVELOPER_DIR: /Applications/Xcode_11.4.app/Contents/Developer
51+
strategy:
52+
matrix:
53+
destination: ["OS=6.2,name=Apple Watch Series 5 - 44mm"] #, "OS=4.2,name=Apple Watch Series 3 - 42mm", "OS=3.2,name=Apple Watch Series 2 - 42mm"]
54+
steps:
55+
- uses: actions/checkout@v2
56+
- name: watchOS - ${{ matrix.destination }}
57+
run: set -o pipefail && env NSUnbufferedIO=YES xcodebuild -project "AttributedString.xcodeproj" -scheme "AttributedString-watchOS" -destination "${{ matrix.destination }}" clean build | xcpretty
5858
# spm:
5959
# name: Test with SPM
6060
# runs-on: macOS-latest

AttributedString.xcodeproj/project.pbxproj

Lines changed: 161 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,20 @@
1313
9B267B1F24404124002F571E /* AttributedString.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9B6E894C23823C40009EBEBE /* AttributedString.framework */; };
1414
9B267B2E2440433F002F571E /* AttributedString.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9B34BD37243DBC8100932E6C /* AttributedString.framework */; };
1515
9B267B3524404391002F571E /* AttributedString_macOS_Tests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B267B2B2440433F002F571E /* AttributedString_macOS_Tests.swift */; };
16+
9B267B76244066B0002F571E /* AttributedString.h in Headers */ = {isa = PBXBuildFile; fileRef = 9B6E894F23823C40009EBEBE /* AttributedString.h */; settings = {ATTRIBUTES = (Public, ); }; };
17+
9B267B77244066C1002F571E /* CGSizeExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B6E89AE238275D2009EBEBE /* CGSizeExtension.swift */; };
18+
9B267B78244066C1002F571E /* CGRectExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B6E89B02382766F009EBEBE /* CGRectExtension.swift */; };
19+
9B267B79244066C1002F571E /* CGPointExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B6E89B2238276B0009EBEBE /* CGPointExtension.swift */; };
20+
9B267B7A244066C1002F571E /* Extension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B0A2A3723851EB6003D8A55 /* Extension.swift */; };
21+
9B267B7B244066C1002F571E /* AttributedString.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B6E899D23823FFD009EBEBE /* AttributedString.swift */; };
22+
9B267B7C244066C1002F571E /* Interpolation.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B6E89A123826D8E009EBEBE /* Interpolation.swift */; };
23+
9B267B7D244066C1002F571E /* Style.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B6E89E02382C301009EBEBE /* Style.swift */; };
24+
9B267B7E244066C1002F571E /* ParagraphStyle.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B6E89E22382C392009EBEBE /* ParagraphStyle.swift */; };
25+
9B267B7F244066C1002F571E /* Attachment.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B6E89E42382C488009EBEBE /* Attachment.swift */; };
26+
9B267B8B24406B2F002F571E /* WKInterfaceButtonExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B267B8924406B2F002F571E /* WKInterfaceButtonExtension.swift */; };
27+
9B267B8C24406B2F002F571E /* WKInterfaceLabelExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B267B8A24406B2F002F571E /* WKInterfaceLabelExtension.swift */; };
28+
9B267B8E24406D71002F571E /* WKInterfaceTextFieldExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B267B8D24406D71002F571E /* WKInterfaceTextFieldExtension.swift */; };
29+
9B267B95244072BE002F571E /* NSShadowExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B267B94244072BE002F571E /* NSShadowExtension.swift */; };
1630
9B34BD3F243DBE7500932E6C /* AttributedString.h in Headers */ = {isa = PBXBuildFile; fileRef = 9B6E894F23823C40009EBEBE /* AttributedString.h */; settings = {ATTRIBUTES = (Public, ); }; };
1731
9B34BD40243DBEA900932E6C /* CGSizeExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B6E89AE238275D2009EBEBE /* CGSizeExtension.swift */; };
1832
9B34BD41243DBEA900932E6C /* CGRectExtension.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B6E89B02382766F009EBEBE /* CGRectExtension.swift */; };
@@ -65,6 +79,11 @@
6579
9B267B1E24404124002F571E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
6680
9B267B292440433F002F571E /* AttributedString-macOS Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "AttributedString-macOS Tests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; };
6781
9B267B2B2440433F002F571E /* AttributedString_macOS_Tests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AttributedString_macOS_Tests.swift; sourceTree = "<group>"; };
82+
9B267B3B24404922002F571E /* AttributedString.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = AttributedString.framework; sourceTree = BUILT_PRODUCTS_DIR; };
83+
9B267B8924406B2F002F571E /* WKInterfaceButtonExtension.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WKInterfaceButtonExtension.swift; sourceTree = "<group>"; };
84+
9B267B8A24406B2F002F571E /* WKInterfaceLabelExtension.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = WKInterfaceLabelExtension.swift; sourceTree = "<group>"; };
85+
9B267B8D24406D71002F571E /* WKInterfaceTextFieldExtension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = WKInterfaceTextFieldExtension.swift; sourceTree = "<group>"; };
86+
9B267B94244072BE002F571E /* NSShadowExtension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NSShadowExtension.swift; sourceTree = "<group>"; };
6887
9B34BD37243DBC8100932E6C /* AttributedString.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = AttributedString.framework; sourceTree = BUILT_PRODUCTS_DIR; };
6988
9B34BD63243DFAA600932E6C /* NSShadowExtension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NSShadowExtension.swift; sourceTree = "<group>"; };
7089
9B34BD66243DFC9E00932E6C /* NSTextFieldExtension.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NSTextFieldExtension.swift; sourceTree = "<group>"; };
@@ -102,6 +121,13 @@
102121
);
103122
runOnlyForDeploymentPostprocessing = 0;
104123
};
124+
9B267B3824404922002F571E /* Frameworks */ = {
125+
isa = PBXFrameworksBuildPhase;
126+
buildActionMask = 2147483647;
127+
files = (
128+
);
129+
runOnlyForDeploymentPostprocessing = 0;
130+
};
105131
9B34BD34243DBC8100932E6C /* Frameworks */ = {
106132
isa = PBXFrameworksBuildPhase;
107133
buildActionMask = 2147483647;
@@ -129,6 +155,17 @@
129155
path = Tests;
130156
sourceTree = "<group>";
131157
};
158+
9B267B8424406AF8002F571E /* WatchKit */ = {
159+
isa = PBXGroup;
160+
children = (
161+
9B267B8924406B2F002F571E /* WKInterfaceButtonExtension.swift */,
162+
9B267B8A24406B2F002F571E /* WKInterfaceLabelExtension.swift */,
163+
9B267B8D24406D71002F571E /* WKInterfaceTextFieldExtension.swift */,
164+
9B267B94244072BE002F571E /* NSShadowExtension.swift */,
165+
);
166+
path = WatchKit;
167+
sourceTree = "<group>";
168+
};
132169
9B6E894223823C40009EBEBE = {
133170
isa = PBXGroup;
134171
children = (
@@ -145,6 +182,7 @@
145182
9B34BD37243DBC8100932E6C /* AttributedString.framework */,
146183
9B267B1A24404124002F571E /* AttributedString-iOS Tests.xctest */,
147184
9B267B292440433F002F571E /* AttributedString-macOS Tests.xctest */,
185+
9B267B3B24404922002F571E /* AttributedString.framework */,
148186
);
149187
name = Products;
150188
sourceTree = "<group>";
@@ -167,8 +205,8 @@
167205
9B6E89A32382738E009EBEBE /* Extension */ = {
168206
isa = PBXGroup;
169207
children = (
208+
9B267B8424406AF8002F571E /* WatchKit */,
170209
9B6E89AD238275B1009EBEBE /* CoreGraphics */,
171-
9B6E89A6238273CD009EBEBE /* WatchKit */,
172210
9B6E89A5238273B2009EBEBE /* AppKit */,
173211
9B6E89A42382739C009EBEBE /* UIKit */,
174212
9B0A2A3723851EB6003D8A55 /* Extension.swift */,
@@ -197,13 +235,6 @@
197235
path = AppKit;
198236
sourceTree = "<group>";
199237
};
200-
9B6E89A6238273CD009EBEBE /* WatchKit */ = {
201-
isa = PBXGroup;
202-
children = (
203-
);
204-
path = WatchKit;
205-
sourceTree = "<group>";
206-
};
207238
9B6E89AD238275B1009EBEBE /* CoreGraphics */ = {
208239
isa = PBXGroup;
209240
children = (
@@ -217,6 +248,14 @@
217248
/* End PBXGroup section */
218249

219250
/* Begin PBXHeadersBuildPhase section */
251+
9B267B3624404922002F571E /* Headers */ = {
252+
isa = PBXHeadersBuildPhase;
253+
buildActionMask = 2147483647;
254+
files = (
255+
9B267B76244066B0002F571E /* AttributedString.h in Headers */,
256+
);
257+
runOnlyForDeploymentPostprocessing = 0;
258+
};
220259
9B34BD32243DBC8100932E6C /* Headers */ = {
221260
isa = PBXHeadersBuildPhase;
222261
buildActionMask = 2147483647;
@@ -272,6 +311,24 @@
272311
productReference = 9B267B292440433F002F571E /* AttributedString-macOS Tests.xctest */;
273312
productType = "com.apple.product-type.bundle.unit-test";
274313
};
314+
9B267B3A24404922002F571E /* AttributedString-watchOS */ = {
315+
isa = PBXNativeTarget;
316+
buildConfigurationList = 9B267B4024404922002F571E /* Build configuration list for PBXNativeTarget "AttributedString-watchOS" */;
317+
buildPhases = (
318+
9B267B3624404922002F571E /* Headers */,
319+
9B267B3724404922002F571E /* Sources */,
320+
9B267B3824404922002F571E /* Frameworks */,
321+
9B267B3924404922002F571E /* Resources */,
322+
);
323+
buildRules = (
324+
);
325+
dependencies = (
326+
);
327+
name = "AttributedString-watchOS";
328+
productName = "AttributedString-watchOS";
329+
productReference = 9B267B3B24404922002F571E /* AttributedString.framework */;
330+
productType = "com.apple.product-type.framework";
331+
};
275332
9B34BD36243DBC8100932E6C /* AttributedString-macOS */ = {
276333
isa = PBXNativeTarget;
277334
buildConfigurationList = 9B34BD3E243DBC8100932E6C /* Build configuration list for PBXNativeTarget "AttributedString-macOS" */;
@@ -324,6 +381,9 @@
324381
9B267B282440433F002F571E = {
325382
CreatedOnToolsVersion = 11.4;
326383
};
384+
9B267B3A24404922002F571E = {
385+
CreatedOnToolsVersion = 11.4;
386+
};
327387
9B34BD36243DBC8100932E6C = {
328388
CreatedOnToolsVersion = 11.4;
329389
};
@@ -348,6 +408,7 @@
348408
targets = (
349409
9B6E894B23823C40009EBEBE /* AttributedString-iOS */,
350410
9B34BD36243DBC8100932E6C /* AttributedString-macOS */,
411+
9B267B3A24404922002F571E /* AttributedString-watchOS */,
351412
9B267B1924404124002F571E /* AttributedString-iOS Tests */,
352413
9B267B282440433F002F571E /* AttributedString-macOS Tests */,
353414
);
@@ -369,6 +430,13 @@
369430
);
370431
runOnlyForDeploymentPostprocessing = 0;
371432
};
433+
9B267B3924404922002F571E /* Resources */ = {
434+
isa = PBXResourcesBuildPhase;
435+
buildActionMask = 2147483647;
436+
files = (
437+
);
438+
runOnlyForDeploymentPostprocessing = 0;
439+
};
372440
9B34BD35243DBC8100932E6C /* Resources */ = {
373441
isa = PBXResourcesBuildPhase;
374442
buildActionMask = 2147483647;
@@ -402,6 +470,26 @@
402470
);
403471
runOnlyForDeploymentPostprocessing = 0;
404472
};
473+
9B267B3724404922002F571E /* Sources */ = {
474+
isa = PBXSourcesBuildPhase;
475+
buildActionMask = 2147483647;
476+
files = (
477+
9B267B8C24406B2F002F571E /* WKInterfaceLabelExtension.swift in Sources */,
478+
9B267B77244066C1002F571E /* CGSizeExtension.swift in Sources */,
479+
9B267B78244066C1002F571E /* CGRectExtension.swift in Sources */,
480+
9B267B79244066C1002F571E /* CGPointExtension.swift in Sources */,
481+
9B267B7A244066C1002F571E /* Extension.swift in Sources */,
482+
9B267B95244072BE002F571E /* NSShadowExtension.swift in Sources */,
483+
9B267B8B24406B2F002F571E /* WKInterfaceButtonExtension.swift in Sources */,
484+
9B267B7B244066C1002F571E /* AttributedString.swift in Sources */,
485+
9B267B7C244066C1002F571E /* Interpolation.swift in Sources */,
486+
9B267B7D244066C1002F571E /* Style.swift in Sources */,
487+
9B267B7E244066C1002F571E /* ParagraphStyle.swift in Sources */,
488+
9B267B7F244066C1002F571E /* Attachment.swift in Sources */,
489+
9B267B8E24406D71002F571E /* WKInterfaceTextFieldExtension.swift in Sources */,
490+
);
491+
runOnlyForDeploymentPostprocessing = 0;
492+
};
405493
9B34BD33243DBC8100932E6C /* Sources */ = {
406494
isa = PBXSourcesBuildPhase;
407495
buildActionMask = 2147483647;
@@ -537,6 +625,62 @@
537625
};
538626
name = Release;
539627
};
628+
9B267B4124404922002F571E /* Debug */ = {
629+
isa = XCBuildConfiguration;
630+
buildSettings = {
631+
APPLICATION_EXTENSION_API_ONLY = YES;
632+
CODE_SIGN_STYLE = Automatic;
633+
DEFINES_MODULE = YES;
634+
DEVELOPMENT_TEAM = B9D8DJR5J5;
635+
DYLIB_COMPATIBILITY_VERSION = 1;
636+
DYLIB_CURRENT_VERSION = 1;
637+
DYLIB_INSTALL_NAME_BASE = "@rpath";
638+
INFOPLIST_FILE = Sources/Info.plist;
639+
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
640+
LD_RUNPATH_SEARCH_PATHS = (
641+
"$(inherited)",
642+
"@executable_path/Frameworks",
643+
"@loader_path/Frameworks",
644+
);
645+
MARKETING_VERSION = 1.2.0;
646+
PRODUCT_BUNDLE_IDENTIFIER = com.attributedstring.watchos;
647+
PRODUCT_NAME = AttributedString;
648+
SDKROOT = watchos;
649+
SKIP_INSTALL = YES;
650+
SWIFT_VERSION = 5.0;
651+
TARGETED_DEVICE_FAMILY = 4;
652+
WATCHOS_DEPLOYMENT_TARGET = 6.2;
653+
};
654+
name = Debug;
655+
};
656+
9B267B4224404922002F571E /* Release */ = {
657+
isa = XCBuildConfiguration;
658+
buildSettings = {
659+
APPLICATION_EXTENSION_API_ONLY = YES;
660+
CODE_SIGN_STYLE = Automatic;
661+
DEFINES_MODULE = YES;
662+
DEVELOPMENT_TEAM = B9D8DJR5J5;
663+
DYLIB_COMPATIBILITY_VERSION = 1;
664+
DYLIB_CURRENT_VERSION = 1;
665+
DYLIB_INSTALL_NAME_BASE = "@rpath";
666+
INFOPLIST_FILE = Sources/Info.plist;
667+
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
668+
LD_RUNPATH_SEARCH_PATHS = (
669+
"$(inherited)",
670+
"@executable_path/Frameworks",
671+
"@loader_path/Frameworks",
672+
);
673+
MARKETING_VERSION = 1.2.0;
674+
PRODUCT_BUNDLE_IDENTIFIER = com.attributedstring.watchos;
675+
PRODUCT_NAME = AttributedString;
676+
SDKROOT = watchos;
677+
SKIP_INSTALL = YES;
678+
SWIFT_VERSION = 5.0;
679+
TARGETED_DEVICE_FAMILY = 4;
680+
WATCHOS_DEPLOYMENT_TARGET = 6.2;
681+
};
682+
name = Release;
683+
};
540684
9B34BD3C243DBC8100932E6C /* Debug */ = {
541685
isa = XCBuildConfiguration;
542686
buildSettings = {
@@ -787,6 +931,15 @@
787931
defaultConfigurationIsVisible = 0;
788932
defaultConfigurationName = Release;
789933
};
934+
9B267B4024404922002F571E /* Build configuration list for PBXNativeTarget "AttributedString-watchOS" */ = {
935+
isa = XCConfigurationList;
936+
buildConfigurations = (
937+
9B267B4124404922002F571E /* Debug */,
938+
9B267B4224404922002F571E /* Release */,
939+
);
940+
defaultConfigurationIsVisible = 0;
941+
defaultConfigurationName = Release;
942+
};
790943
9B34BD3E243DBC8100932E6C /* Build configuration list for PBXNativeTarget "AttributedString-macOS" */ = {
791944
isa = XCConfigurationList;
792945
buildConfigurations = (

AttributedString.xcworkspace/contents.xcworkspacedata

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
{
2+
"images" : [
3+
{
4+
"idiom" : "watch",
5+
"role" : "notificationCenter",
6+
"scale" : "2x",
7+
"size" : "24x24",
8+
"subtype" : "38mm"
9+
},
10+
{
11+
"idiom" : "watch",
12+
"role" : "notificationCenter",
13+
"scale" : "2x",
14+
"size" : "27.5x27.5",
15+
"subtype" : "42mm"
16+
},
17+
{
18+
"idiom" : "watch",
19+
"role" : "companionSettings",
20+
"scale" : "2x",
21+
"size" : "29x29"
22+
},
23+
{
24+
"idiom" : "watch",
25+
"role" : "companionSettings",
26+
"scale" : "3x",
27+
"size" : "29x29"
28+
},
29+
{
30+
"idiom" : "watch",
31+
"role" : "appLauncher",
32+
"scale" : "2x",
33+
"size" : "40x40",
34+
"subtype" : "38mm"
35+
},
36+
{
37+
"idiom" : "watch",
38+
"role" : "appLauncher",
39+
"scale" : "2x",
40+
"size" : "44x44",
41+
"subtype" : "40mm"
42+
},
43+
{
44+
"idiom" : "watch",
45+
"role" : "appLauncher",
46+
"scale" : "2x",
47+
"size" : "50x50",
48+
"subtype" : "44mm"
49+
},
50+
{
51+
"idiom" : "watch",
52+
"role" : "quickLook",
53+
"scale" : "2x",
54+
"size" : "86x86",
55+
"subtype" : "38mm"
56+
},
57+
{
58+
"idiom" : "watch",
59+
"role" : "quickLook",
60+
"scale" : "2x",
61+
"size" : "98x98",
62+
"subtype" : "42mm"
63+
},
64+
{
65+
"idiom" : "watch",
66+
"role" : "quickLook",
67+
"scale" : "2x",
68+
"size" : "108x108",
69+
"subtype" : "44mm"
70+
},
71+
{
72+
"idiom" : "watch-marketing",
73+
"scale" : "1x",
74+
"size" : "1024x1024"
75+
}
76+
],
77+
"info" : {
78+
"author" : "xcode",
79+
"version" : 1
80+
}
81+
}

0 commit comments

Comments
 (0)