Skip to content

Commit fd512cd

Browse files
Merge pull request #5 from novasamatech/feature/package-update
SPM update
2 parents 343c495 + c58bcea commit fd512cd

32 files changed

+225
-65
lines changed

Package.swift

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
// swift-tools-version: 5.9
2+
// The swift-tools-version declares the minimum version of Swift required to build this package.
3+
4+
import PackageDescription
5+
6+
let name = "Operation-iOS"
7+
let package = Package(
8+
name: name,
9+
platforms: [.iOS(.v14)],
10+
products: [
11+
// Products define the executables and libraries a package produces, making them visible to other packages.
12+
.library(
13+
name: name,
14+
targets: [name]),
15+
],
16+
targets: [
17+
.target(
18+
name: name,
19+
path: "Operation-iOS/Classes"
20+
),
21+
.testTarget(
22+
name: "CoreDataTests",
23+
dependencies: [
24+
"Operation-iOS",
25+
"Helpers"
26+
],
27+
path: "Tests/CoreData"
28+
),
29+
.testTarget(
30+
name: "DataProviderTests",
31+
dependencies: [
32+
"Operation-iOS",
33+
"Helpers"
34+
],
35+
path: "Tests/DataProvider"
36+
),
37+
// Operation-iOS uses FireMock which supports only Cocoapods
38+
// SPM NetworkTests are disabled for now
39+
// .testTarget(
40+
// name: "NetworkTests",
41+
// dependencies: [
42+
// "Operation-iOS",
43+
// "Helpers"
44+
// ],
45+
// path: "Tests/Network"
46+
// ),
47+
.testTarget(
48+
name: "OperationTests",
49+
dependencies: [
50+
"Operation-iOS",
51+
"Helpers"
52+
],
53+
path: "Tests/Operation"
54+
),
55+
.target(
56+
name: "Helpers",
57+
dependencies: [
58+
"Operation-iOS"
59+
],
60+
path: "Tests/Helpers",
61+
exclude: ["Network"],
62+
resources: [
63+
.process("CoreData/Model/IEntities.xcdatamodeld"),
64+
.process("CoreData/Model/Entities.xcdatamodeld")
65+
]
66+
)
67+
],
68+
swiftLanguageVersions: [.v5]
69+
)

Tests/CoreData/CoreDataCompatibilityTests.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import XCTest
22
import Operation_iOS
33
import CoreData
4+
#if SWIFT_PACKAGE
5+
import Helpers
6+
#endif
47

58
class CoreDataCompatibilityTests: XCTestCase {
69
let defaultCoreDataService: CoreDataServiceProtocol = {

Tests/CoreData/CoreDataRepositoryDomainTests.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
import XCTest
22
@testable import Operation_iOS
3+
#if SWIFT_PACKAGE
4+
import Helpers
5+
#endif
36

47
class CoreDataRepositoryDomainTests: XCTestCase {
58
var defaultDomainRepository: CoreDataRepository<FeedData, CDFeed> = {

Tests/CoreData/CoreDataRepositoryTests.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
import XCTest
22
@testable import Operation_iOS
3+
#if SWIFT_PACKAGE
4+
import Helpers
5+
#endif
36

47
class CoreDataRepositoryTests: XCTestCase {
58
override func setUp() {

Tests/CoreData/CoreDataServiceTests.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
import XCTest
22
@testable import Operation_iOS
3+
#if SWIFT_PACKAGE
4+
import Helpers
5+
#endif
36

47
class CoreDataServiceTests: XCTestCase {
58
let databaseService: CoreDataService = {

Tests/CoreData/NestedEntitiesTests.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
import XCTest
22
@testable import Operation_iOS
3+
#if SWIFT_PACKAGE
4+
import Helpers
5+
#endif
36

47
class NestedEntitiesTests: XCTestCase {
58

Tests/DataProvider/CoreDataContextObserverNestedTests.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
import XCTest
22
@testable import Operation_iOS
3+
#if SWIFT_PACKAGE
4+
import Helpers
5+
#endif
36

47
class CoreDataContextObserverNestedTests: XCTestCase {
58
func testNotificationDeliveredWhenSeveralItemsUpdated() {

Tests/DataProvider/CoreDataContextObserverTests.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import XCTest
22
import CoreData
33
@testable import Operation_iOS
4+
#if SWIFT_PACKAGE
5+
import Helpers
6+
#endif
47

58
class CoreDataContextObserverTests: XCTestCase {
69
let repository: CoreDataRepository<FeedData, CDFeed> = {

Tests/DataProvider/DataProvider/DataProviderBaseTests.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
import XCTest
22
@testable import Operation_iOS
3+
#if SWIFT_PACKAGE
4+
import Helpers
5+
#endif
36

47
class DataProviderBaseTests: XCTestCase {
58

Tests/DataProvider/DataProvider/DataProviderInterfaceTests.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
import XCTest
22
@testable import Operation_iOS
3+
#if SWIFT_PACKAGE
4+
import Helpers
5+
#endif
36

47
class DataProviderTests: DataProviderBaseTests {
58
let repository: CoreDataRepository<FeedData, CDFeed> = CoreDataRepositoryFacade.shared.createCoreDataRepository()

0 commit comments

Comments
 (0)