diff --git a/.gitignore b/.gitignore index 304a5a7..aca1ed3 100644 --- a/.gitignore +++ b/.gitignore @@ -25,3 +25,7 @@ DerivedData .bundle Pods/ + +# Swift Package Manager +.build/ +.swiftpm/ diff --git a/DeepLinkKit.xcodeproj/project.pbxproj b/DeepLinkKit.xcodeproj/project.pbxproj index 5e0a1b9..b8485ab 100644 --- a/DeepLinkKit.xcodeproj/project.pbxproj +++ b/DeepLinkKit.xcodeproj/project.pbxproj @@ -456,9 +456,7 @@ children = ( DECB32481A87C6270071C76E /* AppLinks */, DEB4EDBC1A4A036D00F31D14 /* DPLDeepLink_Private.h */, - DE058E0C1A3B484A00147C04 /* DPLDeepLink.h */, DE058E0D1A3B484A00147C04 /* DPLDeepLink.m */, - DECB32491A87C64E0071C76E /* DPLMutableDeepLink.h */, DECB324A1A87C64E0071C76E /* DPLMutableDeepLink.m */, ); path = DeepLink; @@ -488,7 +486,6 @@ DE16E91F1A42882F00077E18 /* Router */ = { isa = PBXGroup; children = ( - DE16E9201A42882F00077E18 /* DPLDeepLinkRouter.h */, DE16E9211A42882F00077E18 /* DPLDeepLinkRouter.m */, ); path = Router; @@ -567,16 +564,39 @@ name = BuildScripts; sourceTree = ""; }; + DE1000000000000000000001 /* include */ = { + isa = PBXGroup; + children = ( + DE1000000000000000000002 /* DeepLinkKit */, + ); + path = include; + sourceTree = ""; + }; + DE1000000000000000000002 /* DeepLinkKit */ = { + isa = PBXGroup; + children = ( + DEB4EDBD1A4A726200F31D14 /* DeepLinkKit.h */, + DE4128901A8BBE500089DAA2 /* AppLinks.h */, + DE058E0C1A3B484A00147C04 /* DPLDeepLink.h */, + DEA55ADB1A5F1A0700C312F5 /* DPLDeepLink+AppLinks.h */, + DECB32491A87C64E0071C76E /* DPLMutableDeepLink.h */, + DECB324B1A87C6750071C76E /* DPLMutableDeepLink+AppLinks.h */, + DE16E9201A42882F00077E18 /* DPLDeepLinkRouter.h */, + DEAC40701A5DA86A004A9095 /* DPLRouteHandler.h */, + DEAC406E1A5D97EE004A9095 /* DPLErrors.h */, + DE99EF781A3B83D100CE3449 /* DPLTargetViewControllerProtocol.h */, + ); + path = DeepLinkKit; + sourceTree = ""; + }; DE5DD32C19E0643F007FD439 /* DeepLinkKit */ = { isa = PBXGroup; children = ( BFDB96F11F3BFF8E001AE303 /* Info.plist */, - DEB4EDBD1A4A726200F31D14 /* DeepLinkKit.h */, + DE1000000000000000000001 /* include */, DEC308D91CAD70A5006828A5 /* DeepLinkKit_Private.h */, - DE4128901A8BBE500089DAA2 /* AppLinks.h */, DE99EF6A1A3B6CDD00CE3449 /* Protocols */, DE3E61071A3B4485008D6DFC /* Categories */, - DEB4EDBB1A49CEA400F31D14 /* Errors */, 83D34C3A1B03ECAD00BA6EF1 /* Regex */, DE16E91F1A42882F00077E18 /* Router */, DEAC406F1A5DA7B8004A9095 /* RouteHandler */, @@ -598,7 +618,6 @@ DE99EF6A1A3B6CDD00CE3449 /* Protocols */ = { isa = PBXGroup; children = ( - DE99EF781A3B83D100CE3449 /* DPLTargetViewControllerProtocol.h */, DEEBD4A51AAB6FBB000BCA84 /* DPLSerializable.h */, ); path = Protocols; @@ -627,7 +646,6 @@ DEAC406F1A5DA7B8004A9095 /* RouteHandler */ = { isa = PBXGroup; children = ( - DEAC40701A5DA86A004A9095 /* DPLRouteHandler.h */, DEAC40711A5DA86A004A9095 /* DPLRouteHandler.m */, ); path = RouteHandler; @@ -665,14 +683,6 @@ path = Tests; sourceTree = ""; }; - DEB4EDBB1A49CEA400F31D14 /* Errors */ = { - isa = PBXGroup; - children = ( - DEAC406E1A5D97EE004A9095 /* DPLErrors.h */, - ); - path = Errors; - sourceTree = ""; - }; DEC1B07F1A365213002BB838 /* SupportingFiles */ = { isa = PBXGroup; children = ( @@ -686,9 +696,7 @@ DECB32481A87C6270071C76E /* AppLinks */ = { isa = PBXGroup; children = ( - DEA55ADB1A5F1A0700C312F5 /* DPLDeepLink+AppLinks.h */, DEA55ADC1A5F1A0700C312F5 /* DPLDeepLink+AppLinks.m */, - DECB324B1A87C6750071C76E /* DPLMutableDeepLink+AppLinks.h */, DECB324C1A87C6750071C76E /* DPLMutableDeepLink+AppLinks.m */, ); name = AppLinks; diff --git a/DeepLinkKit/AppLinks.h b/DeepLinkKit/include/DeepLinkKit/AppLinks.h similarity index 100% rename from DeepLinkKit/AppLinks.h rename to DeepLinkKit/include/DeepLinkKit/AppLinks.h diff --git a/DeepLinkKit/DeepLink/DPLDeepLink+AppLinks.h b/DeepLinkKit/include/DeepLinkKit/DPLDeepLink+AppLinks.h similarity index 100% rename from DeepLinkKit/DeepLink/DPLDeepLink+AppLinks.h rename to DeepLinkKit/include/DeepLinkKit/DPLDeepLink+AppLinks.h diff --git a/DeepLinkKit/DeepLink/DPLDeepLink.h b/DeepLinkKit/include/DeepLinkKit/DPLDeepLink.h similarity index 100% rename from DeepLinkKit/DeepLink/DPLDeepLink.h rename to DeepLinkKit/include/DeepLinkKit/DPLDeepLink.h diff --git a/DeepLinkKit/Router/DPLDeepLinkRouter.h b/DeepLinkKit/include/DeepLinkKit/DPLDeepLinkRouter.h similarity index 100% rename from DeepLinkKit/Router/DPLDeepLinkRouter.h rename to DeepLinkKit/include/DeepLinkKit/DPLDeepLinkRouter.h diff --git a/DeepLinkKit/Errors/DPLErrors.h b/DeepLinkKit/include/DeepLinkKit/DPLErrors.h similarity index 100% rename from DeepLinkKit/Errors/DPLErrors.h rename to DeepLinkKit/include/DeepLinkKit/DPLErrors.h diff --git a/DeepLinkKit/DeepLink/DPLMutableDeepLink+AppLinks.h b/DeepLinkKit/include/DeepLinkKit/DPLMutableDeepLink+AppLinks.h similarity index 100% rename from DeepLinkKit/DeepLink/DPLMutableDeepLink+AppLinks.h rename to DeepLinkKit/include/DeepLinkKit/DPLMutableDeepLink+AppLinks.h diff --git a/DeepLinkKit/DeepLink/DPLMutableDeepLink.h b/DeepLinkKit/include/DeepLinkKit/DPLMutableDeepLink.h similarity index 100% rename from DeepLinkKit/DeepLink/DPLMutableDeepLink.h rename to DeepLinkKit/include/DeepLinkKit/DPLMutableDeepLink.h diff --git a/DeepLinkKit/RouteHandler/DPLRouteHandler.h b/DeepLinkKit/include/DeepLinkKit/DPLRouteHandler.h similarity index 100% rename from DeepLinkKit/RouteHandler/DPLRouteHandler.h rename to DeepLinkKit/include/DeepLinkKit/DPLRouteHandler.h diff --git a/DeepLinkKit/Protocols/DPLTargetViewControllerProtocol.h b/DeepLinkKit/include/DeepLinkKit/DPLTargetViewControllerProtocol.h similarity index 100% rename from DeepLinkKit/Protocols/DPLTargetViewControllerProtocol.h rename to DeepLinkKit/include/DeepLinkKit/DPLTargetViewControllerProtocol.h diff --git a/DeepLinkKit/DeepLinkKit.h b/DeepLinkKit/include/DeepLinkKit/DeepLinkKit.h similarity index 100% rename from DeepLinkKit/DeepLinkKit.h rename to DeepLinkKit/include/DeepLinkKit/DeepLinkKit.h diff --git a/DeepLinkKit/include/module.modulemap b/DeepLinkKit/include/module.modulemap new file mode 100644 index 0000000..f991c4d --- /dev/null +++ b/DeepLinkKit/include/module.modulemap @@ -0,0 +1,11 @@ +module DeepLinkKit { + umbrella header "DeepLinkKit/DeepLinkKit.h" + + // Opt-in AppLinks support. Not pulled in by the umbrella header, but still + // part of the module so it is reachable from Swift. + header "DeepLinkKit/AppLinks.h" + header "DeepLinkKit/DPLDeepLink+AppLinks.h" + header "DeepLinkKit/DPLMutableDeepLink+AppLinks.h" + + export * +} diff --git a/Package.swift b/Package.swift new file mode 100644 index 0000000..d1d6075 --- /dev/null +++ b/Package.swift @@ -0,0 +1,36 @@ +// swift-tools-version:5.9 + +import PackageDescription + +let package = Package( + name: "DeepLinkKit", + platforms: [ + .iOS(.v12), + .tvOS(.v12) + ], + products: [ + .library( + name: "DeepLinkKit", + targets: ["DeepLinkKit"] + ) + ], + targets: [ + .target( + name: "DeepLinkKit", + path: "DeepLinkKit", + exclude: ["Info.plist"], + publicHeadersPath: "include", + cSettings: [ + // Headers are imported by file name only, so every directory + // holding one has to be on the search path. + .headerSearchPath("."), + .headerSearchPath("include/DeepLinkKit"), + .headerSearchPath("Categories"), + .headerSearchPath("DeepLink"), + .headerSearchPath("Protocols"), + .headerSearchPath("Regex"), + .headerSearchPath("RouteMatcher") + ] + ) + ] +) diff --git a/README.md b/README.md index be848da..0f94178 100644 --- a/README.md +++ b/README.md @@ -37,6 +37,21 @@ the library, simply add the following line to your Podfile: pod "DeepLinkKit" ``` +### Swift Package Manager +DeepLinkKit is available through [Swift Package Manager](https://swift.org/package-manager/). +Add the package from Xcode via *File › Add Package Dependencies…* using the repository +URL, or add it to the `dependencies` of your `Package.swift`: + +```swift +.package(url: "https://github.com/button/DeepLinkKit.git", from: "1.5.1") +``` + +Then add `DeepLinkKit` to the targets that need it: + +```swift +.target(name: "MyApp", dependencies: ["DeepLinkKit"]) +``` + ### Carthage To install via Carthage, add the following line to your `Cartfile`: