Skip to content

Commit

Permalink
Merge pull request #156 from chillpop/spm
Browse files Browse the repository at this point in the history
Swift Package Manager Support (retry)
  • Loading branch information
factotvm authored Oct 22, 2021
2 parents a57c21c + dca88ed commit 622a680
Show file tree
Hide file tree
Showing 26 changed files with 274 additions and 126 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: CI

on:
push:
branches: [ $default-branch ]
pull_request:
branches: [ $default-branch ]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
build:
runs-on: macos-latest
env:
DESTINATION: "name=iPhone 12"
XCODE_SDK: iphonesimulator

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Test Xcode Framework
run: xcodebuild -scheme Static-iOS -sdk "$XCODE_SDK" -destination "$DESTINATION" test

- name: Test Swift Package
run: xcodebuild -workspace .swiftpm/xcode/package.xcworkspace -scheme Static -sdk "$XCODE_SDK" -destination "$DESTINATION" test
7 changes: 7 additions & 0 deletions .swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

91 changes: 91 additions & 0 deletions .swiftpm/xcode/xcshareddata/xcschemes/Static.xcscheme
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1250"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "Static"
BuildableName = "Static"
BlueprintName = "Static"
ReferencedContainer = "container:">
</BuildableReference>
</BuildActionEntry>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "NO"
buildForArchiving = "NO"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "StaticTests"
BuildableName = "StaticTests"
BlueprintName = "StaticTests"
ReferencedContainer = "container:">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "StaticTests"
BuildableName = "StaticTests"
BlueprintName = "StaticTests"
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 = "Static"
BuildableName = "Static"
BlueprintName = "Static"
ReferencedContainer = "container:">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
12 changes: 0 additions & 12 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion Example/WindowController.swift
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import UIKit

@UIApplicationMain final class WindowController: UIResponder {
var window: UIWindow? = {
lazy var window: UIWindow? = {
let window = UIWindow(frame: UIScreen.main.bounds)
window.rootViewController = UINavigationController(rootViewController: ViewController())
return window
Expand Down
17 changes: 17 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// swift-tools-version:5.3

import PackageDescription

let package = Package(
name: "Static",
platforms: [
.iOS(.v9)
],
products: [
.library(name: "Static", targets: ["Static"])
],
targets: [
.target(name: "Static"),
.testTarget(name: "StaticTests", dependencies: ["Static"])
]
)
File renamed without changes.
2 changes: 1 addition & 1 deletion Static/Cell.swift → Sources/Static/Cell.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import UIKit

public protocol Cell: class {
public protocol Cell: AnyObject {
static func description() -> String
static func nib() -> UINib?

Expand Down
9 changes: 6 additions & 3 deletions Static/DataSource.swift → Sources/Static/DataSource.swift
Original file line number Diff line number Diff line change
Expand Up @@ -310,9 +310,12 @@ extension DataSource: UITableViewDelegate {
extension UITableView.Style {
var defaultSectionExtremityHeight: CGFloat {
switch self {
case .plain: return 0
case .grouped: return UITableView.automaticDimension
@unknown default: return UITableView.automaticDimension
case .plain:
return 0
case .grouped, .insetGrouped:
return UITableView.automaticDimension
@unknown default:
return UITableView.automaticDimension
}
}
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
7 changes: 4 additions & 3 deletions Static.podspec
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
Pod::Spec.new do |spec|
spec.name = 'Static'
spec.version = '4.0.2'
spec.version = '4.1.0'
spec.summary = 'Simple static table views for iOS in Swift.'
spec.description = 'Static provides simple static table views for iOS in Swift.'
spec.homepage = 'https://github.com/venmo/static'
spec.license = { type: 'MIT', file: 'LICENSE' }
spec.source = { git: 'https://github.com/venmo/Static.git', tag: "v#{spec.version}" }
spec.author = { 'Venmo' => '[email protected]', 'Sam Soffes' => '[email protected]' }

spec.platform = :ios, '8.0'
spec.swift_versions = ['5.0', '5.1', '5.2', '5.3']
spec.platform = :ios, '9.0'
spec.frameworks = 'UIKit'
spec.source_files = 'Static/*.{swift,h}'
spec.source_files = 'Sources/Static/**/*.swift'
end
Loading

0 comments on commit 622a680

Please sign in to comment.