Skip to content

Commit 9f493bc

Browse files
Update xcconfig tracking and provisioning (#234)
1 parent 0054f3e commit 9f493bc

File tree

4 files changed

+27
-29
lines changed

4 files changed

+27
-29
lines changed

Examples/WhisperAX/Debug.xcconfig

-8
This file was deleted.

Makefile

+3-7
Original file line numberDiff line numberDiff line change
@@ -35,15 +35,11 @@ setup:
3535

3636
generate-whisperax-xcconfig:
3737
@echo "Updating DEVELOPMENT_TEAM in Examples/WhisperAX/Debug.xcconfig..."
38-
@TEAM_ID=$$(defaults read com.apple.dt.Xcode IDEProvisioningTeamManagerLastSelectedTeamID 2>/dev/null); \
38+
@TEAM_ID=$$(defaults read com.apple.dt.Xcode IDEProvisioningTeams | plutil -convert json -r -o - -- - | jq -r 'to_entries[0].value | sort_by(.teamType == "Individual") | .[0].teamID' 2>/dev/null); \
3939
if [ -z "$$TEAM_ID" ]; then \
4040
echo "Error: No Development Team ID found. Please log into Xcode with your Apple ID and select a team."; \
4141
else \
42-
if grep -q '^DEVELOPMENT_TEAM' Examples/WhisperAX/Debug.xcconfig; then \
43-
sed -i '' "s/^\(DEVELOPMENT_TEAM *= *\).*/\1$$TEAM_ID/" Examples/WhisperAX/Debug.xcconfig; \
44-
else \
45-
echo "DEVELOPMENT_TEAM=$$TEAM_ID" >> Examples/WhisperAX/Debug.xcconfig; \
46-
fi; \
42+
echo "DEVELOPMENT_TEAM=$$TEAM_ID" > Examples/WhisperAX/Debug.xcconfig; \
4743
echo "DEVELOPMENT_TEAM has been updated in Examples/WhisperAX/Debug.xcconfig with your Development Team ID: $$TEAM_ID"; \
4844
fi
4945

@@ -121,7 +117,7 @@ list-devices:
121117
# make benchmark-devices DEVICES="iPhone 15 Pro Max,My Mac" # Benchmark specific device names from `make list-devices`
122118
DEVICES ?=
123119
DEBUG ?= false
124-
benchmark-devices:
120+
benchmark-devices: generate-whisperax-xcconfig
125121
@if [ -n "$(DEVICES)" ]; then \
126122
echo "Benchmarking specific devices: $(DEVICES)"; \
127123
fastlane benchmark devices:"$(DEVICES)" debug:$(DEBUG); \

README.md

+22-2
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ Check out the demo app on [TestFlight](https://testflight.apple.com/join/LPVOyJZ
3030
- [Installation](#installation)
3131
- [Swift Package Manager](#swift-package-manager)
3232
- [Prerequisites](#prerequisites)
33-
- [Steps](#steps)
33+
- [Xcode Steps](#xcode-steps)
34+
- [Package.swift](#packageswift)
3435
- [Homebrew](#homebrew)
3536
- [Getting Started](#getting-started)
3637
- [Quick Example](#quick-example)
@@ -52,14 +53,33 @@ WhisperKit can be integrated into your Swift project using the Swift Package Man
5253
- macOS 14.0 or later.
5354
- Xcode 15.0 or later.
5455

55-
### Steps
56+
### Xcode Steps
5657

5758
1. Open your Swift project in Xcode.
5859
2. Navigate to `File` > `Add Package Dependencies...`.
5960
3. Enter the package repository URL: `https://github.com/argmaxinc/whisperkit`.
6061
4. Choose the version range or specific version.
6162
5. Click `Finish` to add WhisperKit to your project.
6263

64+
### Package.swift
65+
66+
If you're using WhisperKit as part of a swift package, you can include it in your Package.swift dependencies as follows:
67+
68+
```swift
69+
dependencies: [
70+
.package(url: "https://github.com/argmaxinc/WhisperKit.git", from: "0.9.0"),
71+
],
72+
```
73+
74+
Then add `WhisperKit` as a dependency for your target:
75+
76+
```swift
77+
.target(
78+
name: "YourApp",
79+
dependencies: ["WhisperKit"]
80+
),
81+
```
82+
6383
### Homebrew
6484

6585
You can install `WhisperKit` command line app using [Homebrew](https://brew.sh) by running the following command:

fastlane/Fastfile

+2-12
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ require 'pathname'
1818
COMMIT_HASH = `git rev-parse --short HEAD`.strip
1919
COMMIT_TIMESTAMP = `git log -1 --format=%ct`.strip
2020
COMMIT_TIMESTAMP = Time.at(COMMIT_TIMESTAMP.to_i).utc.strftime('%Y-%m-%dT%H%M%S')
21-
XCODE_TEAM_ID = `defaults read com.apple.dt.Xcode IDEProvisioningTeamManagerLastSelectedTeamID`.strip
2221
WORKING_DIR = Dir.pwd
2322
BASE_BENCHMARK_PATH = "#{WORKING_DIR}/benchmark_data".freeze
2423
BASE_UPLOAD_PATH = "#{WORKING_DIR}/upload_folder".freeze
@@ -196,13 +195,6 @@ def run_benchmarks(devices:, config:)
196195
end
197196
end
198197

199-
team_id = XCODE_TEAM_ID
200-
if team_id.empty?
201-
UI.user_error!('Development Team ID not found. Please log into Xcode with your Apple ID.')
202-
else
203-
UI.message("Using Development Team ID: #{team_id}")
204-
end
205-
206198
run_benchmark(devices, config)
207199
end
208200

@@ -239,7 +231,7 @@ def run_benchmark(devices, config)
239231
xcargs = [
240232
"MODEL_NAME=#{model}",
241233
'-allowProvisioningUpdates',
242-
"DEVELOPMENT_TEAM=#{XCODE_TEAM_ID}"
234+
'-allowProvisioningDeviceRegistration'
243235
].join(' ')
244236

245237
scan_result = scan(
@@ -255,9 +247,7 @@ def run_benchmark(devices, config)
255247
output_directory: XCRESULT_PATH,
256248
suppress_xcode_output: false,
257249
result_bundle: true,
258-
# show_xcode_test_logs: true
259250
buildlog_path: XCRESULT_PATH,
260-
# include_simulator_logs: true,
261251
output_style: 'raw',
262252
fail_build: false
263253
)
@@ -357,7 +347,7 @@ def merge_all_summaries(summaries, devices, _config)
357347

358348
unless result[:success]
359349
merged_data[:modelsTested] << model
360-
merged_data[:failureInfo][model] = result[:error] || 'Test failed'
350+
merged_data[:failureInfo][model] = result[:error] || "Test failed without error message, full output: #{result}"
361351
end
362352
end
363353

0 commit comments

Comments
 (0)