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
Merged

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

merged 16 commits into from
Mar 7, 2024

Conversation

markemer
Copy link
Member

@markemer markemer commented Feb 22, 2024

Currently in draft as this fixes one problem but is dependent on the following

@markemer markemer marked this pull request as ready for review February 27, 2024 19:09
Copy link
Member

@jcesarmobile jcesarmobile left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This fails to detect deleted plugins, they are kept in the Package.swift file, making the app fail.

I think we should go with full file generation (or at least everything after the // DO NOT MODIFY THIS FILE) instead of appending the plugins to the existing ones, this way it will generate the file without the uninstalled plugins, otherwise we would need to keep track of installed plugins on every sync and compare with the previous list and update the list, etc.

@jcesarmobile
Copy link
Member

another idea is to keep the file as is and append the dependencies to the end, I've tried this and it works:

package.dependencies.append(.package(name: "CapacitorActionSheet", path: "../capacitor-plugins/action-sheet"))

package.targets.first?.dependencies.append(.product(name: "CapacitorActionSheet", package: "CapacitorActionSheet"))

@markemer
Copy link
Member Author

Thanks for the bug callout - generating the whole thing from the start might be the answer, or something programmatic.

@markemer
Copy link
Member Author

@jcesarmobile and now I'm just generating it - hopefully that'll work better.

cli/src/util/spm.ts Outdated Show resolved Hide resolved
Copy link
Member

@jcesarmobile jcesarmobile left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just a few formatting issues on the resulting file

cli/src/util/spm.ts Outdated Show resolved Hide resolved
cli/src/util/spm.ts Outdated Show resolved Hide resolved
cli/src/util/spm.ts Outdated Show resolved Hide resolved
cli/src/util/spm.ts Outdated Show resolved Hide resolved
cli/src/util/spm.ts Outdated Show resolved Hide resolved
markemer and others added 2 commits March 4, 2024 14:08
Co-authored-by: jcesarmobile <jcesarmobile@gmail.com>
Co-authored-by: jcesarmobile <jcesarmobile@gmail.com>
@markemer markemer requested a review from jcesarmobile March 4, 2024 20:20
@markemer markemer merged commit e45d60d into main Mar 7, 2024
6 checks passed
@markemer markemer deleted the RMDR-29 branch March 7, 2024 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants