From baf30f9285fed4db929232296e52a59dc7aac59f Mon Sep 17 00:00:00 2001 From: Mark Anderson Date: Mon, 22 Jun 2026 13:51:17 -0400 Subject: [PATCH 1/2] fix: add missing logic from merge --- cli/src/util/cordova-ios.ts | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/cli/src/util/cordova-ios.ts b/cli/src/util/cordova-ios.ts index 040116257..bf177f064 100644 --- a/cli/src/util/cordova-ios.ts +++ b/cli/src/util/cordova-ios.ts @@ -13,6 +13,7 @@ import { getPluginPlatform, getPluginType, } from '../plugin'; +import { setAllStringIn } from '../tasks/migrate'; import type { Plugin } from '../plugin'; import { extractTemplate } from '../util/template'; @@ -352,7 +353,21 @@ export async function generateCordovaPackageFile(p: Plugin, config: Config): Pro publicHeadersPath: "."`; } - const content = `// swift-tools-version: 5.9 + const platformTag = getPluginPlatform(p, platform); + + if (platformTag.$?.package) { + const packageSwiftPath = join(p.rootPath, 'Package.swift'); + let content = await readFile(packageSwiftPath, { encoding: 'utf-8' }); + content = content.replace(`apache`, `ionic-team`).replaceAll(`cordova-ios`, `capacitor-swift-pm`); + content = setAllStringIn( + content, + `url: "https://github.com/ionic-team/capacitor-swift-pm.git",`, + `)`, + ` from: "${iosPlatformVersion}"`, + ); + await writeFile(packageSwiftPath, content); + } else { + const content = `// swift-tools-version: 5.9 import PackageDescription @@ -379,4 +394,5 @@ let package = Package( ] )`; await writeFile(join(config.ios.cordovaPluginsDirAbs, 'sources', p.name, 'Package.swift'), content); + } } From 23ea299843510acc731b8b389b693aa45ac287eb Mon Sep 17 00:00:00 2001 From: Mark Anderson Date: Mon, 22 Jun 2026 13:56:50 -0400 Subject: [PATCH 2/2] npm run fmt --- cli/src/util/cordova-ios.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cli/src/util/cordova-ios.ts b/cli/src/util/cordova-ios.ts index bf177f064..371bd96d3 100644 --- a/cli/src/util/cordova-ios.ts +++ b/cli/src/util/cordova-ios.ts @@ -13,8 +13,8 @@ import { getPluginPlatform, getPluginType, } from '../plugin'; -import { setAllStringIn } from '../tasks/migrate'; import type { Plugin } from '../plugin'; +import { setAllStringIn } from '../tasks/migrate'; import { extractTemplate } from '../util/template'; const platform = 'ios'; @@ -393,6 +393,6 @@ let package = Package( ) ] )`; - await writeFile(join(config.ios.cordovaPluginsDirAbs, 'sources', p.name, 'Package.swift'), content); + await writeFile(join(config.ios.cordovaPluginsDirAbs, 'sources', p.name, 'Package.swift'), content); } }