summaryrefslogtreecommitdiff
path: root/tests/build.proj
blob: 4fd840c92b0b500f6dec02b15482edf8a92ea190 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <Import Project="dir.props" />

  <Import Project="$(ToolsDir)VersionTools.targets" Condition="Exists('$(ToolsDir)VersionTools.targets')" />

  <ItemGroup>
    <Project Include="src\dirs.proj" />
  </ItemGroup>

  <Import Project="dir.targets" />

  <Import Project="dir.traversal.targets" />

  <PropertyGroup>
    <TraversalBuildDependsOn>
      BatchRestorePackages;
      BuildTargetingPack;
      $(TraversalBuildDependsOn);
    </TraversalBuildDependsOn>
  </PropertyGroup>

  <ItemGroup>
    <RestoreProjects Include="$(MSBuildThisFileDirectory)scripts\scripts.csproj" />
    <RestoreProjects Include="$(MSBuildThisFileDirectory)src\Common\build_against_pkg_dependencies\build_against_pkg_dependencies.csproj" />
    <RestoreProjects Include="$(MSBuildThisFileDirectory)src\Common\targeting_pack_ref\targeting_pack_ref.csproj" />
    <RestoreProjects Include="$(MSBuildThisFileDirectory)src\Common\test_dependencies\test_dependencies.csproj" />
    <RestoreProjects Include="$(MSBuildThisFileDirectory)src\Common\test_runtime\test_runtime.csproj" />
    <RestoreProjects Include="$(MSBuildThisFileDirectory)src\JIT\config\benchmark+roslyn\benchmark+roslyn.csproj" />
    <RestoreProjects Include="$(MSBuildThisFileDirectory)src\JIT\config\benchmark+serialize\benchmark+serialize.csproj" />
    <RestoreProjects Include="$(MSBuildThisFileDirectory)src\JIT\config\benchmark\benchmark.csproj" />
    <RestoreProjects Include="$(MSBuildThisFileDirectory)src\JIT\config\benchmark+intrinsic\benchmark+intrinsic.csproj" />
    <RestoreProjects Include="$(MSBuildThisFileDirectory)src\performance\performance.csproj" />
  </ItemGroup>

  <Target Name="BuildTargetingPack" AfterTargets="BatchRestorePackages" Condition="$(__SkipTargetingPackBuild) != 'true'">
    <Message Text="Building Targeting Pack" Importance="High" />
    <Error  Text="BuildOS has not been specified. Please do that then run build again."  Condition="'$(BuildOS)' == 'AnyOS'" />
    <MSBuild Projects="$(MSBuildThisFileDirectory)\src\Common\external\external.depproj" />
  </Target>

  <Target Name="BatchRestorePackages" Condition="$(__SkipPackageRestore) != 'true'">
    <Message Importance="High" Text="[$([System.DateTime]::Now.ToString('HH:mm:ss.ff'))] Restoring all packages..." />

    <!-- restore all csproj's with PackageReferences in one pass -->
    <MSBuild Projects="build.proj"
             Properties="RestoreProj=%(RestoreProjects.Identity)"
             Targets="RestorePackage" />

    <Message Importance="High" Text="[$([System.DateTime]::Now.ToString('HH:mm:ss.ff'))] Restoring all packages...Done." />
  </Target>

  <Target Name="RestorePackage">
    <Exec Condition="'$(__DistroRid)' == ''" Command="$(DotnetRestoreCommand) $(RestoreProj) $(PackageVersionArg)" StandardOutputImportance="Low" />
    <Exec Condition="'$(__DistroRid)' != ''" Command="$(DotnetRestoreCommand) -r $(__DistroRid) $(RestoreProj) $(PackageVersionArg)" StandardOutputImportance="Low" />
  </Target>

  <!-- Override RestorePackages from dir.traversal.targets and do a batch restore -->
  <Target Name="RestorePackages" DependsOnTargets="BatchRestorePackages" />
</Project>