BOO-986: Allow DefaultAttribute to work on parameters without an explicit type by...
[boo.git] / default.build
blobbaa6d2c599879d4027e4492c802d20433deecc53
1 <?xml version="1.0"?>
2 <project name="boo" default="all">
4 <property name="boo.major.minor.release.version" value="0.8.1" />
5 <property name="boo.svn.revision" value="2896" />
6 <property name="boo.version" value="${boo.major.minor.release.version}.${boo.svn.revision}" dynamic="True" />
7 <property name="boo.assembly.version" value="2.0.0.0" />
9 <property name="debug" value="true" />
10 <property name="optimize" value="false" />
11 <property name="verbose" value="false" />
13 <property name="antlr.jar" value="lib/antlr-2.7.5/antlr-2.7.5.jar" />
14 <property name="java" value="java" />
16 <property name="ngen.exe" value="${framework::get-framework-directory(framework::get-target-framework())}/ngen.exe" />
17 <property name="skip.ngen" value="True" />
18 <property name="skip.antlr" value="False" />
19 <property name="skip.ast" value="False" />
20 <property name="skip.vs2005" value="False" />
22 <property name="build.dir" value="build" dynamic="True"/>
23 <property name="distrobuild.dir" value="distrobuild"/>
25 <property name="install.prefix" value="/usr/local" />
26 <property name="install.destdir" value="/" />
28 <property name="install.share" value="${path::combine(install.prefix,'share')}" />
29 <property name="install.bindir" value="${path::combine(install.prefix,'bin')}" />
30 <property name="install.libdir" value="${path::combine(install.prefix,'lib')}" />
31 <property name="install.boolib" value="${path::combine(install.libdir,'boo')}" />
33 <property name="fakeroot.boolib" value="${install.destdir}/${install.boolib}" />
34 <property name="fakeroot.bindir" value="${install.destdir}/${install.bindir}" />
35 <property name="fakeroot.libdir" value="${install.destdir}/${install.libdir}" />
36 <property name="fakeroot.share" value="${install.destdir}/${install.share}" />
38 <include buildfile="build.properties" if="${file::exists('build.properties')}" />
40 <property name="boo.distro.name" value="boo-${boo.version}" />
42 <property name="supported.runtimes.net-1.1" value="&lt;supportedRuntime version=&quot;v1.1.4322&quot;/&gt;
43 &lt;supportedRuntime version=&quot;v2.0.50727&quot;/&gt;" />
45 <property name="supported.runtimes.net-2.0"
46 value="&lt;supportedRuntime version=&quot;v2.0.50727&quot;/&gt;
47 &lt;supportedRuntime version=&quot;v1.1.4322&quot;/&gt;" />
49 <property name="supported.runtimes" value="${supported.runtimes.net-2.0}" />
51 <property name="csc.noconfig" value="false" />
52 <property name="csc.define" value="NET_2_0;TRACE;DEBUG" />
54 <property name="fixture" value="" dynamic="true" />
56 <property name="keyfile.path" value="src/boo.snk" overwrite="false" />
58 <target name="all" depends="booc, booi, booish, boo-pkgconfig, Boo.Lang.CodeDom, Boo.Lang.Useful, boo, Boo.Microsoft.Build.Tasks, update-vs2005-env">
59 </target>
61 <target name="set-release-configuration">
62 <property name="debug" value="false" />
63 <property name="optimize" value="true" />
64 <property name="csc.define" value="NET_2_0" />
65 </target>
67 <target name="nostdlib">
68 <property name="csc.define" value="${csc.define};NO_SYSTEM_DLL" />
69 <property name="csc.noconfig" value="true" />
70 </target>
72 <target name="test" depends="all">
73 <exec
74 basedir="${nant::get-base-directory()}"
75 program="NAnt.exe"
76 workingdir="tests"
77 useruntimeengine="true">
78 <arg value="-D:fixture=${fixture}" if="${fixture != ''}" />
79 <arg value="run" />
80 </exec>
81 </target>
83 <target name="test-vs-bin">
84 <exec
85 basedir="${nant::get-base-directory()}"
86 program="NAnt.exe"
87 workingdir="tests"
88 useruntimeengine="true">
89 <arg value="-D:fixture=${fixture}" if="${fixture != ''}" />
90 <arg value="run-vs-bin" />
91 </exec>
92 </target>
94 <target name="compile-tests" depends="all">
95 <exec
96 basedir="${nant::get-base-directory()}"
97 program="NAnt.exe"
98 workingdir="tests"
99 useruntimeengine="true">
100 <arg value="compile" />
101 </exec>
102 </target>
104 <target name="boo" depends="Boo.Lang.Useful, Boo.Lang.Interpreter">
105 <booc
106 target="exe"
107 output="${build.dir}/boo.exe"
108 verbose="${verbose}"
109 debug="${debug}"
110 keyfile="${keyfile.path}">
112 <sources basedir="src/boo">
113 <include name="*.boo" />
114 </sources>
116 <references basedir="${build.dir}">
117 <include name="Boo.Lang.Useful.dll" />
118 <include name="Boo.Lang.Interpreter.dll" />
119 </references>
120 </booc>
121 </target>
123 <target name="booish" depends="Boo.Lang.Interpreter">
124 <booc
125 target="exe"
126 output="${build.dir}/booish.exe"
127 verbose="${verbose}"
128 debug="${debug}"
129 keyfile="${keyfile.path}">
131 <sources basedir="src/booish">
132 <include name="*.boo" />
133 <exclude name="booish.boo" /><!-- old booish -->
134 </sources>
136 <references basedir="${build.dir}">
137 <include name="Boo.Lang.Interpreter.dll" />
138 <include name="Boo.Lang.Compiler.dll" />
139 </references>
140 </booc>
142 <copy file="extras/template.config.in" tofile="${build.dir}/booish.exe.config">
143 <filterchain>
144 <replacestring from="@SUPPORTEDVERSIONS@"
145 to="${supported.runtimes}" />
146 </filterchain>
147 </copy>
149 <if test="${not(platform::is-win32())}">
150 <copy file="extras/booish.in" tofile="${build.dir}/booish" inputencoding="ASCII">
151 <filterchain>
152 <replacestring from="@RUNTIME@" to="mono" />
153 <replacestring from="@prefix@" to="${install.prefix}" />
154 </filterchain>
155 </copy>
156 </if>
157 </target>
159 <target name="booi" depends="core, Boo.Lang.Useful, Boo.Lang.Parser">
161 <booc
162 target="exe"
163 output="${build.dir}/booi.exe"
164 verbose="${verbose}"
165 debug="${debug}"
166 keyfile="${keyfile.path}">
168 <references basedir="${build.dir}">
169 <include name="Boo.Lang.Parser.dll" />
170 <include name="Boo.Lang.Compiler.dll" />
171 <include name="Boo.Lang.Useful.dll" />
172 </references>
174 <sources basedir="src/booi">
175 <include name="*.boo" />
176 </sources>
177 </booc>
179 <copy file="extras/template.config.in" tofile="${build.dir}/booi.exe.config">
180 <filterchain>
181 <replacestring from="@SUPPORTEDVERSIONS@"
182 to="${supported.runtimes}" />
183 </filterchain>
184 </copy>
186 <if test="${not(platform::is-win32())}">
187 <copy file="extras/booi.in" tofile="${build.dir}/booi" inputencoding="ASCII">
188 <filterchain>
189 <replacestring from="@RUNTIME@" to="mono" />
190 <replacestring from="@prefix@" to="${install.prefix}" />
191 </filterchain>
192 </copy>
193 </if>
195 <boo>
196 print("Hello from boo task!")
197 print("Framework directory: ${Project.TargetFramework.FrameworkAssemblyDirectory}")
198 </boo>
200 </target>
202 <target name="dump-properties" depends="core">
203 <boo>
204 for p as System.Collections.DictionaryEntry in Project.Properties:
205 print("${p.Key}: ${p.Value}")
206 </boo>
207 </target>
209 <target name="Boo.Lang.Interpreter" depends="core">
210 <booc target="library"
211 output="${build.dir}/Boo.Lang.Interpreter.dll"
212 verbose="${verbose}"
213 debug="${debug}"
214 keyfile="${keyfile.path}">
215 <sources basedir="src/Boo.Lang.Interpreter">
216 <include name="*.boo" />
217 </sources>
218 <references basedir="${build.dir}">
219 <include name="Boo.Lang.Compiler.dll" />
220 </references>
221 </booc>
222 </target>
224 <target name="Boo.NAnt.Tasks" depends="booc">
225 <uptodate property="Boo.NAnt.Tasks-is-uptodate">
226 <sourcefiles basedir="src/Boo.NAnt.Tasks">
227 <include name="*.boo" />
228 </sourcefiles>
229 <targetfiles>
230 <include name="${build.dir}/Boo.NAnt.Tasks.dll" />
231 </targetfiles>
232 </uptodate>
234 <if test="${debug}">
235 <property name="debugflag" value="-debug"/>
236 </if>
237 <if test="${not debug}">
238 <property name="debugflag" value="-debug-"/>
239 </if>
241 <exec program="${build.dir}/booc.exe" useruntimeengine="true" unless="${Boo.NAnt.Tasks-is-uptodate}">
242 <arg value="-v" />
243 <arg value="-noconfig" />
244 <arg value="${debugflag}" />
245 <arg value="-out:${build.dir}/Boo.NAnt.Tasks.dll" />
246 <arg value="-target:library" />
247 <!--arg value="-keyfile:${keyfile.path}" /-->
248 <arg value="-lib:${nant::get-base-directory()}" />
249 <arg value="-r:NAnt.Core.dll" />
250 <arg value="-r:NAnt.DotNetTasks.dll" />
251 <arg value="src/Boo.NAnt.Tasks/UpdateAssemblyVersionTask.boo" />
252 <arg value="src/Boo.NAnt.Tasks/InsertLicenseTask.boo" />
253 <arg value="src/Boo.NAnt.Tasks/BoocTask.boo" />
254 <arg value="src/Boo.NAnt.Tasks/BooTask.boo" />
255 <arg value="src/Boo.NAnt.Tasks/AbstractBooTask.boo" />
256 </exec>
258 <loadtasks assembly="${build.dir}/Boo.NAnt.Tasks.dll" />
259 </target>
261 <target name="booc" depends="corecs">
262 <csc target="exe"
263 output="${build.dir}/booc.exe"
264 debug="${debug}"
265 optimize="${optimize}"
266 define="${csc.define}"
267 keyfile="${keyfile.path}">
268 <sources basedir="src/booc">
269 <include name="*.cs" />
270 </sources>
272 <references>
273 <include name="${build.dir}/Boo.Lang.dll" />
274 <include name="${build.dir}/Boo.Lang.Compiler.dll" />
275 <include name="${build.dir}/Boo.Lang.Parser.dll" />
276 </references>
277 </csc>
279 <if test="${not(platform::is-win32())}">
280 <copy file="extras/booc.in" tofile="${build.dir}/booc" inputencoding="ASCII">
281 <filterchain>
282 <replacestring from="@RUNTIME@" to="mono" />
283 <replacestring from="@prefix@" to="${install.prefix}" />
284 </filterchain>
285 </copy>
286 </if>
288 <copy todir="${build.dir}" file="src/booc/booc.rsp" />
290 <copy file="extras/template.config.in" tofile="${build.dir}/booc.exe.config">
291 <filterchain>
292 <replacestring from="@SUPPORTEDVERSIONS@"
293 to="${supported.runtimes}" />
294 </filterchain>
295 </copy>
297 <exec program='${ngen.exe}' if="${file::exists(ngen.exe)}" unless="${skip.ngen}">
298 <arg file='${build.dir}/Boo.Lang.dll' />
299 <arg file='${build.dir}/Boo.Lang.Compiler.dll' />
300 <arg file='${build.dir}/Boo.Lang.Extensions.dll' />
301 <arg file='${build.dir}/Boo.Lang.Parser.dll' />
302 <arg file='${build.dir}/booc.exe' />
303 </exec>
304 </target>
306 <target name="corecs" depends="Boo.Lang, Boo.Lang.Compiler, Boo.Lang.Parser">
307 </target>
309 <target name="core" depends="corecs, Boo.Lang.Extensions, Boo.NAnt.Tasks" />
311 <target name="update-bin" depends="all">
312 <mkdir dir="bin" />
313 <delete>
314 <fileset basedir="bin">
315 <include name="*.Tasks.dll" />
316 <include name="*.targets" />
317 <include name="*.config" />
318 <include name="*.exe" />
319 </fileset>
320 </delete>
321 <copy todir="bin">
322 <fileset basedir="${build.dir}">
323 <include name="pt/Boo.Lang.resources.dll" />
324 <include name="Boo.*.dll" />
325 <include name="boo*.exe" />
326 <include name="boo*.rsp" />
327 <include name="*.config" />
328 <include name="*.targets" />
329 </fileset>
330 </copy>
331 </target>
333 <target name="Boo.Microsoft.Build.Tasks" depends="core">
334 <call target="msbuild" if="${'net-2.0' == framework::get-target-framework()}"/>
335 <!-- MSBuild doesn't appear to be supported in mono-2.0 -->
336 </target>
338 <target name="msbuild">
339 <booc target="library"
340 output="${build.dir}/Boo.Microsoft.Build.Tasks.dll"
341 failonerror="false"
342 verbose="${verbose}"
343 debug="${debug}"
344 keyfile="${keyfile.path}">
345 <sources basedir="src/Boo.Microsoft.Build.Tasks">
346 <include name="**/*.boo" />
347 </sources>
348 <references basedir="${build.dir}">
349 <include name="Microsoft.Build.Utilities.dll" />
350 <include name="Microsoft.Build.Tasks.dll" />
351 <include name="Microsoft.Build.Framework.dll" />
352 </references>
353 </booc>
354 <copy todir="${build.dir}">
355 <fileset basedir="src/Boo.Microsoft.Build.Tasks">
356 <include name="Boo.Microsoft.Build.targets" />
357 </fileset>
358 </copy>
359 </target>
361 <target name="Boo.Lang.Useful" depends="core">
362 <uptodate property="useful-grammars-uptodate">
363 <sourcefiles basedir="src/Boo.Lang.Useful">
364 <include name="**/*.g" />
365 </sourcefiles>
366 <targetfiles basedir="src/Boo.Lang.Useful">
367 <include name="**/*Lexer.boo" />
368 </targetfiles>
369 </uptodate>
371 <if test="${not useful-grammars-uptodate}">
372 <exec program="${java}" failonerror="true">
373 <arg value="-cp" />
374 <arg file="${antlr.jar}" />
375 <arg value="antlr.Tool" />
376 <!-- <arg value="-traceParser" /> -->
377 <arg value="-o" />
378 <arg value="src/Boo.Lang.Useful/IO/Impl" />
379 <arg value="src/Boo.Lang.Useful/IO/PreProcessorExpressions.g" />
380 </exec>
381 </if>
383 <booc target="library"
384 output="${build.dir}/Boo.Lang.Useful.dll"
385 verbose="${verbose}"
386 debug="${debug}"
387 keyfile="${keyfile.path}">
388 <sources basedir="src/Boo.Lang.Useful">
389 <include name="**/*.boo" />
390 </sources>
391 <references basedir="${build.dir}">
392 <include name="Boo.Lang.Parser.dll" />
393 <include name="Boo.Lang.Compiler.dll" />
394 </references>
395 </booc>
396 </target>
398 <target name="Boo.Lang.CodeDom" depends="core">
399 <booc target="library"
400 output="${build.dir}/Boo.Lang.CodeDom.dll"
401 verbose="${verbose}"
402 debug="${debug}"
403 keyfile="${keyfile.path}">
404 <sources basedir="src/Boo.Lang.CodeDom">
405 <include name="**/*.boo" />
406 </sources>
407 <references basedir="${build.dir}">
408 <!--
409 <include name="System.Data.dll" />
410 <include name="System.Xml.dll" />
412 <include name="Boo.Lang.Compiler.dll" />
413 </references>
414 </booc>
415 </target>
417 <target name="Boo.Lang.Extensions" depends="corecs, Boo.NAnt.Tasks">
418 <uptodate property="skip.Boo.Lang.Extensions">
419 <sourcefiles basedir="src/Boo.Lang.Extensions">
420 <include name="**/*.boo" />
421 </sourcefiles>
422 <targetfiles basedir="${build.dir}">
423 <include name="Boo.Lang.Extensions.*" />
424 </targetfiles>
425 </uptodate>
426 <delete file="${build.dir}/Boo.Lang.Extensions.dll" failonerror="false" unless="${skip.Boo.Lang.Extensions}"/>
427 <booc target="library"
428 output="${build.dir}/Boo.Lang.Extensions.dll"
429 failonerror="true"
430 verbose="${verbose}"
431 debug="${debug}"
432 unless="${skip.Boo.Lang.Extensions}"
433 keyfile="${keyfile.path}">
434 <sources basedir="src/Boo.Lang.Extensions">
435 <include name="**/*.boo" />
436 </sources>
437 <references basedir="${build.dir}">
438 <include name="Boo.Lang.Compiler.dll" />
439 </references>
440 </booc>
441 </target>
443 <target name="Boo.Lang.Compiler" depends="Boo.Lang, Boo.Lang.Ast">
444 <csc target="library"
445 output="${build.dir}/Boo.Lang.Compiler.dll"
446 debug="${debug}"
447 optimize="${optimize}"
448 define="${csc.define}"
449 keyfile="${keyfile.path}">
451 <sources basedir="src/Boo.Lang.Compiler">
452 <include name="**/*.cs" />
453 </sources>
455 <references>
456 <include name="${build.dir}/Boo.Lang.dll" />
457 <!--include name="${build.dir}/Boo.Lang.Ast.dll" /-->
458 </references>
459 </csc>
460 </target>
462 <target name="Boo.Lang.Ast" depends="Boo.Lang, generate-ast">
463 <!--csc
464 target="library"
465 output="${build.dir}/Boo.Lang.Ast.dll"
466 debug="${debug}"
467 optimize="${optimize}"
468 define="${csc.define}">
470 <sources basedir="src/Boo.Lang.Ast">
471 <include name="**/*.cs" />
472 </sources>
474 <references>
475 <include name="${build.dir}/Boo.Lang.dll" />
476 </references>
477 </csc-->
478 </target>
480 <target name="Boo.Lang" depends="resources">
481 <csc
482 target="library"
483 output="${build.dir}/Boo.Lang.dll"
484 debug="${debug}"
485 optimize="${optimize}"
486 if="${string::starts-with(framework::get-target-framework(), 'net-')}"
487 define="${csc.define}"
488 noconfig="${csc.noconfig}">
490 <sources basedir="src/Boo.Lang">
491 <include name="**/*.cs" />
492 </sources>
494 <resources basedir="${build.dir}">
495 <include name="strings.resources" />
496 </resources>
497 <resources basedir="${build.dir}/pt">
498 <include name="strings.pt.resources" />
499 </resources>
500 <resources basedir="${build.dir}/it">
501 <include name="strings.it.resources" />
502 </resources>
503 </csc>
505 <csc
506 target="library"
507 output="${build.dir}/Boo.Lang.dll"
508 debug="${debug}"
509 optimize="${optimize}"
510 unless="${string::starts-with(framework::get-target-framework(), 'net-')}"
511 define="${csc.define}"
512 noconfig="${csc.noconfig}">
514 <sources basedir="src/Boo.Lang">
515 <include name="**/*.cs" />
516 </sources>
518 <resources basedir="${build.dir}">
519 <include name="strings.resources" />
520 </resources>
521 </csc>
522 </target>
524 <target name="boo-pkgconfig">
525 <copy file="extras/boo.pc.in" tofile="${build.dir}/boo.pc" if="${not(platform::is-win32())}" inputencoding="ASCII">
526 <filterchain>
527 <replacestring from="@prefix@" to="${install.prefix}" />
528 <replacestring from="@VERSION@" to="${boo.version}" />
529 </filterchain>
530 </copy>
531 </target>
533 <target name="install" depends="booc, booish, booi">
534 <call target="install-win32" if="${platform::is-win32()}"/>
535 <call target="install-linux" if="${not(platform::is-win32())}"/>
536 </target>
538 <target name="install-linux" depends="booc, booish, booi">
539 <!--
540 Use pkg-config to find the proper locations for several
541 key files for mime detection, etc
544 <property name="sharedmime.prefix" value="${pkg-config::get-variable('shared-mime-info','prefix')}" />
545 <property name="fakeroot.sharedmime" value="${install.destdir}/${sharedmime.prefix}" />
546 <property name="gsv.prefix" value="${pkg-config::get-variable('gtksourceview-1.0','prefix')}" />
547 <property name="fakeroot.gsv" value="${install.destdir}/${gsv.prefix}" />
549 <mkdir dir="${fakeroot.boolib}"/>
550 <mkdir dir="${fakeroot.bindir}"/>
552 <copy todir="${fakeroot.boolib}">
553 <fileset basedir="${build.dir}">
554 <include name="*.exe"/>
555 <include name="*.rsp"/>
556 <include name="*.config"/>
557 <include name="*.targets"/>
558 <include name="*.Tasks.dll" />
559 </fileset>
560 </copy>
562 <foreach item="File" property="filename">
563 <in>
564 <items>
565 <include name="${build.dir}/Boo.Lang*.dll" />
566 </items>
567 </in>
568 <do>
569 <exec program="gacutil" useruntimeengine="false" workingdir="${build.dir}">
570 <arg value="/i" />
571 <arg value="${path::get-file-name(filename)}" />
572 <arg value="/package" />
573 <arg value="boo" />
574 <arg value="/root" />
575 <arg value="${fakeroot.libdir}" />
576 </exec>
577 </do>
578 </foreach>
580 <copy todir="${fakeroot.boolib}/pt">
581 <fileset basedir="${build.dir}/pt">
582 <include name="*"/>
583 </fileset>
584 </copy>
586 <copy todir="${fakeroot.bindir}">
587 <fileset basedir="${build.dir}">
588 <include name="booc"/>
589 <include name="booish"/>
590 <include name="booi"/>
591 </fileset>
592 </copy>
594 <copy todir="${fakeroot.sharedmime}/share/mime-info">
595 <fileset basedir="extras">
596 <include name="boo.keys" />
597 <include name="boo.mime" />
598 </fileset>
599 </copy>
601 <copy file="extras/boo.lang" todir="${fakeroot.gsv}/share/gtksourceview-1.0/language-specs/" />
602 <copy file="${build.dir}/boo.pc" todir="${fakeroot.libdir}/pkgconfig/" />
603 <copy file="extras/boo-mime-info.xml" todir="${fakeroot.sharedmime}/share/mime/packages/" />
605 <exec program="chmod" commandline="+x ${fakeroot.bindir}/booc" />
606 <exec program="chmod" commandline="+x ${fakeroot.bindir}/booi" />
607 <exec program="chmod" commandline="+x ${fakeroot.bindir}/booish" />
608 </target>
610 <target name="install-win32" depends="all">
612 <fail unless="${property::exists('mono.prefix')}">
613 Please set the property 'mono.prefix' to point to the prefix of your
614 mono installation (example: c:\dotnet\mono-1.1.8).
615 </fail>
617 <copy todir="${path::combine(mono.prefix, 'lib/boo')}">
618 <fileset basedir="${build.dir}">
619 <include name="*.exe"/>
620 <include name="*.rsp"/>
621 <include name="*.config"/>
622 <include name="*.targets"/>
623 <include name="*.Tasks.dll" />
624 </fileset>
625 </copy>
627 <foreach item="File" property="filename">
628 <in>
629 <items>
630 <include name="${build.dir}/Boo.Lang*.dll" />
631 </items>
632 </in>
633 <do>
634 <exec program="${path::combine(mono.prefix, 'bin/gacutil.bat')}"
635 useruntimeengine="false" workingdir="${build.dir}">
636 <arg value="/i" />
637 <arg value="${path::get-file-name(filename)}" />
638 <arg value="/package" />
639 <arg value="boo" />
640 </exec>
641 </do>
642 </foreach>
644 </target>
646 <target name="uninstall">
647 <call target="uninstall-linux" if="${not(platform::is-win32())}"/>
648 <call target="uninstall-win32" if="${platform::is-win32()}"/>
649 </target>
651 <target name="uninstall-linux">
652 <!--
653 Use pkg-config to find the proper locations for several
654 key files for mime detection, etc
657 <property name="sharedmime.prefix" value="${pkg-config::get-variable('shared-mime-info','prefix')}" />
658 <property name="fakeroot.sharedmime" value="${install.destdir}/${sharedmime.prefix}" />
659 <property name="gsv.prefix" value="${pkg-config::get-variable('gtksourceview-1.0','prefix')}" />
660 <property name="fakeroot.gsv" value="${install.destdir}/${gsv.prefix}" />
662 <foreach item="File" property="filename">
663 <in>
664 <items>
665 <include name="bin/Boo.Lang*.dll" />
666 </items>
667 </in>
668 <do>
669 <exec program="gacutil" useruntimeengine="false">
670 <arg value="/u" />
671 <arg value="${path::get-file-name-without-extension(filename)}" />
672 <arg value="/package" />
673 <arg value="boo" />
674 </exec>
675 </do>
676 </foreach>
678 <delete dir="${fakeroot.boolib}" />
680 <delete file="${fakeroot.sharedmime}/share/mime-info/boo.keys" />
681 <delete file="${fakeroot.sharedmime}/share/mime-info/boo.mime" />
682 <delete file="${fakeroot.gsv}/share/gtksourceview-1.0/language-specs/boo.lang" />
683 <delete file="${fakeroot.libdir}/pkgconfig/boo.pc" />
684 <delete file="${fakeroot.sharedmime}/share/mime/packages/boo-mime-info.xml" />
685 <delete file="${fakeroot.bindir}/booi" />
686 <delete file="${fakeroot.bindir}/booc" />
687 <delete file="${fakeroot.bindir}/booish" />
688 </target>
690 <target name="uninstall-win32">
691 <exec program='${ngen.exe}' if="${file::exists(ngen.exe)}" unless="${skip.ngen}">
692 <arg value='/delete' />
693 <arg value='Boo.Lang' />
694 <arg value='Boo.Lang.Compiler' />
695 <arg value='Boo.Lang.Parser' />
696 <arg file='${build.dir}/booc.exe' />
697 </exec>
698 </target>
700 <target name="Boo.Lang.Parser" depends="Boo.Lang.Compiler, compile-grammar">
701 <csc target="library"
702 output="${build.dir}/Boo.Lang.Parser.dll"
703 debug="${debug}"
704 optimize="${optimize}"
705 define="${csc.define}"
706 keyfile="${keyfile.path}">
707 <sources basedir="src/Boo.Lang.Parser">
708 <include name="**/*.cs" />
709 </sources>
710 <references>
711 <include name="${build.dir}/Boo.Lang.dll" />
712 <include name="${build.dir}/Boo.Lang.Compiler.dll" />
713 </references>
714 <nowarn>
715 <warning number="618,219,162" />
716 </nowarn>
717 </csc>
718 </target>
720 <target name="insert-license" depends="core">
721 <insertLicense license="notice.txt">
722 <fileset basedir="src">
723 <include name="**/*.cs" />
724 <include name="**/*.boo" />
725 <exclude name="Boo.Lang.Parser/antlr/**" />
726 </fileset>
727 <fileset basedir="examples">
728 <include name="**/*.boo" />
729 </fileset>
730 </insertLicense>
731 </target>
733 <target name="update-stable-branch" depends="SVNUtil">
734 <boo src="scripts/update-stable-branch.boo">
735 <references basedir="${build.dir}">
736 <include name="SVNUtil.dll" />
737 </references>
738 </boo>
739 </target>
741 <target name="create-distro-tag" depends="SVNUtil">
742 <boo src="scripts/create-distro-tag.boo">
743 <references basedir="${build.dir}">
744 <include name="SVNUtil.dll" />
745 </references>
746 </boo>
747 </target>
749 <target name="SVNUtil" depends="core">
750 <booc target="library" output="${build.dir}/SVNUtil.dll">
751 <sources basedir="scripts">
752 <include name="SVNUtil.boo" />
753 </sources>
754 </booc>
755 </target>
757 <target name="upload-distro" depends="make-bin-dist">
758 <exec program="scp">
759 <arg value="-B" />
760 <arg file="${boo.distro.name}-bin.zip" />
761 <arg file="${boo.distro.name}-src.zip" />
762 <arg file="${boo.distro.name}-bin.tar.bz2" />
763 <arg file="${boo.distro.name}-src.tar.bz2" />
764 <arg file="${boo.distro.name}.tar.gz" />
765 <arg value="${distro-user}@beaver.codehaus.org:/home/projects/boo/dist/distributions/" />
766 </exec>
767 </target>
769 <target name="distro">
770 <call target="distro-win32" if="${platform::is-win32()}"/>
771 <call target="distro-linux" if="${not(platform::is-win32())}"/>
772 </target>
774 <!-- Deprecated, now that binaries are built for multiple frameworks. -->
775 <target name="distro-linux" depends="src-distro">
776 </target>
778 <!-- meant to be run on Windows with both .net 1.1 and .net 2.0 installed -->
779 <target name="distro-win32">
780 <fail unless="${nant.platform.win32}">
781 Use the make-bin-dist or install targets instead on non-win32 platforms.
782 </fail>
783 <delete dir="${distrobuild.dir}" if="${directory::exists(distrobuild.dir)}" />
784 <mkdir dir="${distrobuild.dir}"/>
786 <!-- We call nant externally so we can target multiple frameworks. -->
787 <exec program="${nant.location}/NAnt.exe">
788 <arg value="-t:net-2.0" />
789 <arg value="distro-net-2.0" />
790 </exec>
792 <!-- Here we actually build the zip files. -->
793 <call target="src-distro" />
794 </target>
796 <target name="distro-net-2.0">
797 <call target="rebuild" />
798 <call target="update-bin" />
799 </target>
801 <target name="prepare-bin-distro" depends="insert-license">
802 <property name="distro.dir" value="${build.dir}/${boo.distro.name}" />
804 <delete dir="${distro.dir}" if="${directory::exists(distro.dir)}" />
805 <mkdir dir="${distro.dir}" />
807 <copy todir="${distro.dir}">
808 <fileset>
809 <include name="readme.txt" />
810 <include name="license.txt" />
811 <include name="ast.model.boo" />
812 <include name="docs/**/*.boo" />
813 <include name="docs/**/*.build" />
814 <include name="docs/**/*.sxw" />
815 <include name="bin/**/*.dll" />
816 <include name="bin/**/*.exe" />
817 <include name="bin/**/*.rsp" />
818 <include name="bin/**/*.config" />
819 <include name="bin/**/*.targets" />
821 <include name="extras/**/*.boo" />
822 <include name="extras/**/*.cs" />
823 <include name="extras/**/*.png" />
824 <include name="extras/**/*.ico" />
825 <include name="extras/**/*.prjx" />
826 <include name="extras/**/*.xml" />
827 <include name="extras/**/*.build" />
828 <include name="extras/**/*.lang" />
829 <include name="extras/**/*.keys" />
830 <include name="extras/**/*.mime" />
831 <include name="extras/install-gtksourceview-mode" />
832 <include name="extras/SharpDevelop/**/*.xshd" />
833 <include name="extras/SharpDevelop/**/*.xft" />
834 <include name="extras/SharpDevelop/**/*.xpt" />
835 <include name="extras/SharpDevelop/**/*.txtres" />
836 <include name="extras/SharpDevelop/**/*.addin" />
838 <include name="examples/**/*.boo" />
839 <include name="examples/**/*.xml" />
840 <include name="examples/**/*.aspx" />
841 <include name="examples/**/*.build" />
842 <include name="examples/**/*.config" />
843 </fileset>
844 </copy>
845 </target>
847 <target name="bin-distro" depends="prepare-bin-distro">
848 <zip zipfile="${boo.distro.name}-bin.zip" ziplevel="9">
849 <fileset basedir="${distro.dir}">
850 <include name="**" />
851 </fileset>
852 </zip>
853 </target>
855 <target name="prepare-src-distro" depends="bin-distro">
856 <copy todir="${distro.dir}">
857 <fileset>
858 <include name="extras/*.in" />
859 <include name="default.build" />
860 <include name="notice.txt" />
861 <include name="scripts/*.boo" />
862 <include name="scripts/Templates/*.cs" />
863 <include name="lib/**/*.jar" />
864 <include name="configure.in.in" />
865 <include name="Makefile.am" />
866 <include name="bin/Makefile.am" />
867 <include name="extras/Makefile.am" />
869 <include name="${keyfile.path}" />
870 <include name="src/**/*.cs" />
871 <include name="src/**/*.boo" />
872 <include name="src/**/*.rsp" />
873 <include name="src/**/*.g" />
874 <include name="src/**/*.prjx" />
875 <include name="src/**/*.cmbx" />
876 <include name="src/**/*.targets" />
877 <include name="src/Boo.Lang/Resources/**/*.txt" />
879 <include name="tests/nunit.inc" />
880 <include name="tests/test.snk" />
881 <include name="tests/**/*.boo" />
882 <include name="tests/**/*.cs" />
883 <include name="tests/**/*.txt" />
884 <include name="tests/**/*.build" />
885 <include name="tests/**/*.prjx" />
886 </fileset>
887 </copy>
888 </target>
890 <target name="src-distro" depends="prepare-src-distro">
891 <zip zipfile="${boo.distro.name}-src.zip" ziplevel="9">
892 <fileset basedir="${distro.dir}">
893 <include name="**" />
894 </fileset>
895 </zip>
897 <tar destfile="${boo.distro.name}-src.tar.bz2" compression="BZip2">
898 <fileset basedir="${build.dir}">
899 <include name="${boo.distro.name}/**/*"/>
900 </fileset>
901 </tar>
902 </target>
904 <target name="make-bin-dist">
905 <copy file="configure.in.in" tofile="configure.in" inputencoding="ASCII">
906 <filterchain>
907 <replacestring from="VERSION" to="${boo.version}" />
908 </filterchain>
909 </copy>
911 <!-- Needed to keep automake from freaking -->
912 <touch file="NEWS"/>
913 <touch file="AUTHORS"/>
914 <touch file="ChangeLog"/>
915 <touch file="README"/>
917 <!-- "./autogen.sh", effectively -->
918 <exec program="aclocal" useruntimeengine="false" />
919 <exec program="autoconf" useruntimeengine="false" />
920 <exec program="automake" useruntimeengine="false">
921 <arg value="--add-missing" />
922 </exec>
924 <exec program="./configure" useruntimeengine="false" />
926 <exec program="make" useruntimeengine="false">
927 <arg value="dist" />
928 </exec>
930 <exec program="make" useruntimeengine="false">
931 <arg value="distclean" />
932 </exec>
934 <!-- Clean up all the crap autotools spits out everywhere -->
935 <delete>
936 <fileset>
937 <include name="NEWS" />
938 <include name="AUTHORS" />
939 <include name="ChangeLog" />
940 <include name="README" />
941 <include name="COPYING" />
942 <include name="INSTALL" />
943 <include name="**/Makefile.in" />
944 <exclude name="lib/**/*.*" />
945 <include name="configure" />
946 <include name="autom4te.cache/*" />
947 <include name="autom4te.cache" />
948 <include name="aclocal.m4" />
949 <include name="install-sh" />
950 <include name="missing" />
951 <include name="configure.in" />
952 </fileset>
953 </delete>
954 </target>
956 <target name="resources" depends="init">
958 <resgen
959 input="src/Boo.Lang/Resources/strings.txt"
960 output="${build.dir}/strings.resources" />
962 <property name="locale" value="pt" />
963 <call target="build-resource" />
965 <property name="locale" value="it" />
966 <call target="build-resource" />
968 </target>
970 <target name="build-resource">
972 <mkdir dir="${build.dir}/${locale}" />
973 <resgen
974 input="src/Boo.Lang/Resources/${locale}/strings.txt"
975 output="${build.dir}/${locale}/strings.${locale}.resources" />
977 </target>
979 <target name="compile-grammar" depends="init" unless="${skip.antlr}">
981 <uptodate property="parser-is-uptodate">
982 <sourcefiles basedir="src/Boo.Lang.Parser">
983 <include name="boo.g" />
984 <include name="booel.g" />
985 <include name="wsaboo.g" />
986 <include name="wsabooel.g" />
987 </sourcefiles>
988 <targetfiles basedir="src/Boo.Lang.Parser">
989 <include name="BooParserBase.cs" />
990 <include name="BooExpressionLexer.cs" />
991 <include name="WSABooParserBase.cs" />
992 <include name="WSABooExpressionLexer.cs" />
993 </targetfiles>
994 </uptodate>
996 <if test="${not parser-is-uptodate}">
998 <delete>
999 <fileset basedir="src/Boo.Lang.Parser">
1000 <include name="*TokenTypes.*" />
1001 </fileset>
1002 </delete>
1004 <exec program="${java}" failonerror="true">
1005 <arg value="-cp" />
1006 <arg file="${antlr.jar}" />
1007 <arg value="antlr.Tool" />
1008 <arg value="-o" />
1009 <arg value="src/Boo.Lang.Parser/" />
1010 <arg value="src/Boo.Lang.Parser/boo.g" />
1011 </exec>
1013 <exec program="${java}" failonerror="true">
1014 <arg value="-cp" />
1015 <arg file="${antlr.jar}" />
1016 <arg value="antlr.Tool" />
1017 <arg value="-o" />
1018 <arg value="src/Boo.Lang.Parser/" />
1019 <arg value="src/Boo.Lang.Parser/booel.g" />
1020 </exec>
1022 <exec program="${java}" failonerror="true">
1023 <arg value="-cp" />
1024 <arg file="${antlr.jar}" />
1025 <arg value="antlr.Tool" />
1026 <arg value="-o" />
1027 <arg value="src/Boo.Lang.Parser/" />
1028 <arg value="src/Boo.Lang.Parser/wsaboo.g" />
1029 </exec>
1031 <exec program="${java}" failonerror="true">
1032 <arg value="-cp" />
1033 <arg file="${antlr.jar}" />
1034 <arg value="antlr.Tool" />
1035 <arg value="-o" />
1036 <arg value="src/Boo.Lang.Parser/" />
1037 <arg value="src/Boo.Lang.Parser/wsabooel.g" />
1038 </exec>
1040 <touch file="src/Boo.Lang.Parser/BooParserBase.cs" />
1041 </if>
1042 </target>
1044 <target name="update-vs2005-env" unless="${skip.vs2005}">
1045 <exec program="bin/booi.exe" useruntimeengine="true">
1046 <arg value="scripts/update-vs2005-env.boo" />
1047 </exec>
1048 </target>
1050 <target name="generate-ast" depends="init" unless="${skip.ast}">
1052 <uptodate property="ast-is-uptodate">
1053 <sourcefiles>
1054 <include name="ast.model.boo" />
1055 <include name="scripts/astgen.boo" />
1056 <include name="scripts/Templates/*.cs" />
1057 </sourcefiles>
1058 <targetfiles>
1059 <include name="src/Boo.Lang.Compiler/Ast/Impl/CompileUnitImpl.cs" />
1060 </targetfiles>
1061 </uptodate>
1063 <if test="${not ast-is-uptodate}">
1064 <delete dir="src/Boo.Lang.Compiler/Ast/Impl"
1065 if="${directory::exists('src/Boo.Lang.Compiler/Ast/Impl')}" />
1066 <mkdir dir="src/Boo.Lang.Compiler/Ast/Impl" />
1067 <exec program="bin/booi.exe" useruntimeengine="true">
1068 <arg value="scripts/astgen.boo" />
1069 </exec>
1070 </if>
1071 </target>
1073 <target name="update-svn-revision-number" depends="SVNUtil, Boo.Lang.Useful">
1074 <boo>
1075 <references basedir="${build.dir}">
1076 <include name="SVNUtil.dll" />
1077 <include name="Boo.Lang.Useful.dll" />
1078 </references>
1080 import System.IO
1082 output = svn("info")
1083 revision = /Revision:\s+(\d+)/.Match(output).Groups[1].Value
1084 Project.Properties["boo.svn.revision"] = revision
1085 print Project.Properties["boo.version"]
1087 contents = File.ReadAllText("default.build")
1088 newContents = /property\s+name="boo.svn.revision"\s+value="\d*"/.Replace(
1089 contents,
1090 "property name=\"boo.svn.revision\" value=\"${revision}\"")
1091 File.WriteAllText("default.build", newContents) if contents != newContents
1092 </boo>
1093 </target>
1095 <target name="update-sharpdevelop" depends="all">
1096 <copy todir="${sharpdevelop.dir}/AddIns/AddIns/BackendBindings/BooBinding">
1097 <fileset basedir="${build.dir}">
1098 <include name="*.dll" />
1099 <include name="*.exe" />
1100 </fileset>
1101 </copy>
1102 </target>
1104 <target name="update-assembly-attributes" depends="core, update-svn-revision-number">
1105 <boo>
1106 import System.IO
1108 fname = "src/Boo.Lang/Builtins.cs"
1109 builtins = File.ReadAllText(fname)
1111 version = Project.Properties["boo.version"]
1112 newBuiltins = @/new System.Version\(".+"\)/.Replace(builtins, "new System.Version(\"${version}\")")
1113 if builtins != newBuiltins:
1114 print fname
1115 File.WriteAllText(fname, newBuiltins)
1116 </boo>
1118 <updateAssemblyVersion
1119 version="${boo.assembly.version}">
1120 <fileset basedir="src">
1121 <include name="**/AssemblyInfo.cs" />
1122 <include name="**/AssemblyInfo.boo" />
1123 </fileset>
1124 <fileset basedir="extras">
1125 <include name="**/AssemblyInfo.boo" />
1126 </fileset>
1127 </updateAssemblyVersion>
1129 <updateAssemblyVersion
1130 copyright="(C) 2003-2007 Rodrigo Barreto de Oliveira">
1131 <fileset basedir="src">
1132 <include name="**/AssemblyInfo.cs" />
1133 <include name="**/AssemblyInfo.boo" />
1134 </fileset>
1135 <fileset basedir="extras">
1136 <include name="**/AssemblyInfo.boo" />
1137 <exclude name="SharpDevelop/**/*.*" />
1138 </fileset>
1139 </updateAssemblyVersion>
1140 </target>
1142 <target name="rebuild" depends="clean">
1144 <touch file="ast.model.boo" />
1145 <touch file="src/Boo.Lang.Parser/boo.g" />
1146 <touch file="src/Boo.Lang.Parser/booel.g" />
1147 <mkdir dir="${build.dir}" />
1148 <call target="all" />
1149 </target>
1151 <target name="clean">
1152 <delete dir="${build.dir}" failonerror="false" />
1153 </target>
1155 <target name="init">
1156 <mkdir dir="${build.dir}" />
1157 </target>
1159 <target name="makedeb" depends="rebuild">
1160 <!-- force rebuild to make sure everything's ok and wrappers
1161 are sync'ed with current install.prefix
1163 <nant buildfile="extras/makedeb.build" />
1164 </target>
1166 </project>