xcodebuild-axi 0.1.7 → 0.1.9

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.
Files changed (89) hide show
  1. package/CHANGELOG.md +137 -2
  2. package/README.md +77 -2
  3. package/dist/src/action.d.ts +8 -0
  4. package/dist/src/action.js +37 -30
  5. package/dist/src/action.js.map +1 -1
  6. package/dist/src/args.d.ts +11 -0
  7. package/dist/src/args.js +30 -0
  8. package/dist/src/args.js.map +1 -1
  9. package/dist/src/cli.d.ts +8 -0
  10. package/dist/src/cli.js +53 -22
  11. package/dist/src/cli.js.map +1 -1
  12. package/dist/src/commands/analyze.d.ts +2 -0
  13. package/dist/src/commands/analyze.js +3 -1
  14. package/dist/src/commands/analyze.js.map +1 -1
  15. package/dist/src/commands/archive.d.ts +1 -0
  16. package/dist/src/commands/archive.js +7 -3
  17. package/dist/src/commands/archive.js.map +1 -1
  18. package/dist/src/commands/build.d.ts +1 -0
  19. package/dist/src/commands/build.js +2 -2
  20. package/dist/src/commands/build.js.map +1 -1
  21. package/dist/src/commands/clean.d.ts +2 -1
  22. package/dist/src/commands/clean.js +38 -4
  23. package/dist/src/commands/clean.js.map +1 -1
  24. package/dist/src/commands/coverage.d.ts +1 -0
  25. package/dist/src/commands/coverage.js +7 -2
  26. package/dist/src/commands/coverage.js.map +1 -1
  27. package/dist/src/commands/destinations.d.ts +1 -0
  28. package/dist/src/commands/destinations.js +6 -2
  29. package/dist/src/commands/destinations.js.map +1 -1
  30. package/dist/src/commands/find.d.ts +1 -0
  31. package/dist/src/commands/find.js +2 -2
  32. package/dist/src/commands/find.js.map +1 -1
  33. package/dist/src/commands/info.d.ts +1 -0
  34. package/dist/src/commands/info.js +2 -2
  35. package/dist/src/commands/info.js.map +1 -1
  36. package/dist/src/commands/localize.d.ts +1 -0
  37. package/dist/src/commands/localize.js +2 -2
  38. package/dist/src/commands/localize.js.map +1 -1
  39. package/dist/src/commands/migrate.d.ts +1 -0
  40. package/dist/src/commands/migrate.js +2 -2
  41. package/dist/src/commands/migrate.js.map +1 -1
  42. package/dist/src/commands/packages.d.ts +2 -1
  43. package/dist/src/commands/packages.js +24 -8
  44. package/dist/src/commands/packages.js.map +1 -1
  45. package/dist/src/commands/platforms.d.ts +1 -0
  46. package/dist/src/commands/platforms.js +2 -2
  47. package/dist/src/commands/platforms.js.map +1 -1
  48. package/dist/src/commands/result.d.ts +1 -0
  49. package/dist/src/commands/result.js +10 -11
  50. package/dist/src/commands/result.js.map +1 -1
  51. package/dist/src/commands/schemes.d.ts +1 -0
  52. package/dist/src/commands/schemes.js +2 -1
  53. package/dist/src/commands/schemes.js.map +1 -1
  54. package/dist/src/commands/settings.d.ts +7 -1
  55. package/dist/src/commands/settings.js +136 -22
  56. package/dist/src/commands/settings.js.map +1 -1
  57. package/dist/src/commands/setup.d.ts +1 -0
  58. package/dist/src/commands/setup.js +2 -2
  59. package/dist/src/commands/setup.js.map +1 -1
  60. package/dist/src/commands/sim.d.ts +1 -0
  61. package/dist/src/commands/sim.js +2 -2
  62. package/dist/src/commands/sim.js.map +1 -1
  63. package/dist/src/commands/test.d.ts +1 -0
  64. package/dist/src/commands/test.js +11 -15
  65. package/dist/src/commands/test.js.map +1 -1
  66. package/dist/src/commands/testplans.d.ts +1 -0
  67. package/dist/src/commands/testplans.js +2 -1
  68. package/dist/src/commands/testplans.js.map +1 -1
  69. package/dist/src/commands/tests.d.ts +2 -1
  70. package/dist/src/commands/tests.js +21 -9
  71. package/dist/src/commands/tests.js.map +1 -1
  72. package/dist/src/commands/xcframework.d.ts +19 -1
  73. package/dist/src/commands/xcframework.js +116 -27
  74. package/dist/src/commands/xcframework.js.map +1 -1
  75. package/dist/src/errors.js +10 -0
  76. package/dist/src/errors.js.map +1 -1
  77. package/dist/src/report.d.ts +22 -1
  78. package/dist/src/report.js +40 -0
  79. package/dist/src/report.js.map +1 -1
  80. package/dist/src/scheme.d.ts +34 -0
  81. package/dist/src/scheme.js +46 -0
  82. package/dist/src/scheme.js.map +1 -1
  83. package/dist/src/surface.d.ts +134 -1
  84. package/dist/src/surface.js +668 -265
  85. package/dist/src/surface.js.map +1 -1
  86. package/dist/src/xcresult.d.ts +42 -0
  87. package/dist/src/xcresult.js +41 -0
  88. package/dist/src/xcresult.js.map +1 -1
  89. package/package.json +1 -1
