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

feat(spm): Add method to determine if a plugin is a Swift package #216

Closed
wants to merge 1 commit into from

Conversation

dpogue
Copy link
Member

@dpogue dpogue commented Nov 11, 2024

Platforms affected

iOS

Motivation and Context

We want a declarative way for a plugin to opt-in to using Package.swift for managing its code and resources as opposed to file copying with source-file/header-file/resource-file/etc.

Description

Adds a helper method to detect if there is a <platform name="ios" package="swift"> tag.

Caveats:

  • This currently only looks at the first iOS platform declaration
  • This doesn't currently check the value of the package attribute. If it exists, we assume it is a Swift package. Ideally I'd love for this to be a boolean attribute like in HTML, but XML doesn't support those 😒

Testing

Added unit test case.

Checklist

  • I've run the tests to see all new and existing tests pass
  • I added automated test coverage as appropriate for this change

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.42%. Comparing base (24f7fa2) to head (5005e3f).

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #216      +/-   ##
==========================================
+ Coverage   88.40%   88.42%   +0.02%     
==========================================
  Files          20       20              
  Lines        1147     1149       +2     
==========================================
+ Hits         1014     1016       +2     
  Misses        133      133              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@dpogue
Copy link
Member Author

dpogue commented Nov 23, 2024

I found a way to handle this in the platform that doesn't involve modifying cordova-common, so I'm going to close this

@dpogue dpogue closed this Nov 23, 2024
@dpogue dpogue deleted the swift-package branch November 23, 2024 09:40
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.

2 participants