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
27 changes: 27 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
---
name: Bug report
about: Create a report to help us improve Subprocess
title: ''
labels: bug
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. What executable was running?
2. What arguments are passed in?
3. What environment values are used?

**Expected behavior**
A clear and concise description of what you expected to happen.

**Environment (please complete the following information):**
- OS [e.g. macOS 15]
- Swift version (run `swift --version`) [e.g. swiftlang-6.2.0.1.23 clang-1700.3.1.3]

**Additional context**
Add any other context about the problem here.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for Subprocess future directions
title: "[Feature] Feature Request"
labels: enhancement
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
92 changes: 92 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
# Xcode
#
# gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore

**/.DS_Store

## User settings
xcuserdata/

## compatibility with Xcode 8 and earlier (ignoring not required starting Xcode 9)
*.xcscmblueprint
*.xccheckout

## compatibility with Xcode 3 and earlier (ignoring not required starting Xcode 4)
build/
DerivedData/
*.moved-aside
*.pbxuser
!default.pbxuser
*.mode1v3
!default.mode1v3
*.mode2v3
!default.mode2v3
*.perspectivev3
!default.perspectivev3

## Obj-C/Swift specific
*.hmap

## App packaging
*.ipa
*.dSYM.zip
*.dSYM

## Playgrounds
timeline.xctimeline
playground.xcworkspace

# Swift Package Manager
#
# Add this line if you want to avoid checking in source code from Swift Package Manager dependencies.
# Packages/
# Package.pins
# Package.resolved
# *.xcodeproj
#
# Xcode automatically generates this directory with a .xcworkspacedata file and xcuserdata
# hence it is not needed unless you have added a package configuration file to your project
# .swiftpm

.build/

# CocoaPods
#
# We recommend against adding the Pods directory to your .gitignore. However
# you should judge for yourself, the pros and cons are mentioned at:
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
#
# Pods/
#
# Add this line if you want to avoid checking in source code from the Xcode workspace
# *.xcworkspace

# Carthage
#
# Add this line if you want to avoid checking in source code from Carthage dependencies.
# Carthage/Checkouts

Carthage/Build/

# Accio dependency management
Dependencies/
.accio/

# fastlane
#
# It is recommended to not store the screenshots in the git repo.
# Instead, use fastlane to re-generate the screenshots whenever they are needed.
# For more information about the recommended setup visit:
# https://docs.fastlane.tools/best-practices/source-control/#source-control

fastlane/report.xml
fastlane/Preview.html
fastlane/screenshots/**/*.png
fastlane/test_output

# Code Injection
#
# After new code Injection tools there's a generated folder /iOSInjectionProject
# https://github.com/johnno1962/injectionforxcode

iOSInjectionProject/
4 changes: 4 additions & 0 deletions .spi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
version: 1
builder:
configs:
- documentation_targets: [Subprocess]
11 changes: 11 additions & 0 deletions CODEOWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#
# This source file is part of the Swift.org open source project
#
# Copyright (c) 2023 Apple Inc. and the Swift project authors
# Licensed under Apache License v2.0 with Runtime Library Exception
#
# See https://swift.org/LICENSE.txt for license information
# See https://swift.org/CONTRIBUTORS.txt for Swift project authors
#

* @iCharlesHu
5 changes: 5 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Code of Conduct

The code of conduct for this project can be found at https://swift.org/code-of-conduct.

