-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
460 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
{ | ||
"pins" : [ | ||
{ | ||
"identity" : "jjliso8601dateformatter", | ||
"kind" : "remoteSourceControl", | ||
"location" : "https://github.com/michaeleisel/JJLISO8601DateFormatter", | ||
"state" : { | ||
"revision" : "de422afd9a47b72703c30a81423c478337191390", | ||
"version" : "0.1.6" | ||
} | ||
}, | ||
{ | ||
"identity" : "swift-argument-parser", | ||
"kind" : "remoteSourceControl", | ||
"location" : "https://github.com/apple/swift-argument-parser.git", | ||
"state" : { | ||
"revision" : "c8ed701b513cf5177118a175d85fbbbcd707ab41", | ||
"version" : "1.3.0" | ||
} | ||
}, | ||
{ | ||
"identity" : "swift-collections", | ||
"kind" : "remoteSourceControl", | ||
"location" : "https://github.com/apple/swift-collections.git", | ||
"state" : { | ||
"revision" : "a902f1823a7ff3c9ab2fba0f992396b948eda307", | ||
"version" : "1.0.5" | ||
} | ||
}, | ||
{ | ||
"identity" : "swift-syntax", | ||
"kind" : "remoteSourceControl", | ||
"location" : "https://github.com/apple/swift-syntax.git", | ||
"state" : { | ||
"revision" : "6ad4ea24b01559dde0773e3d091f1b9e36175036", | ||
"version" : "509.0.2" | ||
} | ||
}, | ||
{ | ||
"identity" : "zippyjson", | ||
"kind" : "remoteSourceControl", | ||
"location" : "https://github.com/michaeleisel/ZippyJSON.git", | ||
"state" : { | ||
"revision" : "c4ab804780b64979f19268619dfa563b6be58f7d", | ||
"version" : "1.2.10" | ||
} | ||
}, | ||
{ | ||
"identity" : "zippyjsoncfamily", | ||
"kind" : "remoteSourceControl", | ||
"location" : "https://github.com/michaeleisel/ZippyJSONCFamily", | ||
"state" : { | ||
"revision" : "8abdd7a5e943afe68e7b03fdaa63b21c042a3893", | ||
"version" : "1.2.9" | ||
} | ||
} | ||
], | ||
"version" : 2 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
// swift-tools-version: 5.9 | ||
// The swift-tools-version declares the minimum version of Swift required to build this package. | ||
|
||
import PackageDescription | ||
|
||
let package = Package( | ||
name: "ExamplePackageIntegration", | ||
platforms: [ | ||
.macOS(.v10_15), | ||
.iOS(.v13), | ||
.tvOS(.v13), | ||
.watchOS(.v6), | ||
.macCatalyst(.v13) | ||
], | ||
products: [ | ||
// Products define the executables and libraries a package produces, making them visible to other packages. | ||
.library( | ||
name: "ExamplePackageIntegration", | ||
targets: ["RootModule"]), | ||
], | ||
dependencies: [ | ||
.package(path: "../../") | ||
], | ||
targets: [ | ||
// Targets are the basic building blocks of a package, defining a module or a test suite. | ||
// Targets can depend on other targets in this package and products from dependencies. | ||
.rootTarget( | ||
name: "RootModule", | ||
dependencies: [ | ||
"SharedModule", | ||
"ChildAModule", | ||
"ChildBModule", | ||
"ChildCModule", | ||
] | ||
), | ||
.nonRootTarget( | ||
name: "ChildAModule", | ||
dependencies: [ | ||
"SharedModule", | ||
"GrandchildrenModule", | ||
] | ||
), | ||
.nonRootTarget( | ||
name: "ChildBModule", | ||
dependencies: [ | ||
"SharedModule", | ||
"GrandchildrenModule", | ||
] | ||
), | ||
.nonRootTarget( | ||
name: "ChildCModule", | ||
dependencies: [ | ||
"SharedModule", | ||
"GrandchildrenModule", | ||
] | ||
), | ||
.nonRootTarget( | ||
name: "GrandchildrenModule", | ||
dependencies: [ | ||
"SharedModule" | ||
] | ||
), | ||
.nonRootTarget(name: "SharedModule"), | ||
] | ||
) | ||
|
||
extension Target { | ||
static func rootTarget(name: String, dependencies: [Target.Dependency] = []) -> Target { | ||
.target( | ||
name: name, | ||
dependencies: [ | ||
"SafeDI", | ||
] + dependencies, | ||
plugins: [ | ||
.plugin(name: "SafeDIGenerateDependencyTree", package: "SafeDI"), | ||
] | ||
) | ||
} | ||
|
||
static func nonRootTarget(name: String, dependencies: [Target.Dependency] = []) -> Target { | ||
.target( | ||
name: name, | ||
dependencies: [ | ||
"SafeDI", | ||
] + dependencies, | ||
plugins: [ | ||
.plugin(name: "SafeDICollectInstantiables", package: "SafeDI"), | ||
] | ||
) | ||
} | ||
} |
39 changes: 39 additions & 0 deletions
39
Examples/ExamplePackageIntegration/Sources/ChildAModule/ChildA.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
// Distributed under the MIT License | ||
// | ||
// Permission is hereby granted, free of charge, to any person obtaining a copy | ||
// of this software and associated documentation files (the "Software"), to deal | ||
// in the Software without restriction, including without limitation the rights | ||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
// copies of the Software, and to permit persons to whom the Software is | ||
// furnished to do so, subject to the following conditions: | ||
// | ||
// The above copyright notice and this permission notice shall be included in all | ||
// copies or substantial portions of the Software. | ||
// | ||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
// SOFTWARE. | ||
|
||
import GrandchildrenModule | ||
import SafeDI | ||
import SharedModule | ||
|
||
@Instantiable | ||
public final class ChildA { | ||
|
||
public init(shared: SharedThing, grandchildA: GrandchildA) { | ||
self.shared = shared | ||
self.grandchildA = grandchildA | ||
} | ||
|
||
@Received | ||
let shared: SharedThing | ||
|
||
@Instantiated | ||
let grandchildA: GrandchildA | ||
|
||
} |
39 changes: 39 additions & 0 deletions
39
Examples/ExamplePackageIntegration/Sources/ChildBModule/ChildB.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
// Distributed under the MIT License | ||
// | ||
// Permission is hereby granted, free of charge, to any person obtaining a copy | ||
// of this software and associated documentation files (the "Software"), to deal | ||
// in the Software without restriction, including without limitation the rights | ||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
// copies of the Software, and to permit persons to whom the Software is | ||
// furnished to do so, subject to the following conditions: | ||
// | ||
// The above copyright notice and this permission notice shall be included in all | ||
// copies or substantial portions of the Software. | ||
// | ||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
// SOFTWARE. | ||
|
||
import GrandchildrenModule | ||
import SafeDI | ||
import SharedModule | ||
|
||
@Instantiable | ||
public final class ChildB { | ||
|
||
public init(shared: SharedThing, grandchildB: GrandchildB) { | ||
self.shared = shared | ||
self.grandchildB = grandchildB | ||
} | ||
|
||
@Received | ||
let shared: SharedThing | ||
|
||
@Instantiated | ||
let grandchildB: GrandchildB | ||
|
||
} |
39 changes: 39 additions & 0 deletions
39
Examples/ExamplePackageIntegration/Sources/ChildCModule/ChildC.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
// Distributed under the MIT License | ||
// | ||
// Permission is hereby granted, free of charge, to any person obtaining a copy | ||
// of this software and associated documentation files (the "Software"), to deal | ||
// in the Software without restriction, including without limitation the rights | ||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
// copies of the Software, and to permit persons to whom the Software is | ||
// furnished to do so, subject to the following conditions: | ||
// | ||
// The above copyright notice and this permission notice shall be included in all | ||
// copies or substantial portions of the Software. | ||
// | ||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
// SOFTWARE. | ||
|
||
import GrandchildrenModule | ||
import SafeDI | ||
import SharedModule | ||
|
||
@Instantiable | ||
public final class ChildC { | ||
|
||
public init(shared: SharedThing, grandchildC: GrandchildC) { | ||
self.shared = shared | ||
self.grandchildC = grandchildC | ||
} | ||
|
||
@Received | ||
let shared: SharedThing | ||
|
||
@Instantiated | ||
let grandchildC: GrandchildC | ||
|
||
} |
34 changes: 34 additions & 0 deletions
34
Examples/ExamplePackageIntegration/Sources/GrandchildrenModule/GrandchildA.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// Distributed under the MIT License | ||
// | ||
// Permission is hereby granted, free of charge, to any person obtaining a copy | ||
// of this software and associated documentation files (the "Software"), to deal | ||
// in the Software without restriction, including without limitation the rights | ||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
// copies of the Software, and to permit persons to whom the Software is | ||
// furnished to do so, subject to the following conditions: | ||
// | ||
// The above copyright notice and this permission notice shall be included in all | ||
// copies or substantial portions of the Software. | ||
// | ||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
// SOFTWARE. | ||
|
||
import SafeDI | ||
import SharedModule | ||
|
||
@Instantiable | ||
public final class GrandchildA { | ||
|
||
public init(shared: SharedThing) { | ||
self.shared = shared | ||
} | ||
|
||
@Received | ||
let shared: SharedThing | ||
|
||
} |
34 changes: 34 additions & 0 deletions
34
Examples/ExamplePackageIntegration/Sources/GrandchildrenModule/GrandchildB.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// Distributed under the MIT License | ||
// | ||
// Permission is hereby granted, free of charge, to any person obtaining a copy | ||
// of this software and associated documentation files (the "Software"), to deal | ||
// in the Software without restriction, including without limitation the rights | ||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
// copies of the Software, and to permit persons to whom the Software is | ||
// furnished to do so, subject to the following conditions: | ||
// | ||
// The above copyright notice and this permission notice shall be included in all | ||
// copies or substantial portions of the Software. | ||
// | ||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
// SOFTWARE. | ||
|
||
import SafeDI | ||
import SharedModule | ||
|
||
@Instantiable | ||
public actor GrandchildB { | ||
|
||
public init(shared: SharedThing) { | ||
self.shared = shared | ||
} | ||
|
||
@Received | ||
let shared: SharedThing | ||
|
||
} |
34 changes: 34 additions & 0 deletions
34
Examples/ExamplePackageIntegration/Sources/GrandchildrenModule/GrandchildC.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// Distributed under the MIT License | ||
// | ||
// Permission is hereby granted, free of charge, to any person obtaining a copy | ||
// of this software and associated documentation files (the "Software"), to deal | ||
// in the Software without restriction, including without limitation the rights | ||
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
// copies of the Software, and to permit persons to whom the Software is | ||
// furnished to do so, subject to the following conditions: | ||
// | ||
// The above copyright notice and this permission notice shall be included in all | ||
// copies or substantial portions of the Software. | ||
// | ||
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
// SOFTWARE. | ||
|
||
import SafeDI | ||
import SharedModule | ||
|
||
@Instantiable | ||
public struct GrandchildC { | ||
|
||
public init(shared: SharedThing) { | ||
self.shared = shared | ||
} | ||
|
||
@Received | ||
let shared: SharedThing | ||
|
||
} |
Oops, something went wrong.