1 <?xml version="1.0" encoding="UTF-8"?>
3 <project basedir="." default="jar" name="JRuby">
4 <description>JRuby is a pure Java implementation of a Ruby interpreter.</description>
6 <!-- First try to load machine-specific properties. -->
7 <property file="build.properties"/>
9 <!-- And then load the defaults. It seems backwards to set defaults AFTER
10 setting local overrides, but that's how Ant works. -->
11 <property file="default.build.properties"/>
13 <path id="build.classpath">
14 <fileset dir="${build.lib.dir}" includes="*.jar"/>
15 <fileset dir="${lib.dir}" includes="bsf.jar"/>
18 <!-- directory that contains emma.jar and emma_ant.jar: -->
19 <property name="emma.dir" value="${build.lib.dir}" />
21 <path id="emma.classpath">
22 <pathelement location="${emma.dir}/emma.jar" />
23 <pathelement location="${emma.dir}/emma_ant.jar" />
26 <patternset id="java.src.pattern">
27 <include name="**/*.java"/>
28 <exclude unless="bsf.present" name="org/jruby/javasupport/bsf/**/*.java"/>
29 <exclude unless="jdk1.4+" name="**/XmlAstMarshal.java"/>
30 <exclude unless="jdk1.4+" name="**/AstPersistenceDelegates.java"/>
33 <patternset id="ruby.src.pattern">
34 <include name="**/*.rb"/>
37 <patternset id="other.src.pattern">
38 <include name="**/*.properties"/>
41 <taskdef name="retro" classname="net.sourceforge.retroweaver.ant.RetroWeaverTask" classpathref="build.classpath"/>
43 <import file="netbeans-ant.xml" optional="true"/>
45 <target name="init" description="initialize the build">
46 <xmlproperty file="build-config.xml" keepRoot="false" collapseAttributes="true"/>
47 <tstamp><format property="build.date" pattern="yyyy-MM-dd"/></tstamp>
48 <property environment="env"/>
49 <property name="version.ruby" value="${version.ruby.major}.${version.ruby.minor}"/>
50 <!-- if ruby.home is not set, use env var -->
51 <condition property="ruby.home" value="${env.RUBY_HOME}">
52 <not><isset property="ruby.home"/></not>
56 <target name="prepare" depends="init"
57 description="Creates the directories needed for building">
58 <mkdir dir="${build.dir}"/>
59 <mkdir dir="${classes.dir}"/>
60 <mkdir dir="${jruby.classes.dir}"/>
61 <mkdir dir="${test.classes.dir}"/>
62 <mkdir dir="${test.results.dir}"/>
63 <mkdir dir="${html.test.results.dir}"/>
64 <mkdir dir="${docs.dir}"/>
65 <mkdir dir="${api.docs.dir}"/>
68 <target name="ragel" description="Standalone target that generates all our ragel based source files. Requires ragel and rlgen-java to be on the classpath">
69 <exec executable="ragel" output="__ragel_out">
71 <arg line="${src.dir}/org/jvyamlb/resolver_scanner.rl"/>
73 <exec executable="rlgen-java" input="__ragel_out">
74 <arg line="-o ${src.dir}/org/jvyamlb/ResolverScanner.java"/>
76 <delete file="__ragel_out" quiet="true"/>
79 <target name="check-for-optional-java4-packages"
80 description="check if specific libs and versions are avaiable"
82 <available property="jdk1.4+" classname="java.lang.CharSequence"/>
83 <available property="jdk1.5+" classname="java.lang.StringBuilder"/>
84 <available property="bsf.present" classname="org.apache.bsf.BSFManager"
85 classpathref="build.classpath"/>
86 <available property="junit.present" classname="junit.framework.TestCase"
87 classpathref="build.classpath"/>
88 <available property="cglib.present"
89 classname="net.sf.cglib.reflect.FastClass"
90 classpathref="build.classpath"/>
93 <target name="check-for-optional-packages" if="jdk1.5+"
94 description="check if specific libs and versions are avaiable"
95 depends="check-for-optional-java4-packages">
98 <target name="compile.tasks" depends="prepare"
99 description="Builds the Ant tasks that we need later on in the build">
100 <copy todir="${jruby.classes.dir}">
101 <fileset dir="${src.dir}">
102 <include name="**/*.rb"/>
105 <copy todir="${jruby.classes.dir}/builtin">
106 <fileset dir="${lib.dir}/ruby/site_ruby/1.8/builtin">
107 <include name="**/*.rb"/>
112 <format property="build.date" pattern="yyyy-MM-dd"/>
115 <copy todir="${jruby.classes.dir}" overwrite="true">
116 <fileset dir="${src.dir}">
117 <include name="**/*.properties"/>
120 <filter token="os.arch" value="${os.arch}"/>
121 <filter token="java.specification.version" value="${java.specification.version}"/>
122 <filter token="javac.version" value="${javac.version}"/>
123 <filter token="build.date" value="${build.date}"/>
128 <target name="compile-jruby" depends="compile.tasks, check-for-optional-packages">
129 <javac destdir="${jruby.classes.dir}" debug="true" source="${javac.version}" target="${javac.version}" deprecation="true" encoding="UTF-8">
130 <classpath refid="build.classpath"/>
131 <src path="${src.dir}"/>
132 <patternset refid="java.src.pattern"/>
136 <target name="compile" depends="compile-jruby"
137 description="Compile the source files for the project.">
140 <target name="generate-method-classes" depends="compile">
141 <touch file="${build.dir}/__empty.rb"/>
142 <!-- individual invokers -->
143 <java classname="org.jruby.Main" fork="true" failonerror="true">
144 <classpath refid="build.classpath"/>
145 <classpath path="${jruby.classes.dir}"/>
146 <sysproperty key="jruby.dump_invocations" value="${jruby.classes.dir}"/>
147 <arg value="-rjava"/>
148 <arg value="${build.dir}/__empty.rb"/>
150 <!-- indexed invokers -->
151 <java classname="org.jruby.Main" fork="true" failonerror="true">
152 <classpath refid="build.classpath"/>
153 <classpath path="${jruby.classes.dir}"/>
154 <sysproperty key="jruby.dump_invocations" value="${jruby.classes.dir}"/>
155 <sysproperty key="jruby.indexed.methods" value="true"/>
156 <arg value="-rjava"/>
157 <arg value="${build.dir}/__empty.rb"/>
159 <delete file="${build.dir}/__empty.rb" quiet="true"/>
162 <target name="jar-jruby" unless="jar-up-to-date">
163 <antcall target="generate-method-classes" inheritall="true"/>
164 <taskdef name="jarjar" classname="com.tonicsystems.jarjar.JarJarTask" classpath="${build.lib.dir}/jarjar-0.7.jar"/>
165 <jarjar destfile="${lib.dir}/jruby.jar">
166 <fileset dir="${jruby.classes.dir}">
167 <exclude name="org/jruby/util/ant/**/*.class"/>
169 <zipfileset src="${build.lib.dir}/asm-3.0.jar"/>
170 <zipfileset src="${build.lib.dir}/asm-commons-3.0.jar"/>
171 <zipfileset src="${build.lib.dir}/asm-util-3.0.jar"/>
172 <zipfileset src="${build.lib.dir}/asm-analysis-3.0.jar"/>
173 <zipfileset src="${build.lib.dir}/asm-tree-3.0.jar"/>
174 <zipfileset src="${build.lib.dir}/jline-0.9.91.jar"/>
175 <zipfileset src="${build.lib.dir}/joni.jar"/>
176 <zipfileset src="${build.lib.dir}/jna.jar"/>
177 <zipfileset src="${build.lib.dir}/joda-time-1.5.1.jar"/>
178 <rule pattern="org.objectweb.asm.**" result="jruby.objectweb.asm.@1"/>
180 <attribute name="Built-By" value="${user.name}"/>
181 <attribute name="Main-Class" value="org.jruby.Main"/>
186 <path id="lib.classpath">
187 <pathelement location="${build.lib.dir}/retroweaver-rt-2.0.jar"/>
188 <pathelement location="${build.lib.dir}/backport-util-concurrent.jar"/>
189 <pathelement location="/usr/java/j2sdk1.4.2_16/jre/lib/rt.jar" />
190 <pathelement location="${lib.dir}/bsf.jar" />
193 <target name="jar-1.4" depends="jar-jruby">
194 <copy file="${lib.dir}/jruby.jar" tofile="${lib.dir}/jruby1.5.jar"/>
195 <retro inputjar="${lib.dir}/jruby1.5.jar" outputjar="${lib.dir}/jruby.jar" target="1.4" failonerror="false" verify="true">
197 <path refid="lib.classpath"/>
198 <pathelement location="${lib.dir}/jruby.jar" />
201 <delete file="${lib.dir}/jruby1.5.jar"/>
204 <target name="jar-complete-1.4" depends="jar-complete">
205 <copy file="${lib.dir}/jruby-complete.jar" tofile="${lib.dir}/jruby-complete1.5.jar"/>
206 <retro inputjar="${lib.dir}/jruby-complete1.5.jar" outputjar="${lib.dir}/jruby-complete.jar" target="1.4" failonerror="false" verify="true">
208 <path refid="lib.classpath"/>
209 <pathelement location="${lib.dir}/jruby-complete.jar" />
212 <delete file="${lib.dir}/jruby-complete1.5.jar"/>
215 <target name="jar-complete" depends="generate-method-classes" description="Create the 'complete' JRuby jar. Pass 'mainclass' and 'filename' to adjust.">
216 <property name="mainclass" value="org.jruby.Main"/>
217 <property name="filename" value="jruby-complete.jar"/>
218 <taskdef name="jarjar" classname="com.tonicsystems.jarjar.JarJarTask" classpath="${build.lib.dir}/jarjar-0.7.jar"/>
219 <jarjar destfile="${lib.dir}/${filename}">
220 <fileset dir="${jruby.classes.dir}">
221 <exclude name="org/jruby/util/ant/**/*.class"/>
223 <fileset dir="${basedir}/lib/ruby/1.8">
224 <include name="**/*.rb"/>
226 <zipfileset src="${build.lib.dir}/asm-3.0.jar"/>
227 <zipfileset src="${build.lib.dir}/asm-commons-3.0.jar"/>
228 <zipfileset src="${build.lib.dir}/asm-util-3.0.jar"/>
229 <zipfileset src="${build.lib.dir}/asm-analysis-3.0.jar"/>
230 <zipfileset src="${build.lib.dir}/asm-tree-3.0.jar"/>
231 <zipfileset src="${build.lib.dir}/jline-0.9.91.jar"/>
232 <zipfileset src="${build.lib.dir}/joni.jar"/>
233 <zipfileset src="${build.lib.dir}/jna.jar"/>
234 <zipfileset src="${build.lib.dir}/joda-time-1.5.1.jar"/>
235 <rule pattern="org.objectweb.asm.**" result="jruby.objectweb.asm.@1"/>
236 <zipfileset dir="${basedir}" prefix="META-INF/jruby.home">
237 <include name="bin/*"/>
238 <include name="lib/ruby/gems/1.8/cache/sources*.gem"/>
239 <include name="lib/ruby/gems/1.8/gems/sources*/**/*"/>
240 <include name="lib/ruby/gems/1.8/specifications/sources*.gemspec"/>
241 <include name="lib/ruby/site_ruby/**/*"/>
244 <attribute name="Built-By" value="${user.name}"/>
245 <attribute name="Main-Class" value="${mainclass}"/>
251 <target name="jar-console" depends="generate-method-classes" description="Create the jruby graphical console jar">
252 <antcall target="jar-light">
253 <param name="mainclass" value="org.jruby.demo.IRBConsole"/>
254 <param name="filename" value="jruby-console.jar"/>
258 <target name="jar" depends="init" description="Create the jruby.jar file">
259 <antcall target="jar-jruby" inheritall="true"/>
262 <target name="compile-test" depends="jar" description="Compile the unit tests">
263 <javac destdir="${test.classes.dir}" deprecation="true" debug="true"
264 source="${javac.version}">
266 <path refid="build.classpath"/>
267 <pathelement path="${jruby.classes.dir}"/>
268 <pathelement path="${lib.dir}/jruby.jar"/>
270 <src path="${test.dir}"/>
271 <patternset refid="java.src.pattern"/>
275 <target name="copy-test-files" depends="compile-test"
276 description="Make tests fails available as resources">
277 <copy todir="${test.classes.dir}">
278 <fileset dir="${test.dir}" includes="org/**/*.rb"/>
282 <target name="install-gems">
283 <property name="jruby.home" value="${basedir}"/>
284 <java classname="org.jruby.Main" fork="true" maxmemory="${jruby.launch.memory}" failonerror="true">
285 <classpath refid="build.classpath"/>
286 <classpath path="${jruby.classes.dir}"/>
287 <sysproperty key="jruby.home" value="${jruby.home}"/>
288 <arg value="--command"/>
289 <arg value="maybe_install_gems"/>
292 <arg value="--env-shebang"/>
296 <target name="compile-stdlib" unless="test">
297 <copy todir="${build.dir}/stdlib">
298 <fileset dir="${basedir}/lib/ruby/1.8">
299 <include name="**/*.rb"/>
302 <java classname="org.jruby.Main" fork="true" maxmemory="${jruby.launch.memory}" failonerror="true" dir="${build.dir}/stdlib">
303 <classpath refid="build.classpath"/>
304 <classpath path="${jruby.classes.dir}"/>
305 <sysproperty key="jruby.home" value="${basedir}"/>
306 <sysproperty key="jruby.objectspace.enabled" value="true"/>
307 <jvmarg value="-ea"/>
312 <arg value="jrubyc"/>
317 <target name="emma" description="turns on EMMA instrumentation/reporting" >
318 <available property="emma.present"
319 classname="com.vladium.app.IAppVersion"
320 classpathref="emma.classpath"/>
321 <taskdef resource="emma_ant.properties" classpathref="emma.classpath" />
323 <property name="emma.enabled" value="true" />
325 <path id="classes_to_instrument" >
326 <pathelement location="${jruby.classes.dir}" />
330 <target name="instrument" if="emma.present">
331 <emma enabled="${emma.enabled}" >
332 <instr instrpathref="classes_to_instrument"
333 destdir="${jruby.instrumented.classes.dir}"
334 metadatafile="${test.results.dir}/metadata.emma"
339 <target name="coverage-report" if="emma.present">
340 <emma enabled="${emma.enabled}" >
341 <report sourcepath="${src.dir}" >
342 <fileset dir="${test.results.dir}" >
343 <include name="*.emma" />
345 <html outfile="${html.test.coverage.results.dir}/coverage.html" />
350 <target name="test-short" depends="
353 run-junit-interpreted,
354 run-junit-interpreted-1.9,
358 <target name="test" depends="
362 run-junit-interpreted,
363 run-junit-compiled-1.9,
364 run-junit-interpreted-1.9,
369 <target name="test-compiled" depends="copy-test-files,run-junit-compiled,run-junit-precompiled"/>
370 <target name="test-compiled-1.9" depends="copy-test-files,run-junit-compiled-1.9,run-junit-precompiled-1.9"/>
371 <target name="test-interpreted" depends="copy-test-files,run-junit-interpreted"/>
372 <target name="test-interpreted-1.9" depends="copy-test-files,run-junit-interpreted-1.9"/>
373 <target name="test-reflected" depends="copy-test-files,run-junit-reflected-compiled,run-junit-reflected-precompiled,run-junit-reflected-interpreted"/>
374 <target name="test-threadpool" depends="copy-test-files,run-junit-compiled-threadpool,run-junit-precompiled-threadpool,run-junit-interpreted-threadpool"/>
376 <target name="test-all" depends="
379 run-junit-interpreted,
381 run-junit-precompiled,
382 run-junit-interpreted-1.9,
383 run-junit-compiled-1.9,
384 run-junit-precompiled-1.9,
385 run-junit-reflected-interpreted,
386 run-junit-reflected-compiled,
387 run-junit-reflected-precompiled,
388 run-junit-compiled-threadpool,
389 run-junit-precompiled-threadpool,
390 run-junit-interpreted-threadpool,
391 run-junit-object-persistence,
396 <target name="run-junit-interpreted" description="runs junit tests">
397 <antcall target="run-junit-1.8" inheritall="false"/>
400 <target name="run-junit-interpreted-1.9" description="runs junit tests">
401 <antcall target="run-junit-1.9" inheritall="false"/>
404 <target name="run-junit-reflected-interpreted" description="runs junit tests">
405 <antcall target="run-junit-1.8" inheritall="false">
406 <param name="reflection " value="true"/>
410 <target name="run-junit-reflected-interpreted-1.9" description="runs junit tests">
411 <antcall target="run-junit-1.9" inheritall="false">
412 <param name="reflection " value="true"/>
416 <target name="run-junit-compiled" description="runs junit tests">
417 <antcall target="run-junit-1.8" inheritall="false">
418 <param name="compile.mode" value="JIT"/>
419 <param name="jit.threshold" value="0"/>
423 <target name="run-junit-compiled-1.9" description="runs junit tests">
424 <antcall target="run-junit-1.9" inheritall="false">
425 <param name="compile.mode" value="JIT"/>
426 <param name="jit.threshold" value="0"/>
430 <target name="run-junit-reflected-compiled" description="runs junit tests">
431 <antcall target="run-junit-1.8" inheritall="false">
432 <param name="compile.mode" value="JIT"/>
433 <param name="jit.threshold" value="0"/>
434 <param name="reflection" value="true"/>
438 <target name="run-junit-reflected-compiled-1.9" description="runs junit tests">
439 <antcall target="run-junit-1.9" inheritall="false">
440 <param name="compile.mode" value="JIT"/>
441 <param name="jit.threshold" value="0"/>
442 <param name="reflection" value="true"/>
446 <target name="run-junit-precompiled" description="runs junit tests">
447 <antcall target="run-junit-1.8" inheritall="false">
448 <param name="compile.mode" value="FORCE"/>
449 <param name="jit.threshold" value="0"/>
453 <target name="run-junit-precompiled-1.9" description="runs junit tests">
454 <antcall target="run-junit-1.9" inheritall="false">
455 <param name="compile.mode" value="FORCE"/>
456 <param name="jit.threshold" value="0"/>
460 <target name="run-junit-reflected-precompiled" description="runs junit tests">
461 <antcall target="run-junit-1.8" inheritall="false">
462 <param name="compile.mode" value="FORCE"/>
463 <param name="jit.threshold" value="0"/>
464 <param name="reflection" value="true"/>
468 <target name="run-junit-reflected-precompiled-1.9" description="runs junit tests">
469 <antcall target="run-junit-1.9" inheritall="false">
470 <param name="compile.mode" value="FORCE"/>
471 <param name="jit.threshold" value="0"/>
472 <param name="reflection" value="true"/>
476 <target name="run-junit-threadpool" depends="run-junit-interpreted-threadpool,run-junit-compiled-threadpool"/>
478 <target name="run-junit-interpreted-threadpool" description="runs junit tests">
479 <antcall target="run-junit-1.8" inheritall="false">
480 <param name="thread.pooling" value="true"/>
484 <target name="run-junit-compiled-threadpool" description="runs junit tests">
485 <antcall target="run-junit-1.8" inheritall="false">
486 <param name="compile.mode" value="JIT"/>
487 <param name="jit.threshold" value="0"/>
488 <param name="thread.pooling" value="true"/>
492 <target name="run-junit-precompiled-threadpool" description="runs junit tests">
493 <antcall target="run-junit-1.8" inheritall="false">
494 <param name="compile.mode" value="FORCE"/>
495 <param name="jit.threshold" value="0"/>
496 <param name="thread.pooling" value="true"/>
500 <path id="test.class.path">
501 <pathelement location="${jruby.instrumented.classes.dir}" />
502 <path refid="build.classpath"/>
503 <pathelement path="${java.class.path}"/>
504 <pathelement path="${lib.dir}/jruby.jar"/>
505 <pathelement location="${test.classes.dir}"/>
506 <pathelement path="${test.dir}/requireTest.jar"/>
507 <pathelement location="${test.dir}"/>
510 <target name="run-junit-1.8" description="runs junit tests for 1.8 functionality">
511 <!-- set up properties that haven't been assigned -->
512 <property name="compile.mode" value="OFF"/>
513 <property name="jit.threshold" value="20"/>
514 <property name="jit.max" value="-1"/>
515 <property name="objectspace.enabled" value="true"/>
516 <property name="thread.pooling" value="false"/>
517 <property name="reflection" value="false"/>
518 <echo message="compile=${compile.mode}, jit.threshold=${jit.threshold}, jit.max=${jit.max}, objectspace=${objectspace.enabled} threadpool=${thread.pooling} reflection=${reflection}"/>
520 <taskdef name="junit" classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTask" classpath="${build.lib.dir}/junit.jar"/>
521 <junit fork="yes" forkMode="once" haltonfailure="true" dir="${basedir}" maxmemory="${jruby.test.memory}" showoutput="true" timeout="600000">
522 <classpath refid="test.class.path"/>
524 <sysproperty key="java.awt.headless" value="true"/>
525 <sysproperty key="jruby.base" value="${basedir}"/>
526 <sysproperty key="jruby.home" value="${basedir}"/>
527 <sysproperty key="jruby.lib" value="${lib.dir}"/>
528 <sysproperty key="jruby.compile.mode" value="${compile.mode}"/>
529 <sysproperty key="jruby.jit.threshold" value="${jit.threshold}"/>
530 <sysproperty key="jruby.jit.max" value="${jit.max}"/>
531 <sysproperty key="jruby.objectspace.enabled" value="${objectspace.enabled}"/>
532 <sysproperty key="jruby.thread.pooling" value="${thread.pooling}"/>
533 <sysproperty key="jruby.reflection" value="${reflection}"/>
534 <sysproperty key="jruby.jit.logging.verbose" value="true"/>
535 <sysproperty key="emma.coverage.out.file" value="${test.results.dir}/coverage.emma" />
536 <sysproperty key="emma.coverage.out.merge" value="true" />
538 <jvmarg value="-ea"/>
540 <formatter type="xml"/>
541 <formatter type="brief" usefile="false" />
543 <test name="${test}" if="test"/>
544 <test name="org.jruby.test.MainTestSuite" todir="${test.results.dir}" unless="test"/>
545 <test name="org.jruby.test.ScriptTestSuite" todir="${test.results.dir}" unless="test"/>
546 <test name="org.jruby.test.BFTSTestSuite" todir="${test.results.dir}" unless="test"/>
547 <test name="org.jruby.test.JRubyTestSuite" todir="${test.results.dir}" unless="test"/>
548 <test name="org.jruby.test.MRITestSuite" todir="${test.results.dir}" unless="test"/>
549 <test name="org.jruby.test.RubiconTestSuite" todir="${test.results.dir}" unless="test"/>
550 <test name="org.jruby.test.RubyTestTestSuite" todir="${test.results.dir}" unless="test"/>
551 <test name="org.jvyamlb.YAMLLoadTest" todir="${test.results.dir}" unless="test"/>
552 <test name="org.jvyamlb.YAMLDumpTest" todir="${test.results.dir}" unless="test"/>
555 <junitreport todir="${test.results.dir}">
556 <fileset dir="${test.results.dir}" includes="TEST-*.xml"/>
557 <report format="frames" todir="${html.test.results.dir}"/>
561 <target name="run-junit-1.9" description="runs junit tests">
562 <!-- set up properties that haven't been assigned -->
563 <property name="compile.mode" value="OFF"/>
564 <property name="jit.threshold" value="20"/>
565 <property name="jit.max" value="-1"/>
566 <property name="objectspace.enabled" value="false"/>
567 <property name="thread.pooling" value="false"/>
568 <property name="reflection" value="false"/>
569 <echo message="compile=${compile.mode}, jit.threshold=${jit.threshold}, jit.max=${jit.max}, objectspace=${objectspace.enabled} threadpool=${thread.pooling} reflection=${reflection}"/>
571 <taskdef name="junit" classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTask" classpath="${build.lib.dir}/junit.jar"/>
572 <junit fork="yes" forkMode="once" haltonfailure="true" dir="${basedir}" maxmemory="${jruby.test.memory}" showoutput="true" timeout="600000">
573 <classpath refid="test.class.path"/>
575 <sysproperty key="java.awt.headless" value="true"/>
576 <sysproperty key="jruby.base" value="${basedir}"/>
577 <sysproperty key="jruby.home" value="${basedir}"/>
578 <sysproperty key="jruby.lib" value="${lib.dir}"/>
579 <sysproperty key="jruby.compile.mode" value="${compile.mode}"/>
580 <sysproperty key="jruby.jit.threshold" value="${jit.threshold}"/>
581 <sysproperty key="jruby.jit.max" value="${jit.max}"/>
582 <sysproperty key="jruby.objectspace.enabled" value="${objectspace.enabled}"/>
583 <sysproperty key="jruby.thread.pooling" value="${thread.pooling}"/>
584 <sysproperty key="jruby.reflection" value="${reflection}"/>
585 <sysproperty key="jruby.compat.version" value="ruby1_9"/>
586 <sysproperty key="jruby.jit.logging.verbose" value="true"/>
587 <sysproperty key="emma.coverage.out.file" value="${test.results.dir}/coverage.emma" />
588 <sysproperty key="emma.coverage.out.merge" value="true" />
590 <jvmarg value="-ea"/>
592 <formatter type="xml"/>
593 <formatter type="brief" usefile="false"/>
595 <test name="${test}" if="test"/>
596 <test name="org.jruby.test.Ruby1_9TestSuite" todir="${test.results.dir}" unless="test"/>
599 <junitreport todir="${test.results.dir}">
600 <fileset dir="${test.results.dir}" includes="TEST-*.xml"/>
601 <report format="frames" todir="${html.test.results.dir}"/>
605 <target name="run-junit-object-persistence" description="runs junit tests for object persistence support">
606 <!-- set up properties that haven't been assigned -->
607 <property name="compile.mode" value="OFF"/>
608 <property name="jit.threshold" value="20"/>
609 <property name="objectspace.enabled" value="false"/>
610 <property name="thread.pooling" value="false"/>
611 <property name="reflection" value="false"/>
612 <echo message="compile=${compile.mode}, threshold=${jit.threshold}, objectspace=${objectspace.enabled} threadpool=${thread.pooling} reflection=${reflection}"/>
614 <taskdef name="junit" classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTask" classpath="${build.lib.dir}/junit.jar"/>
615 <junit fork="yes" forkMode="once" haltonfailure="true" dir="${basedir}" maxmemory="${jruby.test.memory}" showoutput="true" timeout="600000">
616 <classpath refid="test.class.path"/>
618 <sysproperty key="java.awt.headless" value="true"/>
619 <sysproperty key="jruby.base" value="${basedir}"/>
620 <sysproperty key="jruby.home" value="${basedir}"/>
621 <sysproperty key="jruby.lib" value="${lib.dir}"/>
622 <sysproperty key="jruby.runtime.threadlocal" value="true"/>
623 <sysproperty key="emma.coverage.out.file" value="${test.results.dir}/coverage.emma" />
624 <sysproperty key="emma.coverage.out.merge" value="true" />
626 <jvmarg value="-ea"/>
628 <formatter type="xml"/>
629 <formatter type="brief" usefile="false"/>
631 <test name="${test}" if="test"/>
632 <test name="org.jruby.test.ObjectPersistenceTestSuite" todir="${test.results.dir}" unless="test"/>
635 <junitreport todir="${test.results.dir}">
636 <fileset dir="${test.results.dir}" includes="TEST-*.xml"/>
637 <report format="frames" todir="${html.test.results.dir}"/>
641 <target name="spec" depends="fetch-specs, run-specs"/>
643 <target name="spec-all" depends="fetch-specs, run-specs-all"/>
645 <target name="fetch-specs">
646 <condition property="rubinius-repo-exists">
647 <available file="${build.dir}/rubinius"/>
650 <antcall target="do-fetch-specs"/>
651 <antcall target="do-update-specs"/>
654 <target name="do-fetch-specs" unless="rubinius-repo-exists">
655 <exec dir="${build.dir}" executable="git">
657 <arg value="--depth"/><arg value="1"/>
658 <arg value="git://git.rubini.us/code"/>
659 <arg value="rubinius"/>
663 <target name="do-update-specs" if="rubinius-repo-exists">
664 <exec dir="${build.dir}/rubinius" executable="git">
669 <target name="clear-specs">
670 <delete dir="${build.dir}/rubinius"/>
673 <target name="run-specs">
674 <antcall target="run-specs-precompiled"/>
675 <antcall target="run-specs-compiled"/>
676 <antcall target="run-specs-interpreted"/>
679 <target name="run-specs-all">
680 <antcall target="run-specs-all-precompiled"/>
683 <target name="run-specs-compiled">
684 <antcall target="_run_specs_internal_" inheritall="false">
685 <param name="compile.mode" value="JIT"/>
686 <param name="jit.threshold" value="0"/>
687 <param name="SPEC" value="${working.rubinius.specs}"/>
691 <target name="run-specs-precompiled">
692 <antcall target="_run_specs_internal_" inheritall="false">
693 <param name="compile.mode" value="FORCE"/>
694 <param name="jit.threshold" value="0"/>
695 <param name="SPEC" value="${working.rubinius.specs}"/>
699 <target name="run-specs-all-precompiled">
700 <antcall target="_run_specs_all_internal_" inheritall="false">
701 <param name="compile.mode" value="FORCE"/>
702 <param name="jit.threshold" value="0"/>
703 <param name="SPEC" value="${working.rubinius.specs}"/>
707 <target name="run-specs-interpreted">
708 <antcall target="_run_specs_internal_" inheritall="false">
709 <param name="compile.mode" value="OFF"/>
710 <param name="jit.threshold" value="0"/>
711 <param name="SPEC" value="${working.rubinius.specs}"/>
715 <target name="update-excludes">
716 <java classname="org.jruby.Main" fork="true" maxmemory="${jruby.launch.memory}" failonerror="false" dir="${build.dir}/rubinius">
717 <classpath refid="build.classpath"/>
718 <classpath path="${jruby.classes.dir}"/>
719 <sysproperty key="jruby.home" value="${basedir}"/>
720 <sysproperty key="jruby.launch.inproc" value="false"/>
722 <arg value="bin/ci"/>
723 <arg value="-t"/><arg value="${basedir}/bin/jruby"/>
725 <arg value="-E"/><arg value="${basedir}/test/spec_excludes"/>
726 <arg value="spec/ruby/1.8"/>
730 <target name="_run_specs_internal_">
731 <!-- set up properties that haven't been assigned -->
732 <property name="compile.mode" value="OFF"/>
733 <property name="jit.threshold" value="20"/>
734 <property name="jit.max" value="-1"/>
735 <property name="objectspace.enabled" value="true"/>
736 <property name="thread.pooling" value="false"/>
737 <property name="reflection" value="false"/>
738 <echo message="compile=${compile.mode}, threshold=${jit.threshold}, objectspace=${objectspace.enabled} threadpool=${thread.pooling} reflection=${reflection}"/>
740 <java classname="org.jruby.Main" fork="true" maxmemory="${jruby.launch.memory}" failonerror="true" dir="${build.dir}/rubinius">
741 <classpath refid="build.classpath"/>
742 <classpath path="${jruby.classes.dir}"/>
744 <jvmarg value="-ea"/>
746 <sysproperty key="jruby.home" value="${basedir}"/>
747 <sysproperty key="jruby.launch.inproc" value="false"/>
749 <!-- properties tweaked for individual runs -->
750 <sysproperty key="jruby.compile.mode" value="${compile.mode}"/>
751 <sysproperty key="jruby.jit.threshold" value="${jit.threshold}"/>
752 <sysproperty key="jruby.jit.max" value="${jit.max}"/>
753 <sysproperty key="jruby.objectspace.enabled" value="${objectspace.enabled}"/>
754 <sysproperty key="jruby.thread.pooling" value="${thread.pooling}"/>
755 <sysproperty key="jruby.reflection" value="${reflection}"/>
756 <sysproperty key="jruby.compat.version" value="ruby1_8"/>
758 <arg value="bin/ci"/>
759 <arg value="-t"/><arg value="${basedir}/bin/jruby"/>
760 <arg value="-f"/><arg value="m"/>
761 <arg value="-E"/><arg value="${basedir}/test/spec_excludes"/>
762 <arg value="spec/ruby/1.8"/>
766 <target name="_run_specs_all_internal_">
767 <!-- set up properties that haven't been assigned -->
768 <property name="compile.mode" value="OFF"/>
769 <property name="jit.threshold" value="20"/>
770 <property name="jit.max" value="-1"/>
771 <property name="objectspace.enabled" value="true"/>
772 <property name="thread.pooling" value="false"/>
773 <property name="reflection" value="false"/>
774 <echo message="compile=${compile.mode}, threshold=${jit.threshold}, objectspace=${objectspace.enabled} threadpool=${thread.pooling} reflection=${reflection}"/>
776 <java classname="org.jruby.Main" fork="true" maxmemory="${jruby.launch.memory}" failonerror="true" dir="${build.dir}/rubinius">
777 <classpath refid="build.classpath"/>
778 <classpath path="${jruby.classes.dir}"/>
780 <jvmarg value="-ea"/>
782 <sysproperty key="jruby.home" value="${basedir}"/>
783 <sysproperty key="jruby.launch.inproc" value="false"/>
785 <!-- properties tweaked for individual runs -->
786 <sysproperty key="jruby.compile.mode" value="${compile.mode}"/>
787 <sysproperty key="jruby.jit.threshold" value="${jit.threshold}"/>
788 <sysproperty key="jruby.jit.max" value="${jit.max}"/>
789 <sysproperty key="jruby.objectspace.enabled" value="${objectspace.enabled}"/>
790 <sysproperty key="jruby.thread.pooling" value="${thread.pooling}"/>
791 <sysproperty key="jruby.reflection" value="${reflection}"/>
792 <sysproperty key="jruby.compat.version" value="ruby1_8"/>
794 <arg value="bin/mspec"/>
795 <arg value="-t"/><arg value="${basedir}/bin/jruby"/>
797 <arg value="spec/ruby/1.8"/>
801 <target name="create-apidocs" depends="prepare"
802 description="Creates the Java API docs">
803 <javadoc destdir="${api.docs.dir}" author="true" version="true" use="true"
804 windowtitle="JRuby API" source="${javac.version}" useexternalfile="true">
805 <fileset dir="${src.dir}">
806 <include name="**/*.java"/>
808 <fileset dir="${test.dir}">
809 <include name="**/*.java"/>
811 <doctitle><![CDATA[<h1>JRuby</h1>]]></doctitle>
812 <bottom><![CDATA[<i>Copyright © 2002-2007 JRuby Team. All Rights Reserved.</i>]]></bottom>
816 <patternset id="dist.bindir.files">
817 <include name="bin/*jruby*"/>
818 <include name="bin/*gem*"/>
819 <include name="bin/*jirb*"/>
820 <include name="bin/generate_yaml_index.rb"/>
821 <include name="bin/testrb"/>
824 <patternset id="dist.lib.files">
825 <include name="lib/ruby/1.8/**"/>
826 <include name="lib/ruby/site_ruby/1.8/**"/>
827 <include name="lib/ruby/gems/1.8/specifications/sources-0.0.1.gemspec"/>
828 <include name="lib/ruby/gems/1.8/cache/sources-0.0.1.gem"/>
829 <include name="lib/ruby/gems/1.8/gems/sources-0.0.1/**"/>
832 <patternset id="dist.files">
833 <include name="lib/*"/>
834 <include name="samples/**"/>
835 <include name="docs/**"/>
836 <include name="COPYING*"/>
837 <include name="README"/>
838 <exclude name="lib/ruby/**"/>
841 <patternset id="dist.bin.files">
842 <patternset refid="dist.files"/>
843 <exclude name="lib/emma.jar"/>
844 <exclude name="lib/emma_ant.jar"/>
845 <exclude name="lib/junit.jar"/>
846 <exclude name="lib/jarjar-0.7.jar"/>
849 <patternset id="dist.src.files">
850 <patternset refid="dist.files"/>
851 <include name="src/**"/>
852 <include name="test/**"/>
853 <include name="build_lib/**"/>
854 <include name="build.xml"/>
855 <include name="build-config.xml"/>
856 <include name="nbproject/*"/>
857 <include name=".project"/>
858 <include name=".classpath"/>
859 <include name="default.build.properties"/>
860 <exclude name="lib/jruby.jar"/>
863 <target name="dist-bin" depends="jar">
866 <fileset dir="${basedir}">
867 <patternset refid="dist.bindir.files"/>
868 <patternset refid="dist.lib.files"/>
871 <antcall target="install-gems">
872 <param name="jruby.home" value="dist"/>
874 <tar destfile="jruby-bin-${version.jruby}.tar.gz" compression="gzip">
875 <tarfileset dir="dist" mode="755" prefix="jruby-${version.jruby}">
876 <include name="bin/**"/>
878 <tarfileset dir="dist" prefix="jruby-${version.jruby}">
879 <include name="lib/**"/>
881 <tarfileset dir="${basedir}" prefix="jruby-${version.jruby}">
882 <patternset refid="dist.bin.files"/>
885 <zip destfile="jruby-bin-${version.jruby}.zip">
886 <zipfileset dir="dist" filemode="755" prefix="jruby-${version.jruby}">
887 <include name="bin/**"/>
889 <zipfileset dir="dist" prefix="jruby-${version.jruby}">
890 <include name="lib/**"/>
892 <zipfileset dir="${basedir}" prefix="jruby-${version.jruby}">
893 <patternset refid="dist.bin.files"/>
898 <target name="dist-src" depends="jar">
901 <fileset dir="${basedir}">
902 <patternset refid="dist.bindir.files"/>
903 <patternset refid="dist.lib.files"/>
906 <antcall target="install-gems">
907 <param name="jruby.home" value="dist"/>
909 <tar destfile="jruby-src-${version.jruby}.tar.gz" compression="gzip">
910 <tarfileset dir="dist" mode="755" prefix="jruby-${version.jruby}">
911 <include name="bin/**"/>
913 <tarfileset dir="dist" prefix="jruby-${version.jruby}">
914 <include name="lib/**"/>
916 <tarfileset dir="${basedir}" prefix="jruby-${version.jruby}">
917 <patternset refid="dist.src.files"/>
920 <zip destfile="jruby-src-${version.jruby}.zip">
921 <zipfileset dir="dist" filemode="755" prefix="jruby-${version.jruby}">
922 <include name="bin/**"/>
924 <zipfileset dir="dist" prefix="jruby-${version.jruby}">
925 <include name="lib/**"/>
927 <zipfileset dir="${basedir}" prefix="jruby-${version.jruby}">
928 <patternset refid="dist.src.files"/>
933 <target name="dist-snapshot" depends="jar">
934 <exec executable="${basedir}/bin/jruby" dir="${basedir}">
935 <arg value="tool/snapshot.rb"/>
936 <arg value="${jruby.classes.dir}/jruby.properties"/>
938 <jar destfile="${lib.dir}/jruby.jar" update="true">
939 <fileset dir="${jruby.classes.dir}">
940 <include name="jruby.properties"/>
943 <property name="jar-up-to-date" value="true"/>
944 <antcall target="dist-bin">
945 <param file="${jruby.classes.dir}/jruby.properties"/>
949 <target name="dist-snapshot-install-stuff">
950 <unzip dest="${snapshot.install.dir}" src="jruby-bin-${version.jruby}.zip"/>
951 <chmod perm="755" file="${snapshot.install.dir}/jruby-${version.jruby}/bin/jruby"/>
952 <exec executable="${snapshot.install.dir}/jruby-${version.jruby}/bin/jruby"
953 dir="${snapshot.install.dir}/jruby-${version.jruby}">
956 <arg value="system('rm -f ${snapshot.install.dir}/current && ln -s ${snapshot.install.dir}/jruby-${version.jruby} ${snapshot.install.dir}/current'); puts 'Successfully installed snapshot'"/>
960 <target name="dist-snapshot-install" depends="dist-snapshot" if="snapshot.install.dir">
961 <antcall target="dist-snapshot-install-stuff">
962 <param file="${jruby.classes.dir}/jruby.properties"/>
966 <target name="dist" depends="dist-bin,dist-src"/>
968 <target name="dist-clean">
969 <delete includeEmptyDirs="true" quiet="true">
971 <include name="jruby-*.tar.gz"/>
972 <include name="jruby-*.zip"/>
974 <fileset dir="dist" includes="**/*"/>
978 <target name="clean" depends="init" description="clean almost everything">
979 <delete dir="${build.dir}"/>
980 <delete dir="${dist.dir}"/>
981 <delete quiet="false">
982 <fileset dir="${lib.dir}" includes="jruby*.jar"/>
984 <delete dir="${api.docs.dir}"/>
987 <property name="nailgun.home" value="${basedir}/tool/nailgun"/>
989 <target name="need-ng">
990 <condition property="should.build.ng">
993 <not><available file="${nailgun.home}/ng"/></not>
998 <target name="build-ng" depends="need-ng" if="should.build.ng">
999 <exec executable="make" dir="${nailgun.home}"/>
1002 <target name="jruby-nailgun" depends="generate-method-classes,build-ng"
1003 description="Set up JRuby to be run with Nailgun (jruby-ng, jruby-ng-server)">
1004 <mkdir dir="${build.dir}/nailmain"/>
1005 <javac srcdir="${nailgun.home}/src/java" destdir="${build.dir}/nailmain"
1006 classpath="${nailgun.home}/nailgun-0.7.1.jar:${jruby.classes.dir}" debug="true"
1007 source="${javac.version}" target="${javac.version}"
1008 deprecation="true" encoding="UTF-8" />
1009 <taskdef name="jarjar" classname="com.tonicsystems.jarjar.JarJarTask"
1010 classpath="${build.lib.dir}/jarjar-0.7.jar"/>
1011 <jarjar destfile="${nailgun.home}/jruby-nailgun.jar">
1012 <fileset dir="${jruby.classes.dir}">
1013 <exclude name="org/jruby/util/ant/**/*.class"/>
1015 <fileset dir="${build.dir}/nailmain"/>
1016 <zipfileset src="${build.lib.dir}/asm-3.0.jar"/>
1017 <zipfileset src="${build.lib.dir}/asm-commons-3.0.jar"/>
1018 <zipfileset src="${build.lib.dir}/asm-util-3.0.jar"/>
1019 <zipfileset src="${build.lib.dir}/asm-analysis-3.0.jar"/>
1020 <zipfileset src="${build.lib.dir}/asm-tree-3.0.jar"/>
1021 <zipfileset src="${build.lib.dir}/jline-0.9.91.jar"/>
1022 <zipfileset src="${build.lib.dir}/joni.jar"/>
1023 <zipfileset src="${build.lib.dir}/jna.jar"/>
1024 <zipfileset src="${build.lib.dir}/joda-time-1.5.1.jar"/>
1025 <zipfileset src="${nailgun.home}/nailgun-0.7.1.jar"/>
1026 <rule pattern="org.objectweb.asm.**" result="jruby.objectweb.asm.@1"/>
1028 <attribute name="Built-By" value="${user.name}"/>
1029 <attribute name="Main-Class" value="org.jruby.Main"/>