forked from mattbrailsford/umbraco-photon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Package.build.xml
102 lines (90 loc) · 3.55 KB
/
Package.build.xml
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
97
98
99
100
101
102
<?xml version="1.0" encoding="utf-8" ?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="Package">
<!--
****************************************
* IMPORTS
****************************************
-->
<PropertyGroup>
<MSBuildCommunityTasksPath>$(MSBuildProjectDirectory)\Tools\MSBuildCommunityTasks</MSBuildCommunityTasksPath>
<MSBuildUmbracoTasksPath>$(MSBuildProjectDirectory)\Tools\MSBuildUmbracoTasks</MSBuildUmbracoTasksPath>
</PropertyGroup>
<Import Project="$(MSBuildCommunityTasksPath)\MSBuild.Community.Tasks.Targets" />
<Import Project="$(MSBuildUmbracoTasksPath)\MSBuild.Umbraco.Tasks.Targets" />
<!--
****************************************
* PROPERTIES
****************************************
-->
<PropertyGroup>
<PackageVersion>0.1</PackageVersion>
<ProjectName>Our.Umbraco.Photon</ProjectName>
<BuildConfig>Release</BuildConfig>
</PropertyGroup>
<PropertyGroup>
<RootDir>$(MSBuildProjectDirectory)</RootDir>
<BuildDir>$(RootDir)\Build</BuildDir>
<PackageDir>$(RootDir)\Package</PackageDir>
<ProjectDir>$(RootDir)\Src\$(ProjectName)</ProjectDir>
</PropertyGroup>
<!--
****************************************
* TARGETS
****************************************
-->
<!-- CLEAN -->
<Target Name="Clean">
<RemoveDir Directories="$(BuildDir)" Condition="Exists('$(BuildDir)')" />
<RemoveDir Directories="$(PackageDir)" Condition="Exists('$(PackageDir)')" />
<MakeDir Directories="$(BuildDir)" />
<MakeDir Directories="$(PackageDir)" />
</Target>
<!-- UPDATE ASSEMBLEY VERSION -->
<Target Name="UpdateAssemblyInfo" DependsOnTargets="Clean">
<FileUpdate
Encoding="ASCII"
Files="$(ProjectDir)\Properties\AssemblyInfo.cs"
Regex="AssemblyVersion\(".*"\)\]"
ReplacementText="AssemblyVersion("$(PackageVersion).0.0")]" />
<FileUpdate
Encoding="ASCII"
Files="$(ProjectDir)\Properties\AssemblyInfo.cs"
Regex="AssemblyFileVersion\(".*"\)\]"
ReplacementText="AssemblyFileVersion("$(PackageVersion).0.0")]" />
</Target>
<!-- COMPILE -->
<Target Name="Compile" DependsOnTargets="UpdateAssemblyInfo">
<MSBuild Projects="$(ProjectDir)\$(ProjectName).csproj" Properties="Configuration=$(BuildConfig)" />
</Target>
<!-- PREPAIRE FILES -->
<Target Name="PrepairFiles" DependsOnTargets="Compile">
<ItemGroup>
<BinFiles Include="$(ProjectDir)\bin\$(BuildConfig)\$(ProjectName).dll" />
<PluginFiles Include="$(ProjectDir)\Web\UI\**\*.*" />
<PackageFile Include="$(RootDir)\Package.xml" />
</ItemGroup>
<Copy SourceFiles="@(BinFiles)" DestinationFolder="$(BuildDir)\bin" />
<Copy SourceFiles="@(PluginFiles)" DestinationFolder="$(BuildDir)\%(RecursiveDir)" />
<Copy SourceFiles="@(PackageFile)" DestinationFolder="$(BuildDir)" />
</Target>
<!-- MANIFEST -->
<Target Name="Manifest" DependsOnTargets="PrepairFiles">
<ItemGroup>
<ManifestFiles Include="$(BuildDir)\**\*" Exclude="$(BuildDir)\Package.xml" />
</ItemGroup>
<ManifestUpdate ManifestFile="$(BuildDir)\Package.xml"
WorkingDirectory="$(BuildDir)"
PackageVersion="$(PackageVersion)"
Files="@(ManifestFiles)" />
</Target>
<!-- PACKAGE -->
<Target Name="Package" DependsOnTargets="Manifest">
<ItemGroup>
<PackageFiles Include="$(BuildDir)\**\*.*" />
</ItemGroup>
<Package ManifestFile="$(BuildDir)\Package.xml"
WorkingDirectory="$(BuildDir)"
OutputDirectory="$(PackageDir)"
Files="@(PackageFiles)" />
</Target>
</Project>