From a56ade614638a11738bacbd5420ef0e1bdd44f0c Mon Sep 17 00:00:00 2001 From: Javier Cicchelli Date: Sat, 16 Mar 2024 01:51:52 +0100 Subject: [PATCH] Created the Libraries package in the project and defined the Foundation library in it. --- Libraries/Package.swift | 57 +++++++++++++++++++++++++++++++ Reviews.xcodeproj/project.pbxproj | 2 ++ 2 files changed, 59 insertions(+) create mode 100644 Libraries/Package.swift diff --git a/Libraries/Package.swift b/Libraries/Package.swift new file mode 100644 index 0000000..2fa99db --- /dev/null +++ b/Libraries/Package.swift @@ -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" + } +} diff --git a/Reviews.xcodeproj/project.pbxproj b/Reviews.xcodeproj/project.pbxproj index 0c43e56..8cac310 100644 --- a/Reviews.xcodeproj/project.pbxproj +++ b/Reviews.xcodeproj/project.pbxproj @@ -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 = ""; }; + 02DC7FB12BA52084000EEEBE /* Libraries */ = {isa = PBXFileReference; lastKnownFileType = wrapper; path = Libraries; sourceTree = ""; }; 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 = ""; }; 345AD12424C6EDDC004E2EE1 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = ""; }; @@ -149,6 +150,7 @@ 345AD10F24C6EDD9004E2EE1 = { isa = PBXGroup; children = ( + 02DC7FB12BA52084000EEEBE /* Libraries */, 02DC7FAB2BA51848000EEEBE /* Frameworks */, 345AD11A24C6EDD9004E2EE1 /* App */, 345AD11924C6EDD9004E2EE1 /* Products */,