Skip to content

Commit

Permalink
Merge pull request #52 from raptorxcz/feature/swift_package_manager
Browse files Browse the repository at this point in the history
Fix SPM
  • Loading branch information
jakubvano authored Aug 7, 2019
2 parents 776168e + 263c8c0 commit 8f41d8f
Show file tree
Hide file tree
Showing 9 changed files with 71 additions and 15 deletions.
29 changes: 26 additions & 3 deletions .Package.test.swift
Original file line number Diff line number Diff line change
@@ -1,10 +1,33 @@
// swift-tools-version:4.2

import PackageDescription

let package = Package(
name: "SwinjectAutoregistration",
products: [
.library(
name: "SwinjectAutoregistration",
targets: ["SwinjectAutoregistration"])
],
dependencies: [
.Package(url: "https://github.com/Swinject/Swinject.git", majorVersion: 2, minor: 5),
.Package(url: "https://github.com/Quick/Quick", majorVersion: 1),
.Package(url: "https://github.com/Quick/Nimble", majorVersion: 7),
.package(url: "https://github.com/Swinject/Swinject.git", from: "2.6.0"),
.package(url: "https://github.com/Quick/Quick", from: "2.1.0"),
.package(url: "https://github.com/Quick/Nimble", from: "8.0.1")
],
targets: [
.target(
name: "SwinjectAutoregistration",
dependencies: [
"Swinject",
],
path: "Sources"),
.testTarget(
name: "SwinjectAutoregistrationTests",
dependencies: [
"Quick",
"Nimble",
"Swinject",
"SwinjectAutoregistration",
])
]
)
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,5 @@ fastlane/screenshots

## SwinjectStoryboard
SwinjectStoryboard.framework.zip

Package.resolved
7 changes: 7 additions & 0 deletions .swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
6 changes: 3 additions & 3 deletions Cartfile.resolved
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
github "Quick/Nimble" "v8.0.1"
github "Quick/Quick" "v2.0.0"
github "Swinject/Swinject" "2.6.0"
github "Quick/Nimble" "v8.0.2"
github "Quick/Quick" "v2.1.0"
github "Swinject/Swinject" "2.6.2"
19 changes: 17 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,8 +1,23 @@
// swift-tools-version:4.2

import PackageDescription

let package = Package(
name: "SwinjectAutoregistration",
products: [
.library(
name: "SwinjectAutoregistration",
targets: ["SwinjectAutoregistration"])
],
dependencies: [
.Package(url: "https://github.com/Swinject/Swinject.git", majorVersion: 2)
.package(url: "https://github.com/Swinject/Swinject.git", from: "2.6.0"),
],
targets: [
.target(
name: "SwinjectAutoregistration",
dependencies: [
"Swinject",
],
path: "Sources"),
]
)
)
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,8 @@ class AutoregistrationSpec: QuickSpec {
let service = container.resolve(UnwrappedService.self)
expect(service).notTo(beNil())
}
#if !os(Linux)

#if !SWIFT_PACKAGE
it("throws assertion when same type arguments are passed") {
expect { () -> Void in
container.autoregister(SameArgumentsService.self, arguments: String.self, Int.self, String.self, initializer: SameArgumentsService.init)
Expand Down Expand Up @@ -237,8 +237,8 @@ class AutoregistrationSpec: QuickSpec {
expect(unresolvableService).to(beNil())
expect(logs.count) == 1
}
#if !os(Linux)

#if !SWIFT_PACKAGE
it("does not loose any logs while multithreading"){
var logs: [String] = []
Container.loggingFunction = { logs.append($0) }
Expand Down Expand Up @@ -266,6 +266,7 @@ class AutoregistrationSpec: QuickSpec {
}
#endif


}
}
}
4 changes: 2 additions & 2 deletions Tests/SwinjectAutoregistrationTests/OperatorsSpec.swift
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ class OperatorsSpec: QuickSpec {
let service = container ~> (Service0.self, name: "MyService")
expect(service).toNot(beNil())
}
#if !os(Linux)

#if !SWIFT_PACKAGE
it("fails with message on unresolvable service") {
var logs = [String]()
Container.loggingFunction = { logs.append($0) }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#if !os(Linux)
#if !SWIFT_PACKAGE
import Quick
import Nimble

Expand Down

0 comments on commit 8f41d8f

Please sign in to comment.