MCPcopy Index your code
hub / github.com/ionic-team/capacitor / checkSwiftToolsVersion

Function checkSwiftToolsVersion

cli/src/util/spm.ts:242–257  ·  view source on GitHub ↗
(config: Config, version: string | undefined)

Source from the content-addressed store, hash-verified

240}
241
242export async function checkSwiftToolsVersion(config: Config, version: string | undefined): Promise<string | null> {
243 if (!version) {
244 return null;
245 }
246
247 const swiftToolsVersionRegex = /^[0-9]+\.[0-9]+(\.[0-9]+)?$/;
248
249 if (!swiftToolsVersionRegex.test(version)) {
250 return (
251 `Invalid Swift tools version: "${version}".\n` +
252 `The Swift tools version must be in major.minor or major.minor.patch format (e.g., "5.9", "6.0", "5.9.2").`
253 );
254 }
255
256 return null;
257}
258
259export async function checkPackageTraitsRequirements(config: Config): Promise<string | null> {
260 const packageTraits = config.app.extConfig.experimental?.ios?.spm?.packageTraits;

Callers 1

getCommonChecksFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected