summaryrefslogtreecommitdiff
path: root/Tools/RepoAPI.Mapping.props
blob: 2f125ec08cdd1b055203b6176007e84e5f7a26f1 (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
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <!--
    Provides a default API implementation where possible by setting BuildTools properties/items.

    API documentation: https://github.com/dotnet/source-build/tree/dev/release/2.0/Documentation/auto-dependency-flow
  -->

  <!-- Produce packages into the specified blob feed. -->
  <PropertyGroup Condition="'$(DotNetOutputBlobFeedDir)' != ''">
    <PackageOutputPath Condition="'$(PackageOutputPath)' == ''">$(DotNetOutputBlobFeedDir)packages/</PackageOutputPath>
    <SymbolPackageOutputPath Condition="'$(SymbolPackageOutputPath)' == ''">$(DotNetOutputBlobFeedDir)assets/</SymbolPackageOutputPath>
  </PropertyGroup>

  <!-- If init-tools downloaded a package version props file, use it. -->
  <PropertyGroup>
    <DownloadedPackageVersionPropsPath>$(ToolsDir)DownloadedPackageVersions.props</DownloadedPackageVersionPropsPath>

    <DotNetPackageVersionPropsPath Condition="'$(DotNetPackageVersionPropsPath)' == '' and 
                                               Exists('$(DownloadedPackageVersionPropsPath)')">$(DownloadedPackageVersionPropsPath)</DotNetPackageVersionPropsPath>
  </PropertyGroup>

  <!--
    Import the restore source props file if passed to get "DotNetRestoreSources".

    Note the "!= ''" check rather than Exists. If this API argument is passed but the file doesn't
    exist, something is wrong and an error should be bubbled up as soon as we know about it.
  -->
  <Import Project="$(DotNetRestoreSourcePropsPath)"
          Condition="'$(DotNetRestoreSourcePropsPath)' != ''"/>

  <!-- Use passed NuGet restore sources, if any. -->
  <PropertyGroup>
    <RestoreSources>$(RestoreSources);$(DotNetRestoreSources)</RestoreSources>
  </PropertyGroup>

  <!--
    Populate DotnetSourceList items based on NuGet restore sources from the Repo API plus any
    additions the repo makes to the RestoreSources property.

    This is used by the "dotnet restore" Exec that uses "source" args. When a repo uses msbuild
    restore tooling, this ItemGroup is unnecessary.
  -->
  <ItemGroup>
    <DotnetSourceList Include="$(RestoreSources)" />
  </ItemGroup>
</Project>