Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

1840 lines (1654 sloc) 81.643 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>
<property name="base.dir" location="${basedir}"/>
<!-- 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"/>
<!-- Gem file names -->
<property name="rspec.gem" value="rspec-1.2.9.gem"/>
<property name="rake.gem" value="rake-0.8.7.gem"/>
<property name="ruby-debug.gem" value="ruby-debug-0.10.3.gem"/>
<property name="ruby-debug-base.gem" value="ruby-debug-base-0.10.3.1-java.gem"/>
<property name="columnize.gem" value="columnize-0.3.1.gem"/>
<property name="shared.lib.dir" value="lib/ruby/site_ruby/shared"/>
<path id="build.classpath">
<fileset dir="${build.lib.dir}" includes="*.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="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>
<import file="netbeans-ant.xml" optional="true"/>
<import file="ivy/build.xml" />
<!-- Initializes the build -->
<target name="init">
<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>
<condition property="run.jvm.model" value="">
<os family="windows"/>
</condition>
<condition property="run.jvm.model" value="-d64">
<or>
<os arch="amd64"/>
<os arch="x86_64"/>
<os arch="sparcv9"/>
<os arch="s390x"/>
</or>
</condition>
<condition property="run.jvm.model" value="-d32">
<or>
<os arch="i386"/>
<os arch="x86"/>
<os arch="powerpc"/>
<os arch="ppc"/>
<os arch="sparc"/>
</or>
</condition>
<condition property="run.jvm.model" value="">
<not><isset property="run.jvm.model"/></not>
</condition>
<condition property="spec.jvm.model.option" value="">
<equals arg1="${run.jvm.model}" arg2=""/>
</condition>
<property name="spec.jvm.model.option" value="-T -J${run.jvm.model}"/>
<property name="rdoc.archive" value="docs/rdocs.tar.gz"/>
<uptodate property="docsNotNeeded" srcfile="${rdoc.archive}" targetfile="${basedir}/share/ri/1.8/system/created.rid"/>
<uptodate property="native-libs-uptodate" targetfile="${lib.dir}/native/libs.OK">
<srcfiles dir= "build_lib" includes="jffi-*.jar"/>
</uptodate>
</target>
<target name="extract-rdocs" depends="init" unless="docsNotNeeded">
<untar src="${rdoc.archive}" dest="${basedir}" compression="gzip"/>
<touch file="${basedir}/share/ri/1.8/system/created.rid"/>
</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>
<!-- Checks if specific libs and versions are avaiable -->
<target name="check-for-optional-java4-packages"
depends="init">
<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>
<target name="prepare-resources" 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/shared/builtin">
<include name="**/*.rb"/>
<include name="**/*.jar"/>
</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="version.ruby.major" value="${version.ruby.major}"/>
<filter token="version.ruby" value="${version.ruby}"/>
<filter token="version.ruby.patchlevel" value="${version.ruby.patchlevel}"/>
<filter token="version.ruby1_9.major" value="${version.ruby1_9.major}"/>
<filter token="version.ruby1_9" value="${version.ruby1_9}"/>
<filter token="version.ruby1_9.patchlevel" value="${version.ruby1_9.patchlevel}"/>
<filter token="build.date" value="${build.date}"/>
<filter token="version.jruby" value="${version.jruby}"/>
<filter token="java.specification.version" value="${java.specification.version}"/>
<filter token="javac.version" value="${javac.version}"/>
<filter token="os.arch" value="${os.arch}"/>
</filterset>
</copy>
</target>
<target name="compile-annotation-binder">
<mkdir dir="${basedir}/src_gen"/>
<javac destdir="${jruby.classes.dir}" debug="true" srcdir="${src.dir}" sourcepath="" classpathref="build.classpath" source="${javac.version}" target="${javac.version}" deprecation="true" encoding="UTF-8">
<include name="org/jruby/anno/FrameField.java"/>
<include name="org/jruby/anno/AnnotationBinder.java"/>
<include name="org/jruby/anno/JRubyMethod.java"/>
<include name="org/jruby/anno/FrameField.java"/>
<include name="org/jruby/CompatVersion.java"/>
<include name="org/jruby/runtime/Visibility.java"/>
<include name="org/jruby/util/CodegenUtils.java"/>
</javac>
</target>
<target name="compile-jruby" depends="prepare-resources, compile-annotation-binder, check-for-optional-packages">
<!-- Generate binding logic ahead of time -->
<apt factory="org.jruby.anno.AnnotationBinder" destdir="${jruby.classes.dir}" debug="true" source="${javac.version}" target="${javac.version}" deprecation="true" encoding="UTF-8">
<classpath refid="build.classpath"/>
<classpath path="${jruby.classes.dir}"/>
<src path="${src.dir}"/>
<patternset refid="java.src.pattern"/>
<compilerarg line="-XDignore.symbol.file=true"/>
<compilerarg line="-J-Xmx${jruby.compile.memory}"/>
</apt>
</target>
<target name="compile" depends="compile-jruby"
description="Compile the source files for the project.">
</target>
<target name="generate-method-classes" depends="compile">
<available file="src_gen/annotated_classes.txt" property="annotations.changed"/>
<antcall target="_gmc_internal_"/>
</target>
<target name="_gmc_internal_" if="annotations.changed">
<echo message="Generating invokers..."/>
<java classname="org.jruby.anno.InvokerGenerator" fork="true" failonerror="true">
<classpath refid="build.classpath"/>
<classpath path="${jruby.classes.dir}"/>
<jvmarg value="${run.jvm.model}"/>
<!-- uncomment this line when building on a JVM with invokedynamic
<jvmarg line="-XX:+InvokeDynamic"/>
-->
<sysproperty key="jruby.bytecode.version" value="${javac.version}"/>
<arg value="src_gen/annotated_classes.txt"/>
<arg value="${jruby.classes.dir}"/>
</java>
<echo message="Compiling populators..."/>
<javac destdir="${jruby.classes.dir}" debug="true" source="${javac.version}" target="${javac.version}" deprecation="true" encoding="UTF-8">
<classpath refid="build.classpath"/>
<classpath path="${jruby.classes.dir}"/>
<src path="src_gen"/>
<patternset refid="java.src.pattern"/>
</javac>
<delete file="src_gen/annotated_classes.txt"/>
</target>
<target name="generate-unsafe" depends="compile">
<available file="${jruby.classes.dir}/org/jruby/util/unsafe/GeneratedUnsafe.class" property="unsafe.not.needed"/>
<antcall target="_gu_internal_"/>
</target>
<target name="_gu_internal_" unless="unsafe.not.needed">
<echo message="Generating Unsafe impl..."/>
<java classname="org.jruby.util.unsafe.UnsafeGenerator" fork="true" failonerror="true">
<classpath refid="build.classpath"/>
<classpath path="${jruby.classes.dir}"/>
<jvmarg value="${run.jvm.model}"/>
<!-- uncomment this line when building on a JVM with invokedynamic
<jvmarg line="-XX:+InvokeDynamic"/>
-->
<arg value="org.jruby.util.unsafe"/>
<arg value="${jruby.classes.dir}/org/jruby/util/unsafe"/>
</java>
</target>
<target name="_update_scm_revision_">
<condition property="ruby.available">
<available file="${ruby.executable}"/>
</condition>
<antcall target="_update_scm_revision_with_ruby_"/>
<antcall target="_update_scm_revision_with_jruby_"/>
</target>
<target name="_update_scm_revision_with_ruby_" if="ruby.available">
<echo message="Using '${ruby.executable}' to calculate revision"/>
<exec failonerror="false" failifexecutionfails="false" errorproperty="ruby.command.failed" dir="${base.dir}" executable="${ruby.executable}">
<arg value="${base.dir}/tool/snapshot.rb"/>
<arg value="${jruby.classes.dir}/org/jruby/jruby.properties"/>
</exec>
<condition property="ruby.failed">
<istrue value="${ruby.command.failed}"/>
</condition>
</target>
<target name="_update_scm_revision_with_jruby_" unless="ruby.available">
<echo message="Using JRuby to calculate revision..."/>
<echo message="Adjust ruby.executable value in build.properties to speed things up!"/>
<property name="jruby.home" value="${basedir}"/>
<java classname="org.jruby.Main" resultproperty="snapshot.result" errorproperty="snapshot.error" failonerror="false">
<classpath refid="build.classpath"/>
<classpath path="${jruby.classes.dir}"/>
<sysproperty key="jruby.home" value="${jruby.home}"/>
<jvmarg value="${run.jvm.model}"/>
<arg value="${base.dir}/tool/snapshot.rb"/>
<arg value="${jruby.classes.dir}/org/jruby/jruby.properties"/>
</java>
</target>
<target name="unzip-native-libs" unless="native-libs-uptodate">
<unzip-native-libs destination.dir="${lib.dir}/native"/>
<echo file="${lib.dir}/native/libs.OK"/>
</target>
<target name="jar-jruby" depends="generate-method-classes, generate-unsafe, unzip-native-libs" unless="jar-up-to-date">
<antcall target="_update_scm_revision_"/>
<jar destfile="${lib.dir}/jruby.jar" compress="true" index="true">
<fileset dir="${jruby.classes.dir}"/>
<zipfileset src="${build.lib.dir}/asm-3.2.jar"/>
<zipfileset src="${build.lib.dir}/asm-commons-3.2.jar"/>
<zipfileset src="${build.lib.dir}/asm-util-3.2.jar"/>
<zipfileset src="${build.lib.dir}/asm-analysis-3.2.jar"/>
<zipfileset src="${build.lib.dir}/asm-tree-3.2.jar"/>
<zipfileset src="${build.lib.dir}/bytelist.jar"/>
<zipfileset src="${build.lib.dir}/constantine.jar"/>
<zipfileset src="${build.lib.dir}/jline-0.9.93.jar"/>
<zipfileset src="${build.lib.dir}/jcodings.jar"/>
<zipfileset src="${build.lib.dir}/joni.jar"/>
<zipfileset src="${build.lib.dir}/jnr-posix.jar"/>
<zipfileset src="${build.lib.dir}/jaffl.jar"/>
<zipfileset src="${build.lib.dir}/jffi.jar"/>
<zipfileset src="${build.lib.dir}/jffi-i386-Linux.jar"/>
<zipfileset src="${build.lib.dir}/jffi-x86_64-Linux.jar"/>
<zipfileset src="${build.lib.dir}/jffi-Darwin.jar"/>
<zipfileset src="${build.lib.dir}/jffi-i386-SunOS.jar"/>
<zipfileset src="${build.lib.dir}/jffi-x86_64-SunOS.jar"/>
<zipfileset src="${build.lib.dir}/jffi-ppc-AIX.jar"/>
<zipfileset src="${build.lib.dir}/jffi-ppc-Linux.jar"/>
<zipfileset src="${build.lib.dir}/jffi-sparc-SunOS.jar"/>
<zipfileset src="${build.lib.dir}/jffi-sparcv9-SunOS.jar"/>
<zipfileset src="${build.lib.dir}/jffi-i386-FreeBSD.jar"/>
<zipfileset src="${build.lib.dir}/jffi-x86_64-FreeBSD.jar"/>
<zipfileset src="${build.lib.dir}/jffi-i386-OpenBSD.jar"/>
<zipfileset src="${build.lib.dir}/jffi-x86_64-OpenBSD.jar"/>
<zipfileset src="${build.lib.dir}/jffi-i386-Windows.jar"/>
<zipfileset src="${build.lib.dir}/jffi-x86_64-Windows.jar"/>
<zipfileset src="${build.lib.dir}/jffi-s390x-Linux.jar"/>
<zipfileset src="${build.lib.dir}/joda-time-1.6.jar"/>
<zipfileset src="${build.lib.dir}/dynalang-0.3.jar"/>
<zipfileset src="${build.lib.dir}/yydebug.jar"/>
<zipfileset src="${build.lib.dir}/nailgun-0.7.1.jar"/>
<zipfileset src="${build.lib.dir}/emma.jar"/>
<metainf dir="${base.dir}/spi">
<include name="services/**"/>
</metainf>
<manifest>
<attribute name="Built-By" value="${user.name}"/>
<attribute name="Main-Class" value="org.jruby.Main"/>
</manifest>
</jar>
</target>
<target name="jar-jruby-light" depends="generate-method-classes, generate-unsafe" unless="jar-up-to-date">
<antcall target="_update_scm_revision_"/>
<jar destfile="${lib.dir}/jruby-light.jar" compress="true" index="true">
<fileset dir="${jruby.classes.dir}">
<exclude name="**/*$Populator.class"/>
<exclude name="**/*INVOKER*.class"/>
<exclude name="**/AnnotationBinder*.class"/>
<exclude name="**/InvokerGenerator.class"/>
<exclude name="org/jruby/ext/ffi/**/*"/>
<exclude name="org/jruby/embed/**/*"/>
</fileset>
<zipfileset src="${build.lib.dir}/asm-3.2.jar"/>
<zipfileset src="${build.lib.dir}/asm-util-3.2.jar"/>
<zipfileset src="${build.lib.dir}/bytelist.jar"/>
<zipfileset src="${build.lib.dir}/constantine.jar"/>
<zipfileset src="${build.lib.dir}/jcodings.jar"/>
<zipfileset src="${build.lib.dir}/joni.jar"/>
<zipfileset src="${build.lib.dir}/jnr-posix.jar"/>
<zipfileset src="${build.lib.dir}/joda-time-1.6.jar"/>
<manifest>
<attribute name="Built-By" value="${user.name}"/>
<attribute name="Main-Class" value="org.jruby.Main"/>
</manifest>
</jar>
</target>
<target name="jar-jruby-dist" depends="generate-method-classes, generate-unsafe" unless="jar-up-to-date">
<antcall target="_update_scm_revision_"/>
<taskdef name="jarjar" classname="com.tonicsystems.jarjar.JarJarTask" classpath="${build.lib.dir}/jarjar-1.0.jar"/>
<jarjar destfile="${lib.dir}/jruby.jar" compress="true">
<fileset dir="${jruby.classes.dir}"/>
<zipfileset src="${build.lib.dir}/asm-3.2.jar"/>
<zipfileset src="${build.lib.dir}/asm-commons-3.2.jar"/>
<zipfileset src="${build.lib.dir}/asm-util-3.2.jar"/>
<zipfileset src="${build.lib.dir}/asm-analysis-3.2.jar"/>
<zipfileset src="${build.lib.dir}/asm-tree-3.2.jar"/>
<zipfileset src="${build.lib.dir}/constantine.jar"/>
<zipfileset src="${build.lib.dir}/bytelist.jar"/>
<zipfileset src="${build.lib.dir}/jline-0.9.93.jar"/>
<zipfileset src="${build.lib.dir}/jcodings.jar"/>
<zipfileset src="${build.lib.dir}/joni.jar"/>
<zipfileset src="${build.lib.dir}/jnr-posix.jar"/>
<zipfileset src="${build.lib.dir}/jaffl.jar"/>
<zipfileset src="${build.lib.dir}/jffi.jar"/>
<zipfileset src="${build.lib.dir}/jffi-i386-Linux.jar"/>
<zipfileset src="${build.lib.dir}/jffi-x86_64-Linux.jar"/>
<zipfileset src="${build.lib.dir}/jffi-Darwin.jar"/>
<zipfileset src="${build.lib.dir}/jffi-i386-SunOS.jar"/>
<zipfileset src="${build.lib.dir}/jffi-x86_64-SunOS.jar"/>
<zipfileset src="${build.lib.dir}/jffi-ppc-AIX.jar"/>
<zipfileset src="${build.lib.dir}/jffi-ppc-Linux.jar"/>
<zipfileset src="${build.lib.dir}/jffi-sparc-SunOS.jar"/>
<zipfileset src="${build.lib.dir}/jffi-sparcv9-SunOS.jar"/>
<zipfileset src="${build.lib.dir}/jffi-i386-FreeBSD.jar"/>
<zipfileset src="${build.lib.dir}/jffi-x86_64-FreeBSD.jar"/>
<zipfileset src="${build.lib.dir}/jffi-i386-OpenBSD.jar"/>
<zipfileset src="${build.lib.dir}/jffi-x86_64-OpenBSD.jar"/>
<zipfileset src="${build.lib.dir}/jffi-i386-Windows.jar"/>
<zipfileset src="${build.lib.dir}/jffi-x86_64-Windows.jar"/>
<zipfileset src="${build.lib.dir}/jffi-s390x-Linux.jar"/>
<zipfileset src="${build.lib.dir}/joda-time-1.6.jar"/>
<zipfileset src="${build.lib.dir}/dynalang-0.3.jar"/>
<zipfileset src="${build.lib.dir}/yydebug.jar"/>
<zipfileset src="${build.lib.dir}/nailgun-0.7.1.jar"/>
<metainf dir="${base.dir}/spi">
<include name="services/**"/>
</metainf>
<manifest>
<attribute name="Built-By" value="${user.name}"/>
<attribute name="Main-Class" value="org.jruby.Main"/>
</manifest>
<rule pattern="org.objectweb.asm.**" result="jruby.objectweb.asm.@1"/>
</jarjar>
<antcall target="_osgify-jar_">
<param name="bndfile" value="jruby.bnd" />
<param name="jar.wrap" value="${lib.dir}/jruby.jar" />
</antcall>
</target>
<!-- Use Bnd to wrap the JAR generated by jarjar in above task -->
<target name="_osgify-jar_">
<filter token="JRUBY_VERSION" value="${version.jruby}"/>
<copy file="${basedir}/jruby.bnd.template" tofile="${build.dir}/${bndfile}" filtering="true"/>
<taskdef resource="aQute/bnd/ant/taskdef.properties"
classpath="${build.lib.dir}/bnd-0.0.249.jar"/>
<bndwrap definitions="${build.dir}" output="${dest.lib.dir}">
<fileset file="${jar.wrap}" />
</bndwrap>
<move file="${jar.wrap}$" tofile="${jar.wrap}"
overwrite="true" />
</target>
<target name="jar-complete" depends="generate-method-classes, generate-unsafe" 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.0.jar"/>
<property name="jar-complete-home" value="${build.dir}/jar-complete/META-INF/jruby.home"/>
<mkdir dir="${jar-complete-home}"/>
<copy todir="${jar-complete-home}">
<fileset dir="${basedir}">
<patternset refid="dist.bindir.files"/>
<patternset refid="dist.lib.files"/>
</fileset>
</copy>
<java classname="${mainclass}" fork="true" maxmemory="${jruby.launch.memory}" failonerror="true">
<classpath>
<pathelement location="${jruby.classes.dir}"/>
<pathelement location="${build.dir}/jar-complete"/>
<path refid="build.classpath"/>
</classpath>
<sysproperty key="jruby.home" value="${build.dir}/jar-complete/META-INF/jruby.home"/>
<env key="RUBYOPT" value=""/>
<jvmarg value="${run.jvm.model}"/>
<arg value="--command"/>
<arg value="maybe_install_gems"/>
<arg value="${build.lib.dir}/${rspec.gem}"/>
<arg value="${build.lib.dir}/${rake.gem}"/>
<arg value="${build.lib.dir}/${ruby-debug-base.gem}"/>
<arg value="${build.lib.dir}/${ruby-debug.gem}"/>
<arg value="${build.lib.dir}/${columnize.gem}"/>
<arg value="--no-ri"/>
<arg value="--no-rdoc"/>
<arg value="--ignore-dependencies"/>
<arg value="--env-shebang"/>
</java>
<taskdef name="jarjar" classname="com.tonicsystems.jarjar.JarJarTask" classpath="${build.lib.dir}/jarjar-1.0.jar"/>
<jarjar destfile="${dest.lib.dir}/${filename}">
<fileset dir="${jruby.classes.dir}"/>
<fileset dir="${build.dir}/jar-complete">
<exclude name="META-INF/jruby.home/lib/ruby/site_ruby/shared/builtin/**"/>
<exclude name="META-INF/jruby.home/lib/ruby/1.9/**"/>
</fileset>
<zipfileset src="${build.lib.dir}/asm-3.2.jar"/>
<zipfileset src="${build.lib.dir}/asm-commons-3.2.jar"/>
<zipfileset src="${build.lib.dir}/asm-util-3.2.jar"/>
<zipfileset src="${build.lib.dir}/asm-analysis-3.2.jar"/>
<zipfileset src="${build.lib.dir}/asm-tree-3.2.jar"/>
<zipfileset src="${build.lib.dir}/bytelist.jar"/>
<zipfileset src="${build.lib.dir}/constantine.jar"/>
<zipfileset src="${build.lib.dir}/jline-0.9.93.jar"/>
<zipfileset src="${build.lib.dir}/jcodings.jar"/>
<zipfileset src="${build.lib.dir}/joni.jar"/>
<zipfileset src="${build.lib.dir}/jnr-posix.jar"/>
<zipfileset src="${build.lib.dir}/jaffl.jar"/>
<zipfileset src="${build.lib.dir}/jffi.jar"/>
<zipfileset src="${build.lib.dir}/jffi-i386-Linux.jar"/>
<zipfileset src="${build.lib.dir}/jffi-x86_64-Linux.jar"/>
<zipfileset src="${build.lib.dir}/jffi-Darwin.jar"/>
<zipfileset src="${build.lib.dir}/jffi-i386-SunOS.jar"/>
<zipfileset src="${build.lib.dir}/jffi-x86_64-SunOS.jar"/>
<zipfileset src="${build.lib.dir}/jffi-ppc-AIX.jar"/>
<zipfileset src="${build.lib.dir}/jffi-ppc-Linux.jar"/>
<zipfileset src="${build.lib.dir}/jffi-sparc-SunOS.jar"/>
<zipfileset src="${build.lib.dir}/jffi-sparcv9-SunOS.jar"/>
<zipfileset src="${build.lib.dir}/jffi-i386-FreeBSD.jar"/>
<zipfileset src="${build.lib.dir}/jffi-x86_64-FreeBSD.jar"/>
<zipfileset src="${build.lib.dir}/jffi-i386-OpenBSD.jar"/>
<zipfileset src="${build.lib.dir}/jffi-x86_64-OpenBSD.jar"/>
<zipfileset src="${build.lib.dir}/jffi-i386-Windows.jar"/>
<zipfileset src="${build.lib.dir}/jffi-x86_64-Windows.jar"/>
<zipfileset src="${build.lib.dir}/jffi-s390x-Linux.jar"/>
<zipfileset src="${build.lib.dir}/joda-time-1.6.jar"/>
<zipfileset src="${build.lib.dir}/dynalang-0.3.jar"/>
<zipfileset src="${build.lib.dir}/yydebug.jar"/>
<zipfileset src="${build.lib.dir}/nailgun-0.7.1.jar"/>
<zipfileset src="${shared.lib.dir}/yecht.jar"/>
<metainf dir="${base.dir}/spi">
<include name="services/**"/>
</metainf>
<manifest>
<attribute name="Built-By" value="${user.name}"/>
<attribute name="Main-Class" value="${mainclass}"/>
</manifest>
<rule pattern="org.objectweb.asm.**" result="jruby.objectweb.asm.@1"/>
</jarjar>
<antcall target="_osgify-jar_">
<param name="bndfile" value="jruby-complete.bnd" />
<param name="jar.wrap" value="${dest.lib.dir}/${filename}" />
</antcall>
</target>
<target name="dist-jar-complete" depends="jar-complete">
<mkdir dir="${dist.dir}"/>
<move file="${dest.lib.dir}/jruby-complete.jar" tofile="${dist.dir}/jruby-complete-${version.jruby}.jar"/>
<checksum file="${dist.dir}/jruby-complete-${version.jruby}.jar" algorithm="md5"/>
<checksum file="${dist.dir}/jruby-complete-${version.jruby}.jar" algorithm="sha1"/>
</target>
<target name="jar-complete-1.9" depends="generate-method-classes, generate-unsafe" 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.0.jar"/>
<property name="jar-complete-home" value="${build.dir}/jar-complete/META-INF/jruby.home"/>
<mkdir dir="${jar-complete-home}"/>
<copy todir="${jar-complete-home}">
<fileset dir="${basedir}">
<patternset refid="dist.bindir.files"/>
<patternset refid="dist.lib.files"/>
</fileset>
</copy>
<java classname="${mainclass}" fork="true" maxmemory="${jruby.launch.memory}" failonerror="true">
<classpath>
<pathelement location="${jruby.classes.dir}"/>
<pathelement location="${build.dir}/jar-complete"/>
<path refid="build.classpath"/>
</classpath>
<sysproperty key="jruby.home" value="${build.dir}/jar-complete/META-INF/jruby.home"/>
<env key="RUBYOPT" value=""/>
<jvmarg value="${run.jvm.model}"/>
<arg value="--command"/>
<arg value="maybe_install_gems"/>
<arg value="${build.lib.dir}/${rspec.gem}"/>
<arg value="${build.lib.dir}/${rake.gem}"/>
<arg value="${build.lib.dir}/${ruby-debug-base.gem}"/>
<arg value="${build.lib.dir}/${ruby-debug.gem}"/>
<arg value="${build.lib.dir}/${columnize.gem}"/>
<arg value="--no-ri"/>
<arg value="--no-rdoc"/>
<arg value="--ignore-dependencies"/>
<arg value="--env-shebang"/>
</java>
<taskdef name="jarjar" classname="com.tonicsystems.jarjar.JarJarTask" classpath="${build.lib.dir}/jarjar-1.0.jar"/>
<jarjar destfile="${dest.lib.dir}/${filename}">
<fileset dir="${jruby.classes.dir}"/>
<fileset dir="${build.dir}/jar-complete">
<exclude name="META-INF/jruby.home/lib/ruby/1.8/**"/>
</fileset>
<zipfileset src="${build.lib.dir}/asm-3.2.jar"/>
<zipfileset src="${build.lib.dir}/asm-commons-3.2.jar"/>
<zipfileset src="${build.lib.dir}/asm-util-3.2.jar"/>
<zipfileset src="${build.lib.dir}/asm-analysis-3.2.jar"/>
<zipfileset src="${build.lib.dir}/asm-tree-3.2.jar"/>
<zipfileset src="${build.lib.dir}/bytelist.jar"/>
<zipfileset src="${build.lib.dir}/constantine.jar"/>
<zipfileset src="${build.lib.dir}/jline-0.9.93.jar"/>
<zipfileset src="${build.lib.dir}/jcodings.jar"/>
<zipfileset src="${build.lib.dir}/joni.jar"/>
<zipfileset src="${build.lib.dir}/jnr-posix.jar"/>
<zipfileset src="${build.lib.dir}/jaffl.jar"/>
<zipfileset src="${build.lib.dir}/jffi.jar"/>
<zipfileset src="${build.lib.dir}/jffi-i386-Linux.jar"/>
<zipfileset src="${build.lib.dir}/jffi-x86_64-Linux.jar"/>
<zipfileset src="${build.lib.dir}/jffi-Darwin.jar"/>
<zipfileset src="${build.lib.dir}/jffi-i386-SunOS.jar"/>
<zipfileset src="${build.lib.dir}/jffi-x86_64-SunOS.jar"/>
<zipfileset src="${build.lib.dir}/jffi-ppc-AIX.jar"/>
<zipfileset src="${build.lib.dir}/jffi-ppc-Linux.jar"/>
<zipfileset src="${build.lib.dir}/jffi-sparc-SunOS.jar"/>
<zipfileset src="${build.lib.dir}/jffi-sparcv9-SunOS.jar"/>
<zipfileset src="${build.lib.dir}/jffi-i386-FreeBSD.jar"/>
<zipfileset src="${build.lib.dir}/jffi-x86_64-FreeBSD.jar"/>
<zipfileset src="${build.lib.dir}/jffi-i386-OpenBSD.jar"/>
<zipfileset src="${build.lib.dir}/jffi-x86_64-OpenBSD.jar"/>
<zipfileset src="${build.lib.dir}/jffi-i386-Windows.jar"/>
<zipfileset src="${build.lib.dir}/jffi-x86_64-Windows.jar"/>
<zipfileset src="${build.lib.dir}/jffi-s390x-Linux.jar"/>
<zipfileset src="${build.lib.dir}/joda-time-1.6.jar"/>
<zipfileset src="${build.lib.dir}/dynalang-0.3.jar"/>
<zipfileset src="${build.lib.dir}/yydebug.jar"/>
<zipfileset src="${build.lib.dir}/nailgun-0.7.1.jar"/>
<zipfileset src="${shared.lib.dir}/yecht.jar"/>
<metainf dir="${base.dir}/spi">
<include name="services/**"/>
</metainf>
<manifest>
<attribute name="Built-By" value="${user.name}"/>
<attribute name="Main-Class" value="${mainclass}"/>
</manifest>
<rule pattern="org.objectweb.asm.**" result="jruby.objectweb.asm.@1"/>
</jarjar>
<antcall target="_osgify-jar_">
<param name="bndfile" value="jruby-complete.bnd" />
<param name="jar.wrap" value="${dest.lib.dir}/${filename}" />
</antcall>
</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="jar-light" depends="init" description="Create the jruby-light.jar file">
<antcall target="jar-jruby-light" inheritall="true"/>
</target>
<target name="jar-dist" depends="init" description="Create the jruby.jar file for distribution. This version uses JarJar Links to rewrite some packages.">
<antcall target="jar-jruby-dist" inheritall="true"/>
</target>
<target name="compile-test" depends="jar" description="Compile the unit tests">
<javac destdir="${test.classes.dir}" deprecation="true" encoding="UTF-8" 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}"/>
<src path="${spec.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}"/>
<property name="install.ri" value="--no-ri"/>
<property name="install.rdoc" value="--no-rdoc"/>
<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="${build.lib.dir}/${rspec.gem}"/>
<arg value="${build.lib.dir}/${rake.gem}"/>
<arg value="${build.lib.dir}/${ruby-debug-base.gem}"/>
<arg value="${build.lib.dir}/${ruby-debug.gem}"/>
<arg value="${build.lib.dir}/${columnize.gem}"/>
<arg value="${install.ri}"/>
<arg value="${install.rdoc}"/>
<arg value="--ignore-dependencies"/>
<arg value="--env-shebang"/>
</java>
</target>
<target name="install-build-gems" depends="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="mocha"/>
<arg value="jruby-openssl"/>
<arg value="--no-ri"/>
<arg value="--no-rdoc"/>
<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"/>
<jvmarg value="${run.jvm.model}"/>
<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; use with 'jar' to create an instrumented jar." >
<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" depends="emma">
<emma enabled="${emma.enabled}" >
<instr instrpathref="classes_to_instrument"
mode="overwrite"
metadatafile="${test.results.dir}/metadata.emma"
merge="false">
<filter excludes="*INVOKER*"/>
</instr>
</emma>
<antcall target="jar"/>
</target>
<target name="coverage-report" description="Generate a coverage report based on aggregated runs." depends="emma">
<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,
run-junit-interpreted-short,
test-rake-targets"
description="Runs unit tests.">
</target>
<target name="test-extended" depends="
copy-test-files,
run-junit-compiled,
test-rake-targets"
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,test-interpreted-1.9"/>
<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-1.9" depends="test-interpreted-1.9, test-compiled-1.9"
description="Runs unit tests compatible with ruby 1.9"/>
<target name="test-all" depends="
copy-test-files,
test-security-manager,
run-junit-interpreted,
run-junit-compiled,
run-junit-precompiled,
run-junit-interpreted-1.9,
run-junit-reflected-precompiled,
run-junit-interpreted-threadpool,
compile-stdlib"
description="Runs unit tests in all modes."/>
<!-- 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-short"><run-junit-1.8-short compile.mode="JIT" jit.threshold="0"/></target>
<target name="run-junit-interpreted-short"><run-junit-1.8-short/></target>
<!-- temporarily disabled during compiler work -->
<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>
<target name="run-junit-embed" depends="copy-test-files" description="Runs unit embedding API tests."><run-junit-embed-all/></target>
<path id="test.class.path">
<fileset dir="${build.lib.dir}" includes="*.jar">
<exclude name="jcodings.jar"/>
<exclude name="joni.jar"/>
</fileset>
<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.maxsize" 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="junit-tests"/>
<sequential>
<echo message="compile=@{compile.mode}, jit.threshold=@{jit.threshold}, jit.maxsize=@{jit.maxsize}, 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="1800000">
<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.maxsize" value="@{jit.maxsize}"/>
<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.thread.pool.enabled" value="@{thread.pooling}"/>
<sysproperty key="jruby.reflection" value="@{reflection}"/>
<sysproperty key="jruby.jit.logging.verbose" value="true"/>
<sysproperty key="jruby.compile.lazyHandles" value="true"/>
<!-- emma coverage tool properties -->
<sysproperty key="emma.coverage.out.file" value="${test.results.dir}/coverage.emma" />
<sysproperty key="emma.coverage.out.merge" value="true" />
<sysproperty key="emma.verbosity.level" value="silent" />
<!-- force encoding to UTF-8 because of stupid Macroman on OS X -->
<sysproperty key="file.encoding" value="UTF-8"/>
<jvmarg value="-ea"/>
<jvmarg value="${run.jvm.model}"/>
<!-- force client VM to improve test run times -->
<jvmarg value="-client"/>
<!-- set a larger max permgen, since the tests load a lot of bytecode -->
<jvmarg value="-XX:MaxPermSize=128M"/>
<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-short">
<attribute name="compile.mode" default="OFF"/>
<attribute name="jit.threshold" default="20"/>
<attribute name="jit.maxsize" default="1000000000"/>
<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}"
jit.maxsize="@{jit.maxsize}">
<junit-tests>
<test name="${test}" if="test"/>
<test name="org.jruby.test.ScriptTestSuite" todir="${test.results.dir}" unless="test"/>
<test name="org.jruby.test.JRubyTestSuite" todir="${test.results.dir}" unless="test"/>
<test name="org.jruby.test.MRITestSuite" todir="${test.results.dir}" unless="test"/>
<test name="org.jruby.test.MainTestSuite" todir="${test.results.dir}" unless="test"/>
</junit-tests>
</run-junit>
</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="jit.maxsize" default="1000000000"/>
<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}"
jit.maxsize="@{jit.maxsize}">
<junit-tests>
<test name="${test}" if="test"/>
<test name="org.jruby.test.ScriptTestSuite" todir="${test.results.dir}" unless="test"/>
<test name="org.jruby.test.JRubyTestSuite" 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.jruby.test.MainTestSuite" 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="jit.maxsize" default="1000000000"/>
<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}"
jit.maxsize="@{jit.maxsize}">
<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>
<macrodef name="run-junit-embed-all">
<sequential>
<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="1800000">
<classpath refid="test.class.path"/>
<jvmarg value="-Dfile.encoding=UTF-8"/>
<formatter type="xml"/>
<formatter type="brief" usefile="false" />
<batchtest fork="yes" todir="${test.results.dir}">
<fileset dir="${test.dir}">
<include name="org/jruby/embed/**/*Test*.java"/>
</fileset>
</batchtest>
</junit>
</sequential>
</macrodef>
<target name="test-security-manager" depends="jar-jruby">
<java classname="org.jruby.Main" fork="true" failonerror="false">
<classpath refid="test.class.path"/>
<sysproperty key="java.security.manager" value=""/>
<!-- Note the extra '=' in the value, it *is* intentional -->
<sysproperty key="java.security.policy" value="=file:test/restricted.policy"/>
<sysproperty key="java.awt.headless" value="true"/>
<jvmarg value="${run.jvm.model}"/>
<arg value="-ve"/>
<arg value="puts 'Restricted policy looks ok'"/>
</java>
</target>
<target name="test-rake-targets" depends="install-gems">
<run-rake rake.targets="spec:ji:quiet"/>
<run-rake rake.targets="test:tracing" jruby.args="--debug"/>
<run-rake rake.targets="spec:compiler"/>
<run-rake rake.targets="spec:ffi"/>
</target>
<macrodef name="run-rake">
<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="inproc" default="true"/>
<attribute name="jruby.args" default=""/>
<attribute name="rake.targets"/>
<attribute name="dir" default="${base.dir}"/>
<attribute name="jvm.args" default="-ea"/>
<sequential>
<echo message="Running rake @{rake.targets}"/>
<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="@{dir}">
<classpath refid="test.class.path"/>
<jvmarg line="@{jvm.args}"/>
<jvmarg value="${run.jvm.model}"/>
<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}"/>
<sysproperty key="jruby.launch.inproc" value="@{inproc}"/>
<sysproperty key="emma.coverage.out.file" value="${test.results.dir}/coverage.emma" />
<sysproperty key="emma.coverage.out.merge" value="true" />
<sysproperty key="emma.verbosity.level" value="silent" />
<arg line="@{jruby.args}"/>
<arg line="-S rake"/>
<arg line="@{rake.targets}"/>
</java>
</sequential>
</macrodef>
<target name="detect-stable-specs-need-update">
<property file="${spec.dir}/rubyspecs.current.revision"/>
<condition property="stable-specs-need-update">
<or>
<not> <available file="${rubyspec.dir}"/> </not>
<not> <available file="${mspec.dir}"/> </not>
<not>
<equals
arg1="${rubyspecs.revision}"
arg2="${rubyspecs.current.revision}"/>
</not>
<not>
<equals
arg1="${mspec.revision}"
arg2="${mspec.current.revision}"/>
</not>
</or>
</condition>
</target>
<target name="fetch-stable-specs" depends="fetch-specs, detect-stable-specs-need-update" if="stable-specs-need-update">
<echo message="Rolling rubyspec to stable version"/>
<exec dir="${rubyspec.dir}" executable="git">
<arg line="checkout ${rubyspecs.revision}"/>
</exec>
<echo message="Rolling mspec to stable version"/>
<exec dir="${mspec.dir}" executable="git">
<arg line="checkout ${mspec.revision}"/>
</exec>
<!-- Write down the revision of downloaded specs -->
<propertyfile file="${spec.dir}/rubyspecs.current.revision" comment="Revision of downloaded specs.">
<entry key="rubyspecs.current.revision" value="${rubyspecs.revision}"/>
<entry key="mspec.current.revision" value="${mspec.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-short" depends="fetch-stable-specs, run-specs-short"
description="Runs known good version of rubyspecs, excluding unstable library specs."/>
<target name="spec-short-1.9" depends="fetch-stable-specs, run-specs-short-1.9"
description="Runs known good version of rubyspecs, excluding unstable library specs."/>
<target name="spec-ci" depends="fetch-stable-specs, run-specs-ci"
description="Runs known good version of rubyspecs interpreted, compiled, and precompile, excluding unstable library specs."/>
<target name="spec-ci-1.9" depends="fetch-stable-specs, run-specs-ci-1.9"
description="Runs known good version of rubyspecs interpreted, compiled, and precompile, excluding unstable library specs."/>
<target name="spec-all" depends="fetch-stable-specs, run-specs-all"
description="Runs known good version of rubyspecs without exclusions."/>
<target name="spec-all-interpreted" depends="fetch-stable-specs, run-specs-all-interpreted"
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="${rubyspec.dir}/.git"/>
</condition>
<antcall target="do-fetch-specs"/>
<antcall target="do-update-specs"/>
</target>
<target name="do-fetch-specs" unless="rubyspec-repo-exists">
<!-- Stable specs might exist, so delete them -->
<antcall target="clear-specs" inheritall="false"/>
<echo message="Cloning rubyspec repo to: ${rubyspec.dir}"/>
<exec dir="${spec.dir}" executable="git">
<arg value="clone"/>
<arg value="git://github.com/rubyspec/rubyspec.git"/>
<arg value="${rubyspec.dir}"/>
</exec>
<echo message="Cloning mspec repo to: ${mspec.dir}"/>
<exec dir="${spec.dir}" executable="git">
<arg value="clone"/>
<arg value="git://github.com/rubyspec/mspec.git"/>
<arg value="${mspec.dir}"/>
</exec>
</target>
<target name="do-update-specs" if="rubyspec-repo-exists">
<echo message="Updating rubyspec repo -- ${rubyspec.dir}"/>
<exec dir="${rubyspec.dir}" executable="git">
<arg value="fetch"/>
</exec>
<echo message="Updating mspec repo -- ${mspec.dir}"/>
<exec dir="${mspec.dir}" executable="git">
<arg value="fetch"/>
</exec>
</target>
<target name="clear-specs">
<delete dir="${rubyspec.dir}"/>
<delete dir="${mspec.dir}"/>
<delete file="${build.dir}/rubyspec.tgz"/>
<delete file="${build.dir}/mspec.tgz"/>
<delete file="${spec.dir}/rubyspecs.current.revision"/>
</target>
<target name="run-specs" depends="run-specs-precompiled, run-specs-compiled, run-specs-interpreted">
<condition property="spec.status.combined.OK">
<and>
<equals arg1="${spec.status.PRECOMPILED}" arg2="0"/>
<equals arg1="${spec.status.COMPILED}" arg2="0"/>
<equals arg1="${spec.status.INTERPRETED}" arg2="0"/>
</and>
</condition>
<fail message="RubySpecs FAILED" unless="spec.status.combined.OK"/>
</target>
<target name="run-specs-short" depends="run-specs-interpreted-short">
<condition property="spec.status.combined.OK">
<and>
<equals arg1="${spec.status.INTERPRETED}" arg2="0"/>
</and>
</condition>
<fail message="RubySpecs FAILED" unless="spec.status.combined.OK"/>
</target>
<target name="run-specs-short-1.9" depends="run-specs-interpreted-short-1.9">
<condition property="spec.status.combined.OK">
<and>
<equals arg1="${spec.status.INTERPRETED}" arg2="0"/>
</and>
</condition>
<fail message="RubySpecs FAILED" unless="spec.status.combined.OK"/>
</target>
<target name="run-specs-ci" depends="run-specs-compiled-short, run-specs-interpreted-short, run-specs-precompiled-short">
<condition property="spec.status.combined.OK">
<and>
<equals arg1="${spec.status.PRECOMPILED}" arg2="0"/>
<equals arg1="${spec.status.COMPILED}" arg2="0"/>
<equals arg1="${spec.status.INTERPRETED}" arg2="0"/>
</and>
</condition>
<fail message="RubySpecs FAILED" unless="spec.status.combined.OK"/>
</target>
<target name="run-specs-ci-1.9" depends="run-specs-compiled-short-1.9, run-specs-interpreted-short-1.9, run-specs-precompiled-short-1.9">
<condition property="spec.status.combined.OK">
<and>
<equals arg1="${spec.status.PRECOMPILED}" arg2="0"/>
<equals arg1="${spec.status.COMPILED}" arg2="0"/>
<equals arg1="${spec.status.INTERPRETED}" arg2="0"/>
</and>
</condition>
<fail message="RubySpecs FAILED" unless="spec.status.combined.OK"/>
</target>
<target name="run-specs-all" depends="jar"><antcall target="run-specs-all-precompiled"/></target>
<target name="run-specs-compiled" depends="jar">
<_run_specs_internal mode.name="COMPILED" compile.mode="JIT" jit.threshold="0" spec.config="${spec.dir}/jruby.1.8.mspec"/>
</target>
<target name="run-specs-precompiled" depends="jar">
<_run_specs_internal mode.name="PRECOMPILED" compile.mode="FORCE" jit.threshold="0" spec.config="${spec.dir}/jruby.1.8.mspec"/>
</target>
<target name="run-specs-interpreted" depends="jar">
<_run_specs_internal mode.name="INTERPRETED" compile.mode="OFF" spec.config="${spec.dir}/jruby.1.8.mspec"/>
</target>
<target name="run-specs-compiled-short" depends="jar">
<_run_specs_internal mode.name="COMPILED" compile.mode="JIT" jit.threshold="0" spec.config="${spec.dir}/jruby.1.8.mspec"/>
</target>
<target name="run-specs-precompiled-short" depends="jar">
<_run_specs_internal mode.name="PRECOMPILED" compile.mode="FORCE" jit.threshold="0" spec.config="${spec.dir}/jruby.1.8.mspec"/>
</target>
<target name="run-specs-interpreted-short" depends="jar">
<_run_specs_internal mode.name="INTERPRETED" compile.mode="OFF" spec.config="${spec.dir}/jruby.1.8.mspec"/>
</target>
<target name="run-specs-compiled-short-1.9" depends="jar">
<_run_specs_internal mode.name="COMPILED" compile.mode="JIT" jit.threshold="0" spec.config="${spec.dir}/jruby.1.9.mspec" compat="RUBY1_9"/>
</target>
<target name="run-specs-precompiled-short-1.9" depends="jar">
<_run_specs_internal mode.name="PRECOMPILED" compile.mode="FORCE" jit.threshold="0" spec.config="${spec.dir}/jruby.1.9.mspec" compat="RUBY1_9"/>
</target>
<target name="run-specs-interpreted-short-1.9" depends="jar">
<_run_specs_internal mode.name="INTERPRETED" compile.mode="OFF" spec.config="${spec.dir}/jruby.1.9.mspec" compat="RUBY1_9"/>
</target>
<target name="run-specs-all-interpreted"><_run_specs_all_internal compile.mode="OFF"/></target>
<target name="run-specs-all-precompiled"><_run_specs_all_internal compile.mode="FORCE" jit.threshold="0"/></target>
<target name="update-excludes">
<java classname="org.jruby.Main" fork="true" maxmemory="${jruby.launch.memory}" failonerror="false" dir="${spec.dir}">
<classpath refid="build.classpath"/>
<classpath path="${jruby.classes.dir}"/>
<sysproperty key="jruby.home" value="${basedir}"/>
<sysproperty key="jruby.launch.inproc" value="false"/>
<arg line="${mspec.dir}/bin/mspec tag"/>
<arg line="--add fails --fail"/>
<arg line="-B ${spec.dir}/default.mspec"/>
</java>
</target>
<target name="spec-show-excludes" depends="prepare"
description="Prints out all currently excluded rubyspecs.">
<spec-show-excludes/>
</target>
<target name="spec-show-excludes-1.9" depends="prepare"
description="Prints out all currently excluded rubyspecs in 1.9 mode.">
<spec-show-excludes spec.mode="1.9"/>
</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"/>
<attribute name="mode.name"/>
<attribute name="spec.config"/>
<attribute name="compat" default="RUBY1_8"/>
<sequential>
<echo message="compile=@{compile.mode}, threshold=@{jit.threshold}, objectspace=@{objectspace.enabled} threadpool=@{thread.pooling} reflection=@{reflection} compat=@{compat}"/>
<java classname="org.jruby.Main" fork="true" maxmemory="${jruby.launch.memory}" failonerror="false" resultproperty="spec.status.@{mode.name}" dir="${base.dir}">
<classpath refid="test.class.path"/>
<jvmarg value="-ea"/>
<jvmarg value="${run.jvm.model}"/>
<sysproperty key="jruby.home" value="${basedir}"/>
<sysproperty key="jruby.launch.inproc" value="false"/>
<sysproperty key="emma.verbosity.level" value="silent" />
<env key="JAVA_OPTS" value="-Demma.verbosity.level=silent"/>
<arg line="${mspec.dir}/bin/mspec ci"/>
<arg line="-T -J-ea"/>
<arg line="-T -J-Djruby.launch.inproc=false"/>
<arg line="-T -J-Djruby.compile.mode=@{compile.mode}"/>
<arg line="-T -J-Djruby.jit.threshold=@{jit.threshold}"/>
<arg line="-T -J-Djruby.jit.max=@{jit.max}"/>
<arg line="-T -J-Djruby.objectspace.enabled=@{objectspace.enabled}"/>
<arg line="-T -J-Djruby.thread.pool.enabled=@{thread.pooling}"/>
<arg line="-T -J-Djruby.reflection=@{reflection}"/>
<arg line="-T -J-Djruby.compat.version=@{compat}"/>
<arg line="-T -J-Demma.coverage.out.file=${test.results.dir}/coverage.emma"/>
<arg line="-T -J-Demma.coverage.out.merge=true"/>
<arg line="-T -J-Demma.verbosity.level=silent" />
<arg line="${spec.jvm.model.option}" />
<arg line="-f m"/>
<arg line="-B @{spec.config}"/>
</java>
</sequential>
</macrodef>
<macrodef name="_run_specs_internal">
<attribute name="compile.mode" default="OFF"/>
<attribute name="jit.threshold" default="20"/>
<attribute name="mode.name"/>
<attribute name="spec.config"/>
<attribute name="compat" default="RUBY1_8"/>
<sequential>
<echo message="Excludes: ${spec.tags.dir}"/>
<run-specs mode.name="@{mode.name}"
compile.mode="@{compile.mode}" jit.threshold="@{jit.threshold}"
spec.config="@{spec.config}" compat="@{compat}"/>
</sequential>
</macrodef>
<macrodef name="spec-show-excludes">
<attribute name="spec.mode" default="1.8"/>
<sequential>
<available property="mspec-available" file="${mspec.dir}/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="${spec.dir}">
<classpath refid="build.classpath"/>
<classpath path="${jruby.classes.dir}"/>
<sysproperty key="jruby.home" value="${basedir}"/>
<sysproperty key="jruby.launch.inproc" value="false"/>
<arg line="${mspec.dir}/bin/mspec"/>
<arg line="-f s -g fails -g critical -g windows --dry-run"/>
<arg line="-T--@{spec.mode}"/>
<arg line="-B ${spec.dir}/jruby.@{spec.mode}.mspec"/>
<arg value=":ci_files"/>
</java>
</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">
<attribute name="dist-stage-dir" default="${dist.stage.bin.dir}"/>
<sequential>
<fixcrlf srcdir="@{dist-stage-dir}/bin" excludes="*.bat,*.exe,*.dll" eol="lf"/>
<fixcrlf srcdir="@{dist-stage-dir}/bin" includes="*.bat" eol="crlf"/>
</sequential>
</macrodef>
<macrodef name="unzip-native-libs">
<attribute name="destination.dir"/>
<sequential>
<mkdir dir="@{destination.dir}"/>
<unzip dest="@{destination.dir}">
<fileset dir="build_lib">
<include name="jffi-*.jar"/>
</fileset>
<patternset>
<include name="**/libjffi-*.so"/>
<include name="**/libjffi-*.a"/>
<include name="**/libjffi-*.jnilib"/>
<include name="**/jffi-*.dll"/>
</patternset>
<mapper>
<filtermapper>
<replacestring from="jni/" to="./"/>
</filtermapper>
</mapper>
</unzip>
</sequential>
</macrodef>
<target name="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"
maxmemory="128m">
<fileset dir="${src.dir}">
<include name="**/*.java"/>
</fileset>
<classpath refid="build.classpath"/>
<doctitle><![CDATA[<h1>JRuby</h1>]]></doctitle>
<bottom><![CDATA[<i>Copyright &#169; 2002-2009 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"/>
<include name="bin/ast*"/>
<include name="bin/spec.bat"/>
<include name="bin/rake.bat"/>
</patternset>
<patternset id="dist.lib.files">
<include name="lib/ruby/1.8/**"/>
<include name="lib/ruby/1.9/**"/>
<include name="lib/ruby/site_ruby/**"/>
<include name="lib/ruby/gems/1.8/specifications/sources-0.0.1.gemspec"/>
<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="LICENSE.RUBY"/>
<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.0.jar"/>
<exclude name="docs/rdocs.tar.gz"/>
<exclude name="bench/**"/>
<include name="share/**"/>
</patternset>
<patternset id="dist.src.files">
<patternset refid="dist.files"/>
<exclude name="share/**"/>
<include name="bench/**"/>
<include name="src/**"/>
<include name="test/**"/>
<include name="spec/**"/>
<include name="tool/**"/>
<exclude name="tool/nailgun/**"/>
<include name="build_lib/**"/>
<include name="Rakefile"/>
<include name="build.xml"/>
<include name="ivy/**"/>
<include name="nbproject/*"/>
<include name=".project"/>
<include name=".classpath"/>
<include name="default.build.properties"/>
<include name="jruby.bnd.template"/>
<include name="pom.xml"/>
<include name="maven/**"/>
<exclude name="lib/jruby.jar"/>
</patternset>
<!-- note: tool/nailgun/configure must be added separately -->
<patternset id="dist.nailgun.files">
<include name="tool/nailgun/Makefile.in"/>
<include name="tool/nailgun/README.txt"/>
<include name="tool/nailgun/ng.exe"/>
<include name="tool/nailgun/src/**"/>
</patternset>
<target name="dist-bin" depends="jar-dist">
<mkdir dir="${dist.stage.bin.dir}"/>
<copy todir="${dist.stage.bin.dir}">
<fileset dir="${basedir}">
<patternset refid="dist.bindir.files"/>
<patternset refid="dist.lib.files"/>
</fileset>
</copy>
<mkdir dir="${dist.stage.bin.dir}/lib/native"/>
<unzip-native-libs destination.dir="${dist.stage.bin.dir}/lib/native"/>
<fixEOLs dist-stage-dir="${dist.stage.bin.dir}"/>
<antcall target="install-gems">
<param name="jruby.home" value="${dist.stage.bin.dir}"/>
<param name="install.ri" value=""/>
<param name="install.rdoc" value=""/>
</antcall>
<tar destfile="${dist.dir}/jruby-bin-${version.jruby}.tar.gz" compression="gzip">
<tarfileset dir="${dist.stage.bin.dir}" mode="755" prefix="jruby-${version.jruby}">
<include name="bin/**"/>
</tarfileset>
<tarfileset dir="${dist.stage.bin.dir}" prefix="jruby-${version.jruby}">
<include name="lib/**"/>
</tarfileset>
<tarfileset dir="${basedir}" prefix="jruby-${version.jruby}">
<patternset refid="dist.bin.files"/>
</tarfileset>
<tarfileset dir="${basedir}" prefix="jruby-${version.jruby}">
<patternset refid="dist.nailgun.files"/>
</tarfileset>
<tarfileset dir="${basedir}" mode="755" prefix="jruby-${version.jruby}">
<include name="tool/nailgun/configure"/>
</tarfileset>
</tar>
<zip destfile="${dist.dir}/jruby-bin-${version.jruby}.zip">
<zipfileset dir="${dist.stage.bin.dir}" filemode="755" prefix="jruby-${version.jruby}">
<include name="bin/**"/>
</zipfileset>
<zipfileset dir="${dist.stage.bin.dir}" prefix="jruby-${version.jruby}">
<include name="lib/**"/>
</zipfileset>
<zipfileset dir="${basedir}" prefix="jruby-${version.jruby}">
<patternset refid="dist.bin.files"/>
</zipfileset>
<zipfileset dir="${basedir}" prefix="jruby-${version.jruby}">
<patternset refid="dist.nailgun.files"/>
</zipfileset>
<zipfileset dir="${basedir}" filemode="755" prefix="jruby-${version.jruby}">
<include name="tool/nailgun/configure"/>
</zipfileset>
</zip>
<checksum file="${dist.dir}/jruby-bin-${version.jruby}.zip" algorithm="md5"/>
<checksum file="${dist.dir}/jruby-bin-${version.jruby}.zip" algorithm="sha1"/>
<checksum file="${dist.dir}/jruby-bin-${version.jruby}.tar.gz" algorithm="md5"/>
<checksum file="${dist.dir}/jruby-bin-${version.jruby}.tar.gz" algorithm="sha1"/>
</target>
<target name="dist-src" depends="jar">
<mkdir dir="${dist.stage.src.dir}"/>
<copy todir="${dist.stage.src.dir}">
<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.stage.src.dir}"/>
<param name="install.ri" value=""/>
<param name="install.rdoc" value=""/>
</antcall>
<fixEOLs dist-stage-dir="${dist.stage.src.dir}"/>
<tar destfile="${dist.dir}/jruby-src-${version.jruby}.tar.gz" compression="gzip">
<tarfileset dir="${dist.stage.src.dir}" mode="755" prefix="jruby-${version.jruby}">
<include name="bin/**"/>
</tarfileset>
<tarfileset dir="${dist.stage.src.dir}" prefix="jruby-${version.jruby}">
<include name="lib/**"/>
</tarfileset>
<tarfileset dir="${basedir}" prefix="jruby-${version.jruby}">
<patternset refid="dist.src.files"/>
</tarfileset>
<tarfileset dir="${basedir}" prefix="jruby-${version.jruby}">
<patternset refid="dist.nailgun.files"/>
</tarfileset>
<tarfileset dir="${basedir}" mode="755" prefix="jruby-${version.jruby}">
<include name="tool/nailgun/configure"/>
</tarfileset>
</tar>
<zip destfile="${dist.dir}/jruby-src-${version.jruby}.zip">
<zipfileset dir="${dist.stage.src.dir}" filemode="755" prefix="jruby-${version.jruby}">
<include name="bin/**"/>
</zipfileset>
<zipfileset dir="${dist.stage.src.dir}" prefix="jruby-${version.jruby}">
<include name="lib/**"/>
</zipfileset>
<zipfileset dir="${basedir}" prefix="jruby-${version.jruby}">
<patternset refid="dist.src.files"/>
</zipfileset>
<zipfileset dir="${basedir}" prefix="jruby-${version.jruby}">
<patternset refid="dist.nailgun.files"/>
</zipfileset>
<zipfileset dir="${basedir}" filemode="755" prefix="jruby-${version.jruby}">
<include name="tool/nailgun/configure"/>
</zipfileset>
<zipfileset dir="${dist.stage.src.dir}" prefix="jruby-${version.jruby}">
<include name="spi/**"/>
</zipfileset>
</zip>
<checksum file="${dist.dir}/jruby-src-${version.jruby}.zip" algorithm="md5"/>
<checksum file="${dist.dir}/jruby-src-${version.jruby}.zip" algorithm="sha1"/>
<checksum file="${dist.dir}/jruby-src-${version.jruby}.tar.gz" algorithm="md5"/>
<checksum file="${dist.dir}/jruby-src-${version.jruby}.tar.gz" algorithm="sha1"/>
</target>
<target name="dist-snapshot" depends="jar">
<jar destfile="${lib.dir}/jruby.jar" update="true">
<fileset dir="${jruby.classes.dir}">
<include name="org/jruby/jruby.properties"/>
</fileset>
</jar>
<property name="jar-up-to-date" value="true"/>
<antcall target="dist-bin">
<param file="${jruby.classes.dir}/org/jruby/jruby.properties"/>
</antcall>
</target>
<target name="dist-snapshot-install-stuff">
<unzip dest="${snapshot.install.dir}" src="${dist.dir}/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}/org/jruby/jruby.properties"/>
</antcall>
</target>
<target name="dist" depends="dist-bin,dist-src,dist-jar-complete"/>
<target name="dist-clean">
<delete dir="${dist.dir}"/>
</target>
<target name="clean" depends="init" description="Cleans almost everything, leaves downloaded specs">
<delete dir="${build.dir}"/>
<delete dir="${dist.dir}"/>
<delete quiet="false">
<fileset dir="${lib.dir}" includes="jruby*.jar"/>
</delete>
<delete dir="${api.docs.dir}"/>
<delete dir="src_gen"/>
<antcall target="clean-ng"/>
</target>
<target name="clean-all" depends="clean, clear-specs, dist-clean" description="Cleans everything, including dist files and specs">
<delete dir="${base.dir}/build.eclipse"/>
<delete dir="${base.dir}/lib/native"/>
</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">
<echo message="Configuring ng client in ${nailgun.home}"/>
<exec executable="./configure" dir="${nailgun.home}" failonerror="true" output="/dev/null"/>
<echo message="Building ng client in ${nailgun.home}"/>
<exec executable="make" dir="${nailgun.home}" output="/dev/null"/>
</target>
<target name="need-clean-ng">
<condition property="should-clean-ng">
<and>
<available file="${nailgun.home}/Makefile"/>
<available file="${nailgun.home}/ng"/>
</and>
</condition>
</target>
<target name="clean-ng" depends="need-clean-ng" if="should-clean-ng">
<exec executable="make" dir="${nailgun.home}" osfamily="unix" failifexecutionfails="false" output="/dev/null">
<arg value="clean"/>
</exec>
</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"/>
</target>
<target name="fetch-rails">
<condition property="rails-repo-exists">
<available file="${rails.dir}/.git"/>
</condition>
<antcall target="do-fetch-rails"/>
<antcall target="do-update-rails"/>
</target>
<target name="do-fetch-rails" unless="rails-repo-exists">
<!-- Rails repo might already have been pulled, so delete it -->
<antcall target="clear-rails" inheritall="false"/>
<echo message="Cloning rails repo to: ${rails.dir}"/>
<exec executable="git">
<arg value="clone"/>
<arg value="--depth"/><arg value="1"/>
<arg value="git://github.com/rails/rails.git"/>
<arg value="${rails.dir}"/>
</exec>
</target>
<target name="do-update-rails" if="rails-repo-exists">
<echo message="Updating rubyspec repo -- ${rails.dir}"/>
<exec dir="${rails.dir}" executable="git">
<arg value="pull"/>
</exec>
</target>
<target name="clear-rails">
<delete dir="${rails.dir}"/>
</target>
<target name="test-rails-stable" depends="jar,install-build-gems,fetch-rails">
<!-- Need to disable assertions because of a rogue one in OpenSSL -->
<run-rake dir="${rails.dir}/activesupport" rake.targets="test" jvm.args="-da"/>
<run-rake dir="${rails.dir}/actionmailer" rake.targets="test"/>
<run-rake dir="${rails.dir}/activemodel" rake.targets="test"/>
<run-rake dir="${rails.dir}/railties" rake.targets="test"/>
</target>
<target name="fetch-prawn">
<condition property="prawn-repo-exists">
<available file="test/prawn/.git"/>
</condition>
<antcall target="do-fetch-prawn"/>
<antcall target="do-update-prawn"/>
</target>
<target name="do-fetch-prawn" unless="prawn-repo-exists">
<!-- Rails repo might already have been pulled, so delete it -->
<antcall target="clear-prawn" inheritall="false"/>
<echo message="Cloning prawn repo to: test/prawn"/>
<exec executable="git">
<arg value="clone"/>
<arg value="--depth"/><arg value="1"/>
<arg value="git://github.com/sandal/prawn.git"/>
<arg value="test/prawn"/>
</exec>
<exec executable="git" dir="test/prawn">
<arg value="checkout"/>
<arg value="0.4.1"/>
</exec>
<exec executable="git" dir="test/prawn">
<arg value="submodule"/>
<arg value="init"/>
</exec>
<exec executable="git" dir="test/prawn">
<arg value="submodule"/>
<arg value="update"/>
</exec>
</target>
<target name="do-update-prawn" if="prawn-repo-exists">
<echo message="Updating rubyspec repo -- test/prawn"/>
<exec dir="test/prawn" executable="git">
<arg value="pull"/>
</exec>
<exec executable="git" dir="test/prawn">
<arg value="checkout"/>
<arg value="0.4.1"/>
</exec>
<exec executable="git" dir="test/prawn">
<arg value="submodule"/>
<arg value="update"/>
</exec>
</target>
<target name="clear-prawn">
<delete dir="test/prawn"/>
</target>
<target name="test-prawn" depends="jar,install-build-gems,fetch-prawn">
<run-rake dir="test/prawn" rake.targets="test examples"/>
</target>
<target name="bench-language">
<java fork="true" classname="org.jruby.Main" output="bench.language.client.interpreted.txt" errorproperty="bench.error" failonerror="false">
<classpath refid="build.classpath"/>
<classpath path="${jruby.classes.dir}"/>
<jvmarg value="-client"/>
<jvmarg value="${run.jvm.model}"/>
<sysproperty key="jruby.home" value="${jruby.home}"/>
<arg value="-X-C"/>
<arg value="bench/language/bench_all.rb"/>
<arg value="5"/>
</java>
<java fork="true" classname="org.jruby.Main" output="bench.language.client.jitted.txt" errorproperty="bench.error" failonerror="false">
<classpath refid="build.classpath"/>
<classpath path="${jruby.classes.dir}"/>
<jvmarg value="-client"/>
<jvmarg value="${run.jvm.model}"/>
<sysproperty key="jruby.home" value="${jruby.home}"/>
<sysproperty key="jruby.jit.threshold" value="5"/>
<arg value="bench/language/bench_all.rb"/>
<arg value="5"/>
</java>
<java fork="true" classname="org.jruby.Main" output="bench.language.client.precompiled.txt" errorproperty="bench.error" failonerror="false">
<classpath refid="build.classpath"/>
<classpath path="${jruby.classes.dir}"/>
<jvmarg value="-client"/>
<jvmarg value="${run.jvm.model}"/>
<sysproperty key="jruby.home" value="${jruby.home}"/>
<arg value="-X+C"/>
<arg value="bench/language/bench_all.rb"/>
<arg value="5"/>
</java>
<java fork="true" classname="org.jruby.Main" output="bench.language.server.interpreted.txt" errorproperty="bench.error" failonerror="false">
<classpath refid="build.classpath"/>
<classpath path="${jruby.classes.dir}"/>
<jvmarg value="-server"/>
<jvmarg value="${run.jvm.model}"/>
<sysproperty key="jruby.home" value="${jruby.home}"/>
<arg value="-X-C"/>
<arg value="bench/language/bench_all.rb"/>
<arg value="5"/>
</java>
<java fork="true" classname="org.jruby.Main" output="bench.language.server.jitted.txt" errorproperty="bench.error" failonerror="false">
<classpath refid="build.classpath"/>
<classpath path="${jruby.classes.dir}"/>
<jvmarg value="-server"/>
<jvmarg value="${run.jvm.model}"/>
<sysproperty key="jruby.home" value="${jruby.home}"/>
<sysproperty key="jruby.jit.threshold" value="5"/>
<arg value="bench/language/bench_all.rb"/>
<arg value="5"/>
</java>
<java fork="true" classname="org.jruby.Main" output="bench.language.server.precompiled.txt" errorproperty="bench.error" failonerror="false">
<classpath refid="build.classpath"/>
<classpath path="${jruby.classes.dir}"/>
<jvmarg value="-server"/>
<jvmarg value="${run.jvm.model}"/>
<sysproperty key="jruby.home" value="${jruby.home}"/>
<arg value="-X+C"/>
<arg value="bench/language/bench_all.rb"/>
<arg value="5"/>
</java>
</target>
</project>
Jump to Line
Something went wrong with that request. Please try again.