Skip to content

Commit 1b15340

Browse files
committed
[nanodu] Development dependencies aren't checked for preview versions
1 parent 5b45c0d commit 1b15340

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

tools/DependencyUpdater/Program.cs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -680,7 +680,7 @@ static void UpdateLibrary(string workingDirectory,
680680

681681
// check all packages
682682

683-
foreach (var package in packageList)
683+
foreach (PackageReference package in packageList)
684684
{
685685
// get package name and target version
686686
string packageName = package.PackageIdentity.Id;
@@ -692,10 +692,14 @@ static void UpdateLibrary(string workingDirectory,
692692
string updateResult = "";
693693
string updateParameters;
694694

695-
if (stablePackages && !packageName.StartsWith("UnitsNet."))
695+
if ((stablePackages && !packageName.StartsWith("UnitsNet."))
696+
|| package.IsDevelopmentDependency)
696697
{
697-
// don't allow prerelease for release, main branches and UnitsNet packages
698-
// go with our Azure feed
698+
// don't allow prerelease for:
699+
// - release
700+
// - main branches
701+
// - UnitsNet packages
702+
// - development dependencies
699703
updateParameters = $"{projectToUpdate} -Id {packageName} {repositoryPath} -FileConflictAction Overwrite";
700704
}
701705
else if (packageName.StartsWith("UnitsNet."))

0 commit comments

Comments
 (0)