[Tizen] Add BuildTools 2.1.0-rc1-02804-05
[platform/upstream/coreclr.git] / Tools / dotnetcli / sdk / 2.1.2 / Sdks / Microsoft.NET.Sdk / buildCrossTargeting / Microsoft.NET.Sdk.targets
1 <!--
2 ***********************************************************************************************
3 Microsoft.NET.Sdk.targets
4
5 WARNING:  DO NOT MODIFY this file unless you are knowledgeable about MSBuild and have
6           created a backup copy.  Incorrect changes to this file will make it
7           impossible to load or build your projects from the command-line or the IDE.
8
9 Copyright (c) .NET Foundation. All rights reserved.
10 ***********************************************************************************************
11 -->
12 <Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
13
14   <PropertyGroup>
15     <MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
16   </PropertyGroup>
17
18   <Import Project="..\build\Microsoft.NET.Sdk.Common.targets"/>
19
20   <!--
21   ============================================================
22                               Publish
23
24    This is the Publish target for cross-targeting.
25    Currently it is unsupported to publish for multiple target frameworks
26    because users can specify the $(PublishDir), and publish would put
27    multiple published applications in a single directory.
28   ============================================================
29    -->
30   <Target Name="Publish">
31     <Error Text="The 'Publish' target is not supported without specifying a target framework. The current project targets multiple frameworks, please specify the framework for the published application." />
32   </Target>
33
34   <!--
35   ============================================================
36                                       GetAllRuntimeIdentifiers
37
38   Outer build implementation of GetAllRuntimeIdentifiers returns
39   a union of all runtime identifiers used across inner and outer
40   build evaluations.
41
42   It is further set to run before '_GenerateRestoreProjectSpec'
43   (note that running only 'Restore' is too late and will not work
44   with solution level restore). This ensures that any conditioning
45   of runtime  identifiers against TargetFramework does not prevent
46   restore from providing  the necessary RID-specific assets for all
47   inner builds.
48
49   It also brings parity to VS vs. command line behavior in this
50   scenario because VS passes all of the information from each
51   configured inner build to restore, whereas command-line restore
52   without this target would only use the runtime identifiers that
53   are statically set in the outer evaluation.
54   ============================================================
55   -->
56   <Target Name="GetAllRuntimeIdentifiers"
57           Returns="$(RuntimeIdentifiers)"
58           BeforeTargets="_GenerateRestoreProjectSpec">
59
60     <ItemGroup>
61       <_GetAllRuntimeIdentifiersTargetFrameworks Include="$(TargetFrameworks)" />
62       <_AllRuntimeIdentifiers Include="$(RuntimeIdentifiers);$(RuntimeIdentifier)" />
63     </ItemGroup>
64
65     <MSBuild Projects="$(MSBuildProjectFile)"
66              Targets="GetAllRuntimeIdentifiers"
67              Properties="TargetFramework=%(_GetAllRuntimeIdentifiersTargetFrameworks.Identity)">
68       <Output ItemName="_AllRuntimeIdentifiers" TaskParameter="TargetOutputs" />
69     </MSBuild>
70
71     <PropertyGroup>
72       <RuntimeIdentifiers>@(_AllRuntimeIdentifiers->Distinct())</RuntimeIdentifiers>
73     </PropertyGroup>
74   </Target>
75
76   <!--
77   ============================================================
78                        GetPackagingOutputs
79
80   Stub cross-targeting implementation of GetPackagingOutputs 
81   to allow project references from from projects that pull in 
82   Microsoft.AppxPackage.targets (UWP, PCL) to cross-targeted
83   projects.
84
85   Ultimately, the appx targets should be modified to use the
86   same P2P TFM negotiation protocol as Microsoft.Common.targets
87   so that they can forward to the TFM-specific GetPackagingOutputs
88   of the appropriate inner build. This stub would not have any
89   bad interaction with that change, which would happily bypass
90   this implementation altogether.
91
92   An empty GetPackagingOutputs is sufficient for the common
93   case of a library with no special assets to contribute to
94   the appx and is also equivalent to what is present in the
95   single-targeted case unless WindowsAppContainer is not set 
96   to true.
97
98   Furthermore, the appx targets currently use continue-on-error
99   such that even without this, clean builds succeed but log an 
100   error and incremental builds silently succeed. As such, this 
101   simply removes a confounding error from successful clean
102   builds.
103
104   ============================================================
105   -->
106   <Target Name="GetPackagingOutputs" />
107
108 </Project>