Skip to content

Commit

Permalink
Fix cocoa pods support (#2)
Browse files Browse the repository at this point in the history
* Fixed CocoaPod support

* Added cocoapod lib lint action

* Added Cocoapod version shield

* Color changes to shields in readme

* More shield format changes

Co-authored-by: Cyrus Ingraham <cyrus.ingraham@jamf.com>
  • Loading branch information
cyrusingraham and cyrusingraham authored Mar 13, 2020
1 parent e50548b commit d7b3639
Show file tree
Hide file tree
Showing 9 changed files with 26 additions and 5 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,10 @@ jobs:
run: xcodebuild build -scheme 'SubprocessMocks' -derivedDataPath .build
- name: Run tests
run: xcodebuild test -scheme 'Subprocess' -derivedDataPath .build

cocoapods:
name: Pod lib lint
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: Lib lint
run: pod lib lint --verbose Subprocess.podspec
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
# Subprocess
[![License](http://img.shields.io/badge/license-MIT-informational.svg?style=flat)](http://mit-license.org)
![Build](https://github.com/jamf/Subprocess/workflows/Build%20&%20Test/badge.svg)
[![License](http://img.shields.io/badge/license-MIT-lightgrey.svg?style=flat)](http://mit-license.org)
[![Platform](https://img.shields.io/badge/platform-macOS-lightgrey.svg?style=flat)](https://developer.apple.com/macos)
[![Language](http://img.shields.io/badge/language-Swift-lightgrey.svg?style=flat)](https://developer.apple.com/swift)
[![CocoaPods](https://img.shields.io/cocoapods/v/Subprocess.svg)](https://cocoapods.org/pods/Subprocess)
[![Platform](https://img.shields.io/badge/platform-macOS-success.svg?style=flat)](https://developer.apple.com/macos)
[![Language](http://img.shields.io/badge/language-Swift-success.svg?style=flat)](https://developer.apple.com/swift)
[![Carthage compatible](https://img.shields.io/badge/Carthage-compatible-4BC51D.svg?style=flat)](https://github.com/Carthage/Carthage)
[![SwiftPM compatible](https://img.shields.io/badge/spm-compatible-brightgreen.svg?style=flat)](https://swift.org/package-manager)
[![SwiftPM compatible](https://img.shields.io/badge/spm-compatible-success.svg?style=flat)](https://swift.org/package-manager)
[![Documentation](docs/badge.svg)](./docs/index.html)

Subprocess is a Swift library for macOS providing interfaces for both synchronous and asynchronous process execution.
Expand Down
2 changes: 2 additions & 0 deletions Sources/SubprocessMocks/MockProcess.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@
//

import Foundation
#if !COCOA_PODS
import Subprocess
#endif

/// Interface used for mocking a process
public struct MockProcess {
Expand Down
2 changes: 2 additions & 0 deletions Sources/SubprocessMocks/MockShell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@
//

import Foundation
#if !COCOA_PODS
import Subprocess
#endif

extension Shell: SubprocessMockObject {}

Expand Down
2 changes: 2 additions & 0 deletions Sources/SubprocessMocks/MockSubprocess.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@
//

import Foundation
#if !COCOA_PODS
import Subprocess
#endif

extension Subprocess: SubprocessMockObject {}

Expand Down
2 changes: 2 additions & 0 deletions Sources/SubprocessMocks/MockSubprocessDependencyBuilder.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@
//

import Foundation
#if !COCOA_PODS
import Subprocess
#endif

/// Error representing a failed call to Subprocess.expect or Shell.expect
public struct ExpectationError: Error {
Expand Down
2 changes: 2 additions & 0 deletions Subprocess.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ Pod::Spec.new do |s|
s.swift_version = '5.1'
s.default_subspec = 'Core'

s.pod_target_xcconfig = { 'OTHER_SWIFT_FLAGS' => '-DCOCOA_PODS' }

s.subspec 'Core' do |ss|
ss.source_files = 'Sources/Subprocess/*.swift'
end
Expand Down
2 changes: 2 additions & 0 deletions Tests/UnitTests/ShellTests.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import XCTest
@testable import Subprocess
#if !COCOA_PODS
@testable import SubprocessMocks
#endif

struct TestCodableObject: Codable, Equatable {
let uuid: UUID
Expand Down
2 changes: 2 additions & 0 deletions Tests/UnitTests/SubprocessTests.swift
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import XCTest
@testable import Subprocess
#if !COCOA_PODS
@testable import SubprocessMocks
#endif

final class SubprocessTests: XCTestCase {

Expand Down

0 comments on commit d7b3639

Please sign in to comment.