Skip to content

Commit 6eee6b0

Browse files
Merge pull request #184 from iZettle/use-spm-to-fetch-and-build-dependencies
Use spm to fetch and build dependencies
2 parents 7059ca9 + b5a621b commit 6eee6b0

File tree

16 files changed

+143
-305
lines changed

16 files changed

+143
-305
lines changed

.circleci/config.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,9 @@ commands:
2727
cd <<parameters.path>>
2828
pod install --verbose
2929
30-
carthage-update:
31-
steps:
32-
- run: sh carthage.sh update Flow --cache-builds
33-
3430
test_main_project:
3531
steps:
3632
- checkout
37-
- carthage-update
3833
- test_project_and_store_results:
3934
project: "Form.xcodeproj"
4035
scheme: "Form"

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
# 4.0.0
2+
- Replaced `Carthage` with `SPM`
3+
- Removed `Presentation` dependency references from project
4+
- Removed conditionally compiled code wrapped in `#if canImport(Presentation)`. The removed code can be added by integrators directly if needed using this [diff](https://github.com/iZettle/Form/pull/184/commits/71eca247c8fcc988928466afa65dea2ac8989517)
5+
16
# 3.3.4
27
- Bug fix for a TableKit update issue [#182](https://github.com/iZettle/Form/issues/182)
38

Cartfile

Lines changed: 0 additions & 1 deletion
This file was deleted.

Cartfile.resolved

Lines changed: 0 additions & 1 deletion
This file was deleted.

Examples/Messages/Example.xcodeproj/project.pbxproj

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@
33
archiveVersion = 1;
44
classes = {
55
};
6-
objectVersion = 50;
6+
objectVersion = 52;
77
objects = {
88

99
/* Begin PBXBuildFile section */
1010
2A8568E12344F73200B9D157 /* ExampleTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2A8568E02344F73200B9D157 /* ExampleTests.swift */; };
11+
75593950283BA41200EA10E9 /* Presentation in Frameworks */ = {isa = PBXBuildFile; productRef = 7559394F283BA41200EA10E9 /* Presentation */; };
1112
F61928ED2088DE200008F713 /* Messages.swift in Sources */ = {isa = PBXBuildFile; fileRef = F61928EC2088DE200008F713 /* Messages.swift */; };
1213
F61928EF2088DE7E0008F713 /* ComposeMessage.swift in Sources */ = {isa = PBXBuildFile; fileRef = F61928EE2088DE7E0008F713 /* ComposeMessage.swift */; };
1314
F61928F12088DEBD0008F713 /* MessageDetails.swift in Sources */ = {isa = PBXBuildFile; fileRef = F61928F02088DEBD0008F713 /* MessageDetails.swift */; };
@@ -63,6 +64,7 @@
6364
isa = PBXFrameworksBuildPhase;
6465
buildActionMask = 2147483647;
6566
files = (
67+
75593950283BA41200EA10E9 /* Presentation in Frameworks */,
6668
);
6769
runOnlyForDeploymentPostprocessing = 0;
6870
};
@@ -144,6 +146,9 @@
144146
dependencies = (
145147
);
146148
name = Example;
149+
packageProductDependencies = (
150+
7559394F283BA41200EA10E9 /* Presentation */,
151+
);
147152
productName = Messages;
148153
productReference = F6B3E0552086210E00F55C53 /* Example.app */;
149154
productType = "com.apple.product-type.application";
@@ -176,6 +181,9 @@
176181
Base,
177182
);
178183
mainGroup = F6B3E04C2086210E00F55C53;
184+
packageReferences = (
185+
7559394E283BA41200EA10E9 /* XCRemoteSwiftPackageReference "Presentation" */,
186+
);
179187
productRefGroup = F6B3E0562086210E00F55C53 /* Products */;
180188
projectDirPath = "";
181189
projectRoot = "";
@@ -468,6 +476,25 @@
468476
defaultConfigurationName = Release;
469477
};
470478
/* End XCConfigurationList section */
479+
480+
/* Begin XCRemoteSwiftPackageReference section */
481+
7559394E283BA41200EA10E9 /* XCRemoteSwiftPackageReference "Presentation" */ = {
482+
isa = XCRemoteSwiftPackageReference;
483+
repositoryURL = "https://github.com/iZettle/Presentation.git";
484+
requirement = {
485+
kind = upToNextMajorVersion;
486+
minimumVersion = 1.15.2;
487+
};
488+
};
489+
/* End XCRemoteSwiftPackageReference section */
490+
491+
/* Begin XCSwiftPackageProductDependency section */
492+
7559394F283BA41200EA10E9 /* Presentation */ = {
493+
isa = XCSwiftPackageProductDependency;
494+
package = 7559394E283BA41200EA10E9 /* XCRemoteSwiftPackageReference "Presentation" */;
495+
productName = Presentation;
496+
};
497+
/* End XCSwiftPackageProductDependency section */
471498
};
472499
rootObject = F6B3E04D2086210E00F55C53 /* Project object */;
473500
}

