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