<!-- Copyright (c) 2025 Apple Inc and the Swift Project authors. All Rights Reserved. -->
10 changes: 10 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
By submitting a pull request, you represent that you have the right to license
your contribution to Apple and the community, and agree by submitting the patch
that your contributions are licensed under the [Swift
license](https://swift.org/LICENSE.txt).

---

Before submitting the pull request, please make sure you have tested your
changes and that they follow the Swift project [guidelines for contributing
code](https://swift.org/contributing/#contributing-code).
95 changes: 95 additions & 0 deletions Package.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
// swift-tools-version: 6.1
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription

let availabilityMacro: SwiftSetting = .enableExperimentalFeature(
"AvailabilityMacro=SubprocessSpan: macOS 9999",
)

var dep: [Package.Dependency] = [
.package(
url: "https://github.com/apple/swift-system",
from: "1.0.0"
)
]
#if !os(Windows)
dep.append(
.package(
url: "https://github.com/apple/swift-docc-plugin",
from: "1.4.3"
),
)
#endif

// Enable SubprocessFoundation by default
var defaultTraits: Set<String> = ["SubprocessFoundation"]
#if compiler(>=6.2)
// Enable SubprocessSpan when Span is available
defaultTraits.insert("SubprocessSpan")
#endif

let package = Package(
name: "Subprocess",
platforms: [.macOS(.v13)],
products: [
.library(
name: "Subprocess",
targets: ["Subprocess"]
)
],
traits: [
"SubprocessFoundation",
"SubprocessSpan",
.default(
enabledTraits: defaultTraits
),
],
dependencies: dep,
targets: [
.target(
name: "Subprocess",
dependencies: [
"_SubprocessCShims",
.product(name: "SystemPackage", package: "swift-system"),
],
path: "Sources/Subprocess",
swiftSettings: [
.enableExperimentalFeature("StrictConcurrency"),
.enableExperimentalFeature("NonescapableTypes"),
.enableExperimentalFeature("LifetimeDependence"),
.enableExperimentalFeature("Span"),
availabilityMacro,
]
),
.testTarget(
name: "SubprocessTests",
dependencies: [
"_SubprocessCShims",
"Subprocess",
"TestResources",
.product(name: "SystemPackage", package: "swift-system"),
],
swiftSettings: [
.enableExperimentalFeature("Span"),
availabilityMacro,
]
),

.target(
name: "TestResources",
dependencies: [
.product(name: "SystemPackage", package: "swift-system")
],
path: "Tests/TestResources",
resources: [
.copy("Resources")
]
),

.target(
name: "_SubprocessCShims",
path: "Sources/_SubprocessCShims"
),
]
)
76 changes: 76 additions & 0 deletions Package@swift-6.0.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
// swift-tools-version: 6.0
// The swift-tools-version declares the minimum version of Swift required to build this package.

import PackageDescription

let availabilityMacro: SwiftSetting = .enableExperimentalFeature(
"AvailabilityMacro=SubprocessSpan: macOS 9999"
)

let package = Package(
name: "Subprocess",
platforms: [.macOS(.v13)],
products: [
.library(
name: "Subprocess",
targets: ["Subprocess"]
)
],
dependencies: [
.package(
url: "https://github.com/apple/swift-system",
from: "1.0.0"
),
.package(
url: "https://github.com/apple/swift-docc-plugin",
from: "1.4.3"
),
],
targets: [
.target(
name: "Subprocess",
dependencies: [
"_SubprocessCShims",
.product(name: "SystemPackage", package: "swift-system"),
],
path: "Sources/Subprocess",
exclude: [
"Span+Subprocess.swift",
"SubprocessFoundation/Span+SubprocessFoundation.swift",
],
swiftSettings: [
.enableExperimentalFeature("StrictConcurrency"),
.define("SubprocessFoundation"),
availabilityMacro,
]
),
.testTarget(
name: "SubprocessTests",
dependencies: [
"_SubprocessCShims",
"Subprocess",
"TestResources",
.product(name: "SystemPackage", package: "swift-system"),
],
swiftSettings: [
availabilityMacro
]
),

.target(
name: "TestResources",
dependencies: [
.product(name: "SystemPackage", package: "swift-system")
],
path: "Tests/TestResources",
resources: [
.copy("Resources")
]
),

.target(
name: "_SubprocessCShims",
path: "Sources/_SubprocessCShims"
),
]
)
Loading