This repository has been archived by the owner on Jun 25, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.proj
72 lines (53 loc) · 2.08 KB
/
build.proj
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
<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" DefaultTargets="Start">
<!-- Variables -->
<PropertyGroup>
<!-- Release Folder -->
<!-- To change the output folder, use the following parameter: /p:BuildDir=C:\BuildTest-->
<MainReleaseDir>release</MainReleaseDir>
<ReleaseDir>$(MainReleaseDir)\bin</ReleaseDir>
<!-- Build Folder -->
<OutDir>src\BitbucketBackup\bin\Release</OutDir>
<!-- create zip file? -->
<CreateZip>0</CreateZip>
<!-- path for MSBuild Community Tasks -->
<MSBuildCommunityTasksPath>$(MSBuildThisFileDirectory)\src\.build</MSBuildCommunityTasksPath>
</PropertyGroup>
<Import Project="$(MSBuildCommunityTasksPath)\MSBuild.Community.Tasks.Targets" />
<!-- "Autostart" -->
<Target Name="Start">
<CallTarget Targets="DeleteReleaseFolder"/>
<CallTarget Targets="Build"/>
<CallTarget Targets="CopyRelease"/>
<CallTarget Condition="$(CreateZip) == '1'" Targets="Zip"/>
</Target>
<!-- delete and re-create build folder -->
<Target Name="DeleteReleaseFolder">
<RemoveDir Directories="$(MainReleaseDir)"/>
</Target>
<!-- compile solution as release -->
<Target Name="Build">
<MSBuild Projects="src\BitbucketBackup.sln" Properties="Configuration=Release"/>
</Target>
<!-- copy files to release folder -->
<Target Name="CopyRelease">
<MakeDir Directories="$(ReleaseDir)"/>
<ItemGroup>
<ReleaseFiles
Include="$(OutDir)\**\*.*;
README.md;
License.rtf"
Exclude="$(OutDir)\*.pdb;
$(OutDir)\*.xml">
</ReleaseFiles>
</ItemGroup>
<Copy SourceFiles="@(ReleaseFiles)" DestinationFiles="@(ReleaseFiles -> '$(ReleaseDir)\%(RecursiveDir)%(Filename)%(Extension)')"/>
</Target>
<!-- create zip file -->
<Target Name="Zip">
<CreateItem Include="$(ReleaseDir)\**\*.*" >
<Output ItemName="ZipFiles" TaskParameter="Include"/>
</CreateItem>
<Zip ZipFileName="$(MainReleaseDir)\zip\bitbucket-backup-$(VersionNumber).zip" WorkingDirectory="$(ReleaseDir)" Files="@(ZipFiles)" />
</Target>
</Project>