Skip to content
This repository has been archived by the owner on Jan 4, 2020. It is now read-only.

[WIP]: Multi dependency package support & other proposed fixes/improvements #193

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

bitwit
Copy link
Contributor

@bitwit bitwit commented Nov 11, 2018

This PR is a WIP of fixes for issues in #189, #191 as well as some other things I'll mention in notes below.

The changes are primarily trying to address importing dependencies from a package that may not go by the same name as the package, or situations where there are multiple libraries from a package that you are trying to import. Along the way, I noticed some issues with the Master Package Description and the way it acts as a template for the Package.swift files used in every script. As a result, in this current WIP code, the Master Package.swift is mostly unused and package update functionality is currently disabled.

I was mostly working with MarathonCore directly, not via CLI, but problems with the Master Package Description pattern I saw were:

  • After running Marathon a few times the dependencies of dependencies start getting added to the Master Package.swift, which are then copied over into the script Package.swift files.
  • This also means that if you have many scripts with dependencies then copying from the Master Package.swift will make the scripts depend on each other's libraries
  • Updating all packages to run some scripts that may not even have many dependencies can make simple script executions take longer
  • I found the versions depended upon in the Package.swift files weren't consistent enough because they only used the major version. It could cause issues during swift package update as it tried to resolve the dependencies correctly

Notes:

  • a new Dependency struct has been introduced that maintains the name of the specific library you want to include, not just the name of the package.
  • if swift tools version is 4.2 or greater then local references use the .package(path:"") format

This work is currently incomplete but I wanted to open a PR with my first shot at the problem as a proposal. Since it's a big change and there is lots of room for discussion.

Thanks for reading/reviewing!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant