Skip to content

Commit 672aea9

Browse files
authored
Merge pull request #18 from Squarespace/avyazovoy/MOBILE-1956-SPM-support
MOBILE-1956: SPM support
2 parents 7698dc3 + a14c9e7 commit 672aea9

35 files changed

Lines changed: 163 additions & 190 deletions

.github/workflows/ci.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,13 @@ jobs:
3838
with:
3939
name: test_artifacts
4040
path: ${{ steps.define_validation_dir.outputs.path }}
41+
42+
- name: Install xcbeautify
43+
run: brew install xcbeautify
44+
45+
- name: Run SPM unit tests
46+
run: |
47+
xcodebuild test \
48+
-scheme swift-simple-source \
49+
-destination 'platform=iOS Simulator,name=iPhone SE (3rd generation),OS=latest' \
50+
| xcbeautify

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@ project.xcworkspace/
1111
xcuserdata/
1212
*.xccheckout
1313

14+
#SPM
15+
/.build
16+
/Packages
17+
.swiftpm/
18+
.netrc
19+
1420
# RubyGems Bundler
1521
vendor/bundle/
1622

Examples/Podfile

Lines changed: 0 additions & 22 deletions
This file was deleted.

Examples/Podfile.lock

Lines changed: 0 additions & 29 deletions
This file was deleted.

Examples/SimpleSourceExample.xcodeproj/project.pbxproj

Lines changed: 23 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
archiveVersion = 1;
44
classes = {
55
};
6-
objectVersion = 56;
6+
objectVersion = 60;
77
objects = {
88

99
/* Begin PBXBuildFile section */
10-
1125C4B111C313BADE9DEE27 /* Pods_SimpleSourceExample.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E03B72459B7D8A89ED6D1A29 /* Pods_SimpleSourceExample.framework */; };
10+
62FF82AA2AF09C9500C7EB61 /* SimpleSource in Frameworks */ = {isa = PBXBuildFile; productRef = 62FF82A92AF09C9500C7EB61 /* SimpleSource */; };
1111
C424C2691E3B4B2900CEE8C0 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = C424C2681E3B4B2900CEE8C0 /* AppDelegate.swift */; };
1212
C424C26B1E3B4B2900CEE8C0 /* ColorTableViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = C424C26A1E3B4B2900CEE8C0 /* ColorTableViewController.swift */; };
1313
C424C26E1E3B4B2900CEE8C0 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = C424C26C1E3B4B2900CEE8C0 /* Main.storyboard */; };
@@ -35,8 +35,6 @@
3535
/* End PBXBuildFile section */
3636

3737
/* Begin PBXFileReference section */
38-
65333953768EE8F03228185B /* Pods-SimpleSourceExample.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SimpleSourceExample.debug.xcconfig"; path = "Pods/Target Support Files/Pods-SimpleSourceExample/Pods-SimpleSourceExample.debug.xcconfig"; sourceTree = "<group>"; };
39-
8C2328A1D61B2AA900671F49 /* Pods-SimpleSourceExample.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-SimpleSourceExample.release.xcconfig"; path = "Pods/Target Support Files/Pods-SimpleSourceExample/Pods-SimpleSourceExample.release.xcconfig"; sourceTree = "<group>"; };
4038
C424C2651E3B4B2900CEE8C0 /* SimpleSourceExample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = SimpleSourceExample.app; sourceTree = BUILT_PRODUCTS_DIR; };
4139
C424C2681E3B4B2900CEE8C0 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
4240
C424C26A1E3B4B2900CEE8C0 /* ColorTableViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ColorTableViewController.swift; sourceTree = "<group>"; };
@@ -63,45 +61,25 @@
6361
C424C2AB1E3D1B1600CEE8C0 /* characters.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = characters.json; sourceTree = "<group>"; };
6462
C4847CC4200388DD00841DBA /* ItemListTableViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ItemListTableViewController.swift; sourceTree = "<group>"; };
6563
C4E8EA791EABC18300D5EE1D /* ReorderingColorGridViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ReorderingColorGridViewController.swift; sourceTree = "<group>"; };
66-
E03B72459B7D8A89ED6D1A29 /* Pods_SimpleSourceExample.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_SimpleSourceExample.framework; sourceTree = BUILT_PRODUCTS_DIR; };
6764
/* End PBXFileReference section */
6865

6966
/* Begin PBXFrameworksBuildPhase section */
7067
C424C2621E3B4B2900CEE8C0 /* Frameworks */ = {
7168
isa = PBXFrameworksBuildPhase;
7269
buildActionMask = 2147483647;
7370
files = (
74-
1125C4B111C313BADE9DEE27 /* Pods_SimpleSourceExample.framework in Frameworks */,
71+
62FF82AA2AF09C9500C7EB61 /* SimpleSource in Frameworks */,
7572
);
7673
runOnlyForDeploymentPostprocessing = 0;
7774
};
7875
/* End PBXFrameworksBuildPhase section */
7976

