Skip to content

Commit 622a680

Browse files
authored
Merge pull request #156 from chillpop/spm
Swift Package Manager Support (retry)
2 parents a57c21c + dca88ed commit 622a680

26 files changed

+274
-126
lines changed

.github/workflows/main.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [ $default-branch ]
6+
pull_request:
7+
branches: [ $default-branch ]
8+
9+
# Allows you to run this workflow manually from the Actions tab
10+
workflow_dispatch:
11+
12+
jobs:
13+
build:
14+
runs-on: macos-latest
15+
env:
16+
DESTINATION: "name=iPhone 12"
17+
XCODE_SDK: iphonesimulator
18+
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v2
22+
23+
- name: Test Xcode Framework
24+
run: xcodebuild -scheme Static-iOS -sdk "$XCODE_SDK" -destination "$DESTINATION" test
25+
26+
- name: Test Swift Package
27+
run: xcodebuild -workspace .swiftpm/xcode/package.xcworkspace -scheme Static -sdk "$XCODE_SDK" -destination "$DESTINATION" test

.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<Scheme
3+
LastUpgradeVersion = "1250"
4+
version = "1.3">
5+
<BuildAction
6+
parallelizeBuildables = "YES"
7+
buildImplicitDependencies = "YES">
8+
<BuildActionEntries>
9+
<BuildActionEntry
10+
buildForTesting = "YES"
11+
buildForRunning = "YES"
12+
buildForProfiling = "YES"
13+
buildForArchiving = "YES"
14+
buildForAnalyzing = "YES">
15+
<BuildableReference
16+
BuildableIdentifier = "primary"
17+
BlueprintIdentifier = "Static"
18+
BuildableName = "Static"
19+
BlueprintName = "Static"
20+
ReferencedContainer = "container:">
21+
</BuildableReference>
22+
</BuildActionEntry>
23+
<BuildActionEntry
24+
buildForTesting = "YES"
25+
buildForRunning = "YES"
26+
buildForProfiling = "NO"
27+
buildForArchiving = "NO"
28+
buildForAnalyzing = "YES">
29+
<BuildableReference
30+
BuildableIdentifier = "primary"
31+
BlueprintIdentifier = "StaticTests"
32+
BuildableName = "StaticTests"
33+
BlueprintName = "StaticTests"
34+
ReferencedContainer = "container:">
35+
</BuildableReference>
36+
</BuildActionEntry>
37+
</BuildActionEntries>
38+
</BuildAction>
39+
<TestAction
40+
buildConfiguration = "Debug"
41+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
42+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
43+
shouldUseLaunchSchemeArgsEnv = "YES">
44+
<Testables>
45+
<TestableReference
46+
skipped = "NO">
47+
<BuildableReference
48+
BuildableIdentifier = "primary"
49+
BlueprintIdentifier = "StaticTests"
50+
BuildableName = "StaticTests"
51+
BlueprintName = "StaticTests"
52+
ReferencedContainer = "container:">
53+
</BuildableReference>
54+
</TestableReference>
55+
</Testables>
56+
</TestAction>
57+
<LaunchAction
58+
buildConfiguration = "Debug"
59+
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
60+
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
61+
launchStyle = "0"
62+
useCustomWorkingDirectory = "NO"
63+
ignoresPersistentStateOnLaunch = "NO"
64+
debugDocumentVersioning = "YES"
65+
debugServiceExtension = "internal"
66+
allowLocationSimulation = "YES">
67+
</LaunchAction>
68+
<ProfileAction
69+
buildConfiguration = "Release"
70+
shouldUseLaunchSchemeArgsEnv = "YES"
71+
savedToolIdentifier = ""
72+
useCustomWorkingDirectory = "NO"
73+
debugDocumentVersioning = "YES">
74+
<MacroExpansion>
75+
<BuildableReference
76+
BuildableIdentifier = "primary"
77+
BlueprintIdentifier = "Static"
78+
BuildableName = "Static"
79+
BlueprintName = "Static"
80+
ReferencedContainer = "container:">
81+
</BuildableReference>
82+
</MacroExpansion>
83+
</ProfileAction>
84+
<AnalyzeAction
85+
buildConfiguration = "Debug">
86+
</AnalyzeAction>
87+
<ArchiveAction
88+
buildConfiguration = "Release"
89+
revealArchiveInOrganizer = "YES">
90+
</ArchiveAction>
91+
</Scheme>

.travis.yml

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

Example/WindowController.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import UIKit
22

33
@UIApplicationMain final class WindowController: UIResponder {
4-
var window: UIWindow? = {
4+
lazy var window: UIWindow? = {
55
let window = UIWindow(frame: UIScreen.main.bounds)
66
window.rootViewController = UINavigationController(rootViewController: ViewController())
77
return window

Package.swift

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// swift-tools-version:5.3
2+
3+
import PackageDescription
4+
5+
let package = Package(
6+
name: "Static",
7+
platforms: [
8+
.iOS(.v9)
9+
],
10+
products: [
11+
.library(name: "Static", targets: ["Static"])
12+
],
13+
targets: [
14+
.target(name: "Static"),
15+
.testTarget(name: "StaticTests", dependencies: ["Static"])
16+
]
17+
)
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import UIKit
22

3-
public protocol Cell: class {
3+
public protocol Cell: AnyObject {
44
static func description() -> String
55
static func nib() -> UINib?
66

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -310,9 +310,12 @@ extension DataSource: UITableViewDelegate {
310310
extension UITableView.Style {
311311
var defaultSectionExtremityHeight: CGFloat {
312312
switch self {
313-
case .plain: return 0
314-
case .grouped: return UITableView.automaticDimension
315-
@unknown default: return UITableView.automaticDimension
313+
case .plain:
314+
return 0
315+
case .grouped, .insetGrouped:
316+
return UITableView.automaticDimension
317+
@unknown default:
318+
return UITableView.automaticDimension
316319
}
317320
}
318321
}

0 commit comments

Comments
 (0)