1 <Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
2 <UsingTask TaskName="GetPerfTestAssemblies" AssemblyFile="$(ToolsDir)net45/Microsoft.DotNet.Build.CloudTestTasks.dll"/>
3 <Import Project="$(ToolsDir)publishtest.targets" />
4 <Import Project="$(ToolsDir)CloudTest.targets" />
5 <Target Name="UploadPerfAssemblies">
6 <Message Text="Searching for Perf tests in $(BinDir)" Importance = "High"/>
8 <TestBinary Include="$(BinDir)**/*.dll" />
9 <TestBinary Include="$(BinDir)**/*.exe" />
12 <!-- Get full paths to each of the perf test directories -->
13 <GetPerfTestAssemblies TestBinaries="@(TestBinary)" GetFullPaths="true">
14 <Output TaskParameter="PerfTestAssemblies" ItemName="CoreCLRPerfTest" />
15 </GetPerfTestAssemblies>
18 <TestRuntimeDependenciesJson>$(SourceDir)Common\test_runtime\project.json</TestRuntimeDependenciesJson>
19 <TestRuntimeProjectLockJson>$(SourceDir)Common\test_runtime\project.lock.json</TestRuntimeProjectLockJson>
23 <DnuSourceList Include="$(CORE_ROOT)\.nuget\pkg" />
26 <!-- Restore the runtime dependencies -->
27 <Exec Command="$(DnuRestoreCommand) "$(TestRuntimeDependenciesJson)""
28 StandardOutputImportance="Low"
29 CustomErrorRegularExpression="^Unable to resolve .*"
31 IgnoreStandardErrorWarningFormat="true" />
33 <!-- For each perf test, generate assembly list, and zip up the workitem -->
34 <MSBuild Projects="$(MSBuildProjectFile)" Properties="CurrPerfAssembly=%(CoreCLRPerfTest.Identity);TestRuntimeProjectLockJson=$(TestRuntimeProjectLockJson)" Targets="_zipSingleProject"/>
36 <!-- After all workitems are packaged, call the CloudBuild Targets from Build Tools which upload these workitems and trigger a test run for these workitems -->
37 <MSBuild Projects="$(MSBuildProjectFile)" Properties="BinDir=$(BinDir)../" Targets="CloudBuild" />
41 <Target Name="_zipSingleProject">
43 <OutDir>$([System.IO.Path]::GetDirectoryName($(CurrPerfAssembly)))/</OutDir>
44 <TestArchiveDir>$(BaseOutputPath)\testStagingDir\</TestArchiveDir>
45 <TestProjectName>$([System.IO.Path]::GetFileNameWithoutExtension($(CurrPerfAssembly)))</TestProjectName>
46 <ProjectLockJson>$(OutDir)project.lock.json</ProjectLockJson>
50 <TestNugetProjectLockFile Include="$(ProjectLockJson)" Condition="Exists($(ProjectLockJson))"/>
51 <TestNugetProjectLockFile Include="$(TestRuntimeProjectLockJson)" Condition="Exists($(TestRuntimeProjectLockJson))"/>
54 <!-- Generate Assembly list based on the individual project's project.json as well as the common runtime dependencies generated by AddAssFilesToAssemblyList target -->
55 <PrereleaseResolveNuGetPackageAssets
56 AllowFallbackOnTargetSelection="true"
57 IncludeFrameworkReferences="false"
58 NuGetPackagesDirectory="$(PackagesDir)"
59 RuntimeIdentifier="$(TestNugetRuntimeId)"
61 ProjectLockFile="%(TestNugetProjectLockFile.FullPath)"
62 TargetMonikers="@(TestTargetFramework)">
63 <Output TaskParameter="ResolvedCopyLocalItems" ItemName="RequiredAssemblies" />
64 </PrereleaseResolveNuGetPackageAssets>
66 <AssemblyPaths Include="$([MSBuild]::MakeRelative($(PackagesDir), %(RequiredAssemblies.FullPath)))" />
68 <RemoveDuplicatesWithLastOneWinsPolicy Inputs="@(AssemblyPaths)">
69 <Output TaskParameter="Filtered" ItemName="UniqueAssemblyPaths" />
70 </RemoveDuplicatesWithLastOneWinsPolicy>
72 <_TestCopyLocalByFileNameWithoutDuplicates></_TestCopyLocalByFileNameWithoutDuplicates>
75 <UniqueAssemblyPaths Include="$([System.String]::Copy('%(_TestCopyLocalByFileNameWithoutDuplicates.SourcePath)').Replace('$(PackagesDir)',''))" Condition="'%(_TestCopyLocalByFileNameWithoutDuplicates.NugetPackageId)' != ''" />
78 File="$(OutDir)/assemblylist.flat.txt"
79 Lines="@(UniqueAssemblyPaths)"
84 InputListLocation="$(OutDir)assemblylist.flat.txt"
85 OutputListLocation="$(OutDir)assemblylist.txt"
88 <Message Text="Archiving Perf test assemblies for project: $(OutDir)" Importance="High" />
89 <MSBuild Projects="$(MSBuildProjectFile)" Properties="OutDir=$(OutDir);TestArchiveDir=$(TestArchiveDir);TestProjectName=$(TestProjectName);DisableCopyTestToTestDirectory=true" Targets="ArchiveTestBuild"/>