(p: Plugin, config: Config)
| 102 | } |
| 103 | |
| 104 | async function generateCordovaPackageFile(p: Plugin, config: Config) { |
| 105 | const iosPlatformVersion = await getCapacitorPackageVersion(config, config.ios.name); |
| 106 | |
| 107 | const platformTag = getPluginPlatform(p, platform); |
| 108 | if (platformTag.$?.package) { |
| 109 | const packageSwiftPath = join(p.rootPath, 'Package.swift'); |
| 110 | let content = await readFile(packageSwiftPath, { encoding: 'utf-8' }); |
| 111 | content = content.replace(`apache`, `ionic-team`).replaceAll(`cordova-ios`, `capacitor-swift-pm`); |
| 112 | content = setAllStringIn( |
| 113 | content, |
| 114 | `url: "https://github.com/ionic-team/capacitor-swift-pm.git",`, |
| 115 | `)`, |
| 116 | ` from: "${iosPlatformVersion}"`, |
| 117 | ); |
| 118 | await writeFile(packageSwiftPath, content); |
| 119 | } else { |
| 120 | await writeGeneratedPackageSwift(p, config, iosPlatformVersion); |
| 121 | } |
| 122 | } |
| 123 | |
| 124 | function buildBinaryTargetEntries(p: Plugin, frameworks: any[]): { binaryTargetsText: string; binaryDepsText: string } { |
| 125 | const customXcframeworks = frameworks.filter((f: any) => f.$.custom === 'true' && f.$.src.endsWith('.xcframework')); |
no test coverage detected