2 ***********************************************************************************************
\r
3 Microsoft.NET.Sdk.Publish.CopyFiles.targets
\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 web deploy projects from the command-line or the IDE.
\r
9 This file defines the steps in the standard package/publish process for collecting only files to run the web appliation.
\r
11 Copyright (C) Microsoft Corporation. All rights reserved.
\r
12 ***********************************************************************************************
\r
14 <Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
\r
17 <_DotNetPublishCopyFiles>
\r
18 _RemoveExcludeFiles;
\r
19 _DeletePublishIntermediateOutputPath;
\r
20 _CopyFilesToPublishIntermediateOutputPath;
\r
21 _CopyAspNetCoreFilesToIntermediateOutputPath;
\r
22 _CopyWebJobFilesToIntermediateOutputPath;
\r
23 </_DotNetPublishCopyFiles>
\r
27 <!--********************************************************************-->
\r
28 <!-- Target _RemoveExcludeFiles -->
\r
29 <!--********************************************************************-->
\r
30 <Target Name="_RemoveExcludeFiles" >
\r
33 <DotNetPublishFiles Remove="@(DotNetPublishFiles)" Condition="'%(Exclude)' == 'true'" />
\r
38 <!--********************************************************************-->
\r
39 <!-- Target _DeletePublishIntermediateOutputPath -->
\r
40 <!--********************************************************************-->
\r
42 <Target Name="_DeletePublishIntermediateOutputPath">
\r
44 <!-- Remove all the files from the temp directory first-->
\r
46 <_PublishTempFiles Include="$(PublishIntermediateOutputPath)**\*.*" />
\r
49 <Delete Files="@(_PublishTempFiles)" ContinueOnError="true" />
\r
50 <RemoveDir Directories="$(PublishIntermediateOutputPath)" ContinueOnError="true" Condition="Exists('$(PublishIntermediateOutputPath)')" />
\r
51 <MakeDir Directories="$(PublishIntermediateOutputPath)" Condition="!Exists('$(PublishIntermediateOutputPath)')"/>
\r
56 <!--********************************************************************-->
\r
57 <!-- Target _CopyAllFilesToPublishIntermediateOutputPath -->
\r
58 <!--********************************************************************-->
\r
59 <Target Name="_CopyFilesToPublishIntermediateOutputPath">
\r
62 SourceFiles="@(DotNetPublishFiles)"
\r
63 DestinationFiles="@(DotNetPublishFiles ->'$(PublishIntermediateOutputPath)%(DestinationRelativePath)')" />
\r
67 <!--********************************************************************-->
\r
68 <!-- Target _CopyAspNetCoreFilesToIntermediateOutputPath -->
\r
69 <!--********************************************************************-->
\r
71 <_CopyAspNetCoreFilesToIntermediateOutputPathDependsOn>
\r
72 $(_CopyAspNetCoreFilesToIntermediateOutputPathDependsOn);
\r
73 _PrepareForAspNetCoreProjectSystemPublish;
\r
75 </_CopyAspNetCoreFilesToIntermediateOutputPathDependsOn>
\r
78 <Target Name="_CopyAspNetCoreFilesToIntermediateOutputPath"
\r
79 Condition="'$(_PublishProjectType)' == 'AspNetCore'"
\r
80 DependsOnTargets="$(_CopyAspNetCoreFilesToIntermediateOutputPathDependsOn)">
\r
83 <!--********************************************************************-->
\r
84 <!-- Target _PrepareForAspNetCoreProjectSystemPublish -->
\r
85 <!--********************************************************************-->
\r
86 <Target Name="_PrepareForAspNetCoreProjectSystemPublish">
\r
88 <PublishDir>$(PublishIntermediateOutputPath)</PublishDir>
\r
89 <Configuration>$(PublishConfiguration)</Configuration>
\r
93 <!--********************************************************************-->
\r
94 <!-- Target _CopyWebJobFilesToIntermediateOutputPath -->
\r
95 <!--********************************************************************-->
\r
97 <_CopyWebJobFilesToIntermediateOutputPathDependsOn>
\r
98 $(_CopyWebJobFilesToIntermediateOutputPathDependsOn);
\r
99 _PrepareForWebJobPublish;
\r
101 </_CopyWebJobFilesToIntermediateOutputPathDependsOn>
\r
104 <Target Name="_CopyWebJobFilesToIntermediateOutputPath"
\r
105 Condition="'$(_PublishProjectType)' == 'WebJob'"
\r
106 DependsOnTargets="$(_CopyWebJobFilesToIntermediateOutputPathDependsOn)">
\r
109 <!--********************************************************************-->
\r
110 <!-- Target _PrepareForWebJobPublish -->
\r
111 <!--********************************************************************-->
\r
112 <Target Name="_PrepareForWebJobPublish">
\r
114 <PublishDir>$(PublishIntermediateOutputPath)\app_data\Jobs\$(WebJobType)\$(WebJobName)\</PublishDir>
\r
115 <Configuration>$(PublishConfiguration)</Configuration>
\r
119 <!--********************************************************************-->
\r
120 <!-- This will ensure that all values have the required metadata -->
\r
121 <!--********************************************************************-->
\r
122 <ItemDefinitionGroup>
\r
123 <DotNetPublishFiles>
\r
124 <DestinationRelativePath></DestinationRelativePath>
\r
125 <Exclude>False</Exclude>
\r
126 </DotNetPublishFiles>
\r
127 </ItemDefinitionGroup>
\r