This repository was archived by the owner on Apr 20, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +17
-1
lines changed
build_projects/dotnet-cli-build Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change 33
44using System ;
55using System . IO ;
6+ using System . Text . RegularExpressions ;
67using Microsoft . Build . Utilities ;
78using Microsoft . Build . Framework ;
89
@@ -84,7 +85,8 @@ public string ReplacePatterns(string inputFileText)
8485 var replacementPattern = ReplacementPatterns [ i ] . ItemSpec ;
8586 var replacementString = ReplacementStrings [ i ] . ItemSpec ;
8687
87- outText = outText . Replace ( replacementPattern , replacementString ) ;
88+ var regex = new Regex ( replacementPattern ) ;
89+ outText = regex . Replace ( outText , replacementString ) ;
8890 }
8991
9092 return outText ;
Original file line number Diff line number Diff line change 264264 <Copy SourceFiles =" @(Stage2Cli)"
265265 DestinationFiles =" @(Stage2Cli->'$(Stage2WithBackwardsCompatibleRuntimesOutputDirectory)/%(RecursiveDir)%(Filename)%(Extension)')" />
266266 </Target >
267+
268+ <Target Name =" RetargetVSTestConsole"
269+ AfterTargets =" Publish" >
270+ <PropertyGroup >
271+ <VSTestRuntimeConfigPath >$(PublishDir)/vstest.console.runtimeconfig.json</VSTestRuntimeConfigPath >
272+ <ReplacementPattern >"version": ".*"</ReplacementPattern >
273+ <ReplacementString >"version": "$(CLI_SharedFrameworkVersion)"</ReplacementString >
274+ </PropertyGroup >
275+ <ReplaceFileContents
276+ InputFile =" $(VSTestRuntimeConfigPath)"
277+ DestinationFile =" $(VSTestRuntimeConfigPath)"
278+ ReplacementPatterns =" $(ReplacementPattern)"
279+ ReplacementStrings =" $(ReplacementString)" />
280+ </Target >
267281</Project >
You can’t perform that action at this time.
0 commit comments