Skip to content

Add support for Swift package manager#3788

Merged
keshav-space merged 14 commits intodevelopfrom
2657-support-swiftpm
Jun 3, 2024
Merged

Add support for Swift package manager#3788
keshav-space merged 14 commits intodevelopfrom
2657-support-swiftpm

Conversation

@keshav-space
Copy link
Member

@keshav-space keshav-space commented May 28, 2024

Tasks

  • Reviewed contribution guidelines
  • PR is descriptively titled 📑 and links the original issue above 🔗
  • Tests pass -- look for a green checkbox ✔️ a few minutes after opening your PR
    Run tests locally to check for errors.
  • Commits are in uniquely-named feature branch and has no merge conflicts 📁
  • Updated documentation pages (if applicable)
  • Updated CHANGELOG.rst (if applicable)

Signed-off-by: Keshav Priyadarshi <[email protected]>
Signed-off-by: Keshav Priyadarshi <[email protected]>
Signed-off-by: Keshav Priyadarshi <[email protected]>
Signed-off-by: Keshav Priyadarshi <[email protected]>
@keshav-space keshav-space force-pushed the 2657-support-swiftpm branch from 686c0ab to b1f17bc Compare May 28, 2024 19:09
Copy link
Member

@pombredanne pombredanne left a comment

Choose a reason for hiding this comment

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

datasource_id=cls.datasource_id,
type=cls.default_package_type,
primary_language=cls.default_primary_language,
namespace=None,
Copy link
Member

Choose a reason for hiding this comment

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

Add namespace

Copy link
Member Author

Choose a reason for hiding this comment

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

@pombredanne We don't have a namespace for the top-level package in the Package.swift manifest.

Copy link
Member

Choose a reason for hiding this comment

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

ok, how does this look like when installed?
Is there any trace of where it came from?
https://github.com/mapbox/mapbox-maps-ios/blob/main/Package.swift has some possible base URL. BUT when I see https://github.com/map-ir/mapir-ios-maps-sdk/blob/cfca260d03ab8f0d1889795ec012adae1d3bfbd8/Package.swift#L20 or https://github.com/mapbox/mapbox-navigation-ios/blob/b9c235e665ea2d3b7cd096e9c6128e97c1d4f00c/Package.swift#L27 it is clear that the actual name is one thing and the "package name" is another thing and seem to be resolved only when interpreting a Package.swift for dependencies.

So IMHO we cannot get that actual correct PURL name short of matching or have this used as a dependency. Just create a follow up issue for this so we can address it later.

Copy link
Member Author

@keshav-space keshav-space May 30, 2024

Choose a reason for hiding this comment

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

ok, how does this look like when installed?
Is there any trace of where it came from?

Yes, we can trace the source of an already installed package from the .build directory.

Tracking this issue here #3793

The PURL for a Swift package depends on where the package is hosted, and given that Package.swift does not contain the repository URL for the top-level package, it is not possible to infer the correct PURL for the top-level package solely from the Package.swift manifest.
We can use https://swiftpackageindex.com/ to get the correct PURL, but this may not work for all packages since Swift Package Index is not authoritative in nature, i.e. a Swift package may exist, and the author may choose not to add their package to Swift Package Index. https://swiftpackageindex.com/add-a-package

keshav-space and others added 9 commits May 29, 2024 21:23
Signed-off-by: Keshav Priyadarshi <[email protected]>

Co-authored-by: Philippe Ombredanne <[email protected]>
Signed-off-by: Keshav Priyadarshi <[email protected]>

Co-authored-by: Philippe Ombredanne <[email protected]>
Signed-off-by: Keshav Priyadarshi <[email protected]>

Co-authored-by: Philippe Ombredanne <[email protected]>
Signed-off-by: Keshav Priyadarshi <[email protected]>

Co-authored-by: Philippe Ombredanne <[email protected]>
Signed-off-by: Keshav Priyadarshi <[email protected]>

Co-authored-by: Philippe Ombredanne <[email protected]>
Signed-off-by: Keshav Priyadarshi <[email protected]>

Co-authored-by: Philippe Ombredanne <[email protected]>
- Use the last segment as name and the rest as namespace

Signed-off-by: Keshav Priyadarshi <[email protected]>
@keshav-space
Copy link
Member Author

Thanks @pombredanne, addressed all your feedback.

Copy link
Member

@pombredanne pombredanne left a comment

Choose a reason for hiding this comment

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

All good. Please merge.

@keshav-space keshav-space merged commit 8e9dc46 into develop Jun 3, 2024
@keshav-space keshav-space deleted the 2657-support-swiftpm branch June 3, 2024 10:59
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.

Add support for Swift PM

2 participants