summaryrefslogtreecommitdiff
path: root/DesignPatterns/DesignPatterns.build
blob: 3348ec2475811cdd1cefd3d22f98f79aa1627d6f (plain)
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
<?xml version="1.0"?>
<project name="DesignPatterns" default="all">
    <property name="debug" value="true" />
	
	<property name="base.dir" value="${project::get-base-directory()}"/>	
	<property name="build.dir" value="${base.dir}\build"/>
	<property name="tools.dir" value="${base.dir}\tools"/>
	<property name="src.dir" value="${base.dir}\src"/>
	<property name="app.src.dir" value="${src.dir}\app"/>
	<property name="test.src.dir" value="${src.dir}\test"/>

	<property name="app.lib" value="DesignPatterns.dll" />
	<property name="test.lib" value="DesignPatterns.test.dll"/>
	
	<fileset id="test.references">
		<include name="${tools.dir}\mbunit\MbUnit.Framework.dll" />
		<include name="${tools.dir}\rhinomocks\Rhino.Mocks.dll" />
		<include name="${build.dir}\${app.lib}"/>
	</fileset>

	<fileset id="app.source.files">
		<exclude name="${app.src.dir}\**\AssemblyInfo.cs" />
		<include name="${app.src.dir}\**\*.cs"/>
	</fileset>
	
    <target name="all" depends="clean, init" description="" />
	
	<target name="clean">
		<delete dir="${build.dir}" />
	</target>

	<target name="init" depends="clean">
		<mkdir dir="${build.dir}"/>
	</target>
	
	<target name="compile" depends="init">
		<csc output="${compile.dir}\${app.lib}" target="library" debug="${debug}">
			<sources refid="app.source.files" />
			<references refid="test.references" />
		</csc>
	</target>

	<target name="test.compile">
		<property name="compile.dir" value="${build.dir}" />
		<call target="compile"/>
		<csc output="${compile.dir}\${test.lib}" target="library" debug="${debug}">
			<sources>
				<include name="${test.src.dir}\**\*.cs"/>
				<exclude name="${test.src.dir}\**\AssemblyInfo.cs" />
			</sources>
			<references refid="test.references"/>
		</csc>
	</target>
	
	<target name="test" depends="test.compile">
		<copy todir="${build.dir}" flatten="true">
			<fileset basedir="${tools.dir}\rhinomocks">
				<include name="**\Rhino.Mocks.dll" />
			</fileset>
		</copy>

		<copy todir="${build.dir}" flatten="true">
			<fileset basedir="${tools.dir}\mbunit">
				<include name="*.dll" />
			</fileset>			
		</copy>		
		
		<exec basedir="${tools.dir}\mbunit" 
			useruntimeengine="true" 
			workingdir="${build.dir}"
			program="mbunit.Cons.exe" 
			failonerror="false"
			commandline="${test.lib} /report-type:Text /rf:${build.dir} /rnf:Report /sr" />		
			
	</target>	

</project>