From a9f218179b60555d86b44bf2b33354da3e64e98c Mon Sep 17 00:00:00 2001 From: Joey Pender Date: Thu, 19 Mar 2026 10:09:56 -0500 Subject: [PATCH 1/6] fix(android): correctly parsing `server.url` when they include paths (#8391) Co-authored-by: Pedro Bilro --- android/capacitor/src/main/java/com/getcapacitor/Bridge.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/capacitor/src/main/java/com/getcapacitor/Bridge.java b/android/capacitor/src/main/java/com/getcapacitor/Bridge.java index 2a72a4304a..de1bad88ba 100644 --- a/android/capacitor/src/main/java/com/getcapacitor/Bridge.java +++ b/android/capacitor/src/main/java/com/getcapacitor/Bridge.java @@ -628,11 +628,11 @@ private void initWebView() { try { URL appUrlObject = new URL(appUrlConfig); authorities.add(appUrlObject.getAuthority()); + localUrl = appUrlObject.getProtocol() + "://" + appUrlObject.getAuthority(); } catch (Exception ex) { Logger.error("Provided server url is invalid: " + ex.getMessage()); return; } - localUrl = appUrlConfig; appUrl = appUrlConfig; } else { appUrl = localUrl; From d2ee84f8186909b142b418c02fc19f79d3c6a6ed Mon Sep 17 00:00:00 2001 From: Pedro Bilro Date: Mon, 23 Mar 2026 09:56:33 +0000 Subject: [PATCH 2/6] feat(cli): Experimental config for swift-tools-version in SPM apps (#8372) --- cli/src/declarations.ts | 36 ++++++++++++++++++++++++++++++++++++ cli/src/ios/common.ts | 6 ++++++ cli/src/util/spm.ts | 20 +++++++++++++++++++- 3 files changed, 61 insertions(+), 1 deletion(-) diff --git a/cli/src/declarations.ts b/cli/src/declarations.ts index 5eacf5e654..9afc560897 100644 --- a/cli/src/declarations.ts +++ b/cli/src/declarations.ts @@ -509,6 +509,42 @@ export interface CapacitorConfig { }; }; + experimental?: { + /** + * Experimental iOS-specific configuration. + * + * These options may change or be removed in future versions. + * + * @since 8.2.0 + */ + ios?: { + /** + * Swift Package Manager (SPM) specific configuration. + * + * @since 8.2.0 + */ + spm?: { + /** + * Swift tools version to use in Package.swift header. + * + * Defines the minimum version of the Swift compiler version required to build your app. + * For more information check the [swift documentation](https://docs.swift.org/swiftpm/documentation/packagemanagerdocs/settingswifttoolsversion/) + * + * Warning: Capacitor does not officially support Swift 6 yet. + * Setting this property to 6.0 or higher may cause issues. + * If you need to set this property to 6.0 or higher, make sure to throughrouly test your iOS app. + * + * This setting may graduate to `ios.spm.swiftToolsVersion` in a future major release. + * + * @since 8.2.0 + * @default '5.9' + * @example '6.1' + */ + swiftToolsVersion?: string; + }; + }; + }; + server?: { /** * Configure the local hostname of the device. diff --git a/cli/src/ios/common.ts b/cli/src/ios/common.ts index 312c13dad2..7ac2831e03 100644 --- a/cli/src/ios/common.ts +++ b/cli/src/ios/common.ts @@ -11,6 +11,7 @@ import type { Config } from '../definitions'; import { logger } from '../log'; import { PluginType, getPluginPlatform } from '../plugin'; import type { Plugin } from '../plugin'; +import { checkSwiftToolsVersion } from '../util/spm'; import { isInstalled, runCommand } from '../util/subprocess'; export async function checkIOSPackage(config: Config): Promise { @@ -32,6 +33,11 @@ export async function getCommonChecks(config: Config): Promise checks.push(() => checkBundler(config)); } else if ((await config.ios.packageManager) === 'Cocoapods') { checks.push(() => checkCocoaPods(config)); + } else if ((await config.ios.packageManager) === 'SPM') { + const swiftToolsVersion = config.app.extConfig.experimental?.ios?.spm?.swiftToolsVersion; + if (swiftToolsVersion) { + checks.push(() => checkSwiftToolsVersion(config, swiftToolsVersion)); + } } return checks; } diff --git a/cli/src/util/spm.ts b/cli/src/util/spm.ts index 30e51cf1a4..5deb4b3b87 100644 --- a/cli/src/util/spm.ts +++ b/cli/src/util/spm.ts @@ -98,8 +98,9 @@ export async function removeCocoapodsFiles(config: Config): Promise { export async function generatePackageText(config: Config, plugins: Plugin[]): Promise { const iosPlatformVersion = await getCapacitorPackageVersion(config, config.ios.name); const iosVersion = getMajoriOSVersion(config); + const swiftToolsVersion = config.app.extConfig.experimental?.ios?.spm?.swiftToolsVersion ?? '5.9'; - let packageSwiftText = `// swift-tools-version: 5.9 + let packageSwiftText = `// swift-tools-version: ${swiftToolsVersion} import PackageDescription // DO NOT MODIFY THIS FILE - managed by Capacitor CLI commands @@ -188,6 +189,23 @@ export async function addInfoPlistDebugIfNeeded(config: Config): Promise { } } +export async function checkSwiftToolsVersion(config: Config, version: string | undefined): Promise { + if (!version) { + return null; + } + + const swiftToolsVersionRegex = /^[0-9]+\.[0-9]+(\.[0-9]+)?$/; + + if (!swiftToolsVersionRegex.test(version)) { + return ( + `Invalid Swift tools version: "${version}".\n` + + `The Swift tools version must be in major.minor or major.minor.patch format (e.g., "5.9", "6.0", "5.9.2").` + ); + } + + return null; +} + // Private Functions async function pluginsWithPackageSwift(plugins: Plugin[]): Promise { From e9fcad6a2b6d91b4565746331a2fb1b47cd9b492 Mon Sep 17 00:00:00 2001 From: Mark Anderson Date: Thu, 19 Feb 2026 10:23:10 -0500 Subject: [PATCH 3/6] chore: add semantic release configuration --- release.config.mjs | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 release.config.mjs diff --git a/release.config.mjs b/release.config.mjs new file mode 100644 index 0000000000..c3429d51b9 --- /dev/null +++ b/release.config.mjs @@ -0,0 +1,24 @@ +/** + * @type {import('semantic-release').GlobalConfig} + */ +export default { + branches: [ '+([0-9])?(.{+([0-9]),x}).x', + 'main', + { name: "next", channel: "next", prerelease: "dev"}, + ], + tagFormat: "${version}", + plugins: [ + "@semantic-release/github", + [ "@semantic-release/commit-analyzer", + { + "preset": "conventionalcommits", + }, + ], + [ + "@semantic-release/release-notes-generator", + { + "preset": "conventionalcommits", + } + ] + ], +}; \ No newline at end of file From b6e2175e85d3ad0d1799d4a520f7fd0de50e5875 Mon Sep 17 00:00:00 2001 From: Mark Anderson Date: Thu, 19 Feb 2026 10:30:42 -0500 Subject: [PATCH 4/6] style: npm run fmt --- release.config.mjs | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/release.config.mjs b/release.config.mjs index c3429d51b9..361e8cd454 100644 --- a/release.config.mjs +++ b/release.config.mjs @@ -2,23 +2,21 @@ * @type {import('semantic-release').GlobalConfig} */ export default { - branches: [ '+([0-9])?(.{+([0-9]),x}).x', - 'main', - { name: "next", channel: "next", prerelease: "dev"}, - ], - tagFormat: "${version}", + branches: ['+([0-9])?(.{+([0-9]),x}).x', 'main', { name: 'next', channel: 'next', prerelease: 'dev' }], + tagFormat: '${version}', plugins: [ - "@semantic-release/github", - [ "@semantic-release/commit-analyzer", - { - "preset": "conventionalcommits", + '@semantic-release/github', + [ + '@semantic-release/commit-analyzer', + { + preset: 'conventionalcommits', }, ], [ - "@semantic-release/release-notes-generator", + '@semantic-release/release-notes-generator', { - "preset": "conventionalcommits", - } - ] + preset: 'conventionalcommits', + }, + ], ], -}; \ No newline at end of file +}; From 6c1cbb70b4d76803ea1bca700e6664345c39ae9d Mon Sep 17 00:00:00 2001 From: Mark Anderson Date: Thu, 19 Feb 2026 10:42:09 -0500 Subject: [PATCH 5/6] Add packages to package.json --- package.json | 3 +++ 1 file changed, 3 insertions(+) diff --git a/package.json b/package.json index 8f339f1966..10a6977590 100644 --- a/package.json +++ b/package.json @@ -33,11 +33,14 @@ "@ionic/prettier-config": "^4.0.0", "@ionic/swiftlint-config": "^2.0.0", "@types/node": "18.18.6", + "conventional-changelog-conventionalcommits": "^9.1.0", "eslint": "^8.57.0", "lerna": "^7.1.3", "prettier": "^3.3.0", "prettier-plugin-java": "^2.6.4", "rimraf": "^4.4.1", + "semantic-release": "^25.0.3", + "semantic-release-monorepo": "^8.0.2", "semver": "^7.3.7", "swiftlint": "^2.0.0", "tar": "^7.5.3" From ed0bdc34c52b0be1931c6dfbb8222f197b888d60 Mon Sep 17 00:00:00 2001 From: Mark Anderson Date: Mon, 16 Mar 2026 13:21:42 -0400 Subject: [PATCH 6/6] do not push --- release.config.mjs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/release.config.mjs b/release.config.mjs index 361e8cd454..a0c1b0771f 100644 --- a/release.config.mjs +++ b/release.config.mjs @@ -2,7 +2,7 @@ * @type {import('semantic-release').GlobalConfig} */ export default { - branches: ['+([0-9])?(.{+([0-9]),x}).x', 'main', { name: 'next', channel: 'next', prerelease: 'dev' }], + branches: ['+([0-9])?(.{+([0-9]),x}).x', 'main', { name: 'semantic', channel: 'next', prerelease: 'dev' }], tagFormat: '${version}', plugins: [ '@semantic-release/github',