Renaming call to ResolveServices
[castle.git] / Experiments / Generator / default.build
blob9bef05c65ff601a2521fa2074c7040137d636326
1 <project name="Generator" default="build">\r
2         <loadtasks assembly="lib/Boo.NAnt.Tasks.dll" />\r
3 \r
4 \r
5         <target name="build" description="Builds the app" depends="prepare">\r
6                 <property name="type" value="exe" overwrite="false" />\r
7                 <property name="target" value="${type}" />\r
8                 <property name="target" value="library" if="${type == 'dll'}" />\r
9                 \r
10                 <booc target="${target}"\r
11                       output="bin/generate.${type}"\r
12                 >\r
13                         <sources basedir="src/app">\r
14                                 <include name="**/*.boo" />\r
15                         </sources>\r
16                         <references basedir="bin">\r
17                                 <include name="Boo.Lang.Compiler.dll" />\r
18                                 <include name="Boo.Lang.Parser.dll" />\r
19                                 <include name="Boo.Lang.Useful.dll" />\r
20                                 <include name="MGutz.CodeInjection.dll" />\r
21                         </references>\r
22                 </booc>\r
23         </target>\r
24         \r
25         <target name="prepare" description="Copy libs to the build dir">\r
26                 <mkdir dir="bin" />\r
27                 <copy todir="bin">\r
28                         <fileset basedir="lib">\r
29                                 <include name="*.*" />\r
30                         </fileset>\r
31                 </copy>\r
32         </target>\r
33         \r
34         <target name="build.tests" description="Builds the test lib" depends="build">\r
35                 <booc target="library"\r
36                       output="bin/tests.dll"\r
37                           debug="true"\r
38                       >\r
39                         <sources basedir="src/test">\r
40                                 <include name="**/*.boo" />\r
41                         </sources>\r
42                         <references basedir="bin">\r
43                                 <include name="nunit.framework.dll" />\r
44                                 <include name="generate.exe" />\r
45                         </references>\r
46                 </booc>\r
47         </target>\r
48         \r
49         <target name="clean" description="Sweep it yeah!">\r
50                 <delete>\r
51                         <fileset>\r
52                                 <include name="bin/**" />\r
53                         </fileset>\r
54                 </delete>\r
55         </target>\r
56         \r
57         <target name="install" description="Installs the application" depends="build">\r
58                 <if test="${platform::is-win32()}">\r
59                         <property name="to" value="${environment::get-folder-path('System')}\.." overwrite="false" />\r
60                         <copy todir="${to}">\r
61                                 <fileset basedir="script">\r
62                                         <include name="monorail.bat" />\r
63                                         <include name="generate.bat" />\r
64                                 </fileset>\r
65                                 <filterchain>\r
66                                         <replacetokens>\r
67                                                 <token key="CD" value="${project::get-base-directory()}" />\r
68                                         </replacetokens>\r
69                                 </filterchain>\r
70                         </copy>\r
71                 </if>\r
72                 <if test="${platform::is-unix()}">\r
73                         <property name="to" value="/usr/bin" overwrite="false" />\r
74                         <copy todir="${to}">\r
75                                 <fileset basedir="script">\r
76                                         <include name="monorail" />\r
77                                         <include name="generate" />\r
78                                 </fileset>\r
79                                 <filterchain>\r
80                                         <replacetokens>\r
81                                                 <token key="CD" value="${project::get-base-directory()}" />\r
82                                         </replacetokens>\r
83                                 </filterchain>\r
84                         </copy>\r
85                         <exec program="chmod">\r
86                                 <arg line="+x ${to}/monorail" />\r
87                         </exec>\r
88                         <exec program="chmod">\r
89                                 <arg line="+x ${to}/generate" />\r
90                         </exec>\r
91                 </if>\r
92         </target>\r
93         \r
94         <target name="test" description="Run tests" depends="build.tests">\r
95                 <nunit2 if="${platform::is-win32()}"> \r
96                         <formatter type="Plain" />\r
97                         <test assemblyname="bin/tests.dll" />\r
98                 </nunit2>       \r
99                 <exec program="nunit-console" if="${platform::is-unix()}">\r
100                         <arg line="bin/tests.dll /nologo" />\r
101                 </exec>\r
102         </target>\r
103         \r
104         <target name="test.unit" description="Run unit tests" depends="build.tests">\r
105                 <exec program="nunit-console" if="${platform::is-unix()}">\r
106                         <arg line="bin/tests.dll /include:Unit /nologo" />\r
107                 </exec>\r
108         </target>\r
109         \r
110         <target name="test.functional" description="Run functional tests" depends="build.tests">\r
111                 <exec program="nunit-console" if="${platform::is-unix()}">\r
112                         <arg line="bin/tests.dll /include:Functional /nologo" />\r
113                 </exec>\r
114         </target>\r
115 </project>\r