Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
uses: actions/checkout@v3
- name: Build and test
shell: bash
env:
env:
NSUnbufferedIO: YES
run: |
swift test --enable-code-coverage --disable-automatic-resolution
Expand All @@ -27,7 +27,7 @@ jobs:
name: Test Linux
runs-on: ubuntu-latest
container:
image: swift:5.6-focal
image: swift:6.3.3
steps:
- uses: actions/checkout@v3
- run: swift test
5 changes: 3 additions & 2 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// swift-tools-version:5.3
// swift-tools-version:6.3
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription
Expand All @@ -25,5 +25,6 @@ let package = Package(
resources: [
.copy("Fixtures")
]),
]
],
swiftLanguageModes: [.v6],
)
23 changes: 5 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

[![Test](https://github.com/Alexander-Ignition/XSTooling/actions/workflows/test.yml/badge.svg)](https://github.com/Alexander-Ignition/XSTooling/actions/workflows/test.yml)
[![SPM compatible](https://img.shields.io/badge/spm-compatible-brightgreen.svg?style=flat)](https://swift.org/package-manager)
[![Swift 5.3](https://img.shields.io/badge/swift-5.3-brightgreen.svg?style=flat)](https://developer.apple.com/swift)
[![Swift 6.3](https://img.shields.io/badge/swift-6.3-brightgreen.svg?style=flat)](https://developer.apple.com/swift)
[![GitHub license](https://img.shields.io/badge/license-MIT-lightgrey.svg)](https://github.com/Alexander-Ignition/XSTooling/blob/master/LICENSE)

Xcode and Swift toolset
Expand Down Expand Up @@ -34,7 +34,7 @@ Finally, add `import XSTooling` to your source code.
```swift
import XSTooling

let sh = Shell.default
let sh = Shell.current
try await sh("swift build").run()
```

Expand All @@ -61,31 +61,18 @@ let url = URL(fileURLWithPath: "logs.txt", isDirectory: false)
FileManager.default.createFile(atPath: url.path, contents: nil)
let file = try FileHandle(forWritingTo: url)

try await sh("swift build").run(.output(file).error(file))
try await sh("swift build").run(standardOutput: file, standardError: file)
```

`Shell` has predefined instances.

```swift
Shell.default
Shell.current
Shell.sh
Shell.bash
Shell.zsh
```

Conceptually, a `Shell` is a wrapper over a `ProcessCommand`.

- `sh.command` contains common parameters for all commands.
- `sh("ls")` each call to this method returned a copy of the `ProcessCommand` with additional arguments

```swift
let sh = Shell.default
sh.command // ProcessCommand
sh.command.environment // [String: String]?
sh.command.currentDirectoryURL // URL?
sh("ls") // ProcessCommand
```

## ProcessCommand

The main component is `ProcessCommand`. Which can configure and run a subprocess. The `read` and `run` methods are called on the `ProcessCommand`.
Expand Down Expand Up @@ -126,7 +113,7 @@ for info in devices where info.state == "Booted" {
try await simulator.device(info.udid).shutdown.run()
}

let udid = devices.first!.udid
let udid = devices.first!.udid
try await simulator.device(udid).boot.run()
try await simulator.device(udid).app("com.example.app").launch.run()
```
Expand Down
55 changes: 0 additions & 55 deletions Sources/XSTooling/Core/AsyncProcess.swift

This file was deleted.

28 changes: 0 additions & 28 deletions Sources/XSTooling/Core/FileHandleReader.swift

This file was deleted.

165 changes: 0 additions & 165 deletions Sources/XSTooling/Core/ProcessCommand.swift

This file was deleted.

Loading
Loading