[Library] Foundation library setup #3

Merged
javier merged 4 commits from library/foundation/setup into main 2024-03-16 01:53:38 +00:00
7 changed files with 285 additions and 0 deletions

24
Libraries.xctestplan Normal file
View File

@ -0,0 +1,24 @@
{
"configurations" : [
{
"id" : "BF43DE96-4FFB-475F-B056-3EE94ACD1F54",
"name" : "Test Scheme Action",
"options" : {
}
}
],
"defaultOptions" : {
"codeCoverage" : false
},
"testTargets" : [
{
"target" : {
"containerPath" : "container:Libraries",
"identifier" : "ReviewsFoundationTest",
"name" : "ReviewsFoundationTest"
}
}
],
"version" : 1
}

View File

@ -0,0 +1,54 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1530"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES"
buildArchitectures = "Automatic">
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
shouldAutocreateTestPlan = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "ReviewsFoundationTest"
BuildableName = "ReviewsFoundationTest"
BlueprintName = "ReviewsFoundationTest"
ReferencedContainer = "container:">
</BuildableReference>
</TestableReference>
</Testables>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View File

@ -0,0 +1,72 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1530"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES"
buildArchitectures = "Automatic">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "ReviewsKit"
BuildableName = "ReviewsKit"
BlueprintName = "ReviewsKit"
ReferencedContainer = "container:">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<TestPlans>
<TestPlanReference
reference = "container:../Libraries.xctestplan"
default = "YES">
</TestPlanReference>
</TestPlans>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "ReviewsKit"
BuildableName = "ReviewsKit"
BlueprintName = "ReviewsKit"
ReferencedContainer = "container:">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View File

@ -0,0 +1,18 @@
//
// String+Constants.swift
// ReviewsFoundation
//
// Created by Javier Cicchelli on 16/03/2024.
// Copyright © 2024 Röck+Cöde VoF. All rights reserved.
//
import Foundation
public extension String {
// MARK: Constants
/// A representation of an empty string.
static let empty: String = ""
}

View File

@ -0,0 +1,27 @@
//
// String+ConstantsTests.swift
// ReviewsFoundationTest
//
// Created by Javier Cicchelli on 16/03/2024.
// Copyright © 2024 Röck+Cöde VoF. All rights reserved.
//
import ReviewsFoundation
import XCTest
final class String_ConstantsTests: XCTestCase {
// MARK: Properties
private var sut: String!
// MARK: Constants tests
func testEmpty() throws {
// GIVEN
sut = .empty
// WHEN
// THEN
XCTAssertTrue(sut.isEmpty)
}
}

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

@ -14,6 +14,8 @@
02DC7FAD2BA51B4C000EEEBE /* ReviewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 345AD13024C6EE64004E2EE1 /* ReviewCell.swift */; };
02DC7FAE2BA51B4C000EEEBE /* FeedViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 345AD12F24C6EE64004E2EE1 /* FeedViewController.swift */; };
02DC7FAF2BA51B4C000EEEBE /* Review.swift in Sources */ = {isa = PBXBuildFile; fileRef = 345AD13124C6EE64004E2EE1 /* Review.swift */; };
02DC7FB32BA52518000EEEBE /* ReviewsKit in Frameworks */ = {isa = PBXBuildFile; productRef = 02DC7FB22BA52518000EEEBE /* ReviewsKit */; };
02DC7FB52BA52520000EEEBE /* ReviewsKit in Frameworks */ = {isa = PBXBuildFile; productRef = 02DC7FB42BA52520000EEEBE /* ReviewsKit */; };
345AD11C24C6EDD9004E2EE1 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 345AD11B24C6EDD9004E2EE1 /* AppDelegate.swift */; };
345AD12524C6EDDC004E2EE1 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 345AD12424C6EDDC004E2EE1 /* Assets.xcassets */; };
345AD12824C6EDDC004E2EE1 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 345AD12624C6EDDC004E2EE1 /* LaunchScreen.storyboard */; };
@ -44,8 +46,10 @@
/* End PBXCopyFilesBuildPhase section */
/* Begin PBXFileReference section */
02900C492BA530E6008D2E8D /* Libraries.xctestplan */ = {isa = PBXFileReference; lastKnownFileType = text; path = Libraries.xctestplan; sourceTree = "<group>"; };
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>"; };
@ -62,6 +66,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
02DC7FB32BA52518000EEEBE /* ReviewsKit in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
@ -70,12 +75,21 @@
buildActionMask = 2147483647;
files = (
02DC7FA22BA51793000EEEBE /* ReviewsFeed.framework in Frameworks */,
02DC7FB52BA52520000EEEBE /* ReviewsKit in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
/* End PBXFrameworksBuildPhase section */
/* Begin PBXGroup section */
02900C4A2BA53162008D2E8D /* Test Plans */ = {
isa = PBXGroup;
children = (
02900C492BA530E6008D2E8D /* Libraries.xctestplan */,
);
name = "Test Plans";
sourceTree = "<group>";
};
02DC7F722BA4F8F0000EEEBE /* Resources */ = {
isa = PBXGroup;
children = (
@ -149,8 +163,10 @@
345AD10F24C6EDD9004E2EE1 = {
isa = PBXGroup;
children = (
02DC7FB12BA52084000EEEBE /* Libraries */,
02DC7FAB2BA51848000EEEBE /* Frameworks */,
345AD11A24C6EDD9004E2EE1 /* App */,
02900C4A2BA53162008D2E8D /* Test Plans */,
345AD11924C6EDD9004E2EE1 /* Products */,
);
sourceTree = "<group>";
@ -201,6 +217,9 @@
dependencies = (
);
name = Feed;
packageProductDependencies = (
02DC7FB22BA52518000EEEBE /* ReviewsKit */,
);
productName = Feed;
productReference = 02DC7F8F2BA51793000EEEBE /* ReviewsFeed.framework */;
productType = "com.apple.product-type.framework";
@ -220,6 +239,9 @@
02DC7FA12BA51793000EEEBE /* PBXTargetDependency */,
);
name = App;
packageProductDependencies = (
02DC7FB42BA52520000EEEBE /* ReviewsKit */,
);
productName = AppStoreReviews;
productReference = 345AD11824C6EDD9004E2EE1 /* Reviews.app */;
productType = "com.apple.product-type.application";
@ -625,6 +647,17 @@
defaultConfigurationName = Release;
};
/* End XCConfigurationList section */
/* Begin XCSwiftPackageProductDependency section */
02DC7FB22BA52518000EEEBE /* ReviewsKit */ = {
isa = XCSwiftPackageProductDependency;
productName = ReviewsKit;
};
02DC7FB42BA52520000EEEBE /* ReviewsKit */ = {
isa = XCSwiftPackageProductDependency;
productName = ReviewsKit;
};
/* End XCSwiftPackageProductDependency section */
};
rootObject = 345AD11024C6EDD9004E2EE1 /* Project object */;
}