Created the Libraries package in the project and defined the Foundation library in it.

This commit is contained in:
Javier Cicchelli 2024-03-16 01:51:52 +01:00
parent 8fc4bb165e
commit a56ade6146
2 changed files with 59 additions and 0 deletions

57
Libraries/Package.swift Normal file
View File

@ -0,0 +1,57 @@
// swift-tools-version: 5.10
import PackageDescription
let package = Package(
name: .Package.name,
platforms: [
.iOS(.v14)
],
products: [
.library(
name: .Product.name.kit,
targets: [
.Target.foundation
]
),
],
targets: [
.target(
name: .Target.foundation,
path: "Foundation/Kit"
),
.testTarget(
name: .Target.foundation.test,
dependencies: [
.byName(name: .Target.foundation)
],
path: "Foundation/Test"
),
]
)
// MARK: - String+Constants
private extension String {
enum Package {
static let name = "reviews-kit"
}
enum Product {
static let name = "Reviews"
}
enum Target {
static let foundation = "\(String.Product.name)Foundation"
}
}
// MARK: - String+Computed
private extension String {
var kit: String {
"\(self)Kit"
}
var test: String {
"\(self)Test"
}
}

View File

@ -46,6 +46,7 @@
/* Begin PBXFileReference section */
02DC7F8F2BA51793000EEEBE /* ReviewsFeed.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = ReviewsFeed.framework; sourceTree = BUILT_PRODUCTS_DIR; };
02DC7F912BA51793000EEEBE /* ReviewsFeed.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ReviewsFeed.h; sourceTree = "<group>"; };
02DC7FB12BA52084000EEEBE /* Libraries */ = {isa = PBXFileReference; lastKnownFileType = wrapper; path = Libraries; sourceTree = "<group>"; };
345AD11824C6EDD9004E2EE1 /* Reviews.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Reviews.app; sourceTree = BUILT_PRODUCTS_DIR; };
345AD11B24C6EDD9004E2EE1 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
345AD12424C6EDDC004E2EE1 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
@ -149,6 +150,7 @@
345AD10F24C6EDD9004E2EE1 = {
isa = PBXGroup;
children = (
02DC7FB12BA52084000EEEBE /* Libraries */,
02DC7FAB2BA51848000EEEBE /* Frameworks */,
345AD11A24C6EDD9004E2EE1 /* App */,
345AD11924C6EDD9004E2EE1 /* Products */,