dependabot-nuget 0.258.0 → 0.260.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/helpers/lib/NuGetUpdater/Directory.Packages.props +2 -0
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Cli/Commands/DiscoverCommand.cs +2 -2
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Cli.Test/EntryPointTests.Discover.cs +255 -191
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Cli.Test/EntryPointTests.Update.cs +63 -35
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Discover/DiscoveryWorker.cs +107 -14
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Utilities/MSBuildHelper.cs +9 -5
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core/Utilities/PathHelper.cs +18 -0
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Discover/DiscoveryWorkerTestBase.cs +6 -1
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Discover/DiscoveryWorkerTests.DotNetToolsJson.cs +6 -2
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Discover/DiscoveryWorkerTests.GlobalJson.cs +6 -2
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Discover/DiscoveryWorkerTests.PackagesConfig.cs +11 -21
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Discover/DiscoveryWorkerTests.Proj.cs +95 -0
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Discover/DiscoveryWorkerTests.Project.cs +204 -62
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Discover/DiscoveryWorkerTests.cs +64 -45
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/MockNuGetPackage.cs +419 -0
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/NuGetUpdater.Core.Test.csproj +1 -0
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/TemporaryDirectory.cs +7 -2
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Update/UpdateWorkerTestBase.cs +77 -19
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Update/UpdateWorkerTests.DirsProj.cs +120 -91
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Update/UpdateWorkerTests.DotNetTools.cs +132 -97
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Update/UpdateWorkerTests.GlobalJson.cs +93 -75
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Update/UpdateWorkerTests.Mixed.cs +45 -42
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Update/UpdateWorkerTests.PackagesConfig.cs +1089 -956
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Update/UpdateWorkerTests.Sdk.cs +1624 -1291
- data/helpers/lib/NuGetUpdater/NuGetUpdater.Core.Test/Utilities/MSBuildHelperTests.cs +296 -293
- data/helpers/lib/NuGetUpdater/global.json +6 -0
- data/lib/dependabot/nuget/file_parser.rb +4 -5
- data/lib/dependabot/nuget/file_updater.rb +1 -1
- data/lib/dependabot/nuget/update_checker/dependency_finder.rb +7 -2
- data/lib/dependabot/nuget/update_checker/property_updater.rb +1 -0
- data/lib/dependabot/nuget/update_checker/version_finder.rb +2 -3
- data/lib/dependabot/nuget/update_checker.rb +1 -0
- metadata +8 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b1b140c78d66095a6746885eac8a58f77a4994265ac2a7bd046b821bb017a7ba
|
4
|
+
data.tar.gz: a36b0a0b9f7da46b710fac37291770c81132285bdb9a67105ac8a0cd29db89a1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 59cc0a904d5d58697dbeb16676c504baf6400d437b3b8ae4c73827863f275be8cf75a49175a8291dc92f91ec607dc98884301df6899c81937461dbd86de974b4
|
7
|
+
data.tar.gz: 07f2c7934ba42348ffc76c41a9b992a879faf356b23996381e4b582f7c4768f88b0227b7ab7dae0c60a7d517d38182c5a5d911278340d4dd0b2924fd9f736877
|
@@ -13,6 +13,8 @@
|
|
13
13
|
<PackageVersion Include="Microsoft.Build" Version="17.5.0" ExcludeAssets="Runtime" PrivateAssets="All" />
|
14
14
|
<PackageVersion Include="Microsoft.Build.Utilities.Core" Version="17.5.0" ExcludeAssets="Runtime" PrivateAssets="All" />
|
15
15
|
|
16
|
+
<PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="4.9.2" />
|
17
|
+
|
16
18
|
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.5.0" />
|
17
19
|
|
18
20
|
<PackageVersion Include="NuGet.Core" Version="2.14.0-rtm-832" Aliases="CoreV2" />
|
@@ -8,7 +8,7 @@ namespace NuGetUpdater.Cli.Commands;
|
|
8
8
|
internal static class DiscoverCommand
|
9
9
|
{
|
10
10
|
internal static readonly Option<DirectoryInfo> RepoRootOption = new("--repo-root", () => new DirectoryInfo(Environment.CurrentDirectory)) { IsRequired = false };
|
11
|
-
internal static readonly Option<
|
11
|
+
internal static readonly Option<string> WorkspaceOption = new("--workspace") { IsRequired = true };
|
12
12
|
internal static readonly Option<string> OutputOption = new("--output", () => DiscoveryWorker.DiscoveryResultFileName) { IsRequired = false };
|
13
13
|
internal static readonly Option<bool> VerboseOption = new("--verbose", getDefaultValue: () => false);
|
14
14
|
|
@@ -27,7 +27,7 @@ internal static class DiscoverCommand
|
|
27
27
|
command.SetHandler(async (repoRoot, workspace, outputPath, verbose) =>
|
28
28
|
{
|
29
29
|
var worker = new DiscoveryWorker(new Logger(verbose));
|
30
|
-
await worker.RunAsync(repoRoot.FullName, workspace
|
30
|
+
await worker.RunAsync(repoRoot.FullName, workspace, outputPath);
|
31
31
|
}, RepoRootOption, WorkspaceOption, OutputOption, VerboseOption);
|
32
32
|
|
33
33
|
return command;
|
@@ -1,8 +1,9 @@
|
|
1
|
-
using System.Collections.Immutable;
|
2
1
|
using System.Text;
|
3
2
|
|
4
3
|
using NuGetUpdater.Core;
|
4
|
+
using NuGetUpdater.Core.Test;
|
5
5
|
using NuGetUpdater.Core.Test.Discover;
|
6
|
+
using NuGetUpdater.Core.Test.Update;
|
6
7
|
|
7
8
|
using Xunit;
|
8
9
|
|
@@ -14,145 +15,202 @@ public partial class EntryPointTests
|
|
14
15
|
{
|
15
16
|
public class Discover : DiscoveryWorkerTestBase
|
16
17
|
{
|
18
|
+
[Fact]
|
19
|
+
public async Task PathWithSpaces()
|
20
|
+
{
|
21
|
+
await RunAsync(path =>
|
22
|
+
[
|
23
|
+
"discover",
|
24
|
+
"--repo-root",
|
25
|
+
path,
|
26
|
+
"--workspace",
|
27
|
+
"path/to/some directory with spaces",
|
28
|
+
],
|
29
|
+
packages: [],
|
30
|
+
initialFiles:
|
31
|
+
[
|
32
|
+
("path/to/some directory with spaces/project.csproj", """
|
33
|
+
<Project Sdk="Microsoft.NETSdk">
|
34
|
+
<PropertyGroup>
|
35
|
+
<TargetFramework>net8.0</TargetFramework>
|
36
|
+
</PropertyGroup>
|
37
|
+
<ItemGroup>
|
38
|
+
<PackageReference Include="Some.Package" Version="1.2.3" />
|
39
|
+
</ItemGroup>
|
40
|
+
</Project>
|
41
|
+
""")
|
42
|
+
],
|
43
|
+
expectedResult: new()
|
44
|
+
{
|
45
|
+
FilePath = "path/to/some directory with spaces",
|
46
|
+
Projects = [
|
47
|
+
new()
|
48
|
+
{
|
49
|
+
FilePath = "project.csproj",
|
50
|
+
TargetFrameworks = ["net8.0"],
|
51
|
+
ReferencedProjectPaths = [],
|
52
|
+
ExpectedDependencyCount = 2,
|
53
|
+
Dependencies = [
|
54
|
+
new("Some.Package", "1.2.3", DependencyType.PackageReference, TargetFrameworks: ["net8.0"], IsDirect: true),
|
55
|
+
],
|
56
|
+
Properties = [
|
57
|
+
new("TargetFramework", "net8.0", "path/to/some directory with spaces/project.csproj"),
|
58
|
+
],
|
59
|
+
}
|
60
|
+
]
|
61
|
+
}
|
62
|
+
);
|
63
|
+
}
|
64
|
+
|
17
65
|
[Fact]
|
18
66
|
public async Task WithSolution()
|
19
67
|
{
|
20
|
-
string solutionPath = "path/to/solution.sln";
|
21
68
|
await RunAsync(path =>
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
<
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
69
|
+
[
|
70
|
+
"discover",
|
71
|
+
"--repo-root",
|
72
|
+
path,
|
73
|
+
"--workspace",
|
74
|
+
"/",
|
75
|
+
],
|
76
|
+
packages:
|
77
|
+
[
|
78
|
+
MockNuGetPackage.CreateSimplePackage("Some.Package", "7.0.1", "net45"),
|
79
|
+
],
|
80
|
+
initialFiles:
|
81
|
+
new[]
|
82
|
+
{
|
83
|
+
("solution.sln", """
|
84
|
+
Microsoft Visual Studio Solution File, Format Version 12.00
|
85
|
+
# Visual Studio 14
|
86
|
+
VisualStudioVersion = 14.0.22705.0
|
87
|
+
MinimumVisualStudioVersion = 10.0.40219.1
|
88
|
+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "my", "path/to/my.csproj", "{782E0C0A-10D3-444D-9640-263D03D2B20C}"
|
89
|
+
EndProject
|
90
|
+
Global
|
91
|
+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
92
|
+
Debug|Any CPU = Debug|Any CPU
|
93
|
+
Release|Any CPU = Release|Any CPU
|
94
|
+
EndGlobalSection
|
95
|
+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
96
|
+
{782E0C0A-10D3-444D-9640-263D03D2B20C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
97
|
+
{782E0C0A-10D3-444D-9640-263D03D2B20C}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
98
|
+
{782E0C0A-10D3-444D-9640-263D03D2B20C}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
99
|
+
{782E0C0A-10D3-444D-9640-263D03D2B20C}.Release|Any CPU.Build.0 = Release|Any CPU
|
100
|
+
EndGlobalSection
|
101
|
+
GlobalSection(SolutionProperties) = preSolution
|
102
|
+
HideSolutionNode = FALSE
|
103
|
+
EndGlobalSection
|
104
|
+
EndGlobal
|
105
|
+
"""),
|
106
|
+
("path/to/my.csproj", """
|
107
|
+
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
108
|
+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
109
|
+
<PropertyGroup>
|
110
|
+
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
111
|
+
</PropertyGroup>
|
112
|
+
<ItemGroup>
|
113
|
+
<None Include="packages.config" />
|
114
|
+
</ItemGroup>
|
115
|
+
<ItemGroup>
|
116
|
+
<Reference Include="Some.Package">
|
117
|
+
<HintPath>packages\Some.Package.7.0.1\lib\net45\Some.Package.dll</HintPath>
|
118
|
+
<Private>True</Private>
|
119
|
+
</Reference>
|
120
|
+
</ItemGroup>
|
121
|
+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
122
|
+
</Project>
|
123
|
+
"""),
|
124
|
+
("path/to/packages.config", """
|
125
|
+
<packages>
|
126
|
+
<package id="Some.Package" version="7.0.1" targetFramework="net45" />
|
127
|
+
</packages>
|
128
|
+
""")
|
129
|
+
},
|
130
|
+
expectedResult: new()
|
131
|
+
{
|
132
|
+
FilePath = "",
|
133
|
+
Projects = [
|
134
|
+
new()
|
135
|
+
{
|
136
|
+
FilePath = "path/to/my.csproj",
|
137
|
+
TargetFrameworks = ["net45"],
|
138
|
+
ReferencedProjectPaths = [],
|
139
|
+
ExpectedDependencyCount = 2,
|
140
|
+
Dependencies = [
|
141
|
+
new("Some.Package", "7.0.1", DependencyType.PackagesConfig, TargetFrameworks: ["net45"]),
|
142
|
+
],
|
143
|
+
Properties = [
|
144
|
+
new("TargetFrameworkVersion", "v4.5", "path/to/my.csproj"),
|
145
|
+
],
|
146
|
+
}
|
147
|
+
]
|
148
|
+
}
|
149
|
+
);
|
97
150
|
}
|
98
151
|
|
99
152
|
[Fact]
|
100
153
|
public async Task WithProject()
|
101
154
|
{
|
102
|
-
var projectPath = "path/to/my.csproj";
|
103
155
|
await RunAsync(path =>
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
<
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
+
[
|
157
|
+
"discover",
|
158
|
+
"--repo-root",
|
159
|
+
path,
|
160
|
+
"--workspace",
|
161
|
+
"path/to",
|
162
|
+
],
|
163
|
+
packages:
|
164
|
+
[
|
165
|
+
MockNuGetPackage.CreateSimplePackage("Some.Package", "7.0.1", "net45"),
|
166
|
+
],
|
167
|
+
initialFiles:
|
168
|
+
new[]
|
169
|
+
{
|
170
|
+
("path/to/my.csproj", """
|
171
|
+
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
172
|
+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
173
|
+
<PropertyGroup>
|
174
|
+
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
175
|
+
</PropertyGroup>
|
176
|
+
<ItemGroup>
|
177
|
+
<None Include="packages.config" />
|
178
|
+
</ItemGroup>
|
179
|
+
<ItemGroup>
|
180
|
+
<Reference Include="Some.Package">
|
181
|
+
<HintPath>packages\Some.Package.7.0.1\lib\net45\Some.Package.dll</HintPath>
|
182
|
+
<Private>True</Private>
|
183
|
+
</Reference>
|
184
|
+
</ItemGroup>
|
185
|
+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
186
|
+
</Project>
|
187
|
+
"""),
|
188
|
+
("path/to/packages.config", """
|
189
|
+
<packages>
|
190
|
+
<package id="Some.Package" version="7.0.1" targetFramework="net45" />
|
191
|
+
</packages>
|
192
|
+
""")
|
193
|
+
},
|
194
|
+
expectedResult: new()
|
195
|
+
{
|
196
|
+
FilePath = "path/to",
|
197
|
+
Projects = [
|
198
|
+
new()
|
199
|
+
{
|
200
|
+
FilePath = "my.csproj",
|
201
|
+
TargetFrameworks = ["net45"],
|
202
|
+
ReferencedProjectPaths = [],
|
203
|
+
ExpectedDependencyCount = 2,
|
204
|
+
Dependencies = [
|
205
|
+
new("Some.Package", "7.0.1", DependencyType.PackagesConfig, TargetFrameworks: ["net45"])
|
206
|
+
],
|
207
|
+
Properties = [
|
208
|
+
new("TargetFrameworkVersion", "v4.5", "path/to/my.csproj"),
|
209
|
+
],
|
210
|
+
}
|
211
|
+
]
|
212
|
+
}
|
213
|
+
);
|
156
214
|
}
|
157
215
|
|
158
216
|
[Fact]
|
@@ -160,76 +218,80 @@ public partial class EntryPointTests
|
|
160
218
|
{
|
161
219
|
var workspacePath = "path/to/";
|
162
220
|
await RunAsync(path =>
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
<
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
221
|
+
[
|
222
|
+
"discover",
|
223
|
+
"--repo-root",
|
224
|
+
path,
|
225
|
+
"--workspace",
|
226
|
+
workspacePath,
|
227
|
+
],
|
228
|
+
packages:
|
229
|
+
[
|
230
|
+
MockNuGetPackage.CreateSimplePackage("Some.Package", "7.0.1", "net45"),
|
231
|
+
],
|
232
|
+
initialFiles:
|
233
|
+
new[]
|
234
|
+
{
|
235
|
+
("path/to/my.csproj", """
|
236
|
+
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
237
|
+
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
238
|
+
<PropertyGroup>
|
239
|
+
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
240
|
+
</PropertyGroup>
|
241
|
+
<ItemGroup>
|
242
|
+
<None Include="packages.config" />
|
243
|
+
</ItemGroup>
|
244
|
+
<ItemGroup>
|
245
|
+
<Reference Include="Some.Package">
|
246
|
+
<HintPath>packages\Some.Package.7.0.1\lib\net45\Some.Package.dll</HintPath>
|
247
|
+
<Private>True</Private>
|
248
|
+
</Reference>
|
249
|
+
</ItemGroup>
|
250
|
+
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
251
|
+
</Project>
|
252
|
+
"""),
|
253
|
+
("path/to/packages.config", """
|
254
|
+
<packages>
|
255
|
+
<package id="Some.Package" version="7.0.1" targetFramework="net45" />
|
256
|
+
</packages>
|
257
|
+
""")
|
258
|
+
},
|
259
|
+
expectedResult: new()
|
260
|
+
{
|
261
|
+
FilePath = workspacePath,
|
262
|
+
Projects = [
|
263
|
+
new()
|
264
|
+
{
|
265
|
+
FilePath = "my.csproj",
|
266
|
+
TargetFrameworks = ["net45"],
|
267
|
+
ReferencedProjectPaths = [],
|
268
|
+
ExpectedDependencyCount = 2,
|
269
|
+
Dependencies = [
|
270
|
+
new("Some.Package", "7.0.1", DependencyType.PackagesConfig, TargetFrameworks: ["net45"])
|
271
|
+
],
|
272
|
+
Properties = [
|
273
|
+
new("TargetFrameworkVersion", "v4.5", "path/to/my.csproj"),
|
274
|
+
],
|
275
|
+
}
|
276
|
+
]
|
277
|
+
}
|
278
|
+
);
|
215
279
|
}
|
216
280
|
|
217
281
|
[Fact]
|
218
282
|
public async Task WithDuplicateDependenciesOfDifferentTypes()
|
219
283
|
{
|
220
|
-
var projectPath = "path/to/my.csproj";
|
221
|
-
var directoryBuildPropsPath = "path/Directory.Build.props";
|
222
284
|
await RunAsync(path =>
|
223
285
|
[
|
224
286
|
"discover",
|
225
287
|
"--repo-root",
|
226
288
|
path,
|
227
289
|
"--workspace",
|
228
|
-
path,
|
290
|
+
"path/to",
|
229
291
|
],
|
230
292
|
new[]
|
231
293
|
{
|
232
|
-
(
|
294
|
+
("path/to/my.csproj", """
|
233
295
|
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
234
296
|
<PropertyGroup>
|
235
297
|
<TargetFramework>net8.0</TargetFramework>
|
@@ -240,7 +302,7 @@ public partial class EntryPointTests
|
|
240
302
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
241
303
|
</Project>
|
242
304
|
"""),
|
243
|
-
(
|
305
|
+
("path/Directory.Build.props", """
|
244
306
|
<Project>
|
245
307
|
<ItemGroup Condition="'$(ManagePackageVersionsCentrally)' == 'true'">
|
246
308
|
<GlobalPackageReference Include="System.Text.Json" Version="8.0.3" />
|
@@ -253,11 +315,11 @@ public partial class EntryPointTests
|
|
253
315
|
},
|
254
316
|
expectedResult: new()
|
255
317
|
{
|
256
|
-
FilePath = "",
|
318
|
+
FilePath = "path/to",
|
257
319
|
Projects = [
|
258
320
|
new()
|
259
321
|
{
|
260
|
-
FilePath =
|
322
|
+
FilePath = "my.csproj",
|
261
323
|
TargetFrameworks = ["net8.0"],
|
262
324
|
ReferencedProjectPaths = [],
|
263
325
|
ExpectedDependencyCount = 2,
|
@@ -272,7 +334,7 @@ public partial class EntryPointTests
|
|
272
334
|
},
|
273
335
|
new()
|
274
336
|
{
|
275
|
-
FilePath =
|
337
|
+
FilePath = "../Directory.Build.props",
|
276
338
|
ReferencedProjectPaths = [],
|
277
339
|
ExpectedDependencyCount = 2,
|
278
340
|
Dependencies = [
|
@@ -288,7 +350,8 @@ public partial class EntryPointTests
|
|
288
350
|
private static async Task RunAsync(
|
289
351
|
Func<string, string[]> getArgs,
|
290
352
|
TestFile[] initialFiles,
|
291
|
-
ExpectedWorkspaceDiscoveryResult expectedResult
|
353
|
+
ExpectedWorkspaceDiscoveryResult expectedResult,
|
354
|
+
MockNuGetPackage[]? packages = null)
|
292
355
|
{
|
293
356
|
var actualResult = await RunDiscoveryAsync(initialFiles, async path =>
|
294
357
|
{
|
@@ -302,6 +365,7 @@ public partial class EntryPointTests
|
|
302
365
|
|
303
366
|
try
|
304
367
|
{
|
368
|
+
await UpdateWorkerTestBase.MockNuGetPackagesInDirectory(packages, path);
|
305
369
|
var args = getArgs(path);
|
306
370
|
var result = await Program.Main(args);
|
307
371
|
if (result != 0)
|