From 70d4fcd33e574d08f9c35853c4d2cbb5eb232990 Mon Sep 17 00:00:00 2001 From: Mathieu GROUSSEAU Date: Sat, 8 Feb 2025 09:05:08 +0100 Subject: [PATCH] Add package --- CLI/CLI.xcodeproj/project.pbxproj | 12 ++++++++++ .../contents.xcworkspacedata | 3 +++ Persistance/.gitignore | 8 +++++++ Persistance/Package.swift | 23 +++++++++++++++++++ .../Sources/Persistance/Persistance.swift | 1 + 5 files changed, 47 insertions(+) create mode 100644 Persistance/.gitignore create mode 100644 Persistance/Package.swift create mode 100644 Persistance/Sources/Persistance/Persistance.swift diff --git a/CLI/CLI.xcodeproj/project.pbxproj b/CLI/CLI.xcodeproj/project.pbxproj index 40266be..620d5eb 100644 --- a/CLI/CLI.xcodeproj/project.pbxproj +++ b/CLI/CLI.xcodeproj/project.pbxproj @@ -9,6 +9,7 @@ /* Begin PBXBuildFile section */ 282549B82D3278F9008D2C3B /* main.swift in Sources */ = {isa = PBXBuildFile; fileRef = 282549B72D3278F9008D2C3B /* main.swift */; }; 282549C02D327907008D2C3B /* Model in Frameworks */ = {isa = PBXBuildFile; productRef = 282549BF2D327907008D2C3B /* Model */; }; + EC6173932D57473D00B099CD /* Persistance in Frameworks */ = {isa = PBXBuildFile; productRef = EC6173922D57473D00B099CD /* Persistance */; }; EC9914352D40233000C0459C /* CustomTypes in Frameworks */ = {isa = PBXBuildFile; productRef = EC9914342D40233000C0459C /* CustomTypes */; }; /* End PBXBuildFile section */ @@ -34,6 +35,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + EC6173932D57473D00B099CD /* Persistance in Frameworks */, 282549C02D327907008D2C3B /* Model in Frameworks */, EC9914352D40233000C0459C /* CustomTypes in Frameworks */, ); @@ -93,6 +95,7 @@ packageProductDependencies = ( 282549BF2D327907008D2C3B /* Model */, EC9914342D40233000C0459C /* CustomTypes */, + EC6173922D57473D00B099CD /* Persistance */, ); productName = CLI; productReference = 282549B42D3278F9008D2C3B /* CLI */; @@ -124,6 +127,7 @@ mainGroup = 282549AB2D3278F9008D2C3B; packageReferences = ( EC9914332D40233000C0459C /* XCLocalSwiftPackageReference "../CustomTypes" */, + EC6173912D57473D00B099CD /* XCLocalSwiftPackageReference "../Persistance" */, ); productRefGroup = 282549B52D3278F9008D2C3B /* Products */; projectDirPath = ""; @@ -307,6 +311,10 @@ /* End XCConfigurationList section */ /* Begin XCLocalSwiftPackageReference section */ + EC6173912D57473D00B099CD /* XCLocalSwiftPackageReference "../Persistance" */ = { + isa = XCLocalSwiftPackageReference; + relativePath = ../Persistance; + }; EC9914332D40233000C0459C /* XCLocalSwiftPackageReference "../CustomTypes" */ = { isa = XCLocalSwiftPackageReference; relativePath = ../CustomTypes; @@ -318,6 +326,10 @@ isa = XCSwiftPackageProductDependency; productName = Model; }; + EC6173922D57473D00B099CD /* Persistance */ = { + isa = XCSwiftPackageProductDependency; + productName = Persistance; + }; EC9914342D40233000C0459C /* CustomTypes */ = { isa = XCSwiftPackageProductDependency; productName = CustomTypes; diff --git a/Connect 4.xcworkspace/contents.xcworkspacedata b/Connect 4.xcworkspace/contents.xcworkspacedata index 7d0dd6c..ca908c0 100644 --- a/Connect 4.xcworkspace/contents.xcworkspacedata +++ b/Connect 4.xcworkspace/contents.xcworkspacedata @@ -1,6 +1,9 @@ + + diff --git a/Persistance/.gitignore b/Persistance/.gitignore new file mode 100644 index 0000000..0023a53 --- /dev/null +++ b/Persistance/.gitignore @@ -0,0 +1,8 @@ +.DS_Store +/.build +/Packages +xcuserdata/ +DerivedData/ +.swiftpm/configuration/registries.json +.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata +.netrc diff --git a/Persistance/Package.swift b/Persistance/Package.swift new file mode 100644 index 0000000..ff1182b --- /dev/null +++ b/Persistance/Package.swift @@ -0,0 +1,23 @@ +// swift-tools-version: 5.10 +// The swift-tools-version declares the minimum version of Swift required to build this package. + +import PackageDescription + +let package = Package( + name: "Persistance", + products: [ + // Products define the executables and libraries a package produces, making them visible to other packages. + .library( + name: "Persistance", + targets: ["Persistance"]), + ], + dependencies: [ + .package(path: "../Model") + ], + targets: [ + // Targets are the basic building blocks of a package, defining a module or a test suite. + // Targets can depend on other targets in this package and products from dependencies. + .target( + name: "Persistance"), + ] +) diff --git a/Persistance/Sources/Persistance/Persistance.swift b/Persistance/Sources/Persistance/Persistance.swift new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/Persistance/Sources/Persistance/Persistance.swift @@ -0,0 +1 @@ +