summaryrefslogtreecommitdiff
path: root/dir.common.props
blob: 5aa4807e04d18839105ef550b088c8f49115198d (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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
<Project>

  <!-- This file contains build properties that apply to product
       projects and test projects. It's imported by
       tests/dir.common.props, and the global dir.props. -->

  <PropertyGroup>
    <CoreclrDir>$(MSBuildThisFileDirectory)</CoreclrDir>
    <PackagesDir>$(CoreclrDir)/.packages/</PackagesDir>
  </PropertyGroup>

  <!-- Define NuGet properties for scenarios where they aren't set. From the command line.
       Should match Nuget.config at root. -->
  <PropertyGroup>
    <NuGetPackageRoot>$(PackagesDir)</NuGetPackageRoot>
    <RestorePackagesPath>$(PackagesDir)</RestorePackagesPath>
  </PropertyGroup>

  <!-- Set default Configuration and Platform -->
  <PropertyGroup>
    <BuildArch>$(__BuildArch)</BuildArch>
    <BuildArch Condition="'$(__BuildArch)'==''">x64</BuildArch>
    <BuildArch Condition="'$(__BuildArch)' == 'amd64'">x64</BuildArch>

    <BuildType>$(__BuildType)</BuildType>
    <BuildType Condition="'$(__BuildType)'==''">Debug</BuildType>
    <BuildType Condition="'$(__BuildType)' == 'debug'">Debug</BuildType>
    <BuildType Condition="'$(__BuildType)' == 'release'">Release</BuildType>
    <BuildType Condition="'$(__BuildType)' == 'checked'">Checked</BuildType>

    <BuildOS>$(__BuildOS)</BuildOS>
    <BuildOS Condition="'$(__BuildOS)' == '' And '$([MSBuild]::IsOSPlatform(Windows))' == 'true'">Windows_NT</BuildOS>
    <BuildOS Condition="'$(__BuildOS)' == '' And '$([MSBuild]::IsOSPlatform(Linux))' == 'true'">Linux</BuildOS>
    <BuildOS Condition="'$(__BuildOS)' == '' And '$([MSBuild]::IsOSPlatform(OSX))' == 'true'">OSX</BuildOS>
    <!-- TODO: converge on one property for BuildOS and __BuildOS, and remove this extra line. -->
    <__BuildOS>$(BuildOS)</__BuildOS>

    <Configuration Condition="'$(Configuration)' == ''">$(BuildType)</Configuration>
    <Platform Condition="'$(Platform)' == ''">$(BuildArch)</Platform>

    <PlatformConfigPathPart>$(BuildOS).$(BuildArch).$(BuildType)</PlatformConfigPathPart>
  </PropertyGroup>

  <!-- Common properties -->
  <PropertyGroup>

    <ProjectDir>$(__ProjectDir)\</ProjectDir>
    <ProjectDir Condition="'$(__ProjectDir)'==''">$(MSBuildThisFileDirectory)</ProjectDir>

    <SourceDir>$(__SourceDir)\</SourceDir>
    <SourceDir Condition="'$(__SourceDir)'==''">$(ProjectDir)src\</SourceDir>

    <RootBinDir>$(__RootBinDir)\</RootBinDir>
    <RootBinDir Condition="'$(__RootBinDir)'==''">$(ProjectDir)bin\</RootBinDir>

    <BinDir>$(__BinDir)\</BinDir>
    <BinDir Condition="'$(__BinDir)'==''">$(RootBinDir)Product\$(PlatformConfigPathPart)\</BinDir>

    <!-- We don't append back slash because this path is used by nuget.exe as output directory and it
         fails to write packages to it if the path contains the forward slash.
    -->
    <PackagesBinDir>$(__PackagesBinDir)</PackagesBinDir>
    <PackagesBinDir Condition="'$(__PackagesBinDir)'==''">$(BinDir).nuget\</PackagesBinDir>
  </PropertyGroup>

  <PropertyGroup>
    <!-- Central place to set the versions of all nuget packages produced in the repo -->
    <PackageVersion Condition="'$(PackageVersion)' == ''">3.0.0</PackageVersion>

    <!-- Set the boolean below to true to generate packages with stabilized versions -->
    <StabilizePackageVersion Condition="'$(StabilizePackageVersion)' == ''">false</StabilizePackageVersion>
    <StableVersion Condition="'$(StabilizePackageVersion)' == 'true' and '$(StableVersion)' == ''">$(PackageVersion)</StableVersion>

    <PreReleaseLabel>preview9</PreReleaseLabel>
  </PropertyGroup>

  <!-- Set up common target properties that we use to conditionally include sources -->
  <PropertyGroup>
    <TargetsFreeBSD Condition="'$(BuildOS)' == 'FreeBSD'">true</TargetsFreeBSD>
    <TargetsLinux Condition="'$(BuildOS)' == 'Linux'">true</TargetsLinux>
    <TargetsNetBSD Condition="'$(BuildOS)' == 'NetBSD'">true</TargetsNetBSD>
    <TargetsOSX Condition="'$(BuildOS)' == 'OSX'">true</TargetsOSX>
    <TargetsWindows Condition="'$(BuildOS)' == 'Windows_NT'">true</TargetsWindows>

    <TargetsUnix Condition="'$(TargetsFreeBSD)' == 'true' or '$(TargetsLinux)' == 'true' or '$(TargetsNetBSD)' == 'true' or '$(TargetsOSX)' == 'true'">true</TargetsUnix>

    <!-- We are only tracking Linux Distributions for Nuget RID mapping -->
    <DistroRid Condition="'$(TargetsLinux)' == 'true'">$(__DistroRid)</DistroRid>

    <!-- Folder for cross target components -->
    <CrossTargetComponentFolder Condition="'$(BuildArch)' == 'arm64'">x64</CrossTargetComponentFolder>
    <CrossTargetComponentFolder Condition="'$(BuildArch)' == 'arm' and '$(TargetsWindows)' == 'true'">x86</CrossTargetComponentFolder>
    <CrossTargetComponentFolder Condition="'$(BuildArch)' == 'arm' and '$(TargetsLinux)' == 'true'">x64</CrossTargetComponentFolder>
  </PropertyGroup>

</Project>