Skip to content

Commit

Permalink
add domain layer
Browse files Browse the repository at this point in the history
  • Loading branch information
Haitec committed Oct 23, 2021
1 parent 976358f commit c21bfd8
Show file tree
Hide file tree
Showing 10 changed files with 156 additions and 2 deletions.
9 changes: 9 additions & 0 deletions CleanApp/CleanApp.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
objects = {

/* Begin PBXBuildFile section */
4929008D27241EEC00D6688E /* DomainLayer in Frameworks */ = {isa = PBXBuildFile; productRef = 4929008C27241EEC00D6688E /* DomainLayer */; };
4931823827235951005EE252 /* PresentationLayer in Frameworks */ = {isa = PBXBuildFile; productRef = 4931823727235951005EE252 /* PresentationLayer */; };
493CDDD62723258300499858 /* CleanApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 493CDDD52723258300499858 /* CleanApp.swift */; };
493CDDE72723258400499858 /* iOSTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 493CDDE62723258400499858 /* iOSTests.swift */; };
Expand All @@ -33,6 +34,7 @@

/* Begin PBXFileReference section */
49204DE3272346EF00891C5E /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
4929008B27241EE500D6688E /* DomainLayer */ = {isa = PBXFileReference; lastKnownFileType = folder; name = DomainLayer; path = Modules/DomainLayer; sourceTree = "<group>"; };
4931822F27234CAD005EE252 /* PresentationLayer */ = {isa = PBXFileReference; lastKnownFileType = folder; name = PresentationLayer; path = Modules/PresentationLayer; sourceTree = "<group>"; };
493CDDD22723258300499858 /* CleanApp.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = CleanApp.app; sourceTree = BUILT_PRODUCTS_DIR; };
493CDDD52723258300499858 /* CleanApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CleanApp.swift; sourceTree = "<group>"; };
Expand All @@ -48,6 +50,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
4929008D27241EEC00D6688E /* DomainLayer in Frameworks */,
4931823827235951005EE252 /* PresentationLayer in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand All @@ -73,6 +76,7 @@
isa = PBXGroup;
children = (
4931822F27234CAD005EE252 /* PresentationLayer */,
4929008B27241EE500D6688E /* DomainLayer */,
);
name = Packages;
sourceTree = "<group>";
Expand Down Expand Up @@ -150,6 +154,7 @@
name = iOS;
packageProductDependencies = (
4931823727235951005EE252 /* PresentationLayer */,
4929008C27241EEC00D6688E /* DomainLayer */,
);
productName = CleanApp;
productReference = 493CDDD22723258300499858 /* CleanApp.app */;
Expand Down Expand Up @@ -606,6 +611,10 @@
/* End XCConfigurationList section */

/* Begin XCSwiftPackageProductDependency section */
4929008C27241EEC00D6688E /* DomainLayer */ = {
isa = XCSwiftPackageProductDependency;
productName = DomainLayer;
};
4931823727235951005EE252 /* PresentationLayer */ = {
isa = XCSwiftPackageProductDependency;
productName = PresentationLayer;
Expand Down
7 changes: 7 additions & 0 deletions CleanApp/Modules/DomainLayer/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.DS_Store
/.build
/Packages
/*.xcodeproj
xcuserdata/
DerivedData/
.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1300"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "DomainLayerTests"
BuildableName = "DomainLayerTests"
BlueprintName = "DomainLayerTests"
ReferencedContainer = "container:">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
codeCoverageEnabled = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "DomainLayerTests"
BuildableName = "DomainLayerTests"
BlueprintName = "DomainLayerTests"
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">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "DomainLayerTests"
BuildableName = "DomainLayerTests"
BlueprintName = "DomainLayerTests"
ReferencedContainer = "container:">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
30 changes: 30 additions & 0 deletions CleanApp/Modules/DomainLayer/Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// swift-tools-version:5.5
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription

let package = Package(
name: "DomainLayer",
products: [
// Products define the executables and libraries a package produces, and make them visible to other packages.
.library(
name: "DomainLayer",
targets: ["DomainLayer"]),
],
dependencies: [
// Dependencies declare other packages that this package depends on.
// .package(url: /* package url */, from: "1.0.0"),
],
targets: [
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
// Targets can depend on other targets in this package, and on products in packages this package depends on.
.target(
name: "DomainLayer",
dependencies: [],
path: "Sources"),
.testTarget(
name: "DomainLayerTests",
dependencies: ["DomainLayer"],
path: "Tests"),
]
)
3 changes: 3 additions & 0 deletions CleanApp/Modules/DomainLayer/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# DomainLayer

Domain layer of CleanApp.
6 changes: 6 additions & 0 deletions CleanApp/Modules/DomainLayer/Sources/DomainLayer.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
public struct Domain {
public private(set) var text = "Hello, World!"

public init() {
}
}
11 changes: 11 additions & 0 deletions CleanApp/Modules/DomainLayer/Tests/DomainTests.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import XCTest
@testable import DomainLayer

final class DomainTests: 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(Domain().text, "Hello, World!")
}
}
3 changes: 2 additions & 1 deletion CleanApp/Modules/PresentationLayer/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,14 @@ let package = Package(
dependencies: [
// Dependencies declare other packages that this package depends on.
// .package(url: /* package url */, from: "1.0.0"),
.package(name: nil, path: "DomainLayer")
],
targets: [
// Targets are the basic building blocks of a package. A target can define a module or a test suite.
// Targets can depend on other targets in this package, and on products in packages this package depends on.
.target(
name: "PresentationLayer",
dependencies: [],
dependencies: ["DomainLayer"],
path: "Sources"),
.testTarget(
name: "PresentationLayerTests",
Expand Down
3 changes: 2 additions & 1 deletion CleanApp/Modules/PresentationLayer/Sources/ContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,12 @@
// Created by Miguel Dönicke on 22.10.21.
//

import DomainLayer
import SwiftUI

public struct ContentView: View {
public var body: some View {
Text("Hello, world!")
Text(Domain().text)
.padding()
}

Expand Down

0 comments on commit c21bfd8

Please sign in to comment.