@@ -2,54 +2,141 @@ import { existsSync } from "node:fs";
2
2
  import { AxiError } from "../errors.js";
3
3
  import { runMetadata, stripPreamble } from "../xcodebuild.js";
4
4
  import { renderFields, renderHelp, renderOutput, tildePath } from "../toon.js";
5
- import { getListFlag, getFlag, rejectUnknownFlags } from "../args.js";
5
+ import { getFlag, hasFlag, orderedFlags, rejectUnknownFlags } from "../args.js";
6
6
  export const XCFRAMEWORK_HELP = `usage: xcodebuild-axi xcframework --output <path.xcframework> [flags]
7
7
  Bundles prebuilt frameworks or libraries into one .xcframework.
8
- flags[4]:
9
- --output <path> the .xcframework to write (required)
10
- --framework <path> a built .framework to include; repeatable
11
- --library <path> a built static or dynamic library to include; repeatable
12
- --headers <path> headers for the library that precedes it; repeatable
8
+ flags[7]:
9
+ --output <path> the .xcframework to write (required)
10
+ --framework <path> a built .framework to include; repeatable
11
+ --library <path> a built static or dynamic library to include; repeatable
12
+ --headers <path> headers for the library that precedes it; repeatable
13
+ --archive <path> take the next --framework or --library out of this .xcarchive
14
+ --debug-symbols <path> dSYMs or bcsymbolmaps for the slice that precedes it; repeatable
15
+ --allow-internal-distribution mark the result as not for public distribution
13
16
  note:
14
- --headers applies to the --library it follows, which is how xcodebuild pairs
15
- them. Give them in matching order.
17
+ Order is meaning here, because it is meaning to xcodebuild: --headers and
18
+ --debug-symbols attach to the --framework or --library they follow, and
19
+ --archive applies to the one that follows it. After --archive, name the
20
+ framework or library rather than giving a path to it.
21
+ Ship dSYMs with anything a crash report has to be read from — an
22
+ .xcframework built without --debug-symbols cannot be symbolicated.
16
23
  examples:
17
24
  xcodebuild-axi xcframework --output Out.xcframework --framework A.framework --framework B.framework
18
25
  xcodebuild-axi xcframework --output Out.xcframework --library libA.a --headers include
26
+ xcodebuild-axi xcframework --output MyLib.xcframework \\
27
+ --archive ios.xcarchive --framework MyLib.framework --debug-symbols ios.xcarchive/dSYMs \\
28
+ --archive sim.xcarchive --framework MyLib.framework --debug-symbols sim.xcarchive/dSYMs
19
29
  `;
