Skip to content

Commit 27c42cc

Browse files
committed
Remove compile-related targets from ant and call mvn.
1 parent c205afc commit 27c42cc

File tree

1 file changed

+5
-239
lines changed

1 file changed

+5
-239
lines changed

build.xml

Lines changed: 5 additions & 239 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@
142142
</target>
143143

144144
<!-- Creates the directories needed for building -->
145-
<target name="prepare" depends="init, create-dirs, copy-resources, update-constants">
145+
<target name="prepare" depends="init, create-dirs, copy-resources">
146146
</target>
147147

148148
<target name="create-dirs" unless="create-dirs.hasrun">
@@ -184,169 +184,10 @@
184184
</copy>
185185
</target>
186186

187-
<macrodef name="update-constants">
188-
<attribute name="tzdata-version" default="${tzdata.distributed.version}"/>
189-
<sequential>
190-
<echo message="Updating Constants.java"/>
191-
192-
<!-- gross bit of property-juggling here to handle error case when git can't be executed -->
193-
<exec osfamily="unix" executable="/bin/sh" outputproperty="jruby.revision.output" failonerror="false"
194-
failifexecutionfails="false" errorproperty="jruby.revision.error">
195-
<arg line="-c 'git log -1 --format=format:%h'"/>
196-
</exec>
197-
<exec osfamily="windows" executable="cmd" outputproperty="jruby.revision.output" failonerror="false"
198-
failifexecutionfails="false" errorproperty="jruby.revision.error">
199-
<arg line="/c git log -1 --format=format:%h"/>
200-
</exec>
201-
<condition property="jruby.revision" value="fffffff">
202-
<equals arg1="${jruby.revision.output}" arg2=""/>
203-
</condition>
204-
<condition property="jruby.revision" value="${jruby.revision.output}">
205-
<not>
206-
<equals arg1="${jruby.revision.output}" arg2=""/>
207-
</not>
208-
</condition>
209-
210-
<echo message="...using git revision = ${jruby.revision}, tzdata = @{tzdata-version}"/>
211-
212-
<!-- avoid overwriting if it hasn't changed, to avoid recompiles -->
213-
<copy file="build/src_gen/org/jruby/runtime/Constants.java"
214-
tofile="build/src_gen/org/jruby/runtime/Constants.java.old"
215-
preservelastmodified="true" failonerror="false"/>
216-
<copy file="resources/org/jruby/runtime/Constants.java"
217-
overwrite="true"
218-
tofile="build/src_gen/org/jruby/runtime/Constants.java.gen">
219-
<filterset>
220-
<filter token="version.ruby.major" value="${version.ruby.major}"/>
221-
<filter token="version.ruby" value="${version.ruby}"/>
222-
<filter token="version.ruby.patchlevel" value="${version.ruby.patchlevel}"/>
223-
<filter token="version.ruby1_9.major" value="${version.ruby1_9.major}"/>
224-
<filter token="version.ruby1_9" value="${version.ruby1_9}"/>
225-
<filter token="version.ruby1_9.patchlevel" value="${version.ruby1_9.patchlevel}"/>
226-
<filter token="version.ruby1_9.revision" value="${version.ruby1_9.revision}"/>
227-
<filter token="version.ruby2_0.major" value="${version.ruby2_0.major}"/>
228-
<filter token="version.ruby2_0" value="${version.ruby2_0}"/>
229-
<filter token="version.ruby2_0.patchlevel" value="${version.ruby2_0.patchlevel}"/>
230-
<filter token="version.ruby2_0.revision" value="${version.ruby2_0.revision}"/>
231-
<filter token="build.date" value="${build.date}"/>
232-
<filter token="version.jruby" value="${version.jruby}"/>
233-
<filter token="java.specification.version" value="${java.specification.version}"/>
234-
<filter token="javac.version" value="${javac.version}"/>
235-
<filter token="os.arch" value="${os.arch}"/>
236-
<filter token="jruby.revision" value="${jruby.revision}"/>
237-
<filter token="joda.time.version" value="${joda.time.version}"/>
238-
<filter token="tzdata.version" value="@{tzdata-version}"/>
239-
<filter token="jruby.default.ruby.version" value="${jruby.default.ruby.version}"/>
240-
</filterset>
241-
</copy>
242-
243-
<condition property="constants.java.is.same">
244-
<filesmatch file1="build/src_gen/org/jruby/runtime/Constants.java.gen"
245-
file2="build/src_gen/org/jruby/runtime/Constants.java.old" textfile="true"/>
246-
</condition>
247-
<antcall target="_uc_internal_"/>
248-
249-
<property name="update-constants.hasrun" value="true"/>
250-
251-
</sequential>
252-
</macrodef>
253-
254-
<target name="update-constants" unless="update-constants.hasrun">
255-
<update-constants/>
256-
</target>
257-
258-
<target name="_uc_internal_" unless="constants.java.is.same">
259-
<copy file="build/src_gen/org/jruby/runtime/Constants.java.gen" tofile="build/src_gen/org/jruby/runtime/Constants.java"/>
260-
<javac destdir="${jruby.classes.dir}" debug="true" srcdir="build/src_gen"
261-
includes="org/jruby/runtime/Constants.java" source="${javac.version}"
262-
target="${javac.version}" deprecation="true" encoding="UTF-8"
263-
includeantruntime="false"/>
264-
</target>
265-
266-
<target name="compile-annotation-binder">
267-
<mkdir dir="build/src_gen"/>
268-
269-
<javac destdir="${jruby.classes.dir}" debug="true" srcdir="${src.dir}"
270-
sourcepath="" classpathref="build.classpath" source="${javac.version}"
271-
target="${javac.version}" deprecation="true" encoding="UTF-8"
272-
includeantruntime="false">
273-
<include name="org/jruby/anno/FrameField.java"/>
274-
<include name="org/jruby/anno/AnnotationBinder.java"/>
275-
<include name="org/jruby/anno/JRubyMethod.java"/>
276-
<include name="org/jruby/anno/FrameField.java"/>
277-
<include name="org/jruby/CompatVersion.java"/>
278-
<include name="org/jruby/runtime/Visibility.java"/>
279-
<include name="org/jruby/util/CodegenUtils.java"/>
280-
<include name="org/jruby/util/SafePropertyAccessor.java"/>
281-
</javac>
282-
</target>
283-
284-
<target name="compile" depends="compile-jruby, generate-method-classes, generate-unsafe"
285-
description="Compile the source files for the project.">
286-
</target>
287-
288-
<target name="compile-jruby" depends="prepare, compile-annotation-binder" unless="compiled">
289-
<javac destdir="${jruby.classes.dir}" fork="true"
290-
debug="true" source="${javac.version}" target="${javac.version}"
291-
deprecation="true" encoding="UTF-8" includeantruntime="true" memorymaximumsize="${jruby.compile.memory}">
292-
<classpath refid="jruby.execute.classpath"/>
293-
<src path="${src.dir}"/>
294-
<exclude name="org/jruby/runtime/Constants.java"/>
295-
<exclude name="java/dyn/**"/>
296-
<patternset refid="java.src.pattern"/>
297-
<compilerarg line="-XDignore.symbol.file=true"/>
298-
<compilerarg line="-J-Dfile.encoding=UTF-8"/>
299-
<compilerarg line="-J-Duser.language=en"/>
300-
<compilerarg line="-J-Xbootclasspath/p:build_lib/unsafe-mock-1.0-SNAPSHOT.jar"/>
301-
<compilerarg line="-processor org.jruby.anno.AnnotationBinder"/>
302-
</javac>
303-
304-
<!-- Apply any instrumentation that is enabled (code coverage, etc) -->
305-
<antcall target="instrument"/>
306-
307-
<property name="compiled" value="true"/>
308-
</target>
309-
310-
<target name="generate-method-classes">
311-
<available file="build/src_gen/annotated_classes.txt" property="annotations.changed"/>
312-
<antcall target="_gmc_internal_"/>
313-
</target>
314-
315-
<target name="_gmc_internal_" if="annotations.changed">
316-
<echo message="Generating invokers..."/>
317-
<java classname="org.jruby.anno.InvokerGenerator" fork="true" failonerror="true">
318-
<classpath refid="jruby.execute.classpath"/>
319-
<sysproperty key="jruby.bytecode.version" value="${javac.version}"/>
320-
<arg value="build/src_gen/annotated_classes.txt"/>
321-
<arg value="${jruby.classes.dir}"/>
322-
</java>
323-
324-
<echo message="Compiling populators..."/>
325-
<javac destdir="${jruby.classes.dir}" debug="true" source="${javac.version}"
326-
target="${javac.version}" deprecation="true" encoding="UTF-8"
327-
includeantruntime="true">
328-
<classpath refid="jruby.execute.classpath"/>
329-
<src path="build/src_gen"/>
330-
<patternset refid="java.src.pattern"/>
331-
</javac>
332-
333-
<delete file="build/src_gen/annotated_classes.txt"/>
334-
</target>
335-
336-
<target name="generate-unsafe">
337-
<available file="${jruby.classes.dir}/org/jruby/util/unsafe/GeneratedUnsafe.class"
338-
property="unsafe.not.needed"/>
339-
<antcall target="_gu_internal_"/>
340-
</target>
341-
342-
<target name="_gu_internal_" unless="unsafe.not.needed">
343-
<echo message="Generating Unsafe impl..."/>
344-
<java classname="org.jruby.util.unsafe.UnsafeGenerator" fork="true" failonerror="true">
345-
<classpath refid="jruby.execute.classpath"/>
346-
<jvmarg line="${java.opts}"/>
347-
<arg value="org.jruby.util.unsafe"/>
348-
<arg value="${jruby.classes.dir}/org/jruby/util/unsafe"/>
349-
</java>
187+
<target name="compile" description="Compile the source files for the project.">
188+
<exec executable="mvn">
189+
<arg line="compile"/>
190+
</exec>
350191
</target>
351192

