Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tag: 1.1
Fetching contributors…

Cannot retrieve contributors at this time

1047 lines (932 sloc) 43.722 kb
<?xml version="1.0" encoding="UTF-8"?>
<project basedir="." default="jar" name="JRuby">
<description>JRuby is a pure Java implementation of a Ruby interpreter.</description>
<!-- First try to load machine-specific properties. -->
<property file="build.properties"/>
<!-- Load revision number for the ruby specs, in a known good state.
There should be no spec failures with such revision. -->
<property file="rubyspecs.revision"/>
<!-- And then load the defaults. It seems backwards to set defaults AFTER
setting local overrides, but that's how Ant works. -->
<property file="default.build.properties"/>
<path id="build.classpath">
<fileset dir="${build.lib.dir}" includes="*.jar"/>
<fileset dir="${lib.dir}" includes="bsf.jar"/>
</path>
<!-- directory that contains emma.jar and emma_ant.jar: -->
<property name="emma.dir" value="${build.lib.dir}" />
<path id="emma.classpath">
<pathelement location="${emma.dir}/emma.jar" />
<pathelement location="${emma.dir}/emma_ant.jar" />
</path>
<patternset id="java.src.pattern">
<include name="**/*.java"/>
<exclude unless="bsf.present" name="org/jruby/javasupport/bsf/**/*.java"/>
<exclude unless="jdk1.4+" name="**/XmlAstMarshal.java"/>
<exclude unless="jdk1.4+" name="**/AstPersistenceDelegates.java"/>
<exclude unless="sun-misc-signal" name="**/SunSignalFacade.java"/>
</patternset>
<patternset id="ruby.src.pattern">
<include name="**/*.rb"/>
</patternset>
<patternset id="other.src.pattern">
<include name="**/*.properties"/>
</patternset>
<taskdef name="retro" classname="net.sourceforge.retroweaver.ant.RetroWeaverTask" classpathref="build.classpath"/>
<import file="netbeans-ant.xml" optional="true"/>
<!-- Initializes the build -->
<target name="init">
<xmlproperty file="build-config.xml" keepRoot="false" collapseAttributes="true"/>
<tstamp><format property="build.date" pattern="yyyy-MM-dd"/></tstamp>
<property environment="env"/>
<property name="version.ruby" value="${version.ruby.major}.${version.ruby.minor}"/>
<!-- if ruby.home is not set, use env var -->
<condition property="ruby.home" value="${env.RUBY_HOME}">
<not><isset property="ruby.home"/></not>
</condition>
<property name="rdoc.archive" value="docs/rdocs.tar.gz"/>
<uptodate property="docsNotNeeded" srcfile="${rdoc.archive}" targetfile="${basedir}/share/ri"/>
</target>
<target name="extract-rdocs" depends="init" unless="docsNotNeeded">
<untar src="${rdoc.archive}" dest="${basedir}" compression="gzip"/>
</target>
<!-- Creates the directories needed for building -->
<target name="prepare" depends="extract-rdocs">
<mkdir dir="${build.dir}"/>
<mkdir dir="${classes.dir}"/>
<mkdir dir="${jruby.classes.dir}"/>
<mkdir dir="${test.classes.dir}"/>
<mkdir dir="${test.results.dir}"/>
<mkdir dir="${html.test.results.dir}"/>
<mkdir dir="${docs.dir}"/>
<mkdir dir="${api.docs.dir}"/>
</target>
<target name="ragel" description="Standalone target that generates all our ragel based source files. Requires ragel and rlgen-java to be on the classpath">
<exec executable="ragel" output="__ragel_out">
<arg line="-J"/>
<arg line="${src.dir}/org/jvyamlb/resolver_scanner.rl"/>
</exec>
<exec executable="rlgen-java" input="__ragel_out">
<arg line="-o ${src.dir}/org/jvyamlb/ResolverScanner.java"/>
</exec>
<delete file="__ragel_out" quiet="true"/>
</target>
<!-- Checks if specific libs and versions are avaiable -->
<target name="check-for-optional-java4-packages"
depends="init">
<available property="jdk1.4+" classname="java.lang.CharSequence"/>
<available property="jdk1.5+" classname="java.lang.StringBuilder"/>
<available property="bsf.present" classname="org.apache.bsf.BSFManager"
classpathref="build.classpath"/>
<available property="junit.present" classname="junit.framework.TestCase"
classpathref="build.classpath"/>
<available property="cglib.present"
classname="net.sf.cglib.reflect.FastClass"
classpathref="build.classpath"/>
</target>
<!-- Checks if specific libs and versions are avaiable -->
<target name="check-for-optional-packages" if="jdk1.5+"
depends="check-for-optional-java4-packages">
<available property="sun-misc-signal"
classname="sun.misc.Signal"/>
</target>
<!-- Builds the Ant tasks that we need later on in the build -->
<target name="compile.tasks" depends="prepare">
<copy todir="${jruby.classes.dir}">
<fileset dir="${src.dir}">
<include name="**/*.rb"/>
</fileset>
</copy>
<copy todir="${jruby.classes.dir}/builtin">
<fileset dir="${lib.dir}/ruby/site_ruby/1.8/builtin">
<include name="**/*.rb"/>
</fileset>
</copy>
<tstamp>
<format property="build.date" pattern="yyyy-MM-dd"/>
</tstamp>
<copy todir="${jruby.classes.dir}" overwrite="true">
<fileset dir="${src.dir}">
<include name="**/*.properties"/>
</fileset>
<filterset>
<filter token="os.arch" value="${os.arch}"/>
<filter token="java.specification.version" value="${java.specification.version}"/>
<filter token="javac.version" value="${javac.version}"/>
<filter token="build.date" value="${build.date}"/>
</filterset>
</copy>
</target>
<target name="compile-jruby" depends="compile.tasks, check-for-optional-packages">
<javac destdir="${jruby.classes.dir}" debug="true" source="${javac.version}" target="${javac.version}" deprecation="true" encoding="UTF-8">
<classpath refid="build.classpath"/>
<src path="${src.dir}"/>
<patternset refid="java.src.pattern"/>
</javac>
</target>
<target name="compile" depends="compile-jruby"
description="Compile the source files for the project.">
</target>
<target name="generate-method-classes" depends="compile">
<touch file="${build.dir}/__empty.rb"/>
<!-- individual invokers -->
<java classname="org.jruby.Main" fork="true" failonerror="true">
<classpath refid="build.classpath"/>
<classpath path="${jruby.classes.dir}"/>
<sysproperty key="jruby.dump_invocations" value="${jruby.classes.dir}"/>
<arg value="-rjava"/>
<arg value="${build.dir}/__empty.rb"/>
</java>
<!-- indexed invokers -->
<!--
<java classname="org.jruby.Main" fork="true" failonerror="true">
<classpath refid="build.classpath"/>
<classpath path="${jruby.classes.dir}"/>
<sysproperty key="jruby.dump_invocations" value="${jruby.classes.dir}"/>
<sysproperty key="jruby.indexed.methods" value="true"/>
<arg value="-rjava"/>
<arg value="${build.dir}/__empty.rb"/>
</java>
-->
<delete file="${build.dir}/__empty.rb" quiet="true"/>
</target>
<target name="jar-jruby" unless="jar-up-to-date">
<antcall target="generate-method-classes" inheritall="true"/>
<taskdef name="jarjar" classname="com.tonicsystems.jarjar.JarJarTask" classpath="${build.lib.dir}/jarjar-1.0rc7.jar"/>
<jarjar destfile="${lib.dir}/jruby.jar">
<fileset dir="${jruby.classes.dir}">
<exclude name="org/jruby/util/ant/**/*.class"/>
</fileset>
<zipfileset src="${build.lib.dir}/asm-3.0.jar"/>
<zipfileset src="${build.lib.dir}/asm-commons-3.0.jar"/>
<zipfileset src="${build.lib.dir}/asm-util-3.0.jar"/>
<zipfileset src="${build.lib.dir}/asm-analysis-3.0.jar"/>
<zipfileset src="${build.lib.dir}/asm-tree-3.0.jar"/>
<zipfileset src="${build.lib.dir}/jline-0.9.93.jar"/>
<zipfileset src="${build.lib.dir}/joni.jar"/>
<zipfileset src="${build.lib.dir}/jna.jar"/>
<zipfileset src="${build.lib.dir}/joda-time-1.5.1.jar"/>
<rule pattern="org.objectweb.asm.**" result="jruby.objectweb.asm.@1"/>
<manifest>
<attribute name="Built-By" value="${user.name}"/>
<attribute name="Main-Class" value="org.jruby.Main"/>
</manifest>
</jarjar>
</target>
<path id="lib.classpath">
<pathelement location="${build.lib.dir}/retroweaver-rt-2.0.5.jar"/>
<pathelement location="${build.lib.dir}/backport-util-concurrent.jar"/>
<pathelement location="/usr/java/j2sdk1.4.2_16/jre/lib/rt.jar" />
<pathelement location="${lib.dir}/bsf.jar" />
</path>
<target name="jar-1.4" depends="jar-jruby">
<copy file="${lib.dir}/jruby.jar" tofile="${lib.dir}/jruby1.5.jar"/>
<retro inputjar="${lib.dir}/jruby1.5.jar" outputjar="${lib.dir}/jruby-weaved.jar" target="1.4" failonerror="true" verify="true">
<classpath>
<path refid="lib.classpath"/>
<pathelement location="${lib.dir}/jruby-weaved.jar" />
</classpath>
</retro>
<taskdef name="jarjar" classname="com.tonicsystems.jarjar.JarJarTask" classpath="${build.lib.dir}/jarjar-1.0rc7.jar"/>
<jarjar destfile="${lib.dir}/jruby.jar">
<zipfileset src="${lib.dir}/jruby-weaved.jar"/>
<zipfileset src="${build.lib.dir}/retroweaver-rt-2.0.5.jar"/>
<zipfileset src="${build.lib.dir}/backport-util-concurrent.jar"/>
<rule pattern="edu.emory.mathcs.backport.**" result="jruby.backport.@1"/>
<rule pattern="org.objectweb.asm.**" result="jruby.objectweb.asm.@1"/>
</jarjar>
<delete file="${lib.dir}/jruby-weaved.jar"/>
<delete file="${lib.dir}/jruby1.5.jar"/>
</target>
<target name="jar-complete-1.4" depends="jar-complete">
<copy file="${lib.dir}/jruby-complete.jar" tofile="${lib.dir}/jruby-complete1.5.jar"/>
<retro inputjar="${lib.dir}/jruby-complete1.5.jar" outputjar="${lib.dir}/jruby-complete.jar" target="1.4" failonerror="false" verify="true">
<classpath>
<path refid="lib.classpath"/>
<pathelement location="${lib.dir}/jruby-complete.jar" />
</classpath>
</retro>
<delete file="${lib.dir}/jruby-complete1.5.jar"/>
</target>
<target name="jar-complete" depends="generate-method-classes" description="Create the 'complete' JRuby jar. Pass 'mainclass' and 'filename' to adjust.">
<property name="mainclass" value="org.jruby.Main"/>
<property name="filename" value="jruby-complete.jar"/>
<taskdef name="jarjar" classname="com.tonicsystems.jarjar.JarJarTask" classpath="${build.lib.dir}/jarjar-1.0rc7.jar"/>
<jarjar destfile="${lib.dir}/${filename}">
<fileset dir="${jruby.classes.dir}">
<exclude name="org/jruby/util/ant/**/*.class"/>
</fileset>
<fileset dir="${basedir}/lib/ruby/1.8">
<include name="**/*.rb"/>
</fileset>
<zipfileset src="${build.lib.dir}/asm-3.0.jar"/>
<zipfileset src="${build.lib.dir}/asm-commons-3.0.jar"/>
<zipfileset src="${build.lib.dir}/asm-util-3.0.jar"/>
<zipfileset src="${build.lib.dir}/asm-analysis-3.0.jar"/>
<zipfileset src="${build.lib.dir}/asm-tree-3.0.jar"/>
<zipfileset src="${build.lib.dir}/jline-0.9.93.jar"/>
<zipfileset src="${build.lib.dir}/joni.jar"/>
<zipfileset src="${build.lib.dir}/jna.jar"/>
<zipfileset src="${build.lib.dir}/joda-time-1.5.1.jar"/>
<rule pattern="org.objectweb.asm.**" result="jruby.objectweb.asm.@1"/>
<zipfileset dir="${basedir}" prefix="META-INF/jruby.home">
<include name="bin/*"/>
<include name="lib/ruby/gems/1.8/cache/sources*.gem"/>
<include name="lib/ruby/gems/1.8/gems/sources*/**/*"/>
<include name="lib/ruby/gems/1.8/specifications/sources*.gemspec"/>
<include name="lib/ruby/site_ruby/**/*"/>
</zipfileset>
<manifest>
<attribute name="Built-By" value="${user.name}"/>
<attribute name="Main-Class" value="${mainclass}"/>
</manifest>
</jarjar>
</target>
<target name="jar-console" depends="generate-method-classes" description="Create the jruby graphical console jar">
<antcall target="jar-complete">
<param name="mainclass" value="org.jruby.demo.IRBConsole"/>
<param name="filename" value="jruby-console.jar"/>
</antcall>
</target>
<target name="jar" depends="init" description="Create the jruby.jar file">
<antcall target="jar-jruby" inheritall="true"/>
</target>
<target name="compile-test" depends="jar" description="Compile the unit tests">
<javac destdir="${test.classes.dir}" deprecation="true" debug="true"
source="${javac.version}">
<classpath>
<path refid="build.classpath"/>
<pathelement path="${jruby.classes.dir}"/>
<pathelement path="${lib.dir}/jruby.jar"/>
</classpath>
<src path="${test.dir}"/>
<patternset refid="java.src.pattern"/>
</javac>
</target>
<target name="copy-test-files" depends="compile-test"
description="Make tests fails available as resources">
<copy todir="${test.classes.dir}">
<fileset dir="${test.dir}" includes="org/**/*.rb"/>
</copy>
</target>
<target name="install-gems">
<property name="jruby.home" value="${basedir}"/>
<java classname="org.jruby.Main" fork="true" maxmemory="${jruby.launch.memory}" failonerror="true">
<classpath refid="build.classpath"/>
<classpath path="${jruby.classes.dir}"/>
<sysproperty key="jruby.home" value="${jruby.home}"/>
<arg value="--command"/>
<arg value="maybe_install_gems"/>
<arg value="rspec"/>
<arg value="rake"/>
<arg value="--env-shebang"/>
</java>
</target>
<target name="compile-stdlib" unless="test">
<copy todir="${build.dir}/stdlib">
<fileset dir="${basedir}/lib/ruby/1.8">
<include name="**/*.rb"/>
</fileset>
</copy>
<java classname="org.jruby.Main" fork="true" maxmemory="${jruby.launch.memory}" failonerror="true" dir="${build.dir}/stdlib">
<classpath refid="build.classpath"/>
<classpath path="${jruby.classes.dir}"/>
<sysproperty key="jruby.home" value="${basedir}"/>
<sysproperty key="jruby.objectspace.enabled" value="true"/>
<jvmarg value="-ea"/>
<arg value="-I"/>
<arg value="bin/"/>
<arg value="-S"/>
<arg value="jrubyc"/>
<arg line="."/>
</java>
</target>
<target name="emma" description="turns on EMMA instrumentation/reporting" >
<available property="emma.present"
classname="com.vladium.app.IAppVersion"
classpathref="emma.classpath"/>
<taskdef resource="emma_ant.properties" classpathref="emma.classpath" />
<property name="emma.enabled" value="true" />
<path id="classes_to_instrument" >
<pathelement location="${jruby.classes.dir}" />
</path>
</target>
<target name="instrument" if="emma.present">
<emma enabled="${emma.enabled}" >
<instr instrpathref="classes_to_instrument"
destdir="${jruby.instrumented.classes.dir}"
metadatafile="${test.results.dir}/metadata.emma"
merge="false" />
</emma>
</target>
<target name="coverage-report" if="emma.present">
<emma enabled="${emma.enabled}" >
<report sourcepath="${src.dir}" >
<fileset dir="${test.results.dir}" >
<include name="*.emma" />
</fileset>
<html outfile="${html.test.coverage.results.dir}/coverage.html" />
</report>
</emma>
</target>
<target name="test" depends="
copy-test-files,
instrument,
run-junit-compiled,
run-junit-compiled-1.9,
test-security-manager,
coverage-report"
description="Runs unit tests.">
</target>
<target name="test-compiled" depends="copy-test-files,run-junit-compiled,run-junit-precompiled"/>
<target name="test-compiled-1.9" depends="copy-test-files,run-junit-compiled-1.9,run-junit-precompiled-1.9"/>
<target name="test-interpreted" depends="copy-test-files,run-junit-interpreted"/>
<target name="test-interpreted-1.9" depends="copy-test-files,run-junit-interpreted-1.9"/>
<target name="test-reflected" depends="copy-test-files,run-junit-reflected-compiled,run-junit-reflected-precompiled,run-junit-reflected-interpreted"/>
<target name="test-threadpool" depends="copy-test-files,run-junit-compiled-threadpool,run-junit-precompiled-threadpool,run-junit-interpreted-threadpool"/>
<target name="test-all" depends="
copy-test-files,
instrument,
test-security-manager,
run-junit-interpreted,
run-junit-compiled,
run-junit-precompiled,
run-junit-interpreted-1.9,
run-junit-compiled-1.9,
run-junit-precompiled-1.9,
run-junit-reflected-interpreted,
run-junit-reflected-compiled,
run-junit-reflected-precompiled,
run-junit-compiled-threadpool,
run-junit-precompiled-threadpool,
run-junit-interpreted-threadpool,
run-junit-object-persistence,
compile-stdlib,
coverage-report"
description="Runs unit tests in all modes."/>
<target name="weave-tests" description="weave the test classes">
<retro srcdir="${test.classes.dir}" target="1.4" failonerror="true" verify="true">
<classpath>
<path refid="lib.classpath"/>
<pathelement location="${lib.dir}/jruby.jar" />
<pathelement location="${build.lib.dir}/junit.jar" />
<pathelement location="${build.lib.dir}/asm-3.0.jar" />
<pathelement location="${test.classes.dir}" />
</classpath>
</retro>
</target>
<target name="test-1.4" depends="
copy-test-files,
jar-1.4,
weave-tests,
instrument,
run-junit-compiled,
run-junit-compiled-1.9,
coverage-report"
description="Runs unit tests with weaved jruby classes.">
</target>
<target name="test-all-1.4" depends="
copy-test-files,
jar-1.4,
weave-tests,
instrument,
run-junit-interpreted,
run-junit-compiled,
run-junit-precompiled,
run-junit-interpreted-1.9,
run-junit-compiled-1.9,
run-junit-precompiled-1.9,
run-junit-reflected-interpreted,
run-junit-reflected-compiled,
run-junit-reflected-precompiled,
run-junit-compiled-threadpool,
run-junit-precompiled-threadpool,
run-junit-interpreted-threadpool,
run-junit-object-persistence,
compile-stdlib,
coverage-report"
description="Runs unit tests in all modes with weaved jruby classes."/>
<!-- All junit permutations for 1.8 and 1.9 support -->
<target name="run-junit-interpreted"><run-junit-1.8/></target>
<target name="run-junit-interpreted-1.9"><run-junit-1.9/></target>
<target name="run-junit-reflected-interpreted"><run-junit-1.8 reflection="true"/></target>
<target name="run-junit-reflected-interpreted-1.9"><run-junit-1.9 reflection="true"/></target>
<target name="run-junit-compiled"><run-junit-1.8 compile.mode="JIT" jit.threshold="0"/></target>
<target name="run-junit-compiled-1.9"><run-junit-1.9 compile.mode="JIT" jit.threshold="0"/></target>
<target name="run-junit-reflected-compiled"><run-junit-1.8 compile.mode="JIT" jit.threshold="0" reflection="true"/></target>
<target name="run-junit-reflected-compiled-1.9"><run-junit-1.9 compile.mode="JIT" jit.threshold="0" reflection="true"/></target>
<target name="run-junit-precompiled"><run-junit-1.8 compile.mode="FORCE" jit.threshold="0"/></target>
<target name="run-junit-precompiled-1.9"><run-junit-1.9 compile.mode="FORCE" jit.threshold="0"/></target>
<target name="run-junit-reflected-precompiled"><run-junit-1.8 compile.mode="FORCE" jit.threshold="0" reflection="true"/></target>
<target name="run-junit-reflected-precompiled-1.9"><run-junit-1.9 compile.mode="FORCE" jit.threshold="0" reflection="true"/></target>
<target name="run-junit-threadpool" depends="run-junit-interpreted-threadpool,run-junit-compiled-threadpool"/>
<target name="run-junit-interpreted-threadpool"><run-junit-1.8 thread.pooling="true"/></target>
<target name="run-junit-compiled-threadpool"><run-junit-1.8 compile.mode="JIT" jit.threshold="0" thread.pooling="true"/></target>
<target name="run-junit-precompiled-threadpool"><run-junit-1.8 compile.mode="FORCE" jit.threshold="0" thread.pooling="true"/></target>
<path id="test.class.path">
<pathelement location="${jruby.instrumented.classes.dir}" />
<fileset dir="${build.lib.dir}" includes="*.jar">
<exclude name="joni.jar"/>
</fileset>
<pathelement path="${lib.dir}/bsf.jar"/>
<pathelement path="${java.class.path}"/>
<pathelement path="${lib.dir}/jruby.jar"/>
<pathelement location="${test.classes.dir}"/>
<pathelement path="${test.dir}/requireTest.jar"/>
<pathelement location="${test.dir}"/>
</path>
<macrodef name="run-junit">
<attribute name="jruby.version" default="ruby1_8"/>
<attribute name="compile.mode" default="OFF"/>
<attribute name="jit.threshold" default="20"/>
<attribute name="jit.max" default="-1"/>
<attribute name="objectspace.enabled" default="true"/>
<attribute name="thread.pooling" default="false"/>
<attribute name="reflection" default="false"/>
<attribute name="threadlocal" default="false"/>
<element name="junit-tests"/>
<sequential>
<echo message="compile=@{compile.mode}, jit.threshold=@{jit.threshold}, jit.max=@{jit.max}, objectspace=@{objectspace.enabled} threadpool=@{thread.pooling} reflection=@{reflection} version=@{jruby.version}"/>
<taskdef name="junit" classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTask" classpath="${build.lib.dir}/junit.jar"/>
<junit jvm="${jruby.test.jvm}" fork="yes" forkMode="once" haltonfailure="true" dir="${basedir}" maxmemory="${jruby.test.memory}" showoutput="true" timeout="1200000">
<classpath refid="test.class.path"/>
<sysproperty key="java.awt.headless" value="true"/>
<sysproperty key="jruby.home" value="${basedir}"/>
<sysproperty key="jruby.lib" value="${lib.dir}"/>
<sysproperty key="jruby.compile.mode" value="@{compile.mode}"/>
<sysproperty key="jruby.jit.threshold" value="@{jit.threshold}"/>
<sysproperty key="jruby.jit.max" value="@{jit.max}"/>
<sysproperty key="jruby.compat.version" value="@{jruby.version}"/>
<sysproperty key="jruby.objectspace.enabled" value="@{objectspace.enabled}"/>
<sysproperty key="jruby.runtime.threadlocal" value="@{threadlocal}"/>
<sysproperty key="jruby.thread.pool.enabled" value="@{thread.pooling}"/>
<sysproperty key="jruby.reflection" value="@{reflection}"/>
<sysproperty key="jruby.jit.logging.verbose" value="true"/>
<sysproperty key="emma.coverage.out.file" value="${test.results.dir}/coverage.emma" />
<sysproperty key="emma.coverage.out.merge" value="true" />
<jvmarg value="-ea"/>
<formatter type="xml"/>
<formatter type="brief" usefile="false" />
<junit-tests/>
</junit>
<junitreport todir="${test.results.dir}">
<fileset dir="${test.results.dir}" includes="TEST-*.xml"/>
<report format="frames" todir="${html.test.results.dir}"/>
</junitreport>
</sequential>
</macrodef>
<!-- runs junit tests for 1.8 functionality -->
<macrodef name="run-junit-1.8">
<attribute name="compile.mode" default="OFF"/>
<attribute name="jit.threshold" default="20"/>
<attribute name="reflection" default="false"/>
<attribute name="thread.pooling" default="false"/>
<sequential>
<run-junit compile.mode="@{compile.mode}" jit.threshold="@{jit.threshold}" reflection="@{reflection}" thread.pooling="@{thread.pooling}">
<junit-tests>
<test name="${test}" if="test"/>
<test name="org.jruby.test.MainTestSuite" todir="${test.results.dir}" unless="test"/>
<test name="org.jruby.test.ScriptTestSuite" todir="${test.results.dir}" unless="test"/>
<test name="org.jruby.test.BFTSTestSuite" todir="${test.results.dir}" unless="test"/>
<test name="org.jruby.test.JRubyTestSuite" todir="${test.results.dir}" unless="test"/>
<test name="org.jruby.test.DubyTestSuite" todir="${test.results.dir}" unless="test"/>
<test name="org.jruby.test.MRITestSuite" todir="${test.results.dir}" unless="test"/>
<test name="org.jruby.test.RubiconTestSuite" todir="${test.results.dir}" unless="test"/>
<test name="org.jruby.test.RubyTestTestSuite" todir="${test.results.dir}" unless="test"/>
<test name="org.jvyamlb.YAMLLoadTest" todir="${test.results.dir}" unless="test"/>
<test name="org.jvyamlb.YAMLDumpTest" todir="${test.results.dir}" unless="test"/>
</junit-tests>
</run-junit>
</sequential>
</macrodef>
<macrodef name="run-junit-1.9">
<attribute name="compile.mode" default="OFF"/>
<attribute name="jit.threshold" default="20"/>
<attribute name="reflection" default="false"/>
<attribute name="thread.pooling" default="false"/>
<sequential>
<run-junit objectspace.enabled="false" jruby.version="ruby1_9" compile.mode="@{compile.mode}" jit.threshold="@{jit.threshold}" reflection="@{reflection}" thread.pooling="@{thread.pooling}">
<junit-tests>
<test name="${test}" if="test"/>
<test name="org.jruby.test.Ruby1_9TestSuite" todir="${test.results.dir}" unless="test"/>
</junit-tests>
</run-junit>
</sequential>
</macrodef>
<!-- Runs junit tests for object persistence support -->
<target name="run-junit-object-persistence">
<run-junit objectspace.enabled="false" threadlocal="true">
<junit-tests>
<test name="${test}" if="test"/>
<test name="org.jruby.test.ObjectPersistenceTestSuite" todir="${test.results.dir}" unless="test"/>
</junit-tests>
</run-junit>
</target>
<target name="test-security-manager">
<java classname="org.jruby.Main" fork="true" failonerror="true">
<classpath refid="build.classpath"/>
<classpath path="${jruby.classes.dir}"/>
<sysproperty key="java.security.manager" value=""/>
<sysproperty key="java.security.policy" value="file:test/restricted.policy"/>
<arg value="-e"/>
<arg value="puts 'Restricted policy looks ok'"/>
</java>
</target>
<target name="detect-stable-specs-need-update">
<property file="${build.dir}/rubyspecs.current.revision"/>
<condition property="stable-specs-need-update">
<or>
<not><available file="${build.dir}/rubyspec"/></not>
<not>
<equals
arg1="${rubyspecs.revision}"
arg2="${rubyspecs.current.revision}"/>
</not>
</or>
</condition>
</target>
<target name="fetch-stable-specs" depends="prepare, detect-stable-specs-need-update" if="stable-specs-need-update">
<echo message="Downlodaing stable rubyspecs..."/>
<get src="http://git.rubini.us/?p=code;a=snapshot;h=${rubyspecs.revision};sf=tgz" dest="${build.dir}/rubyspec.tgz"/>
<!-- Wipe the old specs, if any -->
<delete dir="${build.dir}/rubyspec"/>
<mkdir dir="${build.dir}/rubyspec"/>
<untar src="${build.dir}/rubyspec.tgz" dest="${build.dir}/rubyspec" compression="gzip"/>
<!-- Write down the revision of downloaded specs -->
<propertyfile file="${build.dir}/rubyspecs.current.revision" comment="Revision of downloaded specs.">
<entry key="rubyspecs.current.revision" value="${rubyspecs.revision}"/>
</propertyfile>
</target>
<!-- NOTE: There are two different rubyspecs versions: stable and unstable.
Stable ones are in known good state, and all known JRuby failures are excluded.
The idea is that the stable specs runs must be clean, no failures.
Unstable specs are the very latest, and might have new failures.
Stable specs are downloaded as a snapshot of particular revision.
Unstable specs are downloaded as a git repo. -->
<!-- stable specs -->
<target name="spec" depends="fetch-stable-specs, run-specs"
description="Runs known good version of rubyspecs."/>
<target name="spec-all" depends="fetch-stable-specs, run-specs-all"
description="Runs known good version of rubyspecs without exclusions."/>
<!-- latest, unstable specs -->
<target name="spec-latest" depends="fetch-specs, run-specs"
description="Runs the very latest rubyspecs."/>
<target name="spec-latest-all" depends="fetch-specs, run-specs-all"
description="Runs the very latest rubyspecs without exclusions."/>
<target name="fetch-specs">
<condition property="rubyspec-repo-exists">
<available file="${build.dir}/rubyspec/code/.git"/>
</condition>
<antcall target="do-fetch-specs"/>
<antcall target="do-update-specs"/>
</target>
<target name="download-specs" description="Download the specs as a tgz snapshot and unpack to build/rubyspec/code">
<get src="http://git.rubini.us/?p=code;a=snapshot;sf=tgz" dest="${build.dir}/rubyspec.tgz"/>
<mkdir dir="${build.dir}/rubyspec"/>
<untar src="${build.dir}/rubyspec.tgz" dest="${build.dir}/rubyspec" compression="gzip"/>
</target>
<target name="do-fetch-specs" unless="rubyspec-repo-exists">
<!-- Stable specs might exist, so delete them -->
<antcall target="clear-specs" inheritall="false"/>
<exec dir="${build.dir}" executable="git">
<arg value="clone"/>
<arg value="--depth"/><arg value="1"/>
<arg value="git://git.rubini.us/code"/>
<arg value="rubyspec/code"/>
</exec>
</target>
<target name="do-update-specs" if="rubyspec-repo-exists">
<exec dir="${build.dir}/rubyspec/code" executable="git">
<arg value="pull"/>
</exec>
</target>
<target name="clear-specs">
<delete dir="${build.dir}/rubyspec"/>
<delete file="${build.dir}/rubyspec.tgz"/>
<delete file="${build.dir}/rubyspecs.current.revision"/>
</target>
<target name="run-specs" depends="jar">
<antcall target="run-specs-precompiled"/>
<antcall target="run-specs-compiled"/>
<antcall target="run-specs-interpreted"/>
</target>
<target name="run-specs-all" depends="jar"><antcall target="run-specs-all-precompiled"/></target>
<target name="run-specs-compiled"><_run_specs_internal compile.mode="JIT" jit.threshold="0"/></target>
<target name="run-specs-precompiled"><_run_specs_internal compile.mode="FORCE" jit.threshold="0"/></target>
<target name="run-specs-all-precompiled"><_run_specs_all_internal compile.mode="FORCE" jit.threshold="0"/></target>
<target name="run-specs-interpreted"><_run_specs_internal/></target>
<target name="update-excludes">
<java classname="org.jruby.Main" fork="true" maxmemory="${jruby.launch.memory}" failonerror="false" dir="${build.dir}/rubyspec/code">
<classpath refid="build.classpath"/>
<classpath path="${jruby.classes.dir}"/>
<sysproperty key="jruby.home" value="${basedir}"/>
<sysproperty key="jruby.launch.inproc" value="false"/>
<arg line="bin/mspec tag"/>
<arg line="-t ${basedir}/bin/jruby"/>
<arg line="--add fails --fail"/>
<arg line="-X ${basedir}/test/spec_excludes"/>
<arg value="spec/ruby/1.8"/>
</java>
</target>
<target name="spec-show-excludes" depends="prepare"
description="Prints out all currently excluded rubyspecs.">
<available property="mspec-available"
file="${build.dir}/rubyspec/code/bin/mspec"/>
<fail unless="mspec-available"
message="No rubyspecs found. Download them via 'ant spec'."/>
<java classname="org.jruby.Main" fork="true" maxmemory="${jruby.launch.memory}" failonerror="false" dir="${build.dir}/rubyspec/code">
<classpath refid="build.classpath"/>
<classpath path="${jruby.classes.dir}"/>
<sysproperty key="jruby.home" value="${basedir}"/>
<sysproperty key="jruby.launch.inproc" value="false"/>
<arg line="bin/mspec"/>
<arg line="-t ${basedir}/bin/jruby"/>
<arg line="-f s -g fails --dry-run"/>
<arg line="-X ${basedir}/test/spec_excludes"/>
<arg value="spec/ruby/1.8"/>
</java>
</target>
<macrodef name="run-specs">
<attribute name="compile.mode" default="OFF"/>
<attribute name="jit.threshold" default="20"/>
<attribute name="jit.max" default="-1"/>
<attribute name="objectspace.enabled" default="true"/>
<attribute name="thread.pooling" default="false"/>
<attribute name="reflection" default="false"/>
<element name="extra-args" optional="true"/>
<sequential>
<echo message="compile=@{compile.mode}, threshold=@{jit.threshold}, objectspace=@{objectspace.enabled} threadpool=@{thread.pooling} reflection=@{reflection}"/>
<java classname="org.jruby.Main" fork="true" maxmemory="${jruby.launch.memory}" failonerror="true" dir="${build.dir}/rubyspec/code">
<classpath refid="build.classpath"/>
<classpath path="${jruby.classes.dir}"/>
<jvmarg value="-ea"/>
<sysproperty key="jruby.home" value="${basedir}"/>
<sysproperty key="jruby.launch.inproc" value="false"/>
<!-- properties tweaked for individual runs -->
<sysproperty key="jruby.compile.mode" value="@{compile.mode}"/>
<sysproperty key="jruby.jit.threshold" value="@{jit.threshold}"/>
<sysproperty key="jruby.jit.max" value="@{jit.max}"/>
<sysproperty key="jruby.objectspace.enabled" value="@{objectspace.enabled}"/>
<sysproperty key="jruby.thread.pool.enabled" value="@{thread.pooling}"/>
<sysproperty key="jruby.reflection" value="@{reflection}"/>
<arg line="bin/mspec ci"/>
<arg value="-t"/><arg value="${basedir}/bin/jruby"/>
<arg line="-T -J-ea"/>
<arg value="-f"/><arg value="m"/>
<extra-args/>
<arg value="spec/ruby/1.8"/>
</java>
</sequential>
</macrodef>
<macrodef name="_run_specs_internal">
<attribute name="compile.mode" default="OFF"/>
<attribute name="jit.threshold" default="20"/>
<sequential>
<run-specs compile.mode="@{compile.mode}" jit.threshold="@{jit.threshold}">
<extra-args>
<arg value="-X"/><arg value="${basedir}/test/spec_excludes"/>
</extra-args>
</run-specs>
</sequential>
</macrodef>
<macrodef name="_run_specs_all_internal">
<attribute name="compile.mode" default="OFF"/>
<attribute name="jit.threshold" default="20"/>
<sequential>
<run-specs compile.mode="@{compile.mode}" jit.threshold="@{jit.threshold}"/>
</sequential>
</macrodef>
<macrodef name="fixEOLs">
<sequential>
<fixcrlf srcdir="dist/bin" excludes="*.bat" eol="lf"/>
<fixcrlf srcdir="dist/bin" includes="*.bat" eol="crlf"/>
</sequential>
</macrodef>
<target name="create-apidocs" depends="prepare"
description="Creates the Java API docs">
<javadoc destdir="${api.docs.dir}" author="true" version="true" use="true"
windowtitle="JRuby API" source="${javac.version}" useexternalfile="true">
<fileset dir="${src.dir}">
<include name="**/*.java"/>
</fileset>
<fileset dir="${test.dir}">
<include name="**/*.java"/>
</fileset>
<doctitle><![CDATA[<h1>JRuby</h1>]]></doctitle>
<bottom><![CDATA[<i>Copyright &#169; 2002-2007 JRuby Team. All Rights Reserved.</i>]]></bottom>
</javadoc>
</target>
<patternset id="dist.bindir.files">
<include name="bin/*jruby*"/>
<include name="bin/*gem*"/>
<include name="bin/*ri*"/>
<include name="bin/*rdoc*"/>
<include name="bin/*jirb*"/>
<include name="bin/generate_yaml_index.rb"/>
<include name="bin/testrb"/>
</patternset>
<patternset id="dist.lib.files">
<include name="lib/ruby/1.8/**"/>
<include name="lib/ruby/site_ruby/1.8/**"/>
<include name="lib/ruby/gems/1.8/specifications/sources-0.0.1.gemspec"/>
<include name="lib/ruby/gems/1.8/cache/sources-0.0.1.gem"/>
<include name="lib/ruby/gems/1.8/gems/sources-0.0.1/**"/>
</patternset>
<patternset id="dist.files">
<include name="lib/*"/>
<include name="samples/**"/>
<include name="docs/**"/>
<include name="COPYING*"/>
<include name="README"/>
<exclude name="lib/ruby/**"/>
</patternset>
<patternset id="dist.bin.files">
<patternset refid="dist.files"/>
<exclude name="lib/emma.jar"/>
<exclude name="lib/emma_ant.jar"/>
<exclude name="lib/junit.jar"/>
<exclude name="lib/jarjar-1.0rc7.jar"/>
<exclude name="docs/rdocs.tar.gz"/>
<include name="share/**"/>
</patternset>
<patternset id="dist.src.files">
<patternset refid="dist.files"/>
<exclude name="share/**"/>
<include name="src/**"/>
<include name="test/**"/>
<include name="build_lib/**"/>
<include name="build.xml"/>
<include name="build-config.xml"/>
<include name="nbproject/*"/>
<include name=".project"/>
<include name=".classpath"/>
<include name="default.build.properties"/>
<exclude name="lib/jruby.jar"/>
</patternset>
<target name="dist-bin" depends="jar">
<mkdir dir="dist"/>
<copy todir="dist">
<fileset dir="${basedir}">
<patternset refid="dist.bindir.files"/>
<patternset refid="dist.lib.files"/>
</fileset>
</copy>
<fixEOLs/>
<antcall target="install-gems">
<param name="jruby.home" value="dist"/>
</antcall>
<tar destfile="jruby-bin-${version.jruby}.tar.gz" compression="gzip">
<tarfileset dir="dist" mode="755" prefix="jruby-${version.jruby}">
<include name="bin/**"/>
</tarfileset>
<tarfileset dir="dist" prefix="jruby-${version.jruby}">
<include name="lib/**"/>
</tarfileset>
<tarfileset dir="${basedir}" prefix="jruby-${version.jruby}">
<patternset refid="dist.bin.files"/>
</tarfileset>
</tar>
<zip destfile="jruby-bin-${version.jruby}.zip">
<zipfileset dir="dist" filemode="755" prefix="jruby-${version.jruby}">
<include name="bin/**"/>
</zipfileset>
<zipfileset dir="dist" prefix="jruby-${version.jruby}">
<include name="lib/**"/>
</zipfileset>
<zipfileset dir="${basedir}" prefix="jruby-${version.jruby}">
<patternset refid="dist.bin.files"/>
</zipfileset>
</zip>
</target>
<target name="dist-src" depends="jar">
<mkdir dir="dist"/>
<copy todir="dist">
<fileset dir="${basedir}">
<patternset refid="dist.bindir.files"/>
<patternset refid="dist.lib.files"/>
</fileset>
</copy>
<antcall target="install-gems">
<param name="jruby.home" value="dist"/>
</antcall>
<fixEOLs/>
<tar destfile="jruby-src-${version.jruby}.tar.gz" compression="gzip">
<tarfileset dir="dist" mode="755" prefix="jruby-${version.jruby}">
<include name="bin/**"/>
</tarfileset>
<tarfileset dir="dist" prefix="jruby-${version.jruby}">
<include name="lib/**"/>
</tarfileset>
<tarfileset dir="${basedir}" prefix="jruby-${version.jruby}">
<patternset refid="dist.src.files"/>
</tarfileset>
</tar>
<zip destfile="jruby-src-${version.jruby}.zip">
<zipfileset dir="dist" filemode="755" prefix="jruby-${version.jruby}">
<include name="bin/**"/>
</zipfileset>
<zipfileset dir="dist" prefix="jruby-${version.jruby}">
<include name="lib/**"/>
</zipfileset>
<zipfileset dir="${basedir}" prefix="jruby-${version.jruby}">
<patternset refid="dist.src.files"/>
</zipfileset>
</zip>
</target>
<target name="dist-snapshot" depends="jar">
<exec executable="${basedir}/bin/jruby" dir="${basedir}">
<arg value="tool/snapshot.rb"/>
<arg value="${jruby.classes.dir}/jruby.properties"/>
</exec>
<jar destfile="${lib.dir}/jruby.jar" update="true">
<fileset dir="${jruby.classes.dir}">
<include name="jruby.properties"/>
</fileset>
</jar>
<property name="jar-up-to-date" value="true"/>
<antcall target="dist-bin">
<param file="${jruby.classes.dir}/jruby.properties"/>
</antcall>
</target>
<target name="dist-snapshot-install-stuff">
<unzip dest="${snapshot.install.dir}" src="jruby-bin-${version.jruby}.zip"/>
<chmod perm="755" file="${snapshot.install.dir}/jruby-${version.jruby}/bin/jruby"/>
<exec executable="${snapshot.install.dir}/jruby-${version.jruby}/bin/jruby"
dir="${snapshot.install.dir}/jruby-${version.jruby}">
<arg value="-v"/>
<arg value="-e"/>
<arg value="system('rm -f ${snapshot.install.dir}/current &amp;&amp; ln -s ${snapshot.install.dir}/jruby-${version.jruby} ${snapshot.install.dir}/current'); puts 'Successfully installed snapshot'"/>
</exec>
</target>
<target name="dist-snapshot-install" depends="dist-snapshot" if="snapshot.install.dir">
<antcall target="dist-snapshot-install-stuff">
<param file="${jruby.classes.dir}/jruby.properties"/>
</antcall>
</target>
<target name="dist" depends="dist-bin,dist-src"/>
<target name="dist-clean">
<delete includeEmptyDirs="true" quiet="true">
<fileset dir=".">
<include name="jruby-*.tar.gz"/>
<include name="jruby-*.zip"/>
</fileset>
<fileset dir="dist" includes="**/*"/>
</delete>
</target>
<target name="clean" depends="init" description="Cleans almost everything, leaves downloaded specs">
<delete includeemptydirs="true" quiet="true">
<fileset dir="${build.dir}" excludes="rubyspec**"/>
</delete>
<delete dir="${dist.dir}"/>
<delete quiet="false">
<fileset dir="${lib.dir}" includes="jruby*.jar"/>
</delete>
<delete dir="${api.docs.dir}"/>
</target>
<target name="clean-all" depends="clean" description="Cleans everything, including downloaded specs">
<delete dir="${build.dir}"/>
</target>
<property name="nailgun.home" value="${basedir}/tool/nailgun"/>
<target name="need-ng">
<condition property="should.build.ng">
<and>
<os family="unix"/>
<not><available file="${nailgun.home}/ng"/></not>
</and>
</condition>
</target>
<target name="build-ng" depends="need-ng" if="should.build.ng">
<exec executable="make" dir="${nailgun.home}"/>
</target>
<target name="jruby-nailgun" depends="generate-method-classes,build-ng"
description="Set up JRuby to be run with Nailgun (jruby-ng, jruby-ng-server)">
<mkdir dir="${build.dir}/nailmain"/>
<javac srcdir="${nailgun.home}/src/java" destdir="${build.dir}/nailmain"
classpath="${nailgun.home}/nailgun-0.7.1.jar:${jruby.classes.dir}" debug="true"
source="${javac.version}" target="${javac.version}"
deprecation="true" encoding="UTF-8" />
<taskdef name="jarjar" classname="com.tonicsystems.jarjar.JarJarTask"
classpath="${build.lib.dir}/jarjar-1.0rc7.jar"/>
<jarjar destfile="${nailgun.home}/jruby-nailgun.jar">
<fileset dir="${jruby.classes.dir}">
<exclude name="org/jruby/util/ant/**/*.class"/>
</fileset>
<fileset dir="${build.dir}/nailmain"/>
<zipfileset src="${build.lib.dir}/asm-3.0.jar"/>
<zipfileset src="${build.lib.dir}/asm-commons-3.0.jar"/>
<zipfileset src="${build.lib.dir}/asm-util-3.0.jar"/>
<zipfileset src="${build.lib.dir}/asm-analysis-3.0.jar"/>
<zipfileset src="${build.lib.dir}/asm-tree-3.0.jar"/>
<zipfileset src="${build.lib.dir}/jline-0.9.93.jar"/>
<zipfileset src="${build.lib.dir}/joni.jar"/>
<zipfileset src="${build.lib.dir}/jna.jar"/>
<zipfileset src="${build.lib.dir}/joda-time-1.5.1.jar"/>
<zipfileset src="${nailgun.home}/nailgun-0.7.1.jar"/>
<rule pattern="org.objectweb.asm.**" result="jruby.objectweb.asm.@1"/>
<manifest>
<attribute name="Built-By" value="${user.name}"/>
<attribute name="Main-Class" value="org.jruby.Main"/>
</manifest>
</jarjar>
</target>
</project>
Jump to Line
Something went wrong with that request. Please try again.