20
- const FLAGS = ["--output", "--framework", "--library", "--headers"];
30
+ export const XCFRAMEWORK_FLAGS = [
31
+ "--output",
32
+ "--framework",
33
+ "--library",
34
+ "--headers",
35
+ "--archive",
36
+ "--debug-symbols",
37
+ "--allow-internal-distribution",
38
+ ];
39
+ const VALUE_FLAGS = [
40
+ "--output",
41
+ "--framework",
42
+ "--library",
43
+ "--headers",
44
+ "--archive",
45
+ "--debug-symbols",
46
+ ];
47
+ /** The flags that name a slice of the xcframework rather than describing one. */
48
+ const SLICE_FLAGS = ["--framework", "--library"];
49
+ const XCODEBUILD_FLAG = {
50
+ "--framework": "-framework",
51
+ "--library": "-library",
52
+ "--headers": "-headers",
53
+ "--archive": "-archive",
54
+ "--debug-symbols": "-debug-symbols",
55
+ };
56
+ /**
57
+ * Translate the command's flags into xcodebuild's, keeping their order.
58
+ *
59
+ * xcodebuild reads this argument list positionally — `-headers` belongs to the
60
+ * `-library` before it, `-debug-symbols` to the slice before that, `-archive`
61
+ * to the slice after it — so the translation is a walk rather than a regroup.
62
+ */
63
+ export function planXcframework(args) {
64
+ const sequence = orderedFlags(args, Object.keys(XCODEBUILD_FLAG));
65
+ const plan = {
66
+ args: [],
67
+ frameworks: 0,
68
+ libraries: 0,
69
+ archives: 0,
70
+ missing: [],
71
+ };
72
+ let previous;
73
+ /** The archive the next slice comes out of, if one was just named. */
74
+ let pendingArchive;
75
+ for (const { flag, value } of sequence) {
76
+ if (flag === "--headers" && previous !== "--library") {
77
+ throw new AxiError("--headers describes the --library before it, and none precedes it", "VALIDATION_ERROR", [
78
+ "xcodebuild-axi xcframework --output Out.xcframework --library libA.a --headers include",
79
+ ]);
80
+ }
81
+ if (flag === "--debug-symbols" && !isSliceOrDescriptor(previous)) {
82
+ throw new AxiError("--debug-symbols describes the slice before it, and none precedes it", "VALIDATION_ERROR", [
83
+ "Put --debug-symbols after the --framework or --library it belongs to",
84
+ ]);
85
+ }
86
+ if (pendingArchive !== undefined && !SLICE_FLAGS.includes(flag)) {
87
+ throw new AxiError(`--archive '${pendingArchive}' is not followed by a --framework or --library`, "VALIDATION_ERROR", ["Name the framework or library to take out of the archive next"]);
88
+ }
89
+ if (flag === "--framework")
90
+ plan.frameworks += 1;
91
+ if (flag === "--library")
92
+ plan.libraries += 1;
93
+ if (flag === "--archive") {
94
+ plan.archives += 1;
95
+ pendingArchive = value;
96
+ }
97
+ else if (SLICE_FLAGS.includes(flag)) {
98
+ pendingArchive = undefined;
99
+ }
100
+ // Inside an archive a slice is named, not located, so only the paths that
101
+ // are really paths are checked for.
102
+ const isName = SLICE_FLAGS.includes(flag) && previous === "--archive";
103
+ if (!isName && !existsSync(value))
104
+ plan.missing.push(value);
105
+ plan.args.push(XCODEBUILD_FLAG[flag], value);
106
+ previous = flag;
107
+ }
108
+ if (pendingArchive !== undefined) {
109
+ throw new AxiError(`--archive '${pendingArchive}' is not followed by a --framework or --library`, "VALIDATION_ERROR", ["Name the framework or library to take out of the archive next"]);
110
+ }
111
+ return plan;
112
+ }
113
+ function isSliceOrDescriptor(flag) {
114
+ return flag !== undefined && flag !== "--archive";
115
+ }
21
116
  export async function xcframeworkCommand(args) {
22
- rejectUnknownFlags(args, "xcframework", FLAGS, FLAGS);
117
+ rejectUnknownFlags(args, "xcframework", XCFRAMEWORK_FLAGS, VALUE_FLAGS);
23
118
  const output = getFlag(args, "--output");
24
119
  if (output === undefined) {
25
120
  throw new AxiError("xcframework needs --output", "VALIDATION_ERROR", [
26
121
  "xcodebuild-axi xcframework --output Out.xcframework --framework A.framework",
27
122
  ]);
28
123
  }
29
- const frameworks = getListFlag(args, "--framework");
30
- const libraries = getListFlag(args, "--library");
31
- const headers = getListFlag(args, "--headers");
32
- if (frameworks.length === 0 && libraries.length === 0) {
124
+ const plan = planXcframework(args);
125
+ if (plan.frameworks === 0 && plan.libraries === 0) {
33
126
  throw new AxiError("xcframework needs at least one --framework or --library", "VALIDATION_ERROR", [
34
127
  "xcodebuild-axi xcframework --output Out.xcframework --framework A.framework",
35
128
  ]);
36
129
  }
37
- const missing = [...frameworks, ...libraries].filter((path) => !existsSync(path));
38
- if (missing.length > 0) {
130
+ if (plan.missing.length > 0) {
39
131
  // xcodebuild reports this one input at a time; naming them all at once
40
132
  // saves a round trip per missing path.
41
- throw new AxiError(`Missing input: ${missing.join(", ")}`, "VALIDATION_ERROR", ["Build each slice first, then pass the built products here"]);
133
+ throw new AxiError(`Missing input ${plan.missing.join(", ")}`, "VALIDATION_ERROR", ["Build each slice first, then pass the built products here"]);
42
134
  }
135
+ const internal = hasFlag(args, "--allow-internal-distribution");
43
136
  const { stdout, stderr, exitCode } = await runMetadata([
44
137
  "-create-xcframework",
45
- ...frameworks.flatMap((path) => ["-framework", path]),
46
- ...libraries.flatMap((path, index) => [
47
- "-library",
48
- path,
49
- ...(headers[index] !== undefined
50
- ? ["-headers", headers[index]]
51
- : []),
52
- ]),
138
+ ...plan.args,
139
+ ...(internal ? ["-allow-internal-distribution"] : []),
53
140
  "-output",
54
141
  output,
55
142
  ]);
@@ -60,8 +147,10 @@ export async function xcframeworkCommand(args) {
60
147
  return renderOutput([
61
148
  renderFields({
62
149
  xcframework: tildePath(output),
63
- frameworks: frameworks.length,
64
- libraries: libraries.length,
150
+ frameworks: plan.frameworks,
151
+ libraries: plan.libraries,
152
+ ...(plan.archives > 0 ? { archives: plan.archives } : {}),
153
+ ...(internal ? { distribution: "internal only" } : {}),
65
154
  }),
66
155
  renderHelp([
67
156
  "Add the .xcframework to a target's Frameworks build phase to use it",
@@ -1 +1 @@
1
- {"version":3,"file":"xcframework.js","sourceRoot":"","sources":["../../../src/commands/xcframework.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAA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QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YACzD,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,YAAY,EAAE,eAAe,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SACvD,CAAC;QACF,UAAU,CAAC;YACT,qEAAqE;SACtE,CAAC;KACH,CAAC,CAAC;AACL,CAAC;AAED,SAAS,mBAAmB,CAAC,MAAc;IACzC,OAAO,CACL,aAAa,CAAC,MAAM,CAAC;SAClB,KAAK,CAAC,IAAI,CAAC;SACX,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;SAC1B,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC,IAAI,EAAE,CACzC,CAAC;AACJ,CAAC"}
@@ -33,6 +33,16 @@ const patterns = [
33
33
  "For a device build, pass `--sign` and set DEVELOPMENT_TEAM in the project",
34
34
  ],
35
35
  },
36
+ {
37
+ pattern: /Building a Swift package requires that a destination is provided/,
38
+ code: "DESTINATION_NOT_FOUND",
39
+ message: () => "A Swift package has no default destination, so xcodebuild needs one named",
40
+ suggestions: () => [
41
+ 'Pass a simulator by name: `--device "iPhone 17 Pro"`',
42
+ "Or a whole specifier: `--destination 'platform=macOS'`",
43
+ "Run `xcodebuild-axi destinations` to see what this package supports",
44
+ ],
45
+ },
36
46
  {
37
47
  pattern: /xcodebuild: error: (.+)/,
38
48
  code: "UNKNOWN",
@@ -1 +1 @@
1
- {"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAexD,OAAO,EAAE,QAAQ,EAAE,gBAAgB,EAAE,CAAC;AAiBtC,MAAM,QAAQ,GAAmB;IAC/B;QACE,OAAO,EACL,6HAA6H;QAC/H,IAAI,E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EAAE,GAAG,EAAE,CAAC;YACjB,8FAA8F;YAC9F,2EAA2E;SAC5E;KACF;IACD;QACE,OAAO,EAAE,kEAAkE;QAC3E,IAAI,EAAE,uBAAuB;QAC7B,OAAO,EAAE,GAAG,EAAE,CACZ,2EAA2E;QAC7E,WAAW,EAAE,GAAG,EAAE,CAAC;YACjB,sDAAsD;YACtD,wDAAwD;YACxD,qEAAqE;SACtE;KACF;IACD;QACE,OAAO,EAAE,yBAAyB;QAClC,IAAI,EAAE,SAAS;QACf,OAAO,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE;KACpC;CACF,CAAC;AAEF,gFAAgF;AAChF,MAAM,UAAU,kBAAkB,CAAC,UAAkB;IACnD,KAAK,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,IAAI,QAAQ,EAAE,CAAC;QAC/D,MAAM,KAAK,GAAG,UAAU,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QACxC,IAAI,KAAK,EAAE,CAAC;YACV,OAAO,IAAI,QAAQ,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC;QACxE,CAAC;IACH,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC;AAED,MAAM,UAAU,sBAAsB;IACpC,OAAO,IAAI,QAAQ,CACjB,0EAA0E,EAC1E,qBAAqB,EACrB,CAAC,yEAAyE,CAAC,CAC5E,CAAC;AACJ,CAAC"}
@@ -1,4 +1,4 @@
1
- import type { Diagnostic } from "./xcresult.js";
1
+ import { type Diagnostic, type TestFailure } from "./xcresult.js";
2
2
  /**
3
3
  * Render a capped list of diagnostics.
4
4
  *
@@ -18,3 +18,24 @@ export declare function diagnosticsBlock(label: string, diagnostics: Diagnostic[
18
18
  * would be the quiet wrapper hiding the very failure it exists to surface.
19
19
  */
20
20
  export declare function transcriptTail(tail: string, lines?: number): string;
21
+ export type FailureRow = {
22
+ test: string;
23
+ target: string;
24
+ file?: string;
25
+ line?: number | "";
26
+ message: string;
27
+ };
28
+ /**
29
+ * The failure table both `test` and `result` print.
30
+ *
31
+ * A failing test's message says what went wrong; the file and line say where,
32
+ * and they cost one `test-details` read each because the summary does not
33
+ * carry them. Only the rows actually shown are looked up — a run with four
34
+ * hundred failures should not spend four hundred subprocesses to print twenty
35
+ * lines — and a lookup that fails leaves the location blank rather than
36
+ * failing the report, since a bundle from another Xcode may not answer at all.
37
+ */
38
+ export declare function failureRows(resultPath: string, failures: TestFailure[], options: {
39
+ max: number;
40
+ full: boolean;
41
+ }): Promise<FailureRow[]>;
@@ -1,3 +1,4 @@
1
+ import { failureLocation, readTestDetails, } from "./xcresult.js";
1
2
  import { renderList, truncate } from "./toon.js";
2
3
  /**
3
4
  * Render a capped list of diagnostics.
@@ -36,4 +37,43 @@ export function transcriptTail(tail, lines = 15) {
36
37
  return "";
37
38
  return `tail[${kept.length}]:\n${kept.map((line) => ` ${line}`).join("\n")}`;
38
39
  }
40
+ /**
41
+ * The failure table both `test` and `result` print.
42
+ *
43
+ * A failing test's message says what went wrong; the file and line say where,
44
+ * and they cost one `test-details` read each because the summary does not
45
+ * carry them. Only the rows actually shown are looked up — a run with four
46
+ * hundred failures should not spend four hundred subprocesses to print twenty
47
+ * lines — and a lookup that fails leaves the location blank rather than
48
+ * failing the report, since a bundle from another Xcode may not answer at all.
49
+ */
50
+ export async function failureRows(resultPath, failures, options) {
51
+ const shown = failures.slice(0, options.max);
52
+ const locations = await Promise.all(shown.map(async (failure) => {
53
+ const identifier = failure.testIdentifierString;
54
+ if (!identifier)
55
+ return { file: "", line: "" };
56
+ return readTestDetails(resultPath, identifier)
57
+ .then(failureLocation)
58
+ .catch(() => ({ file: "", line: "" }));
59
+ }));
60
+ // Two empty columns on every row is worse than no columns: TOON prints the
61
+ // header either way, and a bundle written by another Xcode may answer none
62
+ // of these lookups.
63
+ const located = locations.some((location) => location.file.length > 0);
64
+ return shown.map((failure, index) => {
65
+ const message = (failure.failureText ?? "").replace(/\s+/g, " ").trim();
66
+ return {
67
+ test: failure.testIdentifierString ?? failure.testName ?? "unknown",
68
+ target: failure.targetName ?? "",
69
+ ...(located
70
+ ? {
71
+ file: locations[index]?.file ?? "",
72
+ line: locations[index]?.line ?? "",
73
+ }
74
+ : {}),
75
+ message: options.full ? message : truncate(message, 300).text,
76
+ };
77
+ });
78
+ }
39
79
  //# sourceMappingURL=report.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"report.js","sourceRoot":"","sources":["../../src/report.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAEjD;;;;;;;;GAQG;AACH,MAAM,UAAU,gBAAgB,CAC9B,KAAa,EACb,WAAyB,EACzB,KAAa,EACb,YAAY,GAAG,GAAG;IAElB,IAAI,WAAW,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC;IAE9D,MAAM,KAAK,GAAG,WAAW,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC,UAAU,EAAE,EAAE,CAAC,CAAC;QAC7D,IAAI,EAAE,UAAU,CAAC,IAAI;QACrB,IAAI,EAAE,UAAU,CAAC,IAAI;QACrB,GAAG,EAAE,UAAU,CAAC,GAAG;QACnB,IAAI,EAAE,UAAU,CAAC,IAAI;QACrB,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC,IAAI;KACzD,CAAC,CAAC,CAAC;IAEJ,MAAM,MAAM,GAAG,WAAW,CAAC,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC;IACjD,MAAM,OAAO,GACX,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,KAAK,KAA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I,EAAE;iBACnC;gBACH,CAAC,CAAC,EAAE,CAAC;YACP,OAAO,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC,IAAI;SAC9D,CAAC;IACJ,CAAC,CAAC,CAAC;AACL,CAAC"}
@@ -20,3 +20,37 @@ export declare function listSchemes(project: ProjectContext): Promise<SchemeInfo
20
20
  * correct rather than another lookup (AXI principle 6).
21
21
  */
22
22
  export declare function requireScheme(project: ProjectContext, requested: string | undefined, command: string): Promise<string>;
23
+ /** What a command was asked to act on: a scheme, some targets, or all of them. */
24
+ export interface Subject {
25
+ /** How to name it in a report — the scheme, the targets, or "all targets". */
26
+ label: string;
27
+ /** `-scheme X`, `-target A -target B`, or `-alltargets`. */
28
+ flags: string[];
29
+ /**
30
+ * A filesystem-safe stem for artifacts. `label` is written for a reader and
31
+ * can hold spaces and commas; a log file named `all targets-clean.log`
32
+ * is a path every shell needs quoting for.
33
+ */
34
+ slug: string;
35
+ /**
36
+ * The same selection spelled as this tool's own flags, for a rerun hint.
37
+ * Not derivable from `label`: "all targets" is prose, and a hint that says
38
+ * `--target all targets` is a command that does not run.
39
+ */
40
+ rerun: string;
41
+ /** True when targets were named instead of a scheme. */
42
+ targetMode: boolean;
43
+ }
44
+ /**
45
+ * Resolve `--scheme` / `--target` / `--all-targets` into what to pass and what
46
+ * to call it.
47
+ *
48
+ * Shared because the rules are xcodebuild's rather than any one command's:
49
+ * targets need a project, they cannot be combined with a scheme, and a scheme
50
+ * is inferred when the project has only one.
51
+ */
52
+ export declare function resolveSubject(project: ProjectContext, args: {
53
+ scheme?: string;
54
+ targets: string[];
55
+ allTargets: boolean;
56
+ }, command: string): Promise<Subject>;
@@ -63,4 +63,50 @@ export async function requireScheme(project, requested, command) {
63
63
  `schemes: ${schemes.join(", ")}`,
64
64
  ]);
65
65
  }
66
+ /**
67
+ * Resolve `--scheme` / `--target` / `--all-targets` into what to pass and what
68
+ * to call it.
69
+ *
70
+ * Shared because the rules are xcodebuild's rather than any one command's:
71
+ * targets need a project, they cannot be combined with a scheme, and a scheme
72
+ * is inferred when the project has only one.
73
+ */
74
+ export async function resolveSubject(project, args, command) {
75
+ const targetMode = args.targets.length > 0 || args.allTargets;
76
+ if (targetMode && project.kind === "workspace") {
77
+ // xcodebuild's own refusal here is "-target is not supported with
78
+ // -workspace", issued only after it has resolved the package graph.
79
+ throw new AxiError("--target and --all-targets work against a project, not a workspace", "VALIDATION_ERROR", [
80
+ "Pass `--scheme <name>` instead, or cd to the directory holding the .xcodeproj",
81
+ ]);
82
+ }
83
+ if (targetMode && args.scheme !== undefined) {
84
+ throw new AxiError("--scheme and --target select different things to build, so only one can be used", "VALIDATION_ERROR", ["Drop one — a scheme already names the targets it builds"]);
85
+ }
86
+ if (targetMode) {
87
+ return args.allTargets
88
+ ? {
89
+ label: "all targets",
90
+ slug: "all-targets",
91
+ flags: ["-alltargets"],
92
+ rerun: "--all-targets",
93
+ targetMode,
94
+ }
95
+ : {
96
+ label: args.targets.join(","),
97
+ slug: args.targets.join("-"),
98
+ flags: args.targets.flatMap((target) => ["-target", target]),
99
+ rerun: args.targets.map((target) => `--target ${target}`).join(" "),
100
+ targetMode,
101
+ };
102
+ }
103
+ const scheme = await requireScheme(project, args.scheme, command);
104
+ return {
105
+ label: scheme,
106
+ slug: scheme,
107
+ flags: ["-scheme", scheme],
108
+ rerun: `--scheme ${scheme}`,
109
+ targetMode,
110
+ };
111
+ }
66
112
  //# sourceMappingURL=scheme.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"scheme.js","sourceRoot":"","sources":["../../src/scheme.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAEvC,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAmB9C;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAC/B,OAAuB;IAEvB,MAA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gBACnB,KAAK,EAAE,CAAC,aAAa,CAAC;gBACtB,KAAK,EAAE,eAAe;gBACtB,UAAU;aACX;YACH,CAAC,CAAC;gBACE,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC;gBAC7B,IAAI,EAAE,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC;gBAC5B,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;gBAC5D,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,YAAY,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;gBACnE,UAAU;aACX,CAAC;IACR,CAAC;IAED,MAAM,MAAM,GAAG,MAAM,aAAa,CAAC,OAAO,EAAE,IAAI,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClE,OAAO;QACL,KAAK,EAAE,MAAM;QACb,IAAI,EAAE,MAAM;QACZ,KAAK,EAAE,CAAC,SAAS,EAAE,MAAM,CAAC;QAC1B,KAAK,EAAE,YAAY,MAAM,EAAE;QAC3B,UAAU;KACX,CAAC;AACJ,CAAC"}
@@ -6,6 +6,20 @@
6
6
  * rather than inferred: every option `xcodebuild -help` prints is classified,
7
7
  * and `npm run coverage -- --check` fails if a new Xcode adds one this file
8
8
  * has never heard of.
9
+ *
10
+ * "Covered" is asked along four axes, because for a long time it was only
11
+ * asked along the first and the misses all landed on the other three:
12
+ *
13
+ * 1. **Options** — does any command reach this option at all.
14
+ * 2. **Reach** — does every command xcodebuild accepts it on reach it. An
15
+ * option exposed on `build` and missing from `settings` is not covered for
16
+ * anyone asking `settings`, and nothing used to say so.
17
+ * 3. **Forms and sub-surfaces** — the options behind an option: the keys of
18
+ * `-exportOptionsPlist`, the arguments of `-create-xcframework`, the second
19
+ * modes that `-help` documents only inside a usage line.
20
+ * 4. **Companion tools** — `xcresulttool`, `xccov`, `simctl`. Not xcodebuild,
21
+ * so not in its headline number, but this tool wraps them and an agent that
22
+ * has to shell out to one directly has dropped back down.
9
23
  */
10
24
  /**
11
25
  * The Xcode whose `xcodebuild -help` this map was written against.
@@ -18,11 +32,29 @@
18
32
  * mismatch here and merely reports one elsewhere.
19
33
  */
20
34
  export declare const AUTHORED_AGAINST = "27.0";
35
+ /** One command that reaches a thing, and the words that reach it. */
36
+ export interface Exposure {
37
+ /** The `xcodebuild-axi` command. */
38
+ command: string;
39
+ /** How it is reached, e.g. `settings --for-index`. */
40
+ via: string;
41
+ }
42
+ /** A command that could reach a thing and does not. */
43
+ export interface Gap {
44
+ command: string;
45
+ why: string;
46
+ }
21
47
  export type OptionCoverage =
22
48
  /** Reachable through an xcodebuild-axi flag or command. */
23
49
  {
24
50
  status: "exposed";
25
- via: string;
51
+ on: readonly Exposure[];
52
+ /** The command set this option applies to, when it is more than `on`. */
53
+ surface?: SurfaceName;
54
+ /** Commands in that set it will never reach, and why not. */
55
+ declined?: readonly Gap[];
56
+ /** Commands in that set it should reach and does not, yet. */
57
+ missing?: readonly Gap[];
26
58
  }
27
59
  /** The tool always sets it, so there is nothing for a caller to pass. */
28
60
  | {
@@ -34,22 +66,123 @@ export type OptionCoverage =
34
66
  status: "superseded";
35
67
  why: string;
36
68
  }
69
+ /**
70
+ * Not wrapped yet. A gap being paid down, not a boundary — `from` names the
71
+ * command that will grow it, so the open list reads as a work plan.
72
+ */
73
+ | {
74
+ status: "missing";
75
+ why: string;
76
+ from?: string;
77
+ }
37
78
  /** Deliberately not wrapped, for the stated reason. */
38
79
  | {
39
80
  status: "n/a";
40
81
  why: string;
41
82
  };
83
+ /**
84
+ * The commands an option can apply to, by kind.
85
+ *
86
+ * xcodebuild's own usage lines are the authority: `-target` and `-alltargets`
87
+ * sit on the same line as `-showBuildSettings`, so `settings` is expected to
88
+ * take them; `-showdestinations` appears only on the `-scheme` lines, so
89
+ * `destinations` is not expected to take a target.
90
+ */
91
+ export declare const BUILD_FAMILY: readonly ["build", "test", "tests", "analyze", "archive"];
92
+ export declare const SURFACES: {
93
+ /** Shapes compilation, so only the commands that compile something. */
94
+ readonly build: readonly ["build", "test", "tests", "analyze", "archive"];
95
+ /** Applies to any action word, `clean` included. */
96
+ readonly action: readonly ["build", "test", "tests", "analyze", "archive", "clean"];
97
+ /** Changes what the project resolves to, which `settings` reports on. */
98
+ readonly resolution: readonly ["build", "test", "tests", "analyze", "archive", "clean", "settings"];
99
+ /** Package resolution, which `packages` drives on its own. */
100
+ readonly package: readonly ["build", "test", "tests", "analyze", "archive", "packages"];
101
+ /** Selects a scheme to act on. */
102
+ readonly scheme: readonly ["build", "test", "tests", "analyze", "archive", "clean", "settings", "destinations", "testplans", "packages", "localize"];
103
+ /** Constrains which tests are run, and so which tests are enumerated. */
104
+ readonly testing: readonly ["test", "tests"];
105
+ };
106
+ export type SurfaceName = keyof typeof SURFACES;
107
+ /** `"settings --for-index"` -> `{ command: "settings", via: "settings --for-index" }`. */
108
+ export declare function at(via: string): Exposure;
109
+ /** The gaps this file exists to make visible, phrased once and shared. */
42
110
  export declare const OPTION_COVERAGE: Record<string, OptionCoverage>;
43
111
  /** The build actions, classified the same way. */
44
112
  export declare const ACTION_COVERAGE: Record<string, OptionCoverage>;
113
+ /**
114
+ * The second forms of an option, which `-help` documents only inside a usage
115
+ * line or a sentence. Nothing enumerates these, so they are the easiest kind
116
+ * of gap to ship: `-runFirstLaunch -checkForNewerComponents` is a flag on a
117
+ * flag, mentioned once, in prose.
118
+ */
119
+ export declare const FORM_COVERAGE: Record<string, OptionCoverage>;
120
+ /**
121
+ * `-exportOptionsPlist` keys.
122
+ *
123
+ * The plist is the whole configuration surface of `-exportArchive`, and
124
+ * authoring one by hand is exactly the side quest `--method` exists to remove
125
+ * — so a key with no flag is a key that sends the agent back to writing XML.
126
+ */
127
+ export declare const EXPORT_OPTION_COVERAGE: Record<string, OptionCoverage>;
128
+ /** `-create-xcframework`'s own options, which only its `-help` prints. */
129
+ export declare const XCFRAMEWORK_COVERAGE: Record<string, OptionCoverage>;
130
+ /**
131
+ * `xcresulttool`, which owns every answer about a run that already happened.
132
+ *
133
+ * The result bundle is this tool's source of truth (see AGENTS.md), so a leaf
134
+ * missing here is an answer the bundle holds and the tool cannot read out —
135
+ * `test --diagnostics` collecting a report nothing can open, for instance.
136
+ */
137
+ export declare const XCRESULT_COVERAGE: Record<string, OptionCoverage>;
138
+ /** `xccov`, which owns coverage. */
139
+ export declare const XCCOV_COVERAGE: Record<string, OptionCoverage>;
140
+ /**
141
+ * `simctl`, which owns simulators.
142
+ *
143
+ * `sim` exists to put a destination into the state a build or test run needs,
144
+ * and stops there. The rest is classified so the boundary is a decision on
145
+ * the record rather than an omission.
146
+ */
147
+ export declare const SIMCTL_COVERAGE: Record<string, OptionCoverage>;
148
+ /** Every non-xcodebuild surface this tool wraps, for one combined number. */
149
+ export declare const COMPANION_SURFACES: Record<string, Record<string, OptionCoverage>>;
45
150
  export interface CoverageTally {
46
151
  total: number;
47
152
  exposed: number;
48
153
  always: number;
49
154
  superseded: number;
155
+ missing: number;
50
156
  na: number;
51
157
  /** Reachable, handled for you, or answered better — what the README quotes. */
52
158
  covered: number;
53
159
  percent: number;
54
160
  }
55
161
  export declare function tally(map: Record<string, OptionCoverage>): CoverageTally;
162
+ export declare function percent(part: number, whole: number): number;
163
+ /** Every command an option applies to, whether or not it reaches it. */
164
+ export declare function applicable(entry: OptionCoverage): string[];
165
+ export interface ReachTally {
166
+ /** Command-and-option pairs that could exist. */
167
+ pairs: number;
168
+ reached: number;
169
+ declined: number;
170
+ missing: number;
171
+ percent: number;
172
+ }
173
+ /**
174
+ * Coverage counted per command rather than per option.
175
+ *
176
+ * The headline number asks whether an option is reachable at all; this one
177
+ * asks whether it is reachable from where you are standing, which is the
178
+ * question an agent that just got `unknown flag --target` was asking.
179
+ */
180
+ export declare function reach(map: Record<string, OptionCoverage>): ReachTally;
181
+ /** Every gap in a map, as `option` -> the commands that should reach it. */
182
+ export declare function gaps(map: Record<string, OptionCoverage>): Array<{
183
+ option: string;
184
+ command: string;
185
+ why: string;
186
+ }>;
187
+ /** The README's one-line answer to "how do I reach this?". */
188
+ export declare function describe(entry: OptionCoverage): string;