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

Improve PackageOverride API, deprecate Dependency.versionSpec #2366

Merged
merged 6 commits into from
Aug 7, 2022

Conversation

Geod24
Copy link
Member

@Geod24 Geod24 commented Aug 6, 2022

Trying to weed out all the place that made any kind of assumption about what's a Dependency.
While the diff looks pretty terrible because I'm trying very hard not to break code for library users, the result is that versionSpec is no longer used within dub, and I think the resulting (non-deprecated) code is much nicer and easier to read.

@Geod24 Geod24 force-pushed the discriminate branch 2 times, most recently from 720bf79 to 2b9dda6 Compare August 6, 2022 13:53
Geod24 added 4 commits August 6, 2022 16:01
Like Dependency, we only were using one of those two fields,
but it was not readily obvious before, and we relied on one
of them being empty to read the other one.
The code was always assuming overrides were VersionRange,
as trying to do 'dub add-override' would call 'Dependency'
constructor with a string, which forwards to VersionRange.fromString.
However, when using dub as a library, this assumption was much less obvious,
notably because the fields are public.
With this change, we make sure library users do not misuse overrides.
All places which assumed that Dependency contained a VersionRange have been culled,
so we can now start removing those properties.
@Geod24 Geod24 merged commit 78573cc into dlang:master Aug 7, 2022
@Geod24 Geod24 deleted the discriminate branch August 7, 2022 09:24
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