Refactor properties out of test.targets

This commit is contained in:
Justin Goshi 2017-02-17 12:28:25 -08:00
parent a801d387d0
commit 4f209e61ea
6 changed files with 19 additions and 27 deletions

View file

@ -4,5 +4,6 @@
<DotnetCliBuildDirectory>$(RepoRoot)/build_projects/dotnet-cli-build</DotnetCliBuildDirectory>
<MSBuildImportsDir>$(RepoRoot)/resources/MSBuildImports</MSBuildImportsDir>
<SrcDirectory>$(RepoRoot)/src</SrcDirectory>
<TestDirectory>$(RepoRoot)/test/</TestDirectory>
</PropertyGroup>
</Project>

View file

@ -18,5 +18,11 @@
<PackagesDirectory>$(BaseOutputDirectory)/packages</PackagesDirectory>
<SharedFrameworkPublishDirectory>$(IntermediateDirectory)/sharedFrameworkPublish</SharedFrameworkPublishDirectory>
<SharedFrameworkNameVersionPath>$(StageDirectory)/shared/$(SharedFrameworkName)/$(SharedFrameworkVersion)</SharedFrameworkNameVersionPath>
<DotnetUnderTest>$(Stage2Directory)</DotnetUnderTest>
<TestOutputDir>$(RepoRoot)/artifacts/testpackages/</TestOutputDir>
<TestPackagesBuildDir>$(TestOutputDir)/packagesBuild/</TestPackagesBuildDir>
<TestPackagesDir>$(TestOutputDir)/packages/</TestPackagesDir>
<TestArtifactsDir>$(TestOutputDir)/artifacts/</TestArtifactsDir>
<TestResultXmlDir>$(TestOutputDir)/results/</TestResultXmlDir>
</PropertyGroup>
</Project>

View file

@ -1,9 +1,4 @@
<Project ToolsVersion="14.0" DefaultTargets="Test">
<PropertyGroup>
<PathSeparator>/</PathSeparator>
<PathSeparator Condition=" '$(OSName)' == 'win' ">\</PathSeparator>
</PropertyGroup>
<Import Project="test/TestPackageProjects.targets" />
<Import Project="test/TestProjects.targets" />
@ -16,12 +11,11 @@
<PathListSeparator Condition=" '$(OSName)' == 'win' ">%3b</PathListSeparator>
<ExecPath>$(Stage2Directory)$(PathListSeparator)$(PATH)</ExecPath>
<ExecPath Condition=" '$(OSName)' == 'win' ">$(Stage2Directory)</ExecPath>
<TestArtifactsEnv>$(TestArtifactsDir)</TestArtifactsEnv>
</PropertyGroup>
<ItemGroup>
<TestTaskEnvironmentVariables Include="PATH=$(ExecPath)" />
<TestTaskEnvironmentVariables Include="TEST_ARTIFACTS=$(TestArtifactsEnv)" />
<TestTaskEnvironmentVariables Include="TEST_ARTIFACTS=$(TestArtifactsDir)" />
</ItemGroup>
<PropertyGroup>
@ -55,17 +49,6 @@
<Target Name="PrepareTests"
DependsOnTargets="Init;
SetupTestProjectData">
<PropertyGroup>
<TestPackageBuildVersionSuffix>$(CommitCount)</TestPackageBuildVersionSuffix>
<TestOutputDir>$(RepoRoot)/artifacts/testpackages/</TestOutputDir>
<TestPackagesBuildDir>$(TestOutputDir)/packagesBuild/</TestPackagesBuildDir>
<TestPackagesDir>$(TestOutputDir)/packages/</TestPackagesDir>
<TestArtifactsDir>$(TestOutputDir)/artifacts/</TestArtifactsDir>
<TestResultXmlDir>$(TestOutputDir)/results/</TestResultXmlDir>
<TestDirectory>$(RepoRoot)/test/</TestDirectory>
<DotnetUnderTest>$(Stage2Directory)</DotnetUnderTest>
</PropertyGroup>
<MakeDir Directories="$(TestPackagesDir)" Condition="!Exists('$(TestPackagesDir)')"/>
</Target>

View file

@ -12,5 +12,7 @@
<SdkVersion>$(NugetVersion)</SdkVersion>
<SdkNugetVersion>$(SdkVersion)</SdkNugetVersion>
<TestPackageBuildVersionSuffix>$(CommitCount)</TestPackageBuildVersionSuffix>
</PropertyGroup>
</Project>

View file

@ -31,10 +31,10 @@
<Target Name="SetupBuildTestAssetProjectInputs">
<ItemGroup>
<NoAutoBuildTestAssets Include="TestAssets$(PathSeparator)TestProjects$(PathSeparator)**$(PathSeparator).noautobuild" />
<NoAutoBuildTestAssets Include="TestAssets/TestProjects/**/.noautobuild" />
<NoAutoBuildTestAssetProjects Include="%(NoAutoBuildTestAssets.RelativeDir)project.json" />
<PreTestAssetProjects Include="TestAssets$(PathSeparator)TestProjects$(PathSeparator)**$(PathSeparator)project.json"/>
<PreTestAssetProjects Include="TestAssets/TestProjects/**/project.json"/>
<TestAssetProjects Include="%(PreTestAssetProjects.RelativeDir)project.json"
Exclude="@(NoAutoBuildTestAssetProjects)"/>

View file

@ -10,20 +10,20 @@
<PreTestProjectsToExclude Condition=" '$(IsDesktopAvailable)' != 'True' "
Include="test/binding-redirects.Tests/binding-redirects.Tests.csproj;" />
-->
<PreTestProjectsToExclude Include="test$(PathSeparator)binding-redirects.Tests$(PathSeparator)binding-redirects.Tests.csproj;" />
<PreTestProjectsToExclude Include="test/binding-redirects.Tests/binding-redirects.Tests.csproj;" />
<PreTestProjectsToExclude Condition=" 'Non-test projects in test directory' != 'consider moving elsewhere' "
Include="test$(PathSeparator)ArgumentsReflector$(PathSeparator)ArgumentsReflector.csproj;
test$(PathSeparator)Microsoft.DotNet.Tools.Tests.Utilities$(PathSeparator)Microsoft.DotNet.Tools.Tests.Utilities.csproj;
test$(PathSeparator)Msbuild.Tests.Utilities$(PathSeparator)Msbuild.Tests.Utilities.csproj;
test$(PathSeparator)Performance$(PathSeparator)Performance.csproj" />
Include="test/ArgumentsReflector/ArgumentsReflector.csproj;
test/Microsoft.DotNet.Tools.Tests.Utilities/Microsoft.DotNet.Tools.Tests.Utilities.csproj;
test/Msbuild.Tests.Utilities/Msbuild.Tests.Utilities.csproj;
test/Performance/Performance.csproj" />
<PreTestProjectsToExclude Condition=" 'Executed after primary test phase.' != ' Consider moving.' "
Include="test$(PathSeparator)Installer$(PathSeparator)Microsoft.DotNet.Cli.Msi.Tests$(PathSeparator)Microsoft.DotNet.Cli.Msi.Tests.csproj;" />
Include="test/Installer/Microsoft.DotNet.Cli.Msi.Tests/Microsoft.DotNet.Cli.Msi.Tests.csproj;" />
<TestProjectsToExclude Include="%(PreTestProjectsToExclude.Fullpath)" />
<PreTestProjects Include="test$(PathSeparator)*$(PathSeparator)*.csproj;" />
<PreTestProjects Include="test/*/*.csproj;" />
<TestProjects Include="%(PreTestProjects.Fullpath)"
Exclude="@(TestProjectsToExclude)" />