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 <DnuSourceList Include="$(CORE_ROOT)\.nuget\pkg" />
21 <!-- Restore the runtime dependencies -->
22 <Exec Command="$(DnuRestoreCommand) "$(TestRuntimeProjectJson)""
23 StandardOutputImportance="Low"
24 CustomErrorRegularExpression="^Unable to resolve .*"
26 IgnoreStandardErrorWarningFormat="true" />
28 <!-- For each perf test, generate assembly list, and zip up the workitem -->
29 <MSBuild Projects="$(MSBuildProjectFile)" Properties="CurrPerfAssembly=%(CoreCLRPerfTest.Identity);TestRuntimeProjectLockJson=$(TestRuntimeProjectLockJson)" Targets="_zipSingleProject"/>
31 <!-- After all workitems are packaged, call the CloudBuild Targets from Build Tools which upload these workitems and trigger a test run for these workitems -->
32 <MSBuild Projects="$(MSBuildProjectFile)" Properties="BinDir=$(BinDir)../" Targets="CloudBuild" />
36 <Target Name="_zipSingleProject">
38 <OutDir>$([System.IO.Path]::GetDirectoryName($(CurrPerfAssembly)))/</OutDir>
39 <TestArchiveDir>$(BaseOutputPath)\testStagingDir\</TestArchiveDir>
40 <TestProjectName>$([System.IO.Path]::GetFileNameWithoutExtension($(CurrPerfAssembly)))</TestProjectName>
41 <ProjectLockJson>$(OutDir)project.lock.json</ProjectLockJson>
45 <TestNugetProjectLockFile Include="$(ProjectLockJson)" Condition="Exists($(ProjectLockJson))"/>
46 <TestNugetProjectLockFile Include="$(TestRuntimeProjectLockJson)" Condition="Exists($(TestRuntimeProjectLockJson))"/>
49 <!-- Generate Assembly list based on the individual project's project.json as well as the common runtime dependencies generated by AddAssFilesToAssemblyList target -->
50 <PrereleaseResolveNuGetPackageAssets
51 AllowFallbackOnTargetSelection="true"
52 IncludeFrameworkReferences="false"
53 NuGetPackagesDirectory="$(PackagesDir)"
54 RuntimeIdentifier="$(TestNugetRuntimeId)"
56 ProjectLockFile="%(TestNugetProjectLockFile.FullPath)"
57 TargetMonikers="@(TestTargetFramework)">
58 <Output TaskParameter="ResolvedCopyLocalItems" ItemName="RequiredAssemblies" />
59 </PrereleaseResolveNuGetPackageAssets>
61 <AssemblyPaths Include="$([MSBuild]::MakeRelative($(PackagesDir), %(RequiredAssemblies.FullPath)))" />
63 <RemoveDuplicatesWithLastOneWinsPolicy Inputs="@(AssemblyPaths)">
64 <Output TaskParameter="Filtered" ItemName="UniqueAssemblyPaths" />
65 </RemoveDuplicatesWithLastOneWinsPolicy>
67 <_TestCopyLocalByFileNameWithoutDuplicates></_TestCopyLocalByFileNameWithoutDuplicates>
70 <UniqueAssemblyPaths Include="$([System.String]::Copy('%(_TestCopyLocalByFileNameWithoutDuplicates.SourcePath)').Replace('$(PackagesDir)',''))" Condition="'%(_TestCopyLocalByFileNameWithoutDuplicates.NugetPackageId)' != ''" />
73 File="$(OutDir)/assemblylist.flat.txt"
74 Lines="@(UniqueAssemblyPaths)"
79 InputListLocation="$(OutDir)assemblylist.flat.txt"
80 OutputListLocation="$(OutDir)assemblylist.txt"
83 <Message Text="Archiving Perf test assemblies for project: $(OutDir)" Importance="High" />
84 <MSBuild Projects="$(MSBuildProjectFile)" Properties="OutDir=$(OutDir);TestArchiveDir=$(TestArchiveDir);TestProjectName=$(TestProjectName);DisableCopyTestToTestDirectory=true" Targets="ArchiveTestBuild"/>