Updated the Package file to reflect the change in the folder structure, plus the libraries' target names have been renamed to avoid any possible ambiguity with any other 1st or 3rd party library.

This commit is contained in:
Javier Cicchelli 2023-08-11 23:19:33 +02:00
parent c29178535a
commit 5a8d3c0530
4 changed files with 43 additions and 31 deletions

View File

@ -14,56 +14,56 @@ import PackageDescription
// MARK: - Variables // MARK: - Variables
private var targetsLibrary: [String] = [ private var targetsLibrary: [String] = [
.Target.communications, .Target.communication,
.Target.coordination, .Target.coordination,
.Target.core, .Target.foundation,
.Target.dependencies, .Target.dependency,
] ]
private var targetsPackage: [Target] = [ private var targetsPackage: [Target] = [
.target( .target(
name: .Target.communications, name: .Target.communication,
dependencies: [] path: "Libraries/Communication"
), ),
.target( .target(
name: .Target.coordination, name: .Target.coordination,
dependencies: [] path: "Libraries/Coordination"
), ),
.target( .target(
name: .Target.core, name: .Target.foundation,
dependencies: [] path: "Libraries/Foundation"
), ),
.target( .target(
name: .Target.dependencies, name: .Target.dependency,
dependencies: [] path: "Libraries/Dependency"
), ),
.testTarget( .testTarget(
name: "CommunicationsTests", name: .Target.communication.tests,
dependencies: [ dependencies: [
.init(stringLiteral: .Target.communications) .init(stringLiteral: .Target.communication)
], ],
path: "Tests/Communications" path: "Tests/Communication"
), ),
.testTarget( .testTarget(
name: "CoordinationTests", name: .Target.coordination.tests,
dependencies: [ dependencies: [
.init(stringLiteral: .Target.coordination) .init(stringLiteral: .Target.coordination)
], ],
path: "Tests/Coordination" path: "Tests/Coordination"
), ),
.testTarget( .testTarget(
name: "CoreTests", name: .Target.foundation.tests,
dependencies: [ dependencies: [
.init(stringLiteral: .Target.core) .init(stringLiteral: .Target.foundation)
], ],
path: "Tests/Core" path: "Tests/Foundation"
), ),
.testTarget( .testTarget(
name: "DependenciesTests", name: .Target.dependency.tests,
dependencies: [ dependencies: [
.init(stringLiteral: .Target.dependencies) .init(stringLiteral: .Target.dependency)
], ],
path: "Tests/Dependencies" path: "Tests/Dependency"
), ),
] ]
@ -72,10 +72,10 @@ targetsLibrary.append(.Target.persistence)
targetsPackage.append(contentsOf: [ targetsPackage.append(contentsOf: [
.target( .target(
name: .Target.persistence, name: .Target.persistence,
dependencies: [] path: "Libraries/Persistence"
), ),
.testTarget( .testTarget(
name: "PersistenceTests", name: .Target.persistence.tests,
dependencies: [ dependencies: [
.init(stringLiteral: .Target.persistence) .init(stringLiteral: .Target.persistence)
], ],
@ -100,7 +100,7 @@ let package = Package(
], ],
products: [ products: [
.library( .library(
name: .Package.name, name: .Library.name,
targets: targetsLibrary targets: targetsLibrary
), ),
], ],
@ -112,14 +112,26 @@ let package = Package(
private extension String { private extension String {
enum Package { enum Package {
static let name = "swift-libs"
}
enum Library {
static let name = "SwiftLibs" static let name = "SwiftLibs"
} }
enum Target { enum Target {
static let communications = "Communications" static let communication = "SwiftLibsCommunication"
static let coordination = "Coordination" static let coordination = "SwiftLibsCoordination"
static let core = "Core" static let foundation = "SwiftLibsFoundation"
static let dependencies = "Dependencies" static let dependency = "SwiftLibsDependency"
static let persistence = "Persistence" static let persistence = "SwiftLibsPersistence"
}
}
// MARK: - String+Computed
private extension String {
var tests: String {
"\(self)Tests"
} }
} }

View File

@ -11,7 +11,7 @@
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
import Combine import Combine
import Persistence import SwiftLibsPersistence
import XCTest import XCTest
final class FetcherTests: XCTestCase { final class FetcherTests: XCTestCase {

View File

@ -11,7 +11,7 @@
//===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===//
import Foundation import Foundation
import Persistence import SwiftLibsPersistence
import XCTest import XCTest
final class URL_DevicesTests: XCTestCase { final class URL_DevicesTests: XCTestCase {

View File

@ -12,7 +12,7 @@
import CoreData import CoreData
import Foundation import Foundation
import Persistence import SwiftLibsPersistence
struct TestPersistenceService { struct TestPersistenceService {