Skip to content

Commit c2f7268

Browse files
authored
Merge pull request #472 from XcodesOrg/concurrency-shared-xcodeskit
Shared XcodesKit, XcodesLoginKit
2 parents 93bce87 + b61eb07 commit c2f7268

91 files changed

Lines changed: 2926 additions & 6644 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,25 @@ jobs:
55
runs-on: macos-15
66
steps:
77
- uses: actions/checkout@v4
8+
- name: Checkout local package dependencies
9+
run: |
10+
set -euo pipefail
11+
12+
checkout_dependency() {
13+
local repo="$1"
14+
local checkout_path="$2"
15+
local branch="${GITHUB_HEAD_REF:-${GITHUB_REF_NAME:-}}"
16+
17+
if [ -n "$branch" ] && git ls-remote --exit-code --heads "https://github.com/${repo}.git" "$branch" >/dev/null; then
18+
git clone --depth 1 --branch "$branch" "https://github.com/${repo}.git" "$checkout_path"
19+
else
20+
git clone --depth 1 "https://github.com/${repo}.git" "$checkout_path"
21+
fi
22+
}
23+
24+
checkout_dependency XcodesOrg/XcodesLoginKit ../XcodesLoginKit
25+
checkout_dependency XcodesOrg/XcodesKit ../XcodesKit
826
- name: Run tests
9-
env:
27+
env:
1028
DEVELOPER_DIR: /Applications/Xcode_16.4.app
1129
run: swift test

Package.resolved

Lines changed: 23 additions & 22 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Package.swift

Lines changed: 17 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,83 +1,66 @@
1-
// swift-tools-version:5.6
1+
// swift-tools-version:6.0
22
import PackageDescription
33

44
let package = Package(
55
name: "xcodes",
66
platforms: [
7-
.macOS(.v10_15)
7+
.macOS(.v13),
8+
.iOS(.v17)
89
],
910
products: [
1011
.executable(name: "xcodes", targets: ["xcodes"]),
11-
.library(name: "XcodesKit", targets: ["XcodesKit"]),
12-
.library(name: "AppleAPI", targets: ["AppleAPI"]),
12+
.library(name: "XcodesCLIKit", targets: ["XcodesCLIKit"]),
1313
],
1414
dependencies: [
1515
.package(url: "https://github.com/apple/swift-argument-parser", .upToNextMinor(from: "1.1.4")),
16-
.package(url: "https://github.com/mxcl/Path.swift.git", .upToNextMinor(from: "0.16.0")),
16+
.package(url: "https://github.com/mxcl/Path.swift.git", from: "1.0.0"),
1717
.package(url: "https://github.com/mxcl/Version.git", .upToNextMinor(from: "1.0.3")),
18-
.package(url: "https://github.com/mxcl/PromiseKit.git", .upToNextMinor(from: "6.22.1")),
19-
.package(url: "https://github.com/PromiseKit/Foundation.git", .upToNextMinor(from: "3.4.0")),
2018
.package(url: "https://github.com/scinfu/SwiftSoup.git", .upToNextMinor(from: "2.0.0")),
2119
.package(url: "https://github.com/mxcl/LegibleError.git", .upToNextMinor(from: "1.0.1")),
2220
.package(url: "https://github.com/kishikawakatsumi/KeychainAccess.git", .upToNextMinor(from: "3.2.0")),
2321
.package(url: "https://github.com/xcodereleases/data", revision: "fcf527b187817f67c05223676341f3ab69d4214d"),
2422
.package(url: "https://github.com/onevcat/Rainbow.git", .upToNextMinor(from: "3.2.0")),
25-
.package(url: "https://github.com/jpsim/Yams", .upToNextMinor(from: "5.0.1")),
26-
.package(url: "https://github.com/xcodesOrg/swift-srp", branch: "main")
23+
.package(path: "../XcodesLoginKit"),
24+
.package(path: "../XcodesKit")
2725
],
2826
targets: [
2927
.executableTarget(
3028
name: "xcodes",
3129
dependencies: [
3230
.product(name: "ArgumentParser", package: "swift-argument-parser"),
33-
"XcodesKit"
31+
"XcodesCLIKit",
32+
.product(name: "XcodesKit", package: "XcodesKit")
3433
]),
3534
.testTarget(
3635
name: "xcodesTests",
3736
dependencies: [
3837
"xcodes"
3938
]),
4039
.target(
41-
name: "XcodesKit",
40+
name: "XcodesCLIKit",
4241
dependencies: [
43-
"AppleAPI",
4442
"KeychainAccess",
4543
"LegibleError",
4644
.product(name: "Path", package: "Path.swift"),
47-
"PromiseKit",
48-
.product(name: "PMKFoundation", package: "Foundation"),
4945
"SwiftSoup",
5046
"Unxip",
5147
"Version",
5248
.product(name: "XCModel", package: "data"),
53-
"Rainbow",
54-
"Yams"
55-
]),
49+
"XcodesLoginKit",
50+
.product(name: "XcodesKit", package: "XcodesKit"),
51+
"Rainbow"
52+
],
53+
path: "Sources/XcodesKit"),
5654
.testTarget(
5755
name: "XcodesKitTests",
5856
dependencies: [
59-
"XcodesKit",
57+
"XcodesCLIKit",
58+
.product(name: "XcodesKit", package: "XcodesKit"),
6059
"Version"
6160
],
6261
resources: [
6362
.copy("Fixtures"),
6463
]),
6564
.target(name: "Unxip"),
66-
.target(
67-
name: "AppleAPI",
68-
dependencies: [
69-
"PromiseKit",
70-
.product(name: "PMKFoundation", package: "Foundation"),
71-
"Rainbow",
72-
.product(name: "SRP", package: "swift-srp")
73-
]),
74-
.testTarget(
75-
name: "AppleAPITests",
76-
dependencies: [
77-
"AppleAPI"
78-
],
79-
resources: [
80-
.copy("Fixtures"),
81-
]),
8265
]
8366
)

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,18 @@ If you have [aria2](https://aria2.github.io) installed (it's available in Homebr
101101

102102
Xcode will be installed to /Applications by default, but you can provide the path to a different directory with the `--directory` option or the `XCODES_DIRECTORY` environment variable. All of the xcodes commands support this option, like `select` and `uninstall`, so you can manage Xcode versions that aren't in /Applications. xcodes supports having all of your Xcode versions installed in _one_ directory, wherever that may be.
103103

104+
### Architectures
105+
106+
The `list` and `runtimes` commands show architecture availability when Apple provides it. Universal downloads are labeled `[Universal]`, Apple Silicon-only downloads are labeled `[Apple Silicon]`, and Intel-only downloads are labeled `[Intel]`.
107+
108+
You can filter either list by architecture or variant with `--architecture arm64`, `--architecture x86_64`, `--architecture appleSilicon`, or `--architecture universal`. These filters are exact: `arm64` and `appleSilicon` show Apple Silicon-only downloads, `x86_64` shows Intel-only downloads, and `universal` shows downloads that support both architectures. The option can be used multiple times.
109+
110+
```sh
111+
xcodes list --architecture arm64
112+
xcodes list --architecture universal
113+
xcodes runtimes --architecture arm64 --architecture universal --include-betas
114+
```
115+
104116
### Install Runtimes :
105117

106118
Run this command line to display the available runtimes

0 commit comments

Comments
 (0)