This repository has been archived by the owner on May 9, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 166
/
Copy pathBugNET.build
166 lines (146 loc) · 6.63 KB
/
BugNET.build
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
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
<?xml version="1.0" ?>
<project name="BugNET" default="ci" xmlns="http://nant.sf.net/schemas/nant.xsd">
<!-- Setup properties -->
<property name="nant.settings.currentframework" value="net-4.0" />
<property name="publishdirectory" value="${teamcity.build.checkoutDir}\publish" />
<property name="build.dir" value="${teamcity.build.checkoutDir}\build" />
<property name="outputdirectory" value="${build.dir}\output"/>
<!-- Options -->
<property name="publish.enabled" value="true" />
<property name="archive.enabled" value="true" />
<property name="unittest.enabled" value="false" />
<target name="ci" depends="clean, version, build, unittest, publish, archive" />
<target name="clean" description="Cleans the build folder.">
<delete dir="${build.dir}" if="${directory::exists(build.dir)}" />
<delete dir="${publishdirectory}" if="${directory::exists(publishdirectory)}" />
</target>
<target name="version" description="Creates assembly information file with the updated build number">
<!-- create c# solutioninfo file -->
<asminfo output="Common/GlobalAssemblyInfo.cs" language="CSharp">
<imports>
<import namespace="System" />
<import namespace="System.Reflection" />
<import namespace="System.Runtime.InteropServices" />
<import namespace="System.Runtime.CompilerServices" />
</imports>
<attributes>
<attribute type="ComVisibleAttribute" value="false" />
<attribute type="AssemblyConfigurationAttribute" value="${nant.settings.currentframework}.${platform::get-name()}" />
<attribute type="AssemblyCompanyAttribute" value="http://www.bugnetproject.com" />
<attribute type="AssemblyCopyrightAttribute" value="Copyright (C) 2006-2014 BugNET Project" />
<attribute type="AssemblyProductAttribute" value="BugNET Open Source Issue Tracker" />
<attribute type="AssemblyVersionAttribute" value="${build.number}" /> <!-- Major.Minor.Build.Revision-->
<attribute type="AssemblyInformationalVersionAttribute" value="${build.number}" /> <!-- Major.Minor.Build.Revision-->
</attributes>
</asminfo>
</target>
<target name="build" description="Compiles using the release configuration">
<echo message="Building solution via msbuild task." />
<loadtasks assembly="C:\Tools\nantcontrib-0.91-bin\nantcontrib-0.91\bin\NAnt.Contrib.Tasks.dll" />
<msbuild project=".\BugNET.sln">
<arg value="/p:Configuration=Release" />
<arg value="/p:DeployOnBuild=true" />
</msbuild>
</target>
<target name="unittest" description="Run unit and code coverage tests.">
<if test="${not unittest.enabled}">
<echo message="Not running Unit Testing and Code Coverage tests." />
</if>
<if test="${unittest.enabled}">
<echo message="Performing Unit Testing." />
<exec program="C:\Tools\NUnit-2.5.10.11092\bin\net-2.0\nunit-console.exe" workingdir="${outputdirectory}" failonerror="false" commandline="BugNet.Tests.dll /xml:..\results\unit-test-results.xml /nologo"/>
</if>
</target>
<target name="publish" description="Zip up deployable files and place package in publish folder.">
<if test="${not publish.enabled}">
<echo message="Not publishing zipped deployables." />
</if>
<if test="${publish.enabled}">
<echo message="Publishing zipped deployables." />
<call target="publish.bugnet" />
</if>
</target>
<target name="publish.bugnet" description="Produces a distrubutable that can be deployed to a specific environment">
<!-- copy install-->
<copy includeemptydirs="false" todir="${build.dir}\dist\BugNET">
<fileset basedir=".\BugNET_WAP\obj\Release\Package\PackageTmp">
<include name="**\*"/>
<exclude name="**\Latest.SqlDataProvider.sql" />
<exclude name="**\App_Data\**" />
</fileset>
</copy>
<!-- copy source -->
<copy todir="${build.dir}\source\">
<fileset basedir=".">
<include name="**\*" />
<exclude name="**\obj\**" />
<exclude name="**\bin\**" />
<exclude name="**\Latest.SqlDataProvider.sql" />
<exclude name="**\packages\**" />
<exclude name="**\Help\**"/>
<exclude name="**\build\**"/>
<exclude name="**\publish\**"/>
<exclude name="**\*.suo"/>
<exclude name="**\*.user"/>
<exclude name="**\tools"/>
</fileset>
</copy>
<property name="filename" value=".\BugNET_WAP\Providers\DataProviders\SqlDataProvider\Latest.SqlDataProvider.sql" />
<if test="${file::exists(filename) and file::get-length(filename) > 0}">
<echo message="Copying latest sql script" />
<copy file="${filename}"
tofile="${build.dir}\dist\BugNET\Providers\DataProviders\SqlDataProvider\${build.number}.SqlDataProvider.sql" />
<copy file="${filename}"
tofile="${build.dir}\source\src\BugNET_WAP\Providers\DataProviders\SqlDataProvider\${build.number}.SqlDataProvider.sql" />
</if>
<property name="filename" value=".\BugNET_WAP\Install\LatestReleaseNotes.htm" />
<if test="${file::exists(filename) and file::get-length(filename) > 0}">
<echo message="Copying latest release notes" />
<copy file="${filename}"
tofile="${build.dir}\dist\BugNET\Install\${build.number}.htm" />
</if>
<!-- copy svn hooks utility-->
<copy todir="${build.dir}\dist\BugNET.SubversionHooks">
<fileset basedir=".\BugNET.SubversionHooks\bin\Release">
<include name="**\*"/>
<exclude name="**\*.pdb"/>
</fileset>
</copy>
<!-- copy hg hooks utility-->
<copy todir="${build.dir}\dist\BugNET.MercurialChangeGroupHook">
<fileset basedir=".\BugNET.MercurialChangeGroupHook\bin\Release">
<include name="**\*"/>
<exclude name="**\*.pdb"/>
</fileset>
</copy>
</target>
<target name="archive" description="Archives the build as a zip file">
<if test="${not archive.enabled}">
<echo message="Not archiving build" />
</if>
<if test="${archive.enabled}">
<mkdir dir="${publishdirectory}" />
<!-- zip it! -->
<zip zipfile="${publishdirectory}\BugNET-${build.number}-Install.zip">
<fileset basedir="${build.dir}\dist">
<include name="**\*" />
</fileset>
</zip>
<!-- zip the source -->
<zip zipfile="${publishdirectory}\BugNET-${build.number}-Source.zip">
<fileset basedir="${build.dir}\source">
<include name="**\*" />
</fileset>
</zip>
<!-- zip the web deploy package -->
<zip zipfile="${publishdirectory}\BugNET-${build.number}-WebDeploy.zip">
<fileset basedir="${build.dir}\dist\BugNET" prefix="BugNET">
<include name="**\*" />
</fileset>
<fileset basedir=".\WebDeploy">
<include name="**\*" />
</fileset>
</zip>
</if>
</target>
</project>