352193
<target name="unzip-native-libs" unless="native-libs-uptodate">
@@ -848,7 +689,6 @@ other than ASM, which is rewritten to avoid conflicts. -->
848689
<delete dir="${api.docs.dir}"/>
849690
<delete dir="build/src_gen"/>
850691
<antcall target="clean-ng"/>
851-
<antcall target="clean-tzdata"/>
852692
</target>
853693

854694
<target name="clean-all" depends="clean, dist-clean, clear-specs"
@@ -927,80 +767,6 @@ other than ASM, which is rewritten to avoid conflicts. -->
927767
<rake task="bench:language"/>
928768
</target>
929769

930-
<target name="fetch-tzdata" description="Fetch tzdata into build/tzdata">
931-
<available property="tzdata.present" filepath="${tzdata.builddir}/src"
932-
file="tzdata${tzdata.latest.version}.tar.gz"/>
933-
<mkdir dir="${tzdata.builddir}/src"/>
934-
<ftp server="${tzdata.ftpserver}"
935-
action="get"
936-
verbose="yes"
937-
passive="yes"
938-
userid="anonymous"
939-
password="${tzdata.ftp.anonymous.userid}"
940-
remotedir="${tzdata.ftp.dir}"
941-
newer="yes">
942-
<fileset dir="${tzdata.builddir}/src">
943-
<include name="tzdata${tzdata.latest.version}.tar.gz"/>
944-
</fileset>
945-
</ftp>
946-
</target>
947-
948-
<target name="expand-tzdata" depends="fetch-tzdata" description="Expand tzdata into build/tzdata">
949-
<untar src="${tzdata.builddir}/src/tzdata${tzdata.latest.version}.tar.gz"
950-
compression="gzip"
951-
dest="${tzdata.builddir}/src"
952-
/>
953-
</target>
954-
955-
<!-- basically a copy of joda-time's compile.zoneinfo task -->
956-
<target name="compile-tzdata" depends="prepare, expand-tzdata" description="Compile tzdata in build/tzdata">
957-
<mkdir dir="${tzdata.builddir}/build"/>
958-
<mkdir dir="${tzdata.builddir}/build/org/joda/time/tz/data"/>
959-
<echo message="Compiling tzdata version ${tzdata.latest.version}"/>
960-
<java classname="org.joda.time.tz.ZoneInfoCompiler"
961-
fork="true"
962-
output="${dev.null}"
963-
failonerror="false">
964-
<classpath path="${build.lib.dir}/joda-time-${joda.time.version}.jar"/>
965-
<!-- Override default provider since data directory doesn't exist yet -->
966-
<sysproperty key="org.joda.time.DateTimeZone.Provider"
967-
value="org.joda.time.tz.UTCProvider"/>
968-
<!-- Specify source and destination directories -->
969-
<arg line="-src ${tzdata.builddir}/src -dst ${tzdata.builddir}/build/org/joda/time/tz/data"/>
970-
<!-- Specify all the data files to compile -->
971-
<arg value="africa"/>
972-
<arg value="antarctica"/>
973-
<arg value="asia"/>
974-
<arg value="australasia"/>
975-
<arg value="europe"/>
976-
<arg value="northamerica"/>
977-
<arg value="southamerica"/>
978-
<arg value="pacificnew"/>
979-
<arg value="etcetera"/>
980-
<arg value="backward"/>
981-
<arg value="systemv"/>
982-
</java>
983-
<update-constants tzdata-version="${tzdata.latest.version}"/>
984-
<property name="constants.java.is.same" value="true"/>
985-
</target>
986-
987-
<target name="update-tzdata" depends="compile-tzdata"
988-
description="Update joda-time's zone info with one we compiled">
989-
<jar update="yes" destfile="${build.lib.dir}/joda-time-${joda.time.version}.jar"
990-
basedir="${tzdata.builddir}/build"/>
991-
</target>
992-
993-
<target name="clean-tzdata" description="Remove files used for updating time zone information">
994-
<delete dir="${tzdata.builddir}" failonerror="no"/>
995-
<echo message="Reset joda-time jar"/>
996-
<exec osfamily="unix" executable="/bin/sh" failonerror="false" failifexecutionfails="false">
997-
<arg line="-c 'git checkout -- ${build.lib.dir}/joda-time-${joda.time.version}.jar'"/>
998-
</exec>
999-
<exec osfamily="windows" executable="cmd" failonerror="false" failifexecutionfails="false">
1000-
<arg line="/c git checkout -- ${build.lib.dir}/joda-time-${joda.time.version}.jar"/>
1001-
</exec>
1002-
</target>
1003-
1004770
<target name="ci-matrix" depends="clean,jar" description="Run a matrix configuration job from Hudson.">
1005771
<property name="testtype" value="test"/>
1006772
<echo>Running ${testtype} build with JDK ${jdk}</echo>

0 commit comments

Comments
 (0)