8077
/* Begin PBXGroup section */
81-
5D1976861E89CF5DB8542DB1 /* Pods */ = {
82-
isa = PBXGroup;
83-
children = (
84-
65333953768EE8F03228185B /* Pods-SimpleSourceExample.debug.xcconfig */,
85-
8C2328A1D61B2AA900671F49 /* Pods-SimpleSourceExample.release.xcconfig */,
86-
);
87-
name = Pods;
88-
sourceTree = "<group>";
89-
};
90-
6C8F20F1EEC12F51A1D3E66B /* Frameworks */ = {
91-
isa = PBXGroup;
92-
children = (
93-
E03B72459B7D8A89ED6D1A29 /* Pods_SimpleSourceExample.framework */,
94-
);
95-
name = Frameworks;
96-
sourceTree = "<group>";
97-
};
9878
C424C25C1E3B4B2900CEE8C0 = {
9979
isa = PBXGroup;
10080
children = (
10181
C424C2671E3B4B2900CEE8C0 /* SimpleSourceExample */,
10282
C424C2661E3B4B2900CEE8C0 /* Products */,
103-
5D1976861E89CF5DB8542DB1 /* Pods */,
104-
6C8F20F1EEC12F51A1D3E66B /* Frameworks */,
10583
);
10684
sourceTree = "<group>";
10785
};
@@ -264,17 +242,18 @@
264242
isa = PBXNativeTarget;
265243
buildConfigurationList = C424C2771E3B4B2900CEE8C0 /* Build configuration list for PBXNativeTarget "SimpleSourceExample" */;
266244
buildPhases = (
267-
C9493BAEA1942A5FAEECDEE7 /* [CP] Check Pods Manifest.lock */,
268245
C424C2611E3B4B2900CEE8C0 /* Sources */,
269246
C424C2621E3B4B2900CEE8C0 /* Frameworks */,
270247
C424C2631E3B4B2900CEE8C0 /* Resources */,
271-
61726B5B8A96F790C3CA8367 /* [CP] Embed Pods Frameworks */,
272248
);
273249
buildRules = (
274250
);
275251
dependencies = (
276252
);
277253
name = SimpleSourceExample;
254+
packageProductDependencies = (
255+
62FF82A92AF09C9500C7EB61 /* SimpleSource */,
256+
);
278257
productName = SimpleSourceExample;
279258
productReference = C424C2651E3B4B2900CEE8C0 /* SimpleSourceExample.app */;
280259
productType = "com.apple.product-type.application";
@@ -306,6 +285,9 @@
306285
Base,
307286
);
308287
mainGroup = C424C25C1E3B4B2900CEE8C0;
288+
packageReferences = (
289+
62FF82A82AF09C7600C7EB61 /* XCLocalSwiftPackageReference ".." */,
290+
);
309291
productRefGroup = C424C2661E3B4B2900CEE8C0 /* Products */;
310292
projectDirPath = "";
311293
projectRoot = "";
@@ -330,44 +312,6 @@
330312
};
331313
/* End PBXResourcesBuildPhase section */
332314

