Update expected SDK version test to work with multiple stages
This commit is contained in:
parent
12f8c2377f
commit
e4777c0b91
2 changed files with 29 additions and 11 deletions
|
@ -22,11 +22,35 @@
|
|||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
<CopyToPublishDirectory>PreserveNewest</CopyToPublishDirectory>
|
||||
</Content>
|
||||
<Content Include="$(SdkOutputDirectory)\.version">
|
||||
<Link>.version</Link>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
|
||||
<Target Name="WriteExpectedVersion"
|
||||
BeforeTargets="BeforeBuild"
|
||||
DependsOnTargets="PrepareForBuild">
|
||||
|
||||
<PropertyGroup>
|
||||
<ExpectedVersionFileInIntermediateFolder>$(IntermediateOutputPath)ExpectedSdkVersion.txt</ExpectedVersionFileInIntermediateFolder>
|
||||
|
||||
<VersionFileContent>$(SdkVersion)</VersionFileContent>
|
||||
<ExistingVersionFileContent Condition=" Exists('$(ExpectedVersionFileInIntermediateFolder)') ">
|
||||
$([System.IO.File]::ReadAllText($(ExpectedVersionFileInIntermediateFolder)))
|
||||
</ExistingVersionFileContent>
|
||||
|
||||
<ShouldOverwriteVersionFile>false</ShouldOverwriteVersionFile>
|
||||
<ShouldOverwriteVersionFile
|
||||
Condition=" '$(ExistingVersionFileContent.Trim())' != '$(VersionFileContent.Trim())' ">true</ShouldOverwriteVersionFile>
|
||||
</PropertyGroup>
|
||||
|
||||
<WriteLinesToFile File="$(ExpectedVersionFileInIntermediateFolder)"
|
||||
Lines="$(VersionFileContent)"
|
||||
Condition=" '$(ShouldOverwriteVersionFile)' == 'true' "
|
||||
Overwrite="true" />
|
||||
|
||||
<ItemGroup>
|
||||
<Content Include="$(ExpectedVersionFileInIntermediateFolder)" CopyToOutputDirectory="PreserveNewest" />
|
||||
<FileWrites Include="$(ExpectedVersionFileInIntermediateFolder)" />
|
||||
</ItemGroup>
|
||||
</Target>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Microsoft.DotNet.Tools.Tests.Utilities\Microsoft.DotNet.Tools.Tests.Utilities.csproj" />
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue