Commit d0323dd
authored
Fix
This change updates the `msbuild` lockfile parser so that it will not
allow for missing names and or versions. Before this change, a
`*.csproj` file parsed as a lockfile (e.g., with type of `msbuild`)
would show entries with missing name or version as an empty string. This
causes analysis failures when submitting to the API since a valid
package descriptor requires a non-empty `version` field.
Dependency management in NuGet's "Central Package Management" (CPM)
allows for `*.csproj` files containing `PackageReference` elements
without a `Version` attribute. Those versions will be included, along
with the fully transitive set, in the `packages.lock.json` lockfile
generated by NuGet. When both files are present in the same directory,
the changes in this patch will correctly parse both. For more about CPM,
see this reference:
https://devblogs.microsoft.com/nuget/introducing-central-package-management/
The `sample.csproj` test fixture was updated to include an entry with
neither a name or version and another entry with a name but no version.msbuild parser allowing missing versions (#1559)1 parent 007b856 commit d0323dd
File tree
3 files changed
+21
-9
lines changed- lockfile/src
- tests/fixtures
3 files changed
+21
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
15 | 19 | | |
16 | 20 | | |
17 | 21 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
98 | | - | |
| 98 | + | |
99 | 99 | | |
100 | 100 | | |
101 | | - | |
| 101 | + | |
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
| |||
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
116 | | - | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
121 | 123 | | |
122 | | - | |
| 124 | + | |
123 | 125 | | |
124 | 126 | | |
125 | 127 | | |
| |||
130 | 132 | | |
131 | 133 | | |
132 | 134 | | |
133 | | - | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
134 | 140 | | |
135 | 141 | | |
136 | 142 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
13 | 14 | | |
14 | 15 | | |
15 | 16 | | |
| |||
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
| 24 | + | |
23 | 25 | | |
24 | 26 | | |
25 | 27 | | |
| |||
0 commit comments