Skip to content

Commit

Permalink
Parse the Roslyn version from Directory.packages.props
Browse files Browse the repository at this point in the history
  • Loading branch information
christophwille committed Nov 20, 2023
1 parent 4916574 commit fc1deba
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions ICSharpCode.Decompiler.Tests/Helpers/Tester.cs
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,15 @@ static Tester()
#else
testRunnerBasePath = Path.Combine(TesterPath, "../../../../../ICSharpCode.Decompiler.TestRunner/bin/Release/net8.0");
#endif
packagesPropsFile = Path.Combine(TesterPath, "../../../../../packages.props");
roslynLatestVersion = XDocument.Load(packagesPropsFile).XPathSelectElement("//RoslynVersion").Value;
// To parse: <Project><ItemGroup><PackageVersion Include="Microsoft.CodeAnalysis.CSharp" Version="4.8.0-3.final" />
packagesPropsFile = Path.Combine(TesterPath, "../../../../../Directory.Packages.props");
roslynLatestVersion = ((IEnumerable<object>)(XDocument
.Load(packagesPropsFile)
.XPathEvaluate("//Project//ItemGroup//PackageVersion[@Include='Microsoft.CodeAnalysis.CSharp']/@Version")))
.OfType<XAttribute>()
.Single()
.Value;

roslynToolset = new RoslynToolset();
vswhereToolset = new VsWhereToolset();
}
Expand Down

0 comments on commit fc1deba

Please sign in to comment.