-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathSharpArchContrib.build
167 lines (144 loc) · 6.81 KB
/
SharpArchContrib.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" encoding="utf-8" ?>
<!--EXTERNAL_PROPERTIES: build.number-->
<project name="SharpArchContrib" default="dist">
<property name="project.dir" value="${project::get-base-directory()}" />
<property name="version" value="0.1.0.0"/>
<property name="configuration" value="Release"/>
<property name="versionInfo.name" value="CommonAssemblyInfo.cs"/>
<!-- Test -->
<!-- Artifact directories -->
<property name="output.dir" value="${project.dir}\BuildOutput"/>
<property name="bin.dir" value="${output.dir}\bin"/>
<property name="distribution.dir" value="${output.dir}\distribution"/>
<property name="test.output.dir" value="${output.dir}\test"/>
<!-- Tool directories -->
<property name="tools.dir" value="${project.dir}\tools"/>
<property name="nunit.dir" value="${tools.dir}\nunit\bin"/>
<property name="postSharp.dir" value="${tools.dir}\PostSharp"/>
<!-- Version Info -->
<property name="appVersion" value="0.1.0"/>
<property name="revision" value="0"/>
<property name="company.name" value="Codai, LLC"/>
<!-- Controls NGen Use -->
<!-- Cannot NGen on the Code Better TeamCity server so we default to false when we are on TeamCity.
This can be overriden with -D:useNgen=true in the TeamCity configuration -->
<property name="useNgen" value="${not property::exists('build.number')}"/>
<!-- Set this to false to allow sql lite tests requiring a in file SQLLite database to run.
Any test that needs to close the connection during the test has to go to a file since
closing the connection to an in memory database causes the schema to be lost.
When this is true, all the tests of UnitOfWork and Transaction are off. -->
<property name="excludeSqlLiteFileTests" value="true"/>
<include buildfile="${tools.dir}\nant\includes\ngenPostSharp.include"/>
<!-- *********************************************************
The build
*********************************************************-->
<target name="help">
<!--Enter tasks for help target-->
<echo message="The skeleton file for the build process is designed to execute the following targets in turn from the target dist:"/>
<echo message="-- clean"/>
<echo message="-- version"/>
<echo message="-- build"/>
<echo message="-- test"/>
<echo message="-- document"/>
<echo message="-- publish"/>
<echo message=""/>
<echo message="use nant -projecthelp for more"/>
</target>
<target name="dist" description="Build distribution and test" depends="clean, version, build, test, document, publish"/>
<target name="clean" description="Clean up the build environment.">
<echo message="======================================================="/>
<echo message="configuration = ${configuration}"/>
<echo message="======================================================="/>
<if test="${property::exists('teamcity.dotnet.nunitaddin')}">
<copy todir="${nunit.dir}\addins">
<fileset>
<include name="${teamcity.dotnet.nunitaddin}-2.5.0.dll"/>
</fileset>
</copy>
</if>
<delete dir="${output.dir}" failonerror="false"/>
<mkdir dir="${output.dir}"/>
<mkdir dir="${bin.dir}"/>
<mkdir dir="${distribution.dir}"/>
</target>
<target name="build" description="Compile the application.">
<call target="ngenPostSharp" if="${useNgen}"/>
<msbuild project="SharpArchContrib.sln" target="Rebuild">
<property name="Configuration" value="${configuration}"/>
</msbuild>
</target>
<target name="version">
<if test="${property::exists('build.number')}">
<property name="revision" value="${build.number}"/>
</if>
<echo message="******************************************"/>
<echo message="Version: ${appVersion}"/>
<echo message="File Version: ${appVersion}.${revision}"/>
<echo message="*******************************************"/>
<asminfo output="${project.dir}\src\SharpArchContrib.Core\Properties\CommonAssemblyInfo.cs" language="CSharp">
<imports>
<import namespace="System.Reflection" />
<import namespace="System.Runtime.InteropServices" />
</imports>
<attributes>
<attribute type="ComVisibleAttribute" value="false" />
<attribute type="AssemblyCultureAttribute" value=""/>
<attribute type="AssemblyVersionAttribute" value="${appVersion}" />
<attribute type="AssemblyFileVersionAttribute" value="${appVersion}.${revision}"/>
<attribute type="AssemblyCopyrightAttribute" value="Copyright © ${company.name} ${datetime::get-year(datetime::now())}" />
</attributes>
</asminfo>
</target>
<target name="test">
<call target="testExcludeFileDBTests" if="${excludeSqlLiteFileTests}"/>
<call target="allTests" unless="${excludeSqlLiteFileTests}"/>
</target>
<target name="testExcludeFileDBTests">
<exec program="nunit-console.exe" workingdir="${nunit.dir}" basedir="${nunit.dir}" resultproperty="testResult">
<arg value="${project.dir}\src\SharpArchContrib.Tests\bin\${configuration}\SharpArchContrib.Tests.dll"/>
<arg value='/exclude="File DB Tests"'/>
</exec>
</target>
<target name="allTests">
<exec program="nunit-console.exe" workingdir="${nunit.dir}" basedir="${nunit.dir}" resultproperty="testResult">
<arg value="${project.dir}\src\SharpArchContrib.Tests\bin\${configuration}\SharpArchContrib.Tests.dll"/>
</exec>
</target>
<target name="document"/>
<target name="publish">
<copy todir="${bin.dir}">
<fileset basedir="${project.dir}\src\SharpArchContrib.Tests\bin\${configuration}">
<include name="SharpArchContrib.*.dll"/>
<include name="SharpArchContrib.*.pdb"/>
<include name="PostSharp.*"/>
<exclude name="SharpArchContrib.Tests.*"/>
</fileset>
</copy>
<zip zipfile="${distribution.dir}\${project::get-name()}-${configuration}-${appVersion}.${revision}.zip">
<fileset basedir="${output.dir}">
<include name="${bin.dir}/*.*" />
</fileset>
<fileset basedir="${project.dir}">
<include name="tools/PostSharp/**"/>
<include name="tools/nant/**"/>
</fileset>
</zip>
<zip zipfile="${distribution.dir}\${project::get-name()}-source-${appVersion}.${revision}.zip">
<fileset basedir=".">
<include name="*.*" />
<include name="src/**/*.*" />
<include name="lib/**/*.*" />
<include name="tools/**/*.*"/>
<exclude name="**/*.user" />
<exclude name="**/*.cache" />
<exclude name="**/*.suo" />
<exclude name="src/**/bin/**" />
<exclude name="**/obj/**" />
<exclude name="**/_ReSharper.*/**" />
</fileset>
</zip>
</target>
<!-- *********************************************************
Useful Targets
*********************************************************-->
</project>