Skip to content

Commit 997c77d

Browse files
Merge pull request #36 from RedMadRobot/feature/package-split
Extract catbird executable product from Package.swift into CatbirdApp folder with it is own Package.swift
2 parents b8f525c + fff8a55 commit 997c77d

56 files changed

Lines changed: 103 additions & 57 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/release.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,13 @@ jobs:
1313
- name: Build
1414
run: make release
1515
- name: Archive
16-
run: zip -r catbird.zip catbird start.sh stop.sh LICENSE Public Resources Sources/CatbirdAPI
16+
run: zip -r catbird.zip catbird start.sh stop.sh LICENSE Public Resources
17+
working-directory: Packages/CatbirdApp
1718
- name: Upload GitHub Release Assets
1819
run: gh release upload ${{ github.event.release.tag_name }} catbird.zip
1920
env:
2021
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
22+
working-directory: Packages/CatbirdApp
2123
- name: Install Cocoapods
2224
run: bundle install
2325
- name: Deploy to Cocoapods

.github/workflows/test.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,3 @@ jobs:
1919
uses: actions/checkout@v2
2020
- name: Build and test
2121
run: make test
22-
shell: bash

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
Packages
21
.build
32
xcuserdata
43
Catbird.xcodeproj

Makefile

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
11
test:
2-
swift test --enable-code-coverage --disable-automatic-resolution
3-
xcrun llvm-cov report \
4-
.build/x86_64-apple-macosx/debug/CatbirdPackageTests.xctest/Contents/MacOS/CatbirdPackageTests \
5-
-instr-profile=.build/x86_64-apple-macosx/debug/codecov/default.profdata \
6-
-ignore-filename-regex=".build|Tests"
7-
2+
$(call test)
3+
$(call cov_report,Catbird)
4+
cd Packages/CatbirdApp; $(call test)
5+
cd Packages/CatbirdApp; $(call cov_report,CatbirdApp)
86
build:
97
swift build
108

119
release:
12-
swift build -c release
13-
cp ./.build/x86_64-apple-macosx/release/catbird ./catbird
10+
cd Packages/CatbirdApp; swift build -c release
11+
cd Packages/CatbirdApp; cp ./.build/release/catbird ./catbird
1412

1513
update:
1614
swift package update
@@ -20,3 +18,14 @@ clean:
2018

2119
lint:
2220
bundle exec pod spec lint
21+
22+
define test
23+
swift test --enable-code-coverage --disable-automatic-resolution
24+
endef
25+
26+
define cov_report
27+
xcrun llvm-cov report \
28+
.build/debug/$(1)PackageTests.xctest/Contents/MacOS/$(1)PackageTests \
29+
-instr-profile=.build/debug/codecov/default.profdata \
30+
-ignore-filename-regex=".build|Tests"
31+
endef

Package.swift

Lines changed: 5 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -4,40 +4,15 @@ import PackageDescription
44
let package = Package(
55
name: "Catbird",
66
platforms: [
7-
.macOS(.v10_15)
7+
.iOS(.v12),
8+
.macOS(.v10_15)
89
],
910
products: [
10-
.library(name: "CatbirdAPI", targets: ["CatbirdAPI"]),
11-
.executable(name: "catbird", targets: ["CatbirdRun"]),
12-
],
13-
dependencies: [
14-
// 💧 A server-side Swift web framework.
15-
.package(url: "https://github.com/vapor/vapor.git", from: "4.0.0"),
16-
17-
// Templete engine
18-
.package(url: "https://github.com/stencilproject/Stencil.git", from: "0.14.0"),
19-
20-
// macOS system logger
21-
.package(url: "https://github.com/Alexander-Ignition/OSLogging", from: "1.0.0"),
11+
.library(name: "CatbirdAPI", targets: ["CatbirdAPI"])
2212
],
2313
targets: [
2414
// Common API
25-
.target(name: "CatbirdAPI"),
26-
.testTarget(name: "CatbirdAPITests", dependencies: ["CatbirdAPI"]),
27-
28-
// Web Server
29-
.target(name: "CatbirdApp", dependencies: [
30-
.target(name: "CatbirdAPI"),
31-
.product(name: "Vapor", package: "vapor"),
32-
.product(name: "Stencil", package: "Stencil"),
33-
.product(name: "OSLogging", package: "OSLogging"),
34-
]),
35-
.testTarget(name: "CatbirdAppTests", dependencies: [
36-
.target(name: "CatbirdApp"),
37-
.product(name: "XCTVapor", package: "vapor"),
38-
]),
39-
40-
// CLI
41-
.target(name: "CatbirdRun", dependencies: ["CatbirdApp"]),
15+
.target(name: "CatbirdAPI", path: "Packages/CatbirdAPI/Sources"),
16+
.testTarget(name: "CatbirdAPITests", dependencies: ["CatbirdAPI"], path: "Packages/CatbirdAPI/Tests")
4217
]
4318
)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)