xcodebuild-axi 0.1.2 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +52 -1
- package/dist/src/commands/result.d.ts +8 -0
- package/dist/src/commands/result.js +28 -1
- package/dist/src/commands/result.js.map +1 -1
- package/dist/src/commands/settings.d.ts +9 -1
- package/dist/src/commands/settings.js +58 -4
- package/dist/src/commands/settings.js.map +1 -1
- package/dist/src/commands/setup.js +19 -1
- package/dist/src/commands/setup.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,55 @@ Notable changes to `xcodebuild-axi`. Versions follow
|
|
|
6
6
|
|
|
7
7
|
## [Unreleased]
|
|
8
8
|
|
|
9
|
+
## [0.1.4] - 2026-09-21
|
|
10
|
+
|
|
11
|
+
### Added
|
|
12
|
+
|
|
13
|
+
- `settings` takes `--device`, `--destination` and `--sdk`. Build settings are
|
|
14
|
+
destination-dependent, and without one xcodebuild resolves against the
|
|
15
|
+
default _device_ SDK -- so `BUILT_PRODUCTS_DIR` came back under
|
|
16
|
+
`Debug-iphoneos` while `build` and `test` default to a simulator. There was
|
|
17
|
+
no flag to ask otherwise, which made `settings` the wrong way to locate a
|
|
18
|
+
simulator `.app`, silently.
|
|
19
|
+
|
|
20
|
+
### Changed
|
|
21
|
+
|
|
22
|
+
- `settings` reports `platform:` alongside the scheme, so an answer always
|
|
23
|
+
names the destination it is for. The default is unchanged -- still the
|
|
24
|
+
device SDK -- but it no longer looks like the simulator one.
|
|
25
|
+
|
|
26
|
+
### Fixed
|
|
27
|
+
|
|
28
|
+
- `result` reported a **build** bundle as a test run: `result: unknown`,
|
|
29
|
+
`title: Test - MyApp`, `0 passed / 0 failed`, on an `unknown` destination.
|
|
30
|
+
This is the same misread 0.1.2 fixed in the home view, in the second place it
|
|
31
|
+
lives -- and 0.1.2 made it easier to reach rather than harder, because the
|
|
32
|
+
home view now prints `see \`xcodebuild-axi result <path>\`` and that command
|
|
33
|
+
then gave the wrong answer.
|
|
34
|
+
|
|
35
|
+
`home.ts` discriminates on the name `runLabel` gave the bundle, which `result`
|
|
36
|
+
cannot do: it takes an arbitrary path, and its own help offers
|
|
37
|
+
`build/MyApp.xcresult`. So `result` gates the verdict path on the bundle
|
|
38
|
+
having actually recorded tests, and reports anything else from
|
|
39
|
+
`build-results`, which carries the real `actionTitle`, `status` and
|
|
40
|
+
`destination`. A build now reads `result: succeeded`, `title: Build "MyApp"`,
|
|
41
|
+
with the device it landed on.
|
|
42
|
+
|
|
43
|
+
## [0.1.3] - 2026-09-21
|
|
44
|
+
|
|
45
|
+
### Fixed
|
|
46
|
+
|
|
47
|
+
- `setup hooks` installed a session-start hook with a **10 second timeout**,
|
|
48
|
+
which is not long enough. The home view runs `xcodebuild -list`, and against
|
|
49
|
+
a workspace with 16 local Swift packages that resolves the package graph on a
|
|
50
|
+
cold run: measured 10.9s cold, then 2.9s and 1.4s warm. Cold is exactly the
|
|
51
|
+
case a session start hits, so the hook would be killed before it produced
|
|
52
|
+
anything — silently, with no error to notice. The timeout is now 30s, which
|
|
53
|
+
is a ceiling rather than a cost: a warm run still returns in a second or two.
|
|
54
|
+
|
|
55
|
+
Re-run `xcodebuild-axi setup hooks` to repair an already-installed hook; it
|
|
56
|
+
updates the existing entry in place rather than adding a second one.
|
|
57
|
+
|
|
9
58
|
## [0.1.2] - 2026-09-21
|
|
10
59
|
|
|
11
60
|
### Fixed
|
|
@@ -60,7 +109,9 @@ First release.
|
|
|
60
109
|
- 100% of the 117 options `xcodebuild -help` lists are covered, declared in
|
|
61
110
|
`src/surface.ts` and checked against the installed Xcode in CI.
|
|
62
111
|
|
|
63
|
-
[unreleased]: https://github.com/alexrrouse/xcodebuild-axi/compare/v0.1.
|
|
112
|
+
[unreleased]: https://github.com/alexrrouse/xcodebuild-axi/compare/v0.1.4...HEAD
|
|
113
|
+
[0.1.4]: https://github.com/alexrrouse/xcodebuild-axi/compare/v0.1.3...v0.1.4
|
|
114
|
+
[0.1.3]: https://github.com/alexrrouse/xcodebuild-axi/compare/v0.1.2...v0.1.3
|
|
64
115
|
[0.1.2]: https://github.com/alexrrouse/xcodebuild-axi/compare/v0.1.1...v0.1.2
|
|
65
116
|
[0.1.1]: https://github.com/alexrrouse/xcodebuild-axi/compare/v0.1.0...v0.1.1
|
|
66
117
|
[0.1.0]: https://github.com/alexrrouse/xcodebuild-axi/releases/tag/v0.1.0
|
|
@@ -1,2 +1,10 @@
|
|
|
1
|
+
import { type BuildResults } from "../xcresult.js";
|
|
1
2
|
export declare const RESULT_HELP = "usage: xcodebuild-axi result <path.xcresult> [flags]\nRe-reads a result bundle that a previous run wrote, without rebuilding.\nflags[4]:\n --failures failures and errors only\n --warnings include the full warning list\n --max <n> rows to list before summarizing the rest (default: 20)\n --full untruncated messages\nexamples:\n xcodebuild-axi result ~/Library/Caches/xcodebuild-axi/MyApps-1a2b3c4d/MyApp-iPhone-17-Pro-test.xcresult\n xcodebuild-axi result build/MyApp.xcresult --failures --full\n";
|
|
2
3
|
export declare function resultCommand(args: string[]): Promise<string>;
|
|
4
|
+
/**
|
|
5
|
+
* The header a non-test bundle reports. A build bundle carries every field the
|
|
6
|
+
* test-shaped query lacks: `actionTitle` names the action xcodebuild ran,
|
|
7
|
+
* `status` is the verdict it recorded, and `destination` is the device it
|
|
8
|
+
* actually landed on.
|
|
9
|
+
*/
|
|
10
|
+
export declare function buildFields(build: BuildResults): Record<string, string>;
|
|
@@ -37,7 +37,15 @@ export async function resultCommand(args) {
|
|
|
37
37
|
throw new AxiError(`Nothing readable in the bundle at ${rawPath}`, "RESULT_NOT_FOUND");
|
|
38
38
|
}
|
|
39
39
|
const blocks = [];
|
|
40
|
-
|
|
40
|
+
// `xcresulttool` answers the test-shaped query for *any* bundle, so a build
|
|
41
|
+
// comes back as `{title: "Test - X", totalTestCount: 0, result: "unknown"}`
|
|
42
|
+
// rather than as nothing. Reading that as a verdict rendered a build as
|
|
43
|
+
// `result: unknown / title: Test - X / 0 passed / 0 failed`, which is the
|
|
44
|
+
// shape of a clean pass. `home.ts` fixed the same misread by trusting the
|
|
45
|
+
// name `runLabel` gave the bundle, but `result` takes an arbitrary path --
|
|
46
|
+
// its own help offers `build/MyApp.xcresult` -- so the name proves nothing
|
|
47
|
+
// here and the count is the discriminator instead.
|
|
48
|
+
if (summary && (summary.totalTestCount ?? 0) > 0) {
|
|
41
49
|
const device = summary.devicesAndConfigurations?.[0]?.device;
|
|
42
50
|
blocks.push(renderFields({
|
|
43
51
|
result: summary.result?.toLowerCase() ?? "unknown",
|
|
@@ -65,6 +73,9 @@ export async function resultCommand(args) {
|
|
|
65
73
|
blocks.push(renderFields({ failures: "0 test failures in this bundle" }));
|
|
66
74
|
}
|
|
67
75
|
}
|
|
76
|
+
else if (build) {
|
|
77
|
+
blocks.push(renderFields(buildFields(build)));
|
|
78
|
+
}
|
|
68
79
|
if (build) {
|
|
69
80
|
const errors = toDiagnostics(build.errors);
|
|
70
81
|
const warnings = toDiagnostics([
|
|
@@ -93,6 +104,22 @@ export async function resultCommand(args) {
|
|
|
93
104
|
blocks.push(renderHelp(hints));
|
|
94
105
|
return renderOutput(blocks);
|
|
95
106
|
}
|
|
107
|
+
/**
|
|
108
|
+
* The header a non-test bundle reports. A build bundle carries every field the
|
|
109
|
+
* test-shaped query lacks: `actionTitle` names the action xcodebuild ran,
|
|
110
|
+
* `status` is the verdict it recorded, and `destination` is the device it
|
|
111
|
+
* actually landed on.
|
|
112
|
+
*/
|
|
113
|
+
export function buildFields(build) {
|
|
114
|
+
return {
|
|
115
|
+
result: build.status?.toLowerCase() ?? "unknown",
|
|
116
|
+
title: build.actionTitle ?? "",
|
|
117
|
+
destination: describeDevice(build.destination),
|
|
118
|
+
duration: build.startTime !== undefined && build.endTime !== undefined
|
|
119
|
+
? duration(build.endTime - build.startTime)
|
|
120
|
+
: "unknown",
|
|
121
|
+
};
|
|
122
|
+
}
|
|
96
123
|
function expandTilde(path) {
|
|
97
124
|
const home = process.env["HOME"];
|
|
98
125
|
return home && path.startsWith("~/") ? `${home}${path.slice(1)}` : path;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"result.js","sourceRoot":"","sources":["../../../src/commands/result.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EACL,cAAc,EACd,gBAAgB,EAChB,eAAe,EACf,aAAa,
|
|
1
|
+
{"version":3,"file":"result.js","sourceRoot":"","sources":["../../../src/commands/result.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EACL,cAAc,EACd,gBAAgB,EAChB,eAAe,EACf,aAAa,GAEd,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,EACL,QAAQ,EACR,YAAY,EACZ,UAAU,EACV,UAAU,EACV,YAAY,EACZ,SAAS,EACT,QAAQ,GACT,MAAM,YAAY,CAAC;AACpB,OAAO,EACL,UAAU,EACV,OAAO,EACP,WAAW,EACX,kBAAkB,GACnB,MAAM,YAAY,CAAC;AAEpB,MAAM,CAAC,MAAM,WAAW,GAAG;;;;;;;;;;CAU1B,CAAC;AAEF,MAAM,KAAK,GAAG,CAAC,YAAY,EAAE,YAAY,EAAE,OAAO,EAAE,QAAQ,CAAU,CAAC;AAEvE,MAAM,CAAC,KAAK,UAAU,aAAa,CAAC,IAAc;IAChD,kBAAkB,CAAC,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;IAErD,MAAM,CAAC,OAAO,CAAC,GAAG,WAAW,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;IAC/C,IAAI,OAAO,KAA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AM,CAAC,CAAC;IACjC,OAAO,IAAI,IAAI,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;AAC1E,CAAC"}
|
|
@@ -1,2 +1,10 @@
|
|
|
1
|
-
export declare const SETTINGS_HELP = "usage: xcodebuild-axi settings [flags]\nReads resolved build settings. Asking for the keys you want turns a 40 KB dump\ninto a few lines.\nflags[
|
|
1
|
+
export declare const SETTINGS_HELP = "usage: xcodebuild-axi settings [flags]\nReads resolved build settings. Asking for the keys you want turns a 40 KB dump\ninto a few lines.\nflags[10]:\n --scheme <name> scheme to resolve against (required only when the project has more than one)\n --key <NAME> setting to read; repeatable or comma-separated\n --configuration <name> build configuration to resolve against\n --device <name> resolve against a simulator or device by name, e.g. \"iPhone 17 Pro\"\n --destination <spec> raw xcodebuild destination specifier, passed through untouched\n --sdk <name> base SDK to resolve against, e.g. iphonesimulator\n --all dump every setting (large \u2014 hundreds of keys)\n --for-index the per-source-file settings an indexer sees\n --file <path> with --for-index: the one source file to report on\n --full with --for-index --file: list the long argument arrays\nnote:\n Paths and platform names are destination-dependent. With no --device,\n --destination or --sdk, xcodebuild resolves against the default SDK, which is\n the *device* SDK -- so BUILT_PRODUCTS_DIR comes back under Debug-iphoneos\n while build and test default to a simulator. The reported platform names\n what the answer is for.\n --for-index answers a different question from the rest of this command: it\n reports the compiler invocation the indexer builds per source file. The raw\n payload measured 216 KB on a 12-scheme workspace, so without --file it\n reports only which targets have index settings and how many files each has.\nexamples:\n xcodebuild-axi settings --key PRODUCT_BUNDLE_IDENTIFIER,MARKETING_VERSION\n xcodebuild-axi settings --scheme MyApp --key SWIFT_VERSION\n xcodebuild-axi settings --scheme MyApp --device \"iPhone 17 Pro\" --key BUILT_PRODUCTS_DIR\n xcodebuild-axi settings --scheme MyApp --for-index --file MyApp/AppFeature.swift\n";
|
|
2
2
|
export declare function settingsCommand(args: string[]): Promise<string>;
|
|
3
|
+
/**
|
|
4
|
+
* Name the platform an answer is for. These settings are destination-dependent
|
|
5
|
+
* and the destination is easy not to think about, so the report says which one
|
|
6
|
+
* it resolved against rather than leaving the reader to assume.
|
|
7
|
+
*/
|
|
8
|
+
export declare function platformOf(settings: Record<string, unknown>): {
|
|
9
|
+
platform: string;
|
|
10
|
+
} | Record<string, never>;
|
|
@@ -1,21 +1,30 @@
|
|
|
1
1
|
import { AxiError } from "../errors.js";
|
|
2
2
|
import { requireProject } from "../context.js";
|
|
3
3
|
import { requireScheme } from "../scheme.js";
|
|
4
|
+
import { resolveDestination } from "../destination.js";
|
|
4
5
|
import { runMetadata } from "../xcodebuild.js";
|
|
5
6
|
import { renderFields, renderHelp, renderList, renderOutput } from "../toon.js";
|
|
6
7
|
import { getFlag, getListFlag, hasFlag, rejectUnknownFlags } from "../args.js";
|
|
7
8
|
export const SETTINGS_HELP = `usage: xcodebuild-axi settings [flags]
|
|
8
9
|
Reads resolved build settings. Asking for the keys you want turns a 40 KB dump
|
|
9
10
|
into a few lines.
|
|
10
|
-
flags[
|
|
11
|
+
flags[10]:
|
|
11
12
|
--scheme <name> scheme to resolve against (required only when the project has more than one)
|
|
12
13
|
--key <NAME> setting to read; repeatable or comma-separated
|
|
13
14
|
--configuration <name> build configuration to resolve against
|
|
15
|
+
--device <name> resolve against a simulator or device by name, e.g. "iPhone 17 Pro"
|
|
16
|
+
--destination <spec> raw xcodebuild destination specifier, passed through untouched
|
|
17
|
+
--sdk <name> base SDK to resolve against, e.g. iphonesimulator
|
|
14
18
|
--all dump every setting (large — hundreds of keys)
|
|
15
19
|
--for-index the per-source-file settings an indexer sees
|
|
16
20
|
--file <path> with --for-index: the one source file to report on
|
|
17
21
|
--full with --for-index --file: list the long argument arrays
|
|
18
22
|
note:
|
|
23
|
+
Paths and platform names are destination-dependent. With no --device,
|
|
24
|
+
--destination or --sdk, xcodebuild resolves against the default SDK, which is
|
|
25
|
+
the *device* SDK -- so BUILT_PRODUCTS_DIR comes back under Debug-iphoneos
|
|
26
|
+
while build and test default to a simulator. The reported platform names
|
|
27
|
+
what the answer is for.
|
|
19
28
|
--for-index answers a different question from the rest of this command: it
|
|
20
29
|
reports the compiler invocation the indexer builds per source file. The raw
|
|
21
30
|
payload measured 216 KB on a 12-scheme workspace, so without --file it
|
|
@@ -23,18 +32,30 @@ note:
|
|
|
23
32
|
examples:
|
|
24
33
|
xcodebuild-axi settings --key PRODUCT_BUNDLE_IDENTIFIER,MARKETING_VERSION
|
|
25
34
|
xcodebuild-axi settings --scheme MyApp --key SWIFT_VERSION
|
|
35
|
+
xcodebuild-axi settings --scheme MyApp --device "iPhone 17 Pro" --key BUILT_PRODUCTS_DIR
|
|
26
36
|
xcodebuild-axi settings --scheme MyApp --for-index --file MyApp/AppFeature.swift
|
|
27
37
|
`;
|
|
28
38
|
const FLAGS = [
|
|
29
39
|
"--scheme",
|
|
30
40
|
"--key",
|
|
31
41
|
"--configuration",
|
|
42
|
+
"--device",
|
|
43
|
+
"--destination",
|
|
44
|
+
"--sdk",
|
|
32
45
|
"--all",
|
|
33
46
|
"--for-index",
|
|
34
47
|
"--file",
|
|
35
48
|
"--full",
|
|
36
49
|
];
|
|
37
|
-
const VALUE_FLAGS = [
|
|
50
|
+
const VALUE_FLAGS = [
|
|
51
|
+
"--scheme",
|
|
52
|
+
"--key",
|
|
53
|
+
"--configuration",
|
|
54
|
+
"--device",
|
|
55
|
+
"--destination",
|
|
56
|
+
"--sdk",
|
|
57
|
+
"--file",
|
|
58
|
+
];
|
|
38
59
|
export async function settingsCommand(args) {
|
|
39
60
|
rejectUnknownFlags(args, "settings", FLAGS, VALUE_FLAGS);
|
|
40
61
|
const keys = getListFlag(args, "--key");
|
|
@@ -49,11 +70,30 @@ export async function settingsCommand(args) {
|
|
|
49
70
|
const project = requireProject();
|
|
50
71
|
const scheme = await requireScheme(project, getFlag(args, "--scheme"), "settings");
|
|
51
72
|
const configuration = getFlag(args, "--configuration");
|
|
73
|
+
const sdk = getFlag(args, "--sdk");
|
|
74
|
+
// Without a destination xcodebuild resolves against the default *device*
|
|
75
|
+
// SDK, so BUILT_PRODUCTS_DIR and PLATFORM_NAME describe a build that
|
|
76
|
+
// `xcodebuild-axi build` -- which defaults to the newest simulator -- never
|
|
77
|
+
// performs. Reading the `.app` path out of that answer sends you to an
|
|
78
|
+
// iphoneos directory for a simulator build. Only resolve when asked, so the
|
|
79
|
+
// default answer does not move under anyone.
|
|
80
|
+
const rawDestination = getFlag(args, "--destination");
|
|
81
|
+
const device = getFlag(args, "--device");
|
|
82
|
+
const destination = rawDestination !== undefined || device !== undefined
|
|
83
|
+
? await resolveDestination({
|
|
84
|
+
project,
|
|
85
|
+
scheme,
|
|
86
|
+
...(device !== undefined ? { device } : {}),
|
|
87
|
+
...(rawDestination !== undefined ? { raw: rawDestination } : {}),
|
|
88
|
+
})
|
|
89
|
+
: undefined;
|
|
52
90
|
const { stdout } = await runMetadata([
|
|
53
91
|
...project.flags,
|
|
54
92
|
"-scheme",
|
|
55
93
|
scheme,
|
|
56
94
|
...(configuration ? ["-configuration", configuration] : []),
|
|
95
|
+
...(destination ? ["-destination", destination.specifier] : []),
|
|
96
|
+
...(sdk ? ["-sdk", sdk] : []),
|
|
57
97
|
forIndex ? "-showBuildSettingsForIndex" : "-showBuildSettings",
|
|
58
98
|
"-json",
|
|
59
99
|
]);
|
|
@@ -61,9 +101,14 @@ export async function settingsCommand(args) {
|
|
|
61
101
|
return reportIndexSettings(stdout, scheme, getFlag(args, "--file"), hasFlag(args, "--full"));
|
|
62
102
|
}
|
|
63
103
|
const settings = parseSettings(stdout);
|
|
104
|
+
const platform = platformOf(settings);
|
|
64
105
|
if (all) {
|
|
65
106
|
return renderOutput([
|
|
66
|
-
renderFields({
|
|
107
|
+
renderFields({
|
|
108
|
+
scheme,
|
|
109
|
+
...platform,
|
|
110
|
+
settings: Object.keys(settings).length,
|
|
111
|
+
}),
|
|
67
112
|
renderFields({ ...settings }),
|
|
68
113
|
]);
|
|
69
114
|
}
|
|
@@ -76,7 +121,7 @@ export async function settingsCommand(args) {
|
|
|
76
121
|
else
|
|
77
122
|
found[key] = value;
|
|
78
123
|
}
|
|
79
|
-
const blocks = [renderFields({ scheme })];
|
|
124
|
+
const blocks = [renderFields({ scheme, ...platform })];
|
|
80
125
|
if (Object.keys(found).length > 0) {
|
|
81
126
|
blocks.push(renderFields({ settings: found }));
|
|
82
127
|
}
|
|
@@ -90,6 +135,15 @@ export async function settingsCommand(args) {
|
|
|
90
135
|
}
|
|
91
136
|
return renderOutput(blocks);
|
|
92
137
|
}
|
|
138
|
+
/**
|
|
139
|
+
* Name the platform an answer is for. These settings are destination-dependent
|
|
140
|
+
* and the destination is easy not to think about, so the report says which one
|
|
141
|
+
* it resolved against rather than leaving the reader to assume.
|
|
142
|
+
*/
|
|
143
|
+
export function platformOf(settings) {
|
|
144
|
+
const name = settings["PLATFORM_NAME"];
|
|
145
|
+
return typeof name === "string" && name.length > 0 ? { platform: name } : {};
|
|
146
|
+
}
|
|
93
147
|
/**
|
|
94
148
|
* `-showBuildSettingsForIndex` is the one query in this family whose full
|
|
95
149
|
* output is never worth printing: it repeats the entire Swift driver command
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"settings.js","sourceRoot":"","sources":["../../../src/commands/settings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAChF,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,OAAO,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAE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AACnB,CAAC;AAED,SAAS,MAAM,CAAC,KAAa,EAAE,GAAW,EAAE,IAAI,GAAG,GAAG,GAAG,GAAG;IAC1D,OAAO,GAAG,KAAK,IAAI,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;AAChD,CAAC;AAED,SAAS,aAAa,CAAC,IAAY;IACjC,MAAM,GAAG,GAAG,GAAG,OAAO,CAAC,GAAG,EAAE,GAAG,CAAC;IAChC,OAAO,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AAC9D,CAAC;AAED;;;;GAIG;AACH,SAAS,aAAa,CAAC,MAAc;IACnC,MAAM,KAAK,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IAClC,IAAI,KAAK,KAAK,CAAC,CAAC;QAAE,OAAO,EAAE,CAAC;IAC5B,IAAI,MAAoD,CAAC;IACzD,IAAI,CAAC;QACH,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAEpC,CAAC;IACN,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,EAAE,CAAC;IACZ,CAAC;IACD,MAAM,MAAM,GAA2B,EAAE,CAAC;IAC1C,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QAC3B,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,KAAK,CAAC,aAAa,IAAI,EAAE,CAAC,CAAC;IACnD,CAAC;IACD,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
|
@@ -31,6 +31,20 @@ const FLAGS = ["--project", "--status", "--uninstall"];
|
|
|
31
31
|
* as soon as the checkout moved.
|
|
32
32
|
*/
|
|
33
33
|
const MARKER = "xcodebuild-axi";
|
|
34
|
+
/**
|
|
35
|
+
* How long the session-start hook is allowed to take.
|
|
36
|
+
*
|
|
37
|
+
* The SDK defaults to 10s, which is not enough. The home view runs
|
|
38
|
+
* `xcodebuild -list`, and against a workspace with 16 local Swift packages
|
|
39
|
+
* that resolves the package graph on a cold run: measured 10.9s cold, then
|
|
40
|
+
* 2.9s and 1.4s warm. Cold is exactly the case a session start hits, and a
|
|
41
|
+
* hook that times out contributes nothing at all — the whole point of it is
|
|
42
|
+
* lost silently, with no error to notice.
|
|
43
|
+
*
|
|
44
|
+
* 30s is headroom over the slowest real measurement rather than a guess. It is
|
|
45
|
+
* a ceiling, not a cost: a warm run still returns in a second or two.
|
|
46
|
+
*/
|
|
47
|
+
const HOOK_TIMEOUT_SECONDS = 30;
|
|
34
48
|
export async function setupCommand(args) {
|
|
35
49
|
rejectUnknownFlags(args, "setup", FLAGS);
|
|
36
50
|
const [target] = positionals(args, []);
|
|
@@ -64,7 +78,11 @@ export async function setupCommand(args) {
|
|
|
64
78
|
await uninstallSessionStartHooks({ scope, marker: MARKER });
|
|
65
79
|
return renderOutput([renderFields({ setup: "hooks removed", scope })]);
|
|
66
80
|
}
|
|
67
|
-
await installSessionStartHooks({
|
|
81
|
+
await installSessionStartHooks({
|
|
82
|
+
scope,
|
|
83
|
+
marker: MARKER,
|
|
84
|
+
timeoutSeconds: HOOK_TIMEOUT_SECONDS,
|
|
85
|
+
});
|
|
68
86
|
const status = sessionStartHookStatus({ scope, marker: MARKER });
|
|
69
87
|
return renderOutput([
|
|
70
88
|
renderFields({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setup.js","sourceRoot":"","sources":["../../../src/commands/setup.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,wBAAwB,EACxB,sBAAsB,EACtB,0BAA0B,GAC3B,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AACpE,OAAO,EAAE,O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