Examples/Messages/Example.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved

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

Examples/Messages/Example/Messages.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,3 +79,9 @@ struct Empty: Presentable {
7979
return (UIViewController(), NilDisposer())
8080
}
8181
}
82+
83+
public extension MasterDetailSelection where Elements.Index == TableIndex {
84+
func bindTo<Row, Section>(_ tableKit: TableKit<Row, Section>) -> Disposable {
85+
return self.map { $0?.index }.bindTo(tableKit, select: self.select)
86+
}
87+
}

Examples/Messages/Podfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ platform :ios, '11.0'
33
target 'Example' do
44
use_frameworks!
55

6-
pod 'FormFramework/Presentation', :path => '../..'
76
pod 'FormFramework', :path => '../..'
87

98
end

Form.xcodeproj/project.pbxproj

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

99
/* Begin PBXBuildFile section */
@@ -35,6 +35,7 @@
3535
724EC30D2241513D001F3E11 /* UILabel+StylingTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 724EC30C2241513D001F3E11 /* UILabel+StylingTests.swift */; };
3636
7270AFB0201FAB7C004DAAA3 /* ViewLayoutArea.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7270AFAF201FAB7C004DAAA3 /* ViewLayoutArea.swift */; };
3737
72C5ED6F226F432600E32125 /* UIScrollView+PinningTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 72C5ED6E226F432600E32125 /* UIScrollView+PinningTests.swift */; };
38+
7592CA3E282BF9DC00920278 /* Flow in Frameworks */ = {isa = PBXBuildFile; productRef = 7592CA3D282BF9DC00920278 /* Flow */; };
3839
B35F8AEE1F36676D00904E37 /* Collection+Changes.swift in Sources */ = {isa = PBXBuildFile; fileRef = B35F8AED1F36676D00904E37 /* Collection+Changes.swift */; };
3940
B35F8B4C1F3783E400904E37 /* CollectionDiffTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = B35F8B4B1F3783E400904E37 /* CollectionDiffTests.swift */; };
4041
CA6755EA1D4B6F1C000662FF /* SegmentedControlStyle.swift in Sources */ = {isa = PBXBuildFile; fileRef = CA6755E91D4B6F1C000662FF /* SegmentedControlStyle.swift */; };
@@ -48,7 +49,6 @@
4849
F624C3CE1F7CFC9F00E1F5C1 /* UIViewController+Install.swift in Sources */ = {isa = PBXBuildFile; fileRef = F624C3CD1F7CFC9F00E1F5C1 /* UIViewController+Install.swift */; };
4950
F62E45B91CABFB5300C6867E /* Form.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F6A9D5DE1C1728BA009A0EEB /* Form.framework */; };
5051
F63863122090B73F00A43824 /* RowView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F63863112090B73F00A43824 /* RowView.swift */; };
51-
F647306C20BFDFB1002BC8E3 /* RowsSelection.swift in Sources */ = {isa = PBXBuildFile; fileRef = F647306A20BFDFB1002BC8E3 /* RowsSelection.swift */; };
5252
F64C27F01C7B2C5B003CC378 /* TextStyle.swift in Sources */ = {isa = PBXBuildFile; fileRef = F64C27EA1C7B2C5B003CC378 /* TextStyle.swift */; };
5353
F64C27F11C7B2C5B003CC378 /* ButtonStyle.swift in Sources */ = {isa = PBXBuildFile; fileRef = F64C27EB1C7B2C5B003CC378 /* ButtonStyle.swift */; };
5454
F65A9F811C7B1E8F007007B4 /* Form.h in Headers */ = {isa = PBXBuildFile; fileRef = F65A9F7F1C7B1E8F007007B4 /* Form.h */; settings = {ATTRIBUTES = (Public, ); }; };
@@ -160,7 +160,6 @@
160160
F62E45B41CABFB5300C6867E /* FormTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = FormTests.xctest; sourceTree = BUILT_PRODUCTS_DIR; };
161161
F62E45B81CABFB5300C6867E /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
162162
F63863112090B73F00A43824 /* RowView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = RowView.swift; path = Form/RowView.swift; sourceTree = "<group>"; };
163-
F647306A20BFDFB1002BC8E3 /* RowsSelection.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = RowsSelection.swift; path = Form/RowsSelection.swift; sourceTree = "<group>"; };
164163
F64C27EA1C7B2C5B003CC378 /* TextStyle.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = TextStyle.swift; path = Form/TextStyle.swift; sourceTree = "<group>"; };
165164
F64C27EB1C7B2C5B003CC378 /* ButtonStyle.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = ButtonStyle.swift; path = Form/ButtonStyle.swift; sourceTree = "<group>"; };
166165
F65A9F7F1C7B1E8F007007B4 /* Form.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = Form.h; path = Form/Form.h; sourceTree = SOURCE_ROOT; };
@@ -179,7 +178,6 @@
179178
F666BB8E20BE9741006D2507 /* NumberEditor.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = NumberEditor.swift; path = Form/NumberEditor.swift; sourceTree = "<group>"; };
180179
F666BBD720BEDC31006D2507 /* FormFramework.podspec */ = {isa = PBXFileReference; lastKnownFileType = text; path = FormFramework.podspec; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.ruby; };
181180
F666BBD820BEDC32006D2507 /* LICENSE.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = LICENSE.md; sourceTree = "<group>"; };
182-
F666BBD920BEDC32006D2507 /* Cartfile */ = {isa = PBXFileReference; lastKnownFileType = text; path = Cartfile; sourceTree = "<group>"; };
183181
F666BBDA20BEDC32006D2507 /* CHANGELOG.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = CHANGELOG.md; sourceTree = "<group>"; };
184182
F66835CA2091B6DF002D2676 /* UIView+Embedding.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = "UIView+Embedding.swift"; path = "Form/UIView+Embedding.swift"; sourceTree = "<group>"; };
185183
F66835D52091CC32002D2676 /* UIResponders+Utilities.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = "UIResponders+Utilities.swift"; path = "Form/UIResponders+Utilities.swift"; sourceTree = "<group>"; };
@@ -234,6 +232,14 @@
234232
/* End PBXFileReference section */
235233

