From db11dfa31df196731bc74b422735f1a7105e7248 Mon Sep 17 00:00:00 2001 From: Javier Cicchelli Date: Sat, 3 Dec 2022 12:02:38 +0100 Subject: [PATCH] Created the Libraries SPM package. --- BeReal.xcodeproj/project.pbxproj | 29 ++++++------------- BeReal/Extensions/String+Constants.swift | 11 ------- Libraries/.gitignore | 9 ++++++ Libraries/Package.swift | 22 ++++++++++++++ Libraries/Sources/Libraries/Libraries.swift | 6 ++++ .../Tests/LibrariesTests/LibrariesTests.swift | 11 +++++++ 6 files changed, 57 insertions(+), 31 deletions(-) delete mode 100644 BeReal/Extensions/String+Constants.swift create mode 100644 Libraries/.gitignore create mode 100644 Libraries/Package.swift create mode 100644 Libraries/Sources/Libraries/Libraries.swift create mode 100644 Libraries/Tests/LibrariesTests/LibrariesTests.swift diff --git a/BeReal.xcodeproj/project.pbxproj b/BeReal.xcodeproj/project.pbxproj index 03762d3..212a117 100644 --- a/BeReal.xcodeproj/project.pbxproj +++ b/BeReal.xcodeproj/project.pbxproj @@ -7,6 +7,7 @@ objects = { /* Begin PBXBuildFile section */ + 026D9825293B6374009FE888 /* Libraries in Frameworks */ = {isa = PBXBuildFile; productRef = 026D9824293B6374009FE888 /* Libraries */; }; 02AE64EF29363DBF005A4AF3 /* BeRealApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 02AE64EE29363DBF005A4AF3 /* BeRealApp.swift */; }; 02AE64F129363DBF005A4AF3 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 02AE64F029363DBF005A4AF3 /* ContentView.swift */; }; 02AE64F329363DC1005A4AF3 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 02AE64F229363DC1005A4AF3 /* Assets.xcassets */; }; @@ -14,7 +15,6 @@ 02AE650029363DC1005A4AF3 /* BeRealTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 02AE64FF29363DC1005A4AF3 /* BeRealTests.swift */; }; 02AE650A29363DC1005A4AF3 /* BeRealUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 02AE650929363DC1005A4AF3 /* BeRealUITests.swift */; }; 02AE650C29363DC1005A4AF3 /* BeRealUITestsLaunchTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 02AE650B29363DC1005A4AF3 /* BeRealUITestsLaunchTests.swift */; }; - 02FFFD7B29395DD200306533 /* String+Constants.swift in Sources */ = {isa = PBXBuildFile; fileRef = 02FFFD7A29395DD200306533 /* String+Constants.swift */; }; 4694AAA0293A7C8800D54903 /* Modules in Frameworks */ = {isa = PBXBuildFile; productRef = 4694AA9F293A7C8800D54903 /* Modules */; }; /* End PBXBuildFile section */ @@ -36,6 +36,7 @@ /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ + 026D9823293B6365009FE888 /* Libraries */ = {isa = PBXFileReference; lastKnownFileType = wrapper; path = Libraries; sourceTree = ""; }; 02784F03293A8331005F839D /* Modules */ = {isa = PBXFileReference; lastKnownFileType = wrapper; path = Modules; sourceTree = ""; }; 02AE64EB29363DBF005A4AF3 /* BeReal.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = BeReal.app; sourceTree = BUILT_PRODUCTS_DIR; }; 02AE64EE29363DBF005A4AF3 /* BeRealApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BeRealApp.swift; sourceTree = ""; }; @@ -47,7 +48,6 @@ 02AE650529363DC1005A4AF3 /* BeRealUITests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = BeRealUITests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 02AE650929363DC1005A4AF3 /* BeRealUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BeRealUITests.swift; sourceTree = ""; }; 02AE650B29363DC1005A4AF3 /* BeRealUITestsLaunchTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BeRealUITestsLaunchTests.swift; sourceTree = ""; }; - 02FFFD7A29395DD200306533 /* String+Constants.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "String+Constants.swift"; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -55,6 +55,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( + 026D9825293B6374009FE888 /* Libraries in Frameworks */, 4694AAA0293A7C8800D54903 /* Modules in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; @@ -79,6 +80,7 @@ 02AE64E229363DBF005A4AF3 = { isa = PBXGroup; children = ( + 026D9823293B6365009FE888 /* Libraries */, 02784F03293A8331005F839D /* Modules */, 02AE64ED29363DBF005A4AF3 /* BeReal */, 02AE64FE29363DC1005A4AF3 /* BeRealTests */, @@ -101,8 +103,6 @@ 02AE64ED29363DBF005A4AF3 /* BeReal */ = { isa = PBXGroup; children = ( - 02CE555F293B44C900730DC9 /* Profile */, - 02FFFD7929395DBF00306533 /* Extensions */, 02AE64EE29363DBF005A4AF3 /* BeRealApp.swift */, 02AE64F029363DBF005A4AF3 /* ContentView.swift */, 02AE64F229363DC1005A4AF3 /* Assets.xcassets */, @@ -136,21 +136,6 @@ path = BeRealUITests; sourceTree = ""; }; - 02CE555F293B44C900730DC9 /* Profile */ = { - isa = PBXGroup; - children = ( - ); - path = Profile; - sourceTree = ""; - }; - 02FFFD7929395DBF00306533 /* Extensions */ = { - isa = PBXGroup; - children = ( - 02FFFD7A29395DD200306533 /* String+Constants.swift */, - ); - path = Extensions; - sourceTree = ""; - }; 4694AA9E293A7C8800D54903 /* Frameworks */ = { isa = PBXGroup; children = ( @@ -176,6 +161,7 @@ name = BeReal; packageProductDependencies = ( 4694AA9F293A7C8800D54903 /* Modules */, + 026D9824293B6374009FE888 /* Libraries */, ); productName = BeReal; productReference = 02AE64EB29363DBF005A4AF3 /* BeReal.app */; @@ -294,7 +280,6 @@ files = ( 02AE64F129363DBF005A4AF3 /* ContentView.swift in Sources */, 02AE64EF29363DBF005A4AF3 /* BeRealApp.swift in Sources */, - 02FFFD7B29395DD200306533 /* String+Constants.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -645,6 +630,10 @@ /* End XCConfigurationList section */ /* Begin XCSwiftPackageProductDependency section */ + 026D9824293B6374009FE888 /* Libraries */ = { + isa = XCSwiftPackageProductDependency; + productName = Libraries; + }; 4694AA9F293A7C8800D54903 /* Modules */ = { isa = XCSwiftPackageProductDependency; productName = Modules; diff --git a/BeReal/Extensions/String+Constants.swift b/BeReal/Extensions/String+Constants.swift deleted file mode 100644 index b4df93d..0000000 --- a/BeReal/Extensions/String+Constants.swift +++ /dev/null @@ -1,11 +0,0 @@ -// -// String+Constants.swift -// BeReal -// -// Created by Javier Cicchelli on 01/12/2022. -// Copyright © 2022 Röck+Cöde. All rights reserved. -// - -extension String { - static let empty = "" -} diff --git a/Libraries/.gitignore b/Libraries/.gitignore new file mode 100644 index 0000000..3b29812 --- /dev/null +++ b/Libraries/.gitignore @@ -0,0 +1,9 @@ +.DS_Store +/.build +/Packages +/*.xcodeproj +xcuserdata/ +DerivedData/ +.swiftpm/config/registries.json +.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata +.netrc diff --git a/Libraries/Package.swift b/Libraries/Package.swift new file mode 100644 index 0000000..3f4bfd1 --- /dev/null +++ b/Libraries/Package.swift @@ -0,0 +1,22 @@ +// swift-tools-version: 5.7 + +import PackageDescription + +let package = Package( + name: "Libraries", + products: [ + .library( + name: "Libraries", + targets: ["Libraries"]), + ], + dependencies: [ + ], + targets: [ + .target( + name: "Libraries", + dependencies: []), + .testTarget( + name: "LibrariesTests", + dependencies: ["Libraries"]), + ] +) diff --git a/Libraries/Sources/Libraries/Libraries.swift b/Libraries/Sources/Libraries/Libraries.swift new file mode 100644 index 0000000..c1536b6 --- /dev/null +++ b/Libraries/Sources/Libraries/Libraries.swift @@ -0,0 +1,6 @@ +public struct Libraries { + public private(set) var text = "Hello, World!" + + public init() { + } +} diff --git a/Libraries/Tests/LibrariesTests/LibrariesTests.swift b/Libraries/Tests/LibrariesTests/LibrariesTests.swift new file mode 100644 index 0000000..dd47066 --- /dev/null +++ b/Libraries/Tests/LibrariesTests/LibrariesTests.swift @@ -0,0 +1,11 @@ +import XCTest +@testable import Libraries + +final class LibrariesTests: XCTestCase { + func testExample() throws { + // This is an example of a functional test case. + // Use XCTAssert and related functions to verify your tests produce the correct + // results. + XCTAssertEqual(Libraries().text, "Hello, World!") + } +}