333-
/* Begin PBXShellScriptBuildPhase section */
334-
61726B5B8A96F790C3CA8367 /* [CP] Embed Pods Frameworks */ = {
335-
isa = PBXShellScriptBuildPhase;
336-
buildActionMask = 2147483647;
337-
files = (
338-
);
339-
inputFileListPaths = (
340-
"${PODS_ROOT}/Target Support Files/Pods-SimpleSourceExample/Pods-SimpleSourceExample-frameworks-${CONFIGURATION}-input-files.xcfilelist",
341-
);
342-
name = "[CP] Embed Pods Frameworks";
343-
outputFileListPaths = (
344-
"${PODS_ROOT}/Target Support Files/Pods-SimpleSourceExample/Pods-SimpleSourceExample-frameworks-${CONFIGURATION}-output-files.xcfilelist",
345-
);
346-
runOnlyForDeploymentPostprocessing = 0;
347-
shellPath = /bin/sh;
348-
shellScript = "\"${PODS_ROOT}/Target Support Files/Pods-SimpleSourceExample/Pods-SimpleSourceExample-frameworks.sh\"\n";
349-
showEnvVarsInLog = 0;
350-
};
351-
C9493BAEA1942A5FAEECDEE7 /* [CP] Check Pods Manifest.lock */ = {
352-
isa = PBXShellScriptBuildPhase;
353-
buildActionMask = 2147483647;
354-
files = (
355-
);
356-
inputPaths = (
357-
"${PODS_PODFILE_DIR_PATH}/Podfile.lock",
358-
"${PODS_ROOT}/Manifest.lock",
359-
);
360-
name = "[CP] Check Pods Manifest.lock";
361-
outputPaths = (
362-
"$(DERIVED_FILE_DIR)/Pods-SimpleSourceExample-checkManifestLockResult.txt",
363-
);
364-
runOnlyForDeploymentPostprocessing = 0;
365-
shellPath = /bin/sh;
366-
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n";
367-
showEnvVarsInLog = 0;
368-
};
369-
/* End PBXShellScriptBuildPhase section */
370-
371315
/* Begin PBXSourcesBuildPhase section */
372316
C424C2611E3B4B2900CEE8C0 /* Sources */ = {
373317
isa = PBXSourcesBuildPhase;
@@ -539,7 +483,6 @@
539483
};
540484
C424C2781E3B4B2900CEE8C0 /* Debug */ = {
541485
isa = XCBuildConfiguration;
542-
baseConfigurationReference = 65333953768EE8F03228185B /* Pods-SimpleSourceExample.debug.xcconfig */;
543486
buildSettings = {
544487
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
545488
INFOPLIST_FILE = SimpleSourceExample/Info.plist;
@@ -554,7 +497,6 @@
554497
};
555498
C424C2791E3B4B2900CEE8C0 /* Release */ = {
556499
isa = XCBuildConfiguration;
557-
baseConfigurationReference = 8C2328A1D61B2AA900671F49 /* Pods-SimpleSourceExample.release.xcconfig */;
558500
buildSettings = {
559501
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
560502
INFOPLIST_FILE = SimpleSourceExample/Info.plist;
@@ -590,6 +532,20 @@
590532
};
591533
/* End XCConfigurationList section */
592534

535+
/* Begin XCLocalSwiftPackageReference section */
536+
62FF82A82AF09C7600C7EB61 /* XCLocalSwiftPackageReference ".." */ = {
537+
isa = XCLocalSwiftPackageReference;
538+
relativePath = ..;
539+
};
540+
/* End XCLocalSwiftPackageReference section */
541+
542+
/* Begin XCSwiftPackageProductDependency section */
543+
62FF82A92AF09C9500C7EB61 /* SimpleSource */ = {
544+
isa = XCSwiftPackageProductDependency;
545+
productName = SimpleSource;
546+
};
547+
/* End XCSwiftPackageProductDependency section */
548+
593549
/* Begin XCVersionGroup section */
594550
C424C29D1E3D030600CEE8C0 /* CharacterModel.xcdatamodeld */ = {
595551
isa = XCVersionGroup;

Examples/SimpleSourceExample.xcodeproj/xcshareddata/xcschemes/SimpleSourceExample.xcscheme

Lines changed: 3 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<Scheme
33
LastUpgradeVersion = "1500"
4-
version = "1.3">
4+
version = "1.7">
55
<BuildAction
66
parallelizeBuildables = "YES"
77
buildImplicitDependencies = "YES">
@@ -20,28 +20,15 @@
2020
ReferencedContainer = "container:SimpleSourceExample.xcodeproj">
2121
</BuildableReference>
2222
</BuildActionEntry>
23-
<BuildActionEntry
24-
buildForTesting = "YES"
25-
buildForRunning = "NO"
26-
buildForProfiling = "NO"
27-
buildForArchiving = "NO"
28-
buildForAnalyzing = "NO">
29-
<BuildableReference
30-
BuildableIdentifier = "primary"
31-
BlueprintIdentifier = "C73479B4B3EC915F6BFD710EFCBAA9B3"
32-
BuildableName = "SimpleSource-Unit-Tests.xctest"
33-
BlueprintName = "SimpleSource-Unit-Tests"
34-
ReferencedContainer = "container:Pods/Pods.xcodeproj">
35-
</BuildableReference>
36-
</BuildActionEntry>
3723
</BuildActionEntries>
3824
</BuildAction>
3925
<TestAction
4026
buildConfiguration = "Debug"
4127
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
4228
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
4329
shouldUseLaunchSchemeArgsEnv = "YES"
44-
codeCoverageEnabled = "YES">
30+
codeCoverageEnabled = "YES"
31+
shouldAutocreateTestPlan = "YES">
4532
<MacroExpansion>
4633
<BuildableReference
4734
BuildableIdentifier = "primary"
@@ -51,18 +38,6 @@
5138
ReferencedContainer = "container:SimpleSourceExample.xcodeproj">
5239
</BuildableReference>
5340
</MacroExpansion>
54-
<Testables>
55-
<TestableReference
56-
skipped = "NO">
57-
<BuildableReference
58-
BuildableIdentifier = "primary"
59-
BlueprintIdentifier = "C73479B4B3EC915F6BFD710EFCBAA9B3"
60-
BuildableName = "SimpleSource-Unit-Tests.xctest"
61-
BlueprintName = "SimpleSource-Unit-Tests"
62-
ReferencedContainer = "container:Pods/Pods.xcodeproj">
63-
</BuildableReference>
64-
</TestableReference>
65-
</Testables>
6641
</TestAction>
6742
<LaunchAction
6843
buildConfiguration = "Debug"

Examples/SimpleSourceExample.xcworkspace/contents.xcworkspacedata

Lines changed: 0 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Examples/SimpleSourceExample/Colors.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import Foundation
22
import SimpleSource
3+
import UIKit
34

45
// MARK: Sections
56

Package.resolved

Lines changed: 41 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)