-
Notifications
You must be signed in to change notification settings - Fork 302
/
project.build
64 lines (54 loc) · 3.29 KB
/
project.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
<?xml version="1.0" ?>
<project name="LinqToExcel" default="build">
<property name="nant.settings.currentframework" value="net-3.5" />
<property name="dir.base" value="${directory::get-current-directory()}" />
<property name="dir.bin" value="${dir.base}\bin" />
<property name="dir.test" value="${dir.base}\tests" />
<property name="file.project" value="${dir.base}\src\LinqToExcel\LinqToExcel.csproj" />
<property name="file.project.test" value="${dir.base}\src\LinqToExcel.Tests\LinqToExcel.Tests.csproj" />
<property name="file.publish" value="${dir.base}\publish.zip" />
<property name="tool.MbUnit" value="${dir.base}\lib\MbUnit\MbUnit.Cons.exe" />
<target name="build" depends="clean, compile, deleteLog4netXml" />
<target name="publish" depends="test, build, zip" />
<target name="clean" description="deletes folders used in the build">
<delete dir="${dir.bin}" if="${directory::exists(dir.bin)}" />
<delete dir="${dir.test}" if="${directory::exists(dir.test)}" />
<delete file="${file.publish}" if="${file::exists(file.publish)}" />
</target>
<target name="compile" description="compiles the project">
<exec program="${framework::get-framework-directory(framework::get-target-framework())}\msbuild.exe"
commandline=""${file.project}" /p:Configuration=Release;DocumentationFile=LinqToExcel.xml;OutputPath="${dir.bin}\\"" />
</target>
<target name="zip" description="zips the contents of the bin folder to the zip.dir">
<zip zipfile="${file.publish}">
<fileset basedir="${dir.bin}">
<include name="**/*" />
</fileset>
</zip>
</target>
<target name="compile-test-project" description="compiles the test project">
<exec program="${framework::get-framework-directory(framework::get-target-framework())}\msbuild.exe"
commandline=""${file.project.test}" /p:OutputPath="${dir.test}\bin\\"" />
</target>
<target name="unit-test" depends="clean, compile-test-project" description="runs the unit tests">
<exec program="${tool.MbUnit}"
commandline=""${dir.test}\bin\LinqToExcel.Tests.dll" /report-folder:"${dir.test}\reports\\" /report-type:Html /filter-category:"Unit"" />
<!-- clean up the created directories if the unittests passed -->
<call target="clean" />
</target>
<target name="integration-test" depends="clean, compile-test-project" description="runs the integration tests">
<exec program="${tool.MbUnit}"
commandline=""${dir.test}\bin\LinqToExcel.Tests.dll" /report-folder:"${dir.test}\reports\\" /report-type:Html /filter-category:"Integration"" />
<!-- clean up the created directories if the unittests passed -->
<call target="clean" />
</target>
<target name="test" depends="clean, compile-test-project" description="runs all the tests">
<exec program="${tool.MbUnit}"
commandline=""${dir.test}\bin\LinqToExcel.Tests.dll" /report-folder:"${dir.test}\reports\\" /report-type:Html" />
<!-- clean up the created directories if the unittests passed -->
<call target="clean" />
</target>
<target name="deleteLog4netXml" description="Deletes the log4net.xml file that isn't need and takes up a lot of space">
<delete file="${dir.bin}/log4net.xml" />
</target>
</project>