-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathgo.build
125 lines (110 loc) · 5.21 KB
/
go.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
<project name="Hydras and Hypermedia" default="build">
<property name="nant.settings.currentframework" value="net-4.0" />
<property name="mode" value="tutorial"/>
<property name="src" value="src" if="${property::get-value('mode')=='tutorial'}"/>
<property name="src" value="master-src" unless="${property::get-value('mode')=='tutorial'}"/>
<property name="solution.file" value="HydrasAndHypermedia.sln" if="${property::get-value('mode')=='tutorial'}"/>
<property name="solution.file" value="Master.HydrasAndHypermedia.sln" unless="${property::get-value('mode')=='tutorial'}"/>
<property name="configuration" value="debug"/>
<property name="base.dir" value="${project::get-base-directory()}"/>
<property name="output.dir" value="${base.dir}\output"/>
<property name="output.bin.dir" value="${output.dir}\bin"/>
<property name="output.bin.server.dir" value="${output.bin.dir}\server"/>
<property name="output.bin.client.dir" value="${output.bin.dir}\client"/>
<property name="output.reports.dir" value="${output.dir}\reports"/>
<property name="output.reports.unit-tests.dir" value="${output.reports.dir}\unit-tests"/>
<property name="output.reports.exercises.dir" value="${output.reports.dir}\exercises"/>
<property name="binaries.server.dir" value="${base.dir}\${src}\HydrasAndHypermedia.Server\bin"/>
<property name="binaries.client.dir" value="${base.dir}\${src}\HydrasAndHypermedia.Client\bin\${configuration}"/>
<property name="binaries.unit-tests.dir" value="${base.dir}\src\Tests.HydrasAndHypermedia\bin\${configuration}"/>
<property name="binaries.exercises.dir" value="${base.dir}\${src}\HydrasAndHypermedia.Exercises\bin\${configuration}"/>
<property name="unit-tests.assembly" value="Tests.HydrasAndHypermedia.dll"/>
<property name="unit-tests.file" value="results.xml"/>
<property name="exercises.assembly" value="HydrasAndHypermedia.Exercises.dll"/>
<property name="exercises.file" value="results.xml"/>
<loadtasks>
<fileset>
<include name=".\tools\nantcontrib\bin\NAnt.Contrib.Tasks.dll" />
</fileset>
</loadtasks>
<target name="intro">
<echo message="Working directory: ${directory::get-current-directory()}"/>
</target>
<target name="clean">
<delete dir="${output.dir}" />
</target>
<target name="create.output.directories">
<mkdir dir="${output.dir}" />
<mkdir dir="${output.bin.server.dir}" />
<mkdir dir="${output.bin.client.dir}" />
<mkdir dir="${output.reports.unit-tests.dir}" />
<mkdir dir="${output.reports.exercises.dir}" />
</target>
<target name="build.solution">
<msbuild project="${solution.file}">
<arg value="/property:Configuration=${configuration}"/>
<arg value="/t:Rebuild"/>
<arg value="/verbosity:quiet"/>
</msbuild>
</target>
<target name="deploy">
<copy todir="${output.bin.server.dir}">
<fileset basedir="${binaries.server.dir}">
<include name="**/*.dll" />
<include name="**/*.exe" />
<include name="**/*.exe.config" />
</fileset>
</copy>
<copy todir="${output.bin.client.dir}">
<fileset basedir="${binaries.client.dir}">
<include name="**/*.dll" />
<include name="**/*.exe" />
<include name="**/*.exe.config" />
</fileset>
</copy>
<copy todir="${output.reports.unit-tests.dir}">
<fileset basedir="${binaries.unit-tests.dir}">
<include name="**/${unit-tests.file}" />
<include name="**/*.html" />
</fileset>
</copy>
<copy todir="${output.reports.exercises.dir}">
<fileset basedir="${binaries.exercises.dir}">
<include name="**/${exercises.file}" />
<include name="**/*.html" />
</fileset>
</copy>
</target>
<target name="run.unit.tests">
<exec program="${base.dir}\tools\nunit\bin\net-2.0\nunit-console.exe"
workingdir="${binaries.unit-tests.dir}"
commandline="${unit-tests.assembly} /xml:${unit-tests.file} /nologo" failonerror="false" resultproperty="unit-tests.result"/>
</target>
<target name="run.exercises">
<exec program="${base.dir}\tools\nunit\bin\net-2.0\nunit-console.exe"
workingdir="${binaries.exercises.dir}"
commandline="${exercises.assembly} /xml:${exercises.file} /nologo" failonerror="false" resultproperty="exercises.result"/>
</target>
<target name="generate.reports">
<nunit2report todir="${binaries.unit-tests.dir}">
<fileset>
<include name="${binaries.unit-tests.dir}\${unit-tests.file}" />
</fileset>
</nunit2report>
<nunit2report todir="${binaries.exercises.dir}">
<fileset>
<include name="${binaries.exercises.dir}\${exercises.file}" />
</fileset>
</nunit2report>
</target>
<target name="start.application">
<exec program="run.bat" spawn="true"/>
</target>
<target name="build" depends="intro, clean, create.output.directories, build.solution, run.unit.tests, run.exercises, generate.reports, deploy">
<echo message="mode : ${mode}"/>
<echo message="src : ${src}"/>
<echo message="solution.file : ${solution.file}"/>
<fail if="${unit-tests.result != '0' or exercises.result !='0'}">One or more unit tests failed</fail>
</target>
<target name="run" depends="build, start.application"/>
</project>