Skip to content

Commit 507cd1a

Browse files
Revert "Revert "Fix tests running on version freeze (#10735)" (#10775)"
This reverts commit 312a2b8.
1 parent 94941d9 commit 507cd1a

File tree

2 files changed

+27
-1
lines changed

2 files changed

+27
-1
lines changed

src/BuildCheck.UnitTests/Microsoft.Build.BuildCheck.UnitTests.csproj

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,4 +46,30 @@
4646
</None>
4747
</ItemGroup>
4848

49+
<!-- This target creates packages needed for e2e testing. Inputs and outputs are defined to enable incremental builds. -->
50+
51+
<PropertyGroup Label="TestAssests">
52+
<ArtifactsNonShippingPackagesDir>$(ArtifactsBinDir)Microsoft.Build.BuildCheck.UnitTests\CustomChecks</ArtifactsNonShippingPackagesDir>
53+
</PropertyGroup>
54+
55+
<ItemGroup Label="TestAssets">
56+
<ProjectsToPack Include="..\Build\Microsoft.Build.csproj" />
57+
<ProjectsToPack Include="..\Framework\Microsoft.Build.Framework.csproj" />
58+
<ProjectsToPack Include="..\StringTools\StringTools.csproj" />
59+
</ItemGroup>
60+
61+
<Target Name="GetSourceFilesForPacking">
62+
<ItemGroup>
63+
<SourceFilesForPacking Include="%(ProjectsToPack.RootDir)%(ProjectsToPack.Directory)**\*.cs" />
64+
</ItemGroup>
65+
</Target>
66+
67+
<Target Name="MSBuildPackagesForTests"
68+
AfterTargets="Build"
69+
DependsOnTargets="GetSourceFilesForPacking"
70+
Inputs="@(ProjectsToPack);@(SourceFilesForPacking)"
71+
Outputs="$(ArtifactsNonShippingPackagesDir)\Microsoft.Build.$(Version).nupkg;$(ArtifactsNonShippingPackagesDir)\Microsoft.Build.Framework.$(Version).nupkg;$(ArtifactsNonShippingPackagesDir)\Microsoft.NET.StringTools.$(Version).nupkg">
72+
<Exec Command="dotnet pack &quot;%(ProjectsToPack.Identity)&quot; -o &quot;$(ArtifactsNonShippingPackagesDir)&quot; -p:PackageVersion=$(PackageVersion)" />
73+
</Target>
74+
4975
</Project>

src/BuildCheck.UnitTests/TestAssets/Common/CommonTest.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
<!-- In the real world scenario, the dependencies are added as Nuget PackageReference, modified for test purposes only. -->
1313
<ItemGroup>
14-
<ProjectReference Include="..\..\..\Build\Microsoft.Build.csproj" IncludeInPackage="true" />
14+
<ProjectReference Include="..\..\..\Build\Microsoft.Build.csproj" />
1515
</ItemGroup>
1616

1717
</Project>

0 commit comments

Comments
 (0)