|
1 | 1 | <Project Sdk="Microsoft.Build.NoTargets" TreatAsLocalProperty="CleanWhileBuilding">
|
2 | 2 |
|
| 3 | + <PropertyGroup> |
| 4 | + <!-- The scenario-tests repo shouldn't be cleaned after building as we run tests from it. --> |
| 5 | + <CleanWhileBuilding>false</CleanWhileBuilding> |
| 6 | + |
| 7 | + <ScenarioTestsArtifactsDir>$([MSBuild]::NormalizeDirectory('$(ArtifactsDir)', 'scenario-tests'))</ScenarioTestsArtifactsDir> |
| 8 | + <ScenarioTestsResultsDir>$([MSBuild]::NormalizeDirectory('$(ArtifactsTestResultsDir)', 'scenario-tests'))</ScenarioTestsResultsDir> |
| 9 | + <NuGetConfigInputForScenarioTests>$([MSBuild]::NormalizePath('$(SrcDir)', 'sdk', 'NuGet.config'))</NuGetConfigInputForScenarioTests> |
| 10 | + <NuGetConfigOutputForScenarioTests>$(ScenarioTestsArtifactsDir)NuGet.config</NuGetConfigOutputForScenarioTests> |
| 11 | + </PropertyGroup> |
| 12 | + |
3 | 13 | <ItemGroup>
|
4 | 14 | <RepositoryReference Include="arcade" />
|
5 | 15 | <RepositoryReference Include="command-line-api" />
|
|
10 | 20 | <RepositoryReference Include="source-build-reference-packages" />
|
11 | 21 | </ItemGroup>
|
12 | 22 |
|
13 |
| - <PropertyGroup> |
14 |
| - <!-- The scenario-tests repo shouldn't be cleaned after building as we run tests from it. --> |
15 |
| - <CleanWhileBuilding>false</CleanWhileBuilding> |
16 |
| - |
17 |
| - <ScenarioTestsArtifactsDir>$([MSBuild]::NormalizeDirectory('$(ArtifactsDir)', 'scenario-tests'))</ScenarioTestsArtifactsDir> |
18 |
| - <ScenarioTestsResultsDir>$([MSBuild]::NormalizeDirectory('$(ArtifactsTestResultsDir)', 'scenario-tests'))</ScenarioTestsResultsDir> |
19 |
| - <_ScenarioTestsNuGetConfig>$(ScenarioTestsArtifactsDir)NuGet.config</_ScenarioTestsNuGetConfig> |
20 |
| - <_SdkNuGetConfig>$([MSBuild]::NormalizePath('$(SrcDir)', 'sdk', 'NuGet.config'))</_SdkNuGetConfig> |
21 |
| - </PropertyGroup> |
22 |
| - |
23 | 23 | <Target Name="SetupNuGetConfig"
|
24 |
| - Inputs="$(_SdkNuGetConfig)" |
25 |
| - Outputs="$(_ScenarioTestsNuGetConfig)"> |
26 |
| - |
27 |
| - <Copy SourceFiles="$(_SdkNuGetConfig)" |
28 |
| - DestinationFiles="$(_ScenarioTestsNuGetConfig)" /> |
29 |
| - |
| 24 | + Inputs="$(NuGetConfigInputForScenarioTests)" |
| 25 | + Outputs="$(NuGetConfigOutputForScenarioTests)"> |
| 26 | + <Copy SourceFiles="$(NuGetConfigInputForScenarioTests)" |
| 27 | + DestinationFiles="$(NuGetConfigOutputForScenarioTests)" /> |
30 | 28 | </Target>
|
31 | 29 |
|
32 |
| - <Target Name="RunScenarioTests" |
33 |
| - DependsOnTargets="SetupNuGetConfig;DetermineSourceBuiltSdkVersion"> |
34 |
| - |
| 30 | + <Target Name="PrepareScenarioTestsInputs" |
| 31 | + DependsOnTargets="SetupNuGetConfig;DetermineSourceBuiltSdkVersion" |
| 32 | + BeforeTargets="Test"> |
35 | 33 | <PropertyGroup>
|
36 | 34 | <_CurrentDateTime>$([System.DateTime]::Now.ToString("yyyy-MM-dd_HH_mm_ss"))</_CurrentDateTime>
|
37 | 35 | <_TestXmlOutputPath>$(ScenarioTestsResultsDir)$(_CurrentDateTime).xml</_TestXmlOutputPath>
|
|
49 | 47 | <MakeDir Directories="$(ScenarioTestsResultsDir)" />
|
50 | 48 |
|
51 | 49 | <ItemGroup>
|
52 |
| - <_ScenarioTestEnvVars Include=" |
| 50 | + <TestEnvironmentVariable Include=" |
53 | 51 | TestRoot=$(_TestRoot);
|
54 | 52 | DotNetRoot=$(DotNetSdkExtractDir);
|
55 | 53 | TestSdkVersion=$(SourceBuiltSdkVersion);
|
56 | 54 | AdditionalTestArgs=$(_ScenarioTestsAdditionalArgs);
|
57 | 55 | DotNetTool=$(_DotNetTool);
|
58 | 56 | _InitializeDotNetCli=$(DotNetSdkExtractDir)" />
|
59 | 57 | </ItemGroup>
|
60 |
| - |
61 |
| - <Exec Command="$(TestCommand)" |
62 |
| - WorkingDirectory="$(ProjectDirectory)" |
63 |
| - EnvironmentVariables="@(_ScenarioTestEnvVars)" /> |
64 | 58 | </Target>
|
65 | 59 |
|
66 | 60 | </Project>
|
0 commit comments