Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(spm): add product lines to Package.swift #7278

Merged
merged 16 commits into from
Mar 7, 2024
Prev Previous commit
Next Next commit
Apply suggestions from code review
Co-authored-by: jcesarmobile <jcesarmobile@gmail.com>
  • Loading branch information
markemer and jcesarmobile authored Mar 4, 2024
commit bf0268e95b84066c0aa682eefcbff3b1cf0cb81b
26 changes: 13 additions & 13 deletions cli/src/util/spm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,27 +62,27 @@ let package = Package(

for (const plugin of plugins) {
const relPath = relative(config.ios.nativeXcodeProjDirAbs, plugin.rootPath);
packageSwiftText += `,\n .package(name: "${plugin.ios?.name}", path: "${relPath}")`;
packageSwiftText += `,\n .package(name: "${plugin.ios?.name}", path: "${relPath}")`;
}

packageSwiftText += `
],
targets: [
.target(
name: "CapApp-SPM",
dependencies: [
.product(name: "Capacitor", package: "capacitor-spm"),
.product(name: "Cordova", package: "capacitor-spm")`;
],
targets: [
.target(
name: "CapApp-SPM",
dependencies: [
.product(name: "Capacitor", package: "capacitor-spm"),
.product(name: "Cordova", package: "capacitor-spm")`;

for (const plugin of plugins) {
packageSwiftText += `,\n .product(name: "${plugin.ios?.name}", package: "${plugin.ios?.name}")`;
packageSwiftText += `,\n .product(name: "${plugin.ios?.name}", package: "${plugin.ios?.name}")`;
}

packageSwiftText += `
]
)
]
)
]
)
]
)
`;

return packageSwiftText;
Expand Down