Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -646,5 +646,13 @@ Using Msbuild from '/usr/local/dotnet/current/sdk/9.0.311'.
// expectedError
new DependencyFileNotParseable("/path/to/packages.config", "Unexpected XML declaration. The XML declaration must be the first node in the document, and no whitespace characters are allowed to appear before it. Line 1, position 5.")
];

yield return
[
// output
"Circular dependency detected 'ReactiveProperty 3.6.0 => System.Reactive 3.1.1 => System.Reactive.PlatformServices 6.1.0 => System.Reactive 3.1.1'.",
// expectedError
new UnknownError(new Exception("Circular dependency detected"), "TEST-JOB-ID"),
];
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -646,6 +646,7 @@ internal static void ThrowOnError(string output)
ThrowOnBadResponse(output);
ThrowOnUnparseableFile(output);
ThrowOnMultipleProjectsForPackagesConfig(output);
ThrowOnCircularDependency(output);
}

private static void ThrowOnUnauthenticatedFeed(string stdout)
Expand Down Expand Up @@ -788,6 +789,15 @@ private static void ThrowOnMultipleProjectsForPackagesConfig(string output)
}
}

private static void ThrowOnCircularDependency(string output)
{
var pattern = new Regex(@"Circular dependency detected '.*'");
if (pattern.IsMatch(output))
{
throw new Exception("Circular dependency detected");
}
}

internal static bool TryGetGlobalJsonPath(string repoRootPath, string workspacePath, [NotNullWhen(returnValue: true)] out string? globalJsonPath)
{
globalJsonPath = PathHelper.GetFileInDirectoryOrParent(workspacePath, repoRootPath, "global.json", caseSensitive: false);
Expand Down
Loading