-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDirectory.build.targets
33 lines (25 loc) · 1.47 KB
/
Directory.build.targets
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
<!--
***********************************************************************************************
Directory.Build.targets
Solution-wide build targets.
Simple example of calling classic .net framework VS WebPublish when DeployOnBuild is set to true.
Also see Directory.Build.props and publishsettings.targets for publish profile properties.
[Anders Laub // Laub+Co]
***********************************************************************************************
-->
<Project>
<Sdk Name="Microsoft.Build.CentralPackageVersions" Version="2.0.79" />
<Target Name="AutoWebPublish" AfterTargets="Build" Condition="'$(DeployOnBuild)'=='True' AND '$(UsingMicrosoftNETSdk)' != 'True'">
<PropertyGroup>
<publishUrl Condition="!HasTrailingSlash('$(publishUrl)')">$(publishUrl)/</publishUrl>
</PropertyGroup>
<Message Importance="High" Text="Publishing project $(MSBuildProjectName) to $(publishUrl)." Condition="'$(DeployOnBuild)' == 'true'" />
<CallTarget Targets="WebPublish" />
</Target>
<Target Name="RemoveFilesFromWebPublish" AfterTargets="ResolveReferences">
<ItemGroup>
<_IgnoredFiles Include="@(SitecoreAssemblies)" Condition="'@(SitecoreAssemblies)' != ''" />
<ReferenceCopyLocalPaths Remove="@(ReferenceCopyLocalPaths)" Condition="'%(Filename)' != '' and '@(_IgnoredFiles)' != ''" />
</ItemGroup>
</Target>
</Project>