(config: Config, platform: string)
| 481 | } |
| 482 | |
| 483 | export function resolvePlatform(config: Config, platform: string): string | null { |
| 484 | if (platform[0] !== '@') { |
| 485 | const core = resolveNode(config.app.rootDir, `@capacitor/${platform}`, 'package.json'); |
| 486 | |
| 487 | if (core) { |
| 488 | return dirname(core); |
| 489 | } |
| 490 | |
| 491 | const community = resolveNode(config.app.rootDir, `@capacitor-community/${platform}`, 'package.json'); |
| 492 | |
| 493 | if (community) { |
| 494 | return dirname(community); |
| 495 | } |
| 496 | |
| 497 | const enterprise = resolveNode(config.app.rootDir, `@ionic-enterprise/capacitor-${platform}`, 'package.json'); |
| 498 | |
| 499 | if (enterprise) { |
| 500 | return dirname(enterprise); |
| 501 | } |
| 502 | } |
| 503 | |
| 504 | // third-party |
| 505 | const thirdParty = resolveNode(config.app.rootDir, platform, 'package.json'); |
| 506 | |
| 507 | if (thirdParty) { |
| 508 | return dirname(thirdParty); |
| 509 | } |
| 510 | |
| 511 | return null; |
| 512 | } |
| 513 | |
| 514 | export async function checkJDKMajorVersion(): Promise<number> { |
| 515 | try { |
no test coverage detected