appium-xcode 6.1.9 → 6.2.0
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 +12 -0
- package/build/lib/helpers.d.ts +7 -0
- package/build/lib/helpers.d.ts.map +1 -1
- package/build/lib/helpers.js +24 -5
- package/build/lib/helpers.js.map +1 -1
- package/build/lib/index.d.ts +3 -3
- package/build/lib/xcode.d.ts +3 -4
- package/build/lib/xcode.d.ts.map +1 -1
- package/build/lib/xcode.js +5 -6
- package/build/lib/xcode.js.map +1 -1
- package/lib/helpers.ts +26 -5
- package/lib/xcode.ts +6 -7
- package/package.json +4 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
## [6.2.0](https://github.com/appium/appium-xcode/compare/v6.1.10...v6.2.0) (2026-04-27)
|
|
2
|
+
|
|
3
|
+
### Features
|
|
4
|
+
|
|
5
|
+
* Ditch bluebird, lodash and plist ([#173](https://github.com/appium/appium-xcode/issues/173)) ([a7c88ca](https://github.com/appium/appium-xcode/commit/a7c88cac6239694a192eb0525902a28370a5292d))
|
|
6
|
+
|
|
7
|
+
## [6.1.10](https://github.com/appium/appium-xcode/compare/v6.1.9...v6.1.10) (2026-04-17)
|
|
8
|
+
|
|
9
|
+
### Miscellaneous Chores
|
|
10
|
+
|
|
11
|
+
* **deps-dev:** bump typescript from 5.9.3 to 6.0.2 ([#171](https://github.com/appium/appium-xcode/issues/171)) ([be3f3e9](https://github.com/appium/appium-xcode/commit/be3f3e9fc50e336f5806dc20731a6bd12ca00c1a))
|
|
12
|
+
|
|
1
13
|
## [6.1.9](https://github.com/appium/appium-xcode/compare/v6.1.8...v6.1.9) (2026-02-16)
|
|
2
14
|
|
|
3
15
|
### Bug Fixes
|
package/build/lib/helpers.d.ts
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
import type { TeenProcessExecResult } from 'teen_process';
|
|
2
2
|
export declare const XCRUN_TIMEOUT = 15000;
|
|
3
|
+
/**
|
|
4
|
+
* Memoizes function calls by caching results for serialized argument lists.
|
|
5
|
+
*
|
|
6
|
+
* @param fn The function to memoize
|
|
7
|
+
* @returns A memoized wrapper around the input function
|
|
8
|
+
*/
|
|
9
|
+
export declare function memoize<Args extends unknown[], Result>(fn: (...args: Args) => Result): (...args: Args) => Result;
|
|
3
10
|
/**
|
|
4
11
|
* Executes 'xcrun' command line utility
|
|
5
12
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../lib/helpers.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../lib/helpers.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAC,qBAAqB,EAAC,MAAM,cAAc,CAAC;AAIxD,eAAO,MAAM,aAAa,QAAQ,CAAC;AAEnC;;;;;GAKG;AACH,wBAAgB,OAAO,CAAC,IAAI,SAAS,OAAO,EAAE,EAAE,MAAM,EACpD,EAAE,EAAE,CAAC,GAAG,IAAI,EAAE,IAAI,KAAK,MAAM,GAC5B,CAAC,GAAG,IAAI,EAAE,IAAI,KAAK,MAAM,CAS3B;AAED;;;;;;;GAOG;AACH,wBAAsB,eAAe,CACnC,IAAI,EAAE,MAAM,EAAE,EACd,OAAO,GAAE,MAAsB,GAC9B,OAAO,CAAC,qBAAqB,CAAC,MAAM,CAAC,CAAC,CAWxC;AAED;;;;;GAKG;AACH,wBAAsB,YAAY,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAwBtE;AAED;;;;;GAKG;AACH,wBAAsB,cAAc,CAAC,aAAa,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAGxF"}
|
package/build/lib/helpers.js
CHANGED
|
@@ -4,15 +4,30 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.XCRUN_TIMEOUT = void 0;
|
|
7
|
+
exports.memoize = memoize;
|
|
7
8
|
exports.runXcrunCommand = runXcrunCommand;
|
|
8
9
|
exports.findAppPaths = findAppPaths;
|
|
9
10
|
exports.readXcodePlist = readXcodePlist;
|
|
10
|
-
const lodash_1 = __importDefault(require("lodash"));
|
|
11
|
-
const bluebird_1 = __importDefault(require("bluebird"));
|
|
12
11
|
const teen_process_1 = require("teen_process");
|
|
13
12
|
const support_1 = require("@appium/support");
|
|
14
13
|
const node_path_1 = __importDefault(require("node:path"));
|
|
15
14
|
exports.XCRUN_TIMEOUT = 15000;
|
|
15
|
+
/**
|
|
16
|
+
* Memoizes function calls by caching results for serialized argument lists.
|
|
17
|
+
*
|
|
18
|
+
* @param fn The function to memoize
|
|
19
|
+
* @returns A memoized wrapper around the input function
|
|
20
|
+
*/
|
|
21
|
+
function memoize(fn) {
|
|
22
|
+
const cache = new Map();
|
|
23
|
+
return (...args) => {
|
|
24
|
+
const key = JSON.stringify(args);
|
|
25
|
+
if (!cache.has(key)) {
|
|
26
|
+
cache.set(key, fn(...args));
|
|
27
|
+
}
|
|
28
|
+
return cache.get(key);
|
|
29
|
+
};
|
|
30
|
+
}
|
|
16
31
|
/**
|
|
17
32
|
* Executes 'xcrun' command line utility
|
|
18
33
|
*
|
|
@@ -47,8 +62,12 @@ async function findAppPaths(bundleId) {
|
|
|
47
62
|
catch {
|
|
48
63
|
return [];
|
|
49
64
|
}
|
|
50
|
-
const matchedPaths =
|
|
51
|
-
|
|
65
|
+
const matchedPaths = stdout
|
|
66
|
+
.trim()
|
|
67
|
+
.split('\n')
|
|
68
|
+
.map((p) => p.trim())
|
|
69
|
+
.filter(Boolean);
|
|
70
|
+
if (!matchedPaths.length) {
|
|
52
71
|
return [];
|
|
53
72
|
}
|
|
54
73
|
const results = matchedPaths.map((p) => (async () => {
|
|
@@ -56,7 +75,7 @@ async function findAppPaths(bundleId) {
|
|
|
56
75
|
return p;
|
|
57
76
|
}
|
|
58
77
|
})());
|
|
59
|
-
return (await
|
|
78
|
+
return (await Promise.all(results)).filter(Boolean);
|
|
60
79
|
}
|
|
61
80
|
/**
|
|
62
81
|
* Finds and retrieves the content of the Xcode's Info.plist file
|
package/build/lib/helpers.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../lib/helpers.ts"],"names":[],"mappings":";;;;;;
|
|
1
|
+
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../lib/helpers.ts"],"names":[],"mappings":";;;;;;AAaA,0BAWC;AAUD,0CAcC;AAQD,oCAwBC;AAQD,wCAGC;AA3FD,+CAAkC;AAElC,6CAA0C;AAC1C,0DAA6B;AAEhB,QAAA,aAAa,GAAG,KAAK,CAAC;AAEnC;;;;;GAKG;AACH,SAAgB,OAAO,CACrB,EAA6B;IAE7B,MAAM,KAAK,GAAG,IAAI,GAAG,EAAkB,CAAC;IACxC,OAAO,CAAC,GAAG,IAAU,EAAU,EAAE;QAC/B,MAAM,GAAG,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;QACjC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;YACpB,KAAK,CAAC,GAAG,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,IAAI,CAAC,CAAC,CAAC;QAC9B,CAAC;QACD,OAAO,KAAK,CAAC,GAAG,CAAC,GAAG,CAAW,CAAC;IAClC,CAAC,CAAC;AACJ,CAAC;AAED;;;;;;;GAOG;AACI,KAAK,UAAU,eAAe,CACnC,IAAc,EACd,UAAkB,qBAAa;IAE/B,IAAI,CAAC;QACH,OAAO,MAAM,IAAA,mBAAI,EAAC,OAAO,EAAE,IAAI,EAAE,EAAC,OAAO,EAAC,CAAC,CAAC;IAC9C,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,iDAAi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C,CAAC;IAClE,OAAO,CAAC,MAAM,YAAE,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,eAAK,CAAC,cAAc,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AACnF,CAAC"}
|
package/build/lib/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { getPath, getVersion, getMaxIOSSDK, getMaxTVOSSDK, getClangVersion } from './xcode';
|
|
2
2
|
declare const xcode: {
|
|
3
|
-
getPath: (
|
|
3
|
+
getPath: (timeout?: number | undefined) => Promise<string>;
|
|
4
4
|
getVersion: typeof getVersion;
|
|
5
|
-
getMaxIOSSDK: (
|
|
6
|
-
getMaxTVOSSDK: (
|
|
5
|
+
getMaxIOSSDK: (retries?: number | undefined, timeout?: number | undefined) => Promise<string | null>;
|
|
6
|
+
getMaxTVOSSDK: (retries?: number | undefined, timeout?: number | undefined) => Promise<string>;
|
|
7
7
|
getClangVersion: typeof getClangVersion;
|
|
8
8
|
};
|
|
9
9
|
export { getPath, getVersion, getMaxIOSSDK, getMaxTVOSSDK, getClangVersion };
|
package/build/lib/xcode.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import _ from 'lodash';
|
|
2
1
|
import type { XcodeVersion } from './types';
|
|
3
2
|
/**
|
|
4
3
|
* Retrieves the full path to Xcode Developer subfolder via xcode-select
|
|
@@ -23,7 +22,7 @@ export declare function getPathFromDeveloperDir(): Promise<string>;
|
|
|
23
22
|
* @returns Full path to Xcode Developer subfolder timeout
|
|
24
23
|
* @throws {Error} If there was an error while retrieving the path.
|
|
25
24
|
*/
|
|
26
|
-
export declare const getPath: (
|
|
25
|
+
export declare const getPath: (timeout?: number | undefined) => Promise<string>;
|
|
27
26
|
/**
|
|
28
27
|
* Retrieves Xcode version
|
|
29
28
|
*
|
|
@@ -60,7 +59,7 @@ export declare function getMaxIOSSDKWithoutRetry(timeout?: number): Promise<stri
|
|
|
60
59
|
* @returns The SDK version
|
|
61
60
|
* @throws {Error} If the SDK version number cannot be determined
|
|
62
61
|
*/
|
|
63
|
-
export declare const getMaxIOSSDK: (
|
|
62
|
+
export declare const getMaxIOSSDK: (retries?: number | undefined, timeout?: number | undefined) => Promise<string | null>;
|
|
64
63
|
/**
|
|
65
64
|
* Retrieves the maximum version of tvOS SDK supported by the installed Xcode
|
|
66
65
|
*
|
|
@@ -77,5 +76,5 @@ export declare function getMaxTVOSSDKWithoutRetry(timeout?: number): Promise<str
|
|
|
77
76
|
* @returns The SDK version
|
|
78
77
|
* @throws {Error} If the SDK version number cannot be determined
|
|
79
78
|
*/
|
|
80
|
-
export declare const getMaxTVOSSDK: (
|
|
79
|
+
export declare const getMaxTVOSSDK: (retries?: number | undefined, timeout?: number | undefined) => Promise<string>;
|
|
81
80
|
//# sourceMappingURL=xcode.d.ts.map
|
package/build/lib/xcode.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"xcode.d.ts","sourceRoot":"","sources":["../../lib/xcode.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"xcode.d.ts","sourceRoot":"","sources":["../../lib/xcode.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAC,YAAY,EAAC,MAAM,SAAS,CAAC;AAO1C;;;;;;GAMG;AACH,wBAAsB,sBAAsB,CAAC,OAAO,GAAE,MAAsB,GAAG,OAAO,CAAC,MAAM,CAAC,CAuC7F;AAED;;;;;;GAMG;AACH,wBAAsB,uBAAuB,IAAI,OAAO,CAAC,MAAM,CAAC,CAe/D;AAED;;;;;;GAMG;AACH,eAAO,MAAM,OAAO,mDAGnB,CAAC;AAEF;;;;;;;;GAQG;AACH,wBAAsB,UAAU,CAAC,KAAK,EAAE,KAAK,EAAE,OAAO,CAAC,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;AACpG,wBAAsB,UAAU,CAC9B,KAAK,EAAE,IAAI,EACX,OAAO,CAAC,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE,MAAM,GACf,OAAO,CAAC,YAAY,CAAC,CAAC;AA0BzB;;;;;;;GAOG;AACH,wBAAsB,eAAe,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAiB9D;AAED;;;;;;GAMG;AACH,wBAAsB,wBAAwB,CAAC,OAAO,GAAE,MAAsB,GAAG,OAAO,CAAC,MAAM,CAAC,CAS/F;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,YAAY,wFAKvB,CAAC;AAEH;;;;;;GAMG;AACH,wBAAsB,yBAAyB,CAAC,OAAO,GAAE,MAAsB,GAAG,OAAO,CAAC,MAAM,CAAC,CAQhG;AAED;;;;;;;GAOG;AACH,eAAO,MAAM,aAAa,iFAKxB,CAAC"}
|
package/build/lib/xcode.js
CHANGED
|
@@ -46,7 +46,6 @@ exports.getMaxTVOSSDKWithoutRetry = getMaxTVOSSDKWithoutRetry;
|
|
|
46
46
|
const support_1 = require("@appium/support");
|
|
47
47
|
const node_path_1 = __importDefault(require("node:path"));
|
|
48
48
|
const asyncbox_1 = require("asyncbox");
|
|
49
|
-
const lodash_1 = __importDefault(require("lodash"));
|
|
50
49
|
const teen_process_1 = require("teen_process");
|
|
51
50
|
const semver = __importStar(require("semver"));
|
|
52
51
|
const helpers_1 = require("./helpers");
|
|
@@ -63,7 +62,7 @@ const log = support_1.logger.getLogger('Xcode');
|
|
|
63
62
|
async function getPathFromXcodeSelect(timeout = helpers_1.XCRUN_TIMEOUT) {
|
|
64
63
|
const generateErrorMessage = async (prefix) => {
|
|
65
64
|
const xcodePaths = await (0, helpers_1.findAppPaths)(XCODE_BUNDLE_ID);
|
|
66
|
-
if (
|
|
65
|
+
if (!xcodePaths.length) {
|
|
67
66
|
return `${prefix}. Consider installing Xcode to address this issue.`;
|
|
68
67
|
}
|
|
69
68
|
const proposals = xcodePaths.map((p) => ` sudo xcode-select -s "${node_path_1.default.join(p, 'Contents', 'Developer')}"`);
|
|
@@ -120,7 +119,7 @@ async function getPathFromDeveloperDir() {
|
|
|
120
119
|
* @returns Full path to Xcode Developer subfolder timeout
|
|
121
120
|
* @throws {Error} If there was an error while retrieving the path.
|
|
122
121
|
*/
|
|
123
|
-
exports.getPath =
|
|
122
|
+
exports.getPath = (0, helpers_1.memoize)((timeout = helpers_1.XCRUN_TIMEOUT) => process.env.DEVELOPER_DIR ? getPathFromDeveloperDir() : getPathFromXcodeSelect(timeout));
|
|
124
123
|
async function getVersion(parse = false, retries = DEFAULT_NUMBER_OF_RETRIES, timeout = helpers_1.XCRUN_TIMEOUT) {
|
|
125
124
|
const version = (await getVersionMemoized(retries, timeout));
|
|
126
125
|
// xcode version strings are not exactly semver string: patch versions of 0
|
|
@@ -190,7 +189,7 @@ async function getMaxIOSSDKWithoutRetry(timeout = helpers_1.XCRUN_TIMEOUT) {
|
|
|
190
189
|
* @returns The SDK version
|
|
191
190
|
* @throws {Error} If the SDK version number cannot be determined
|
|
192
191
|
*/
|
|
193
|
-
exports.getMaxIOSSDK =
|
|
192
|
+
exports.getMaxIOSSDK = (0, helpers_1.memoize)(function getMaxIOSSDK(retries = DEFAULT_NUMBER_OF_RETRIES, timeout = helpers_1.XCRUN_TIMEOUT) {
|
|
194
193
|
return (0, asyncbox_1.retry)(retries, getMaxIOSSDKWithoutRetry, timeout);
|
|
195
194
|
});
|
|
196
195
|
/**
|
|
@@ -217,7 +216,7 @@ async function getMaxTVOSSDKWithoutRetry(timeout = helpers_1.XCRUN_TIMEOUT) {
|
|
|
217
216
|
* @returns The SDK version
|
|
218
217
|
* @throws {Error} If the SDK version number cannot be determined
|
|
219
218
|
*/
|
|
220
|
-
exports.getMaxTVOSSDK =
|
|
219
|
+
exports.getMaxTVOSSDK = (0, helpers_1.memoize)(async function getMaxTVOSSDK(retries = DEFAULT_NUMBER_OF_RETRIES, timeout = helpers_1.XCRUN_TIMEOUT) {
|
|
221
220
|
return (await (0, asyncbox_1.retry)(retries, getMaxTVOSSDKWithoutRetry, timeout));
|
|
222
221
|
});
|
|
223
222
|
// Private helper functions
|
|
@@ -242,7 +241,7 @@ async function getVersionWithoutRetry(timeout = helpers_1.XCRUN_TIMEOUT) {
|
|
|
242
241
|
* @returns Xcode version
|
|
243
242
|
* @throws {Error} If there was a failure while retrieving the version
|
|
244
243
|
*/
|
|
245
|
-
const getVersionMemoized =
|
|
244
|
+
const getVersionMemoized = (0, helpers_1.memoize)(function getVersionMemoized(retries = DEFAULT_NUMBER_OF_RETRIES, timeout = helpers_1.XCRUN_TIMEOUT) {
|
|
246
245
|
return (0, asyncbox_1.retry)(retries, getVersionWithoutRetry, timeout);
|
|
247
246
|
});
|
|
248
247
|
//# sourceMappingURL=xcode.js.map
|
package/build/lib/xcode.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"xcode.js","sourceRoot":"","sources":["../../lib/xcode.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"xcode.js","sourceRoot":"","sources":["../../lib/xcode.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAoBA,wDAuCC;AASD,0DAeC;AA6BD,gCAuBC;AAUD,0CAiBC;AASD,4DASC;AAwBD,8DAQC;AApND,6CAA2C;AAC3C,0DAA6B;AAC7B,uCAA+B;AAC/B,+CAAkC;AAClC,+CAAiC;AACjC,uCAAgG;AAGhG,MAAM,yBAAyB,GAAG,CAAC,CAAC;AACpC,MAAM,eAAe,GAAG,oBAAoB,CAAC;AAE7C,MAAM,GAAG,GAAG,gBAAM,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;AAEtC;;;;;;GAMG;AACI,KAAK,UAAU,sBAAsB,CAAC,UAAkB,uBAAa;IAC1E,MAAM,oBAAoB,GAAG,KAAK,EAAE,MAAc,EAAmB,EAAE;QACrE,MAAM,UAAU,GAAG,MAAM,IA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B,EAAE,OAAO,CAAC,CAAW,CAAC;AAC9E,CAAC,CAAC,CAAC;AAEH,2BAA2B;AAE3B;;;;;;GAMG;AACH,KAAK,UAAU,sBAAsB,CACnC,UAAkB,uBAAa;IAE/B,MAAM,aAAa,GAAG,MAAM,IAAA,eAAO,EAAC,OAAO,CAAC,CAAC;IAC7C,qEAAqE;IACrE,MAAM,EAAC,0BAA0B,EAAC,GAAG,MAAM,IAAA,wBAAc,EAAC,aAAa,CAAC,CAAC;IACzE,OAAO,MAAM,CAAC,MAAM,CAAC,0BAA0B,CAAC,CAAC;AACnD,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,kBAAkB,GAAG,IAAA,iBAAO,EAAC,SAAS,kBAAkB,CAC5D,UAAkB,yBAAyB,EAC3C,UAAkB,uBAAa;IAE/B,OAAO,IAAA,gBAAK,EAAC,OAAO,EAAE,sBAAsB,EAAE,OAAO,CAAC,CAAC;AACzD,CAAC,CAAC,CAAC"}
|
package/lib/helpers.ts
CHANGED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import _ from 'lodash';
|
|
2
|
-
import B from 'bluebird';
|
|
3
1
|
import {exec} from 'teen_process';
|
|
4
2
|
import type {TeenProcessExecResult} from 'teen_process';
|
|
5
3
|
import {fs, plist} from '@appium/support';
|
|
@@ -7,6 +5,25 @@ import path from 'node:path';
|
|
|
7
5
|
|
|
8
6
|
export const XCRUN_TIMEOUT = 15000;
|
|
9
7
|
|
|
8
|
+
/**
|
|
9
|
+
* Memoizes function calls by caching results for serialized argument lists.
|
|
10
|
+
*
|
|
11
|
+
* @param fn The function to memoize
|
|
12
|
+
* @returns A memoized wrapper around the input function
|
|
13
|
+
*/
|
|
14
|
+
export function memoize<Args extends unknown[], Result>(
|
|
15
|
+
fn: (...args: Args) => Result,
|
|
16
|
+
): (...args: Args) => Result {
|
|
17
|
+
const cache = new Map<string, Result>();
|
|
18
|
+
return (...args: Args): Result => {
|
|
19
|
+
const key = JSON.stringify(args);
|
|
20
|
+
if (!cache.has(key)) {
|
|
21
|
+
cache.set(key, fn(...args));
|
|
22
|
+
}
|
|
23
|
+
return cache.get(key) as Result;
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
|
|
10
27
|
/**
|
|
11
28
|
* Executes 'xcrun' command line utility
|
|
12
29
|
*
|
|
@@ -45,8 +62,12 @@ export async function findAppPaths(bundleId: string): Promise<string[]> {
|
|
|
45
62
|
return [];
|
|
46
63
|
}
|
|
47
64
|
|
|
48
|
-
const matchedPaths =
|
|
49
|
-
|
|
65
|
+
const matchedPaths = stdout
|
|
66
|
+
.trim()
|
|
67
|
+
.split('\n')
|
|
68
|
+
.map((p) => p.trim())
|
|
69
|
+
.filter(Boolean);
|
|
70
|
+
if (!matchedPaths.length) {
|
|
50
71
|
return [];
|
|
51
72
|
}
|
|
52
73
|
const results = matchedPaths.map((p) =>
|
|
@@ -56,7 +77,7 @@ export async function findAppPaths(bundleId: string): Promise<string[]> {
|
|
|
56
77
|
}
|
|
57
78
|
})(),
|
|
58
79
|
);
|
|
59
|
-
return (await
|
|
80
|
+
return (await Promise.all(results)).filter(Boolean) as string[];
|
|
60
81
|
}
|
|
61
82
|
|
|
62
83
|
/**
|
package/lib/xcode.ts
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import {fs, logger} from '@appium/support';
|
|
2
2
|
import path from 'node:path';
|
|
3
3
|
import {retry} from 'asyncbox';
|
|
4
|
-
import _ from 'lodash';
|
|
5
4
|
import {exec} from 'teen_process';
|
|
6
5
|
import * as semver from 'semver';
|
|
7
|
-
import {runXcrunCommand, findAppPaths, XCRUN_TIMEOUT, readXcodePlist} from './helpers';
|
|
6
|
+
import {runXcrunCommand, findAppPaths, XCRUN_TIMEOUT, readXcodePlist, memoize} from './helpers';
|
|
8
7
|
import type {XcodeVersion} from './types';
|
|
9
8
|
|
|
10
9
|
const DEFAULT_NUMBER_OF_RETRIES = 2;
|
|
@@ -22,7 +21,7 @@ const log = logger.getLogger('Xcode');
|
|
|
22
21
|
export async function getPathFromXcodeSelect(timeout: number = XCRUN_TIMEOUT): Promise<string> {
|
|
23
22
|
const generateErrorMessage = async (prefix: string): Promise<string> => {
|
|
24
23
|
const xcodePaths = await findAppPaths(XCODE_BUNDLE_ID);
|
|
25
|
-
if (
|
|
24
|
+
if (!xcodePaths.length) {
|
|
26
25
|
return `${prefix}. Consider installing Xcode to address this issue.`;
|
|
27
26
|
}
|
|
28
27
|
|
|
@@ -91,7 +90,7 @@ export async function getPathFromDeveloperDir(): Promise<string> {
|
|
|
91
90
|
* @returns Full path to Xcode Developer subfolder timeout
|
|
92
91
|
* @throws {Error} If there was an error while retrieving the path.
|
|
93
92
|
*/
|
|
94
|
-
export const getPath =
|
|
93
|
+
export const getPath = memoize(
|
|
95
94
|
(timeout: number = XCRUN_TIMEOUT): Promise<string> =>
|
|
96
95
|
process.env.DEVELOPER_DIR ? getPathFromDeveloperDir() : getPathFromXcodeSelect(timeout),
|
|
97
96
|
);
|
|
@@ -189,7 +188,7 @@ export async function getMaxIOSSDKWithoutRetry(timeout: number = XCRUN_TIMEOUT):
|
|
|
189
188
|
* @returns The SDK version
|
|
190
189
|
* @throws {Error} If the SDK version number cannot be determined
|
|
191
190
|
*/
|
|
192
|
-
export const getMaxIOSSDK =
|
|
191
|
+
export const getMaxIOSSDK = memoize(function getMaxIOSSDK(
|
|
193
192
|
retries: number = DEFAULT_NUMBER_OF_RETRIES,
|
|
194
193
|
timeout: number = XCRUN_TIMEOUT,
|
|
195
194
|
) {
|
|
@@ -221,7 +220,7 @@ export async function getMaxTVOSSDKWithoutRetry(timeout: number = XCRUN_TIMEOUT)
|
|
|
221
220
|
* @returns The SDK version
|
|
222
221
|
* @throws {Error} If the SDK version number cannot be determined
|
|
223
222
|
*/
|
|
224
|
-
export const getMaxTVOSSDK =
|
|
223
|
+
export const getMaxTVOSSDK = memoize(async function getMaxTVOSSDK(
|
|
225
224
|
retries: number = DEFAULT_NUMBER_OF_RETRIES,
|
|
226
225
|
timeout: number = XCRUN_TIMEOUT,
|
|
227
226
|
): Promise<string> {
|
|
@@ -254,7 +253,7 @@ async function getVersionWithoutRetry(
|
|
|
254
253
|
* @returns Xcode version
|
|
255
254
|
* @throws {Error} If there was a failure while retrieving the version
|
|
256
255
|
*/
|
|
257
|
-
const getVersionMemoized =
|
|
256
|
+
const getVersionMemoized = memoize(function getVersionMemoized(
|
|
258
257
|
retries: number = DEFAULT_NUMBER_OF_RETRIES,
|
|
259
258
|
timeout: number = XCRUN_TIMEOUT,
|
|
260
259
|
): Promise<semver.SemVer | null> {
|
package/package.json
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
"ios",
|
|
7
7
|
"xcode"
|
|
8
8
|
],
|
|
9
|
-
"version": "6.
|
|
9
|
+
"version": "6.2.0",
|
|
10
10
|
"author": "Appium Contributors",
|
|
11
11
|
"license": "Apache-2.0",
|
|
12
12
|
"repository": {
|
|
@@ -30,9 +30,6 @@
|
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@appium/support": "^7.0.0-rc.1",
|
|
32
32
|
"asyncbox": "^6.0.1",
|
|
33
|
-
"bluebird": "^3.7.2",
|
|
34
|
-
"lodash": "^4.17.4",
|
|
35
|
-
"plist": "^3.0.1",
|
|
36
33
|
"semver": "^7.0.0",
|
|
37
34
|
"teen_process": "^4.0.4"
|
|
38
35
|
},
|
|
@@ -46,8 +43,8 @@
|
|
|
46
43
|
"format": "prettier -w ./lib ./test",
|
|
47
44
|
"format:check": "prettier --check ./lib ./test",
|
|
48
45
|
"prepare": "npm run build",
|
|
49
|
-
"test": "mocha --exit --timeout 1m \"./test/unit/**/*-specs.
|
|
50
|
-
"e2e-test": "mocha --exit --timeout 5m \"./test/e2e/**/*-specs.
|
|
46
|
+
"test": "mocha --exit --timeout 1m \"./test/unit/**/*-specs.ts\"",
|
|
47
|
+
"e2e-test": "mocha --exit --timeout 5m \"./test/e2e/**/*-specs.ts\""
|
|
51
48
|
},
|
|
52
49
|
"prettier": {
|
|
53
50
|
"bracketSpacing": false,
|
|
@@ -60,8 +57,6 @@
|
|
|
60
57
|
"@appium/types": "^1.0.0-rc.1",
|
|
61
58
|
"@semantic-release/changelog": "^6.0.1",
|
|
62
59
|
"@semantic-release/git": "^10.0.1",
|
|
63
|
-
"@types/bluebird": "^3.5.38",
|
|
64
|
-
"@types/lodash": "^4.14.196",
|
|
65
60
|
"@types/mocha": "^10.0.1",
|
|
66
61
|
"@types/node": "^25.0.0",
|
|
67
62
|
"chai": "^6.0.0",
|
|
@@ -71,6 +66,6 @@
|
|
|
71
66
|
"prettier": "^3.0.0",
|
|
72
67
|
"semantic-release": "^25.0.2",
|
|
73
68
|
"ts-node": "^10.9.1",
|
|
74
|
-
"typescript": "^
|
|
69
|
+
"typescript": "^6.0.2"
|
|
75
70
|
}
|
|
76
71
|
}
|