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

Add support for local dependencies #81

Merged
merged 2 commits into from
Apr 7, 2019
Merged

Add support for local dependencies #81

merged 2 commits into from
Apr 7, 2019

Conversation

jasonzurita
Copy link
Contributor

Resolves issue: #76

Supports local dependencies when full local path is written or using ~/ prefix.

If the dependency is not scp or a github dependency with the @ symbol prefix, we check if the string path is valid in the user's file system using the Path dependency before setting the dependency as local. This way, we still allow github dependencies without the @ prefix.

If determined to be a local dependency, a new DependencyName enum case holds the dependency as a Path, which facilitates providing the dependency string when generating the Package.swift and when decoding. Moreover, this enum case is used to provide the correct packageline.

The related test makes use of Path.home to have a directory that is valid for testing wherever the test is run.

Also, updates README.

@jasonzurita jasonzurita mentioned this pull request Apr 7, 2019
If the dependency is not scp or a github dependency with
the `@` symbol prefix, we check if the string path is valid in the
user's file system using the Path dependency. This way, we still
allow github dependencies without the `@` prefix.

If determined to be a local dependency, a new `DependencyName`
enum case holds the dependency as a Path, which facilitates
providing the string for `Package.swift` and when decoding.
Moreover, this enum case is used to provide the correct `packageline`.

The related test makes use of `Path.home` to have a directory
that is valid for testing wherever the test is run.

Also, updates README.
Parse regex prefix was updated to allow a
`~` prefix using "match one of these characters"
syntax — i.e., [~@].

The related test makes use of `Path.home` to have a directory
that is valid for testing wherever the test is run.

Also, update README
@mxcl
Copy link
Owner

mxcl commented Apr 7, 2019

It seems a pity to require full paths. My experience with this sort of thing in other packages is 90% of the time you specify a relative path.

@jasonzurita
Copy link
Contributor Author

Yeah, I agree! I thought of relative paths as I was adding the support for ~/ paths, and that this would be a good first step towards a more full local dependency implementation that included relative paths. I figured that I didn't want to hold this work back by continuing to increase the scope.

@mxcl
Copy link
Owner

mxcl commented Apr 7, 2019

One way to work around the conflict with GitHub-user/repo would be to require ./foo or ../ for relative paths. Anyway, can merge and we can revisit doing that.

@mxcl mxcl merged commit fb3333e into mxcl:master Apr 7, 2019
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.

None yet

2 participants