236234
/* Begin PBXFrameworksBuildPhase section */
235+
7592CA3B282BF9AB00920278 /* Frameworks */ = {
236+
isa = PBXFrameworksBuildPhase;
237+
buildActionMask = 2147483647;
238+
files = (
239+
7592CA3E282BF9DC00920278 /* Flow in Frameworks */,
240+
);
241+
runOnlyForDeploymentPostprocessing = 0;
242+
};
237243
F62E45B11CABFB5300C6867E /* Frameworks */ = {
238244
isa = PBXFrameworksBuildPhase;
239245
buildActionMask = 2147483647;
@@ -377,7 +383,6 @@
377383
F6A9D5D41C1728BA009A0EEB = {
378384
isa = PBXGroup;
379385
children = (
380-
F666BBD920BEDC32006D2507 /* Cartfile */,
381386
F666BBDA20BEDC32006D2507 /* CHANGELOG.md */,
382387
F666BBD720BEDC31006D2507 /* FormFramework.podspec */,
383388
F666BBD820BEDC32006D2507 /* LICENSE.md */,
@@ -438,7 +443,6 @@
438443
1CEED6CF21341FF300893573 /* ScrollViewDelegate.swift */,
439444
1C0656C11F82625E00E60465 /* UICollectionViewCell+Utilities.swift */,
440445
1CDA23EB1F8E3A3300CCC541 /* TableAnimatable.swift */,
441-
F647306A20BFDFB1002BC8E3 /* RowsSelection.swift */,
442446
);
443447
name = Tables;
444448
sourceTree = "<group>";
@@ -464,7 +468,6 @@
464468
F62E45B01CABFB5300C6867E /* Sources */,
465469
F62E45B11CABFB5300C6867E /* Frameworks */,
466470
F62E45B21CABFB5300C6867E /* Resources */,
467-
720D32F820E6A3570013FC29 /* Copy Flow */,
468471
);
469472
buildRules = (
470473
);
@@ -481,6 +484,7 @@
481484
buildConfigurationList = F6A9D5F21C1728BA009A0EEB /* Build configuration list for PBXNativeTarget "Form" */;
482485
buildPhases = (
483486
F6A9D5D91C1728BA009A0EEB /* Sources */,
487+
7592CA3B282BF9AB00920278 /* Frameworks */,
484488
F6A9D5DB1C1728BA009A0EEB /* Headers */,
485489
F6A9D5DC1C1728BA009A0EEB /* Resources */,
486490
ED7163CF2189C1A0008AD729 /* ShellScript */,
@@ -490,6 +494,9 @@
490494
dependencies = (
491495
);
492496
name = Form;
497+
packageProductDependencies = (
498+
7592CA3D282BF9DC00920278 /* Flow */,
499+
);
493500
productName = Layout;
494501
productReference = F6A9D5DE1C1728BA009A0EEB /* Form.framework */;
495502
productType = "com.apple.product-type.framework";
@@ -525,6 +532,9 @@
525532
Base,
526533
);
527534
mainGroup = F6A9D5D41C1728BA009A0EEB;
535+
packageReferences = (
536+
7592CA3C282BF9DB00920278 /* XCRemoteSwiftPackageReference "Flow" */,
537+
);
528538
productRefGroup = F6A9D5DF1C1728BA009A0EEB /* Products */;
529539
projectDirPath = "";
530540
projectRoot = "";
@@ -553,22 +563,6 @@
553563
/* End PBXResourcesBuildPhase section */
554564

555565
/* Begin PBXShellScriptBuildPhase section */
556-
720D32F820E6A3570013FC29 /* Copy Flow */ = {
557-
isa = PBXShellScriptBuildPhase;
558-
buildActionMask = 2147483647;
559-
files = (
560-
);
561-
inputPaths = (
562-
"$(SRCROOT)/Carthage/Build/iOS/Flow.framework",
563-
);
564-
name = "Copy Flow";
565-
outputPaths = (
566-
"$(DERIVED_FILE_DIR)/",
567-
);
568-
runOnlyForDeploymentPostprocessing = 0;
569-
shellPath = /bin/sh;
570-
shellScript = "/usr/local/bin/carthage copy-frameworks";
571-
};
572566
ED7163CF2189C1A0008AD729 /* ShellScript */ = {
573567
isa = PBXShellScriptBuildPhase;
574568
buildActionMask = 2147483647;
@@ -672,7 +666,6 @@
672666
F6C34D3A1C7F37DC00168CD9 /* DefaultStyling.swift in Sources */,
673667
F6A326EA1F94935200C3A692 /* UILabel+Styling.swift in Sources */,
674668
F6BFAFAD2090746C00CBA6B1 /* BarButtonStyle.swift in Sources */,
675-
F647306C20BFDFB1002BC8E3 /* RowsSelection.swift in Sources */,
676669
F6C2E5EA1C69FA0300453548 /* Table.swift in Sources */,
677670
F65A9F9C1C7B1EC6007007B4 /* SeparatorStyle.swift in Sources */,
678671
F67D37921C7B2EDD00A35BD4 /* TextEditor.swift in Sources */,
@@ -717,7 +710,11 @@
717710
CLANG_ANALYZER_NONNULL = YES;
718711
FRAMEWORK_SEARCH_PATHS = "$(PROJECT_DIR)/Carthage/Build/iOS";
719712
INFOPLIST_FILE = FormTests/Info.plist;
720-
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
713+
LD_RUNPATH_SEARCH_PATHS = (
714+
"$(inherited)",
715+
"@executable_path/Frameworks",
716+
"@loader_path/Frameworks",
717+
);
721718
PRODUCT_BUNDLE_IDENTIFIER = com.iZettle.FormTests;
722719
PRODUCT_NAME = "$(TARGET_NAME)";
723720
SWIFT_VERSION = 5.0;
@@ -730,7 +727,11 @@
730727
CLANG_ANALYZER_NONNULL = YES;
731728
FRAMEWORK_SEARCH_PATHS = "$(PROJECT_DIR)/Carthage/Build/iOS";
732729
INFOPLIST_FILE = FormTests/Info.plist;
733-
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
730+
LD_RUNPATH_SEARCH_PATHS = (
731+
"$(inherited)",
732+
"@executable_path/Frameworks",
733+
"@loader_path/Frameworks",
734+
);
734735
PRODUCT_BUNDLE_IDENTIFIER = com.iZettle.FormTests;
735736
PRODUCT_NAME = "$(TARGET_NAME)";
736737
SWIFT_VERSION = 5.0;
@@ -835,7 +836,8 @@
835836
IPHONEOS_DEPLOYMENT_TARGET = 9.0;
836837
MTL_ENABLE_DEBUG_INFO = NO;
837838
SDKROOT = iphoneos;
838-
SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule";
839+
SWIFT_COMPILATION_MODE = wholemodule;
840+
SWIFT_OPTIMIZATION_LEVEL = "-O";
839841
SWIFT_VERSION = 3.0;
840842
TARGETED_DEVICE_FAMILY = "1,2";
841843
VALIDATE_PRODUCT = YES;
@@ -856,8 +858,12 @@
856858
HEADER_SEARCH_PATHS = "$(SRCROOT)/**";
857859
INFOPLIST_FILE = Form/Info.plist;
858860
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
859-
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
860-
MARKETING_VERSION = 3.3.3;
861+
LD_RUNPATH_SEARCH_PATHS = (
862+
"$(inherited)",
863+
"@executable_path/Frameworks",
864+
"@loader_path/Frameworks",
865+
);
866+
MARKETING_VERSION = 4.0.0;
861867
PRODUCT_BUNDLE_IDENTIFIER = com.iZettle.Form;
862868
PRODUCT_NAME = Form;
863869
SKIP_INSTALL = YES;
@@ -877,8 +883,12 @@
877883
HEADER_SEARCH_PATHS = "$(SRCROOT)/**";
878884
INFOPLIST_FILE = Form/Info.plist;
879885
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
880-
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
881-
MARKETING_VERSION = 3.3.3;
886+
LD_RUNPATH_SEARCH_PATHS = (
887+
"$(inherited)",
888+
"@executable_path/Frameworks",
889+
"@loader_path/Frameworks",
890+
);
891+
MARKETING_VERSION = 4.0.0;
882892
PRODUCT_BUNDLE_IDENTIFIER = com.iZettle.Form;
883893
PRODUCT_NAME = Form;
884894
SKIP_INSTALL = YES;
@@ -917,6 +927,25 @@
917927
defaultConfigurationName = Release;
918928
};
919929
/* End XCConfigurationList section */
930+
931+
/* Begin XCRemoteSwiftPackageReference section */
932+
7592CA3C282BF9DB00920278 /* XCRemoteSwiftPackageReference "Flow" */ = {
933+
isa = XCRemoteSwiftPackageReference;
934+
repositoryURL = "https://github.com/iZettle/Flow.git";
935+
requirement = {
936+
kind = upToNextMajorVersion;
937+
minimumVersion = 1.10.1;
938+
};
939+
};
940+
/* End XCRemoteSwiftPackageReference section */
941+
942+
/* Begin XCSwiftPackageProductDependency section */
943+
7592CA3D282BF9DC00920278 /* Flow */ = {
944+
isa = XCSwiftPackageProductDependency;
945+
package = 7592CA3C282BF9DB00920278 /* XCRemoteSwiftPackageReference "Flow" */;
946+
productName = Flow;
947+
};
948+
/* End XCSwiftPackageProductDependency section */
920949
};
921950
rootObject = F6A9D5D51C1728BA009A0EEB /* Project object */;
922951
}

Form.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved

Lines changed: 16 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)