Skip to content

Commit db95880

Browse files
author
Florian Rieger
authored
Merge pull request #14 from AppCron/swift-package
Swift Package
2 parents e0b00b9 + d204061 commit db95880

File tree

14 files changed

+63
-655
lines changed

14 files changed

+63
-655
lines changed

.gitignore

Lines changed: 37 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
# Created by https://www.gitignore.io/api/osx,xcode,swift
2+
# Created by https://www.gitignore.io/api/osx,swift,swiftpackagemanager
33

44
### OSX ###
55
*.DS_Store
@@ -29,8 +29,7 @@ Network Trash Folder
2929
Temporary Items
3030
.apdisk
3131

32-
33-
### Xcode ###
32+
### Swift ###
3433
# Xcode
3534
#
3635
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
@@ -55,31 +54,6 @@ xcuserdata/
5554
*.xccheckout
5655
*.xcscmblueprint
5756

58-
59-
### Swift ###
60-
# Xcode
61-
#
62-
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore
63-
64-
## Build generated
65-
build/
66-
DerivedData/
67-
68-
## Various settings
69-
*.pbxuser
70-
!default.pbxuser
71-
*.mode1v3
72-
!default.mode1v3
73-
*.mode2v3
74-
!default.mode2v3
75-
*.perspectivev3
76-
!default.perspectivev3
77-
xcuserdata/
78-
79-
## Other
80-
*.moved-aside
81-
*.xcuserstate
82-
8357
## Obj-C/Swift specific
8458
*.hmap
8559
*.ipa
@@ -94,5 +68,40 @@ playground.xcworkspace
9468
#
9569
# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies.
9670
# Packages/
71+
# Package.pins
9772
.build/
9873

74+
# CocoaPods
75+
#
76+
# We recommend against adding the Pods directory to your .gitignore. However
77+
# you should judge for yourself, the pros and cons are mentioned at:
78+
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
79+
#
80+
# Pods/
81+
82+
# Carthage
83+
#
84+
# Add this line if you want to avoid checking in source code from Carthage dependencies.
85+
# Carthage/Checkouts
86+
87+
Carthage/Build
88+
89+
# fastlane
90+
#
91+
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the
92+
# screenshots whenever they are needed.
93+
# For more information about the recommended setup visit:
94+
# https://docs.fastlane.tools/best-practices/source-control/#source-control
95+
96+
fastlane/report.xml
97+
fastlane/Preview.html
98+
fastlane/screenshots
99+
fastlane/test_output
100+
101+
### SwiftPackageManager ###
102+
Packages
103+
.build
104+
xcuserdata
105+
*.xcodeproj
106+
107+
# End of https://www.gitignore.io/api/osx,swift,swiftpackagemanager

Package.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import PackageDescription
2+
3+
let package = Package(
4+
name: "ACInteractor",
5+
dependencies : [],
6+
exclude: ["Tests"]
7+
)

README.md

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
Swift Package for a Use Case centric architecture as proposed by Robert C. Martin and others.
55

66
## Overview
7-
ACInteractor is a Swift Package that supports a Use Case centric architecture and TDD in Swift projects. The basic idea is that one Use Case, and only one Use Case, is executed by a single class. As proposed by Robert C. Martin, these kind of classes are called Interactors.
7+
ACInteractor is a [Swift Package](https://swift.org/package-manager/) that supports a Use Case centric architecture and TDD in Swift projects. The basic idea is that one Use Case, and only one Use Case, is executed by a single class. As proposed by Robert C. Martin, these kind of classes are called Interactors.
88
- Each Interactor has a Request model.
99
- Each Interactor has a Response model.
1010
- Each Interactor has an Execute function that takes the Request model and returns the Response model.
@@ -50,15 +50,14 @@ ACInteractor
5050
├── LICENSE
5151
├── README.md
5252
├── Sources // The source files
53-
├── Tests // The unit test files
54-
└── Xcode // The Xcode project to run the test
53+
└── Tests // The unit test files
5554
```
5655

5756
## Setup
58-
Since Swift 3 and Swift Package are not available with a stable Xcode release, just add the Files of the **Sources** folder to your project.
57+
Since [Swift Package](https://swift.org/package-manager/) is not supporting iOS Xcode projects yet, it's recommended to add the files of the **Sources** folder directly to your project.
5958

6059
### via Git Submodule
61-
At the moment it's recommended to add the entire ACInteractor project as a [Git Submodule](https://git-scm.com/book/en/v2/Git-Tools-Submodules) to your repository.
60+
You can add the entire ACInteractor project as a [Git Submodule](https://git-scm.com/book/en/v2/Git-Tools-Submodules) to your repository.
6261

6362
0. Navigate to the root directory of your Git repository in Terminal.
6463
0. Run the following command:
@@ -68,7 +67,15 @@ At the moment it's recommended to add the entire ACInteractor project as a [Git
6867
0. Add the files of the **Sources** folder to your project.
6968

7069
### via Download
71-
Alternatively you can just download the files directly from Github and add the files of the *Sources* folder to your project.
70+
Alternatively you can just download the files directly from Github and add the files of the **Sources** folder to your project.
71+
72+
### as Swift Package Dependency
73+
You can also add it as [Swift Package](https://swift.org/package-manager/) Dependency to another Swift Package.
74+
``` Swift
75+
dependencies: [
76+
.Package(url: "https://github.com/AppCron/ACInteractor.git", majorVersion: 0)
77+
]
78+
```
7279

7380
## Writing Interactors
7481
``` Swift
File renamed without changes.
File renamed without changes.
File renamed without changes.

Tests/InteractorStatusInMemoryGatewayTests.swift renamed to Tests/ACInteractorTests/InteractorStatusInMemoryGatewayTests.swift

File renamed without changes.
File renamed without changes.

Tests/LinuxMain.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import XCTest
2+
@testable import ACInteractorTests
3+
4+
XCTMain([
5+
testCase(ACInteractorTests.allTests),
6+
])

Xcode/ACInteractor.h

Lines changed: 0 additions & 19 deletions
This file was deleted.

0 commit comments

Comments
 (0)