-
Notifications
You must be signed in to change notification settings - Fork 0
/
Package.build.xml
137 lines (121 loc) · 5.35 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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
<?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>
<MSBuildNuGetTasksPath>$(MSBuildProjectDirectory)\Tools\MSBuildNuGetTasks</MSBuildNuGetTasksPath>
</PropertyGroup>
<Import Project="$(MSBuildCommunityTasksPath)\MSBuild.Community.Tasks.Targets" />
<Import Project="$(MSBuildUmbracoTasksPath)\MSBuild.Umbraco.Tasks.Targets" />
<Import Project="$(MSBuildNuGetTasksPath)\MSBuild.NuGet.Tasks.Targets" />
<!--
****************************************
* PROPERTIES
****************************************
-->
<PropertyGroup>
<PackageVersion>0.1</PackageVersion>
<BuildConfiguration>Release</BuildConfiguration>
</PropertyGroup>
<PropertyGroup>
<RootDir>$(MSBuildProjectDirectory)</RootDir>
<BuildDir>$(RootDir)\Build</BuildDir>
<PackageDir>$(RootDir)\Package</PackageDir>
<ProjectDir>$(RootDir)\MultiMover</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)")]" />
<FileUpdate
Encoding="ASCII"
Files="$(ProjectDir)\Properties\AssemblyInfo.cs"
Regex="AssemblyFileVersion\(".*"\)\]"
ReplacementText="AssemblyFileVersion("$(PackageVersion)")]" />
</Target>
<!-- COMPILE -->
<Target Name="Compile" DependsOnTargets="UpdateAssemblyInfo">
<MSBuild Projects="$(ProjectDir)\MultiMover.csproj" Properties="Configuration=$(BuildConfiguration);PostBuildEvent=" />
</Target>
<!-- PREPAIRE FILES -->
<Target Name="PrepairFiles_Umbraco" DependsOnTargets="Compile">
<ItemGroup>
<BinFiles Include="$(ProjectDir)\bin\$(BuildConfiguration)\MultiMover.dll" />
<WebFiles Include="$(ProjectDir)\Web\UI\**\*.*" />
<PackageFile Include="$(RootDir)\Package.xml;" />
</ItemGroup>
<Copy SourceFiles="@(BinFiles)" DestinationFolder="$(BuildDir)\bin" />
<Copy SourceFiles="@(WebFiles)" DestinationFolder="$(BuildDir)\%(RecursiveDir)" />
<Copy SourceFiles="@(PackageFile)" DestinationFolder="$(BuildDir)" />
</Target>
<!-- MANIFEST -->
<Target Name="Manifest_Umbraco" DependsOnTargets="PrepairFiles_Umbraco">
<ItemGroup>
<UmbracoManifestFiles Include="$(BuildDir)\**\*" Exclude="$(BuildDir)\Package.xml" />
</ItemGroup>
<MSBuild.Umbraco.Tasks.ManifestUpdate ManifestFile="$(BuildDir)\Package.xml"
WorkingDirectory="$(BuildDir)"
PackageVersion="$(PackageVersion)"
Files="@(UmbracoManifestFiles)" />
</Target>
<!-- PACKAGE -->
<Target Name="Package_Umbraco" DependsOnTargets="Manifest_Umbraco">
<ItemGroup>
<UmbracoPackageFiles Include="$(BuildDir)\**\*.*" Exclude="$(BuildDir)\Package.nuspec;$(BuildDir)\lib" />
</ItemGroup>
<MSBuild.Umbraco.Tasks.Package ManifestFile="$(BuildDir)\Package.xml"
WorkingDirectory="$(BuildDir)"
OutputDirectory="$(PackageDir)"
Files="@(UmbracoPackageFiles)" />
</Target>
<!-- PREPAIRE FILES -->
<Target Name="PrepairFiles_NuGet" DependsOnTargets="Package_Umbraco">
<RemoveDir Directories="$(BuildDir)" Condition="Exists('$(BuildDir)')" />
<ItemGroup>
<BinFiles Include="$(ProjectDir)\bin\$(BuildConfiguration)\MultiMover.dll" />
<WebFiles Include="$(ProjectDir)\Web\UI\**\*.*" />
<NuGetPackageFile Include="$(RootDir)\Package.nuspec" />
</ItemGroup>
<Copy SourceFiles="@(BinFiles)" DestinationFolder="$(BuildDir)\lib" />
<Copy SourceFiles="@(WebFiles)" DestinationFolder="$(BuildDir)\content\%(RecursiveDir)" />
<Copy SourceFiles="@(NuGetPackageFile)" DestinationFolder="$(BuildDir)\" />
</Target>
<!-- MANIFEST -->
<Target Name="Manifest_NuGet" DependsOnTargets="PrepairFiles_NuGet">
<ItemGroup>
<NuGetManifestFiles Include="$(BuildDir)\**\*" Exclude="$(BuildDir)\Package.nuspec" />
</ItemGroup>
<MSBuild.NuGet.Tasks.ManifestUpdate ManifestFile="$(BuildDir)\Package.nuspec"
WorkingDirectory="$(BuildDir)"
Version="$(PackageVersion)"
Files="@(NuGetManifestFiles)" />
</Target>
<!-- PACKAGE -->
<Target Name="Package_NuGet" DependsOnTargets="Manifest_NuGet">
<MSBuild.NuGet.Tasks.Pack NuGetExePath="$(RootDir)\Tools\NuGet\NuGet.exe"
ManifestFile="$(BuildDir)\Package.nuspec"
BasePath="$(BuildDir)"
OutputDirectory="$(PackageDir)" />
</Target>
<Target Name="Package" DependsOnTargets="Package_NuGet"></Target>
</Project>