Skip to content

Commit

Permalink
Merge pull request #3245 from eclipse/revert-3230-remove-emma
Browse files Browse the repository at this point in the history
Revert "Remove unused compile_ddr.xml file from DDR_VM debugtools"
  • Loading branch information
pshipton authored Oct 11, 2018
2 parents 1a5873d + c8b6ca4 commit 7c163f0
Showing 1 changed file with 387 additions and 0 deletions.
387 changes: 387 additions & 0 deletions debugtools/DDR_VM/compile_ddr.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,387 @@
<?xml version="1.0" encoding="UTF-8"?>

<!--
Copyright (c) 2010, 2018 IBM Corp. and others
This program and the accompanying materials are made available under
the terms of the Eclipse Public License 2.0 which accompanies this
distribution and is available at https://www.eclipse.org/legal/epl-2.0/
or the Apache License, Version 2.0 which accompanies this distribution and
is available at https://www.apache.org/licenses/LICENSE-2.0.
This Source Code may also be made available under the following
Secondary Licenses when the conditions for such availability set
forth in the Eclipse Public License, v. 2.0 are satisfied: GNU
General Public License, version 2 with the GNU Classpath
Exception [1] and GNU General Public License, version 2 with the
OpenJDK Assembly Exception [2].
[1] https://www.gnu.org/software/classpath/license.html
[2] http://openjdk.java.net/legal/assembly-exception.html
SPDX-License-Identifier: EPL-2.0 OR Apache-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 OR LicenseRef-GPL-2.0 WITH Assembly-exception
-->

<project name="DDR_VM" default="dist">

<property environment="env"/>

<property name="output.dir" value="output"/>
<property name="output.libs.dir" value="${output.dir}/libs"/>
<property name="output.bin.dir" value="${output.dir}/bin"/>

<property name="findbugs.dir" value="${output.dir}/findbugs"/>
<property name="findbugs.zip" value="${output.dir}/findbugs.zip"/>
<property name="findbugs.unpack.dir" value="${findbugs.dir}/unpack"/>
<property name="findbugs.results.dir" value="${findbugs.dir}/results"/>

<condition property="j9ddr_jar" value="${output.libs.dir}/j9ddr.jar" else="${output.libs.dir}/${product}_j9ddr.jar">
<equals arg1="${product}" arg2="java8" />
</condition>

<property name="j9_core_dir" value="../DDR_VM"/>
<property name="j9_core_lib" value="${j9_core_dir}/lib"/>
<property name="j9_core_src" value="${j9_core_dir}/src"/>
<property name="j9_core_tests_src" value="${j9_core_dir}/testsrc"/>
<property name="j9_core_bin" value="${output.bin.dir}/j9_core"/>
<property name="j9_core_tests_bin" value="${output.bin.dir}/j9_core_tests"/>
<property name="j9_core_jar" value="${output.libs.dir}/j9ddr-core.jar"/>
<property name="j9_core_tests_jar" value="${output.libs.dir}/j9ddr-core-tests.jar"/>

<property name="mat_plugin_dir" value="../DDR_MAT_Plugin"/>
<property name="mat_plugin_lib" value="${mat_plugin_dir}/lib"/>
<property name="mat_plugin_meta" value="${mat_plugin_dir}/META-INF"/>
<property name="mat_plugin_jar" value="${output.libs.dir}/com.ibm.dtfj.j9ddr_0.0.1.jar"/>

<property name="junit.jar" value="${j9_core_lib}/junit.jar"/>
<property name="emma.jar" value="${j9_core_lib}/emma.jar" />
<property name="emma_ant.jar" value="${j9_core_lib}/emma_ant.jar" />
<property name="emma_bin" value="${output.bin.dir}/emma" />
<property name="emma_jar" value="${output.libs.dir}/j9ddr-emma.jar"/>

<if>
<!-- VM_VERSION is inherited from DDR_VM/generate.xml -->
<equals arg1="${VM_VERSION}" arg2="24" />
<then>
<!-- the RAS jars are in RASTools folder in 2.4 VM infrasstructure -->
<property name="dtfj_interface_dir" value="../RASTools"/>
<!-- !snapformat only compiles against a traceformat.jar with the API included -->
<property name="traceformat.jar" value="${j9_core_lib}/traceformat.jar"/>
</then>
<else>
<property name="dtfj_interface_dir" value="../../RAS_Binaries"/>
<!-- Until DDR is compiled in the modular way, use Java 8 jars for traceformat and DTFJ. -->
<property name="traceformat.jar" value="${dtfj_interface_dir}/traceformat.jar"/>
</else>
</if>
<property name="dtfj.jar" value="${dtfj_interface_dir}/dtfj.jar"/>
<property name="dtfj-j9.jar" value="${j9_core_lib}/dtfj.j9-head.jar"/>
<property name="ibmjzos.jar" value="${j9_core_lib}/ibmjzos.jar"/>

<if>
<equals arg1="${product}" arg2="java8" />
<then>
<property name="src.level" value="1.8"/>
<property name="target.level" value="1.8"/>
<property name="compilerarg.javac.addexports" value=""/>
</then>
<else>
<property name="src.level" value="1.9"/>
<property name="target.level" value="1.9"/>
<property name="compilerarg.javac.addexports" value="--add-exports java.base/jdk.internal.org.objectweb.asm=ALL-UNNAMED,com.ibm.dtfj --add-exports com.ibm.dtfj/com.ibm.dtfj.utils=ALL-UNNAMED --add-exports com.ibm.dtfj/com.ibm.dtfj.utils.file=ALL-UNNAMED --add-exports com.ibm.traceformat/com.ibm.jvm.trace.format.api=ALL-UNNAMED"/>
</else>
</if>

<!-- Set up task classpath -->
<path id="runtime.cp">
<fileset dir="${j9_core_lib}" includes="ant-contrib.jar"/>
<fileset dir="${j9_core_lib}" includes="antform.jar"/>
</path>

<taskdef resource='net/sf/antcontrib/antlib.xml' classpathref="runtime.cp"/>

<path id="emma.lib">
<pathelement location="${emma.jar}" />
<pathelement location="${emma_ant.jar}" />
</path>

<target name="dist" depends="compile,package">
</target>

<!-- automation target, want to leave lib/ but nuke bin/ -->
<target name="dist_and_clean_bin" depends="compile,package,clean.bin">
</target>

<target name="clean.bin">
<delete dir="${output.dir}/bin" includeemptydirs="true" failonerror="false" />
<delete dir="${output.dir}/findbugs" includeemptydirs="true" failonerror="false" />

<if>
<os family="unix"/>
<then>
<!-- ant delete appears to be flaky most of the time and fails to delete an otherwise
accessible and empty directory. Fix it by using proper tooling, avoid rm -rf to avoid non-fun deletions -->
<shellscript shell="bash" dir="/tmp">
rmdir ${output.dir}/bin/emma
rmdir ${output.dir}/bin
rmdir ${output.dir}/findbugs
</shellscript>
</then>
</if>
</target>

<target name="package">
<antcall target="package.j9_core"/>
<!--<antcall target="package.mat_plugin"/>-->
<antcall target="package.j9ddr"/>
<if>
<equals arg1="${product}" arg2="java8" />
<then>
<antcall target="package.emma"/>
</then>
</if>
</target>

<target name="package.emma">
<!--Load the EMMA task-->
<taskdef resource="emma_ant.properties" classpathref="emma.lib"/>
<echo>Instrumenting classes (J9 core)</echo>
<emma>
<instr outdir="${emma_bin}" merge="yes" mode="fullcopy" outfile="${emma_bin}/coverage.em" instrpath="${j9_core_bin}" filter="-*generated*" />
</emma>
<echo>Creating jar file</echo>
<jar destfile="${emma_jar}">
<fileset dir="${emma_bin}/classes" />
<zipfileset src="${j9_core_jar}"/>
</jar>
</target>

<target name="package.j9_core">
<jar destfile="${j9_core_jar}" basedir="${j9_core_bin}"/>
<jar destfile="${j9_core_tests_jar}" basedir="${j9_core_tests_bin}"/>
</target>

<target name="package.j9ddr">
<jar destfile="${j9ddr_jar}">
<zipfileset src="${j9_core_jar}"/>
</jar>
</target>

<target name="package.mat_plugin">
<copy file="${j9_core_jar}" todir="${mat_plugin_lib}" />
<jar destfile="${mat_plugin_jar}" manifest="${mat_plugin_meta}/MANIFEST.MF">
<zipfileset file="${mat_plugin_dir}/plugin.xml" />
<zipfileset dir="${mat_plugin_lib}" includes="*" prefix="lib" />
</jar>
</target>

<target name="package.asm">
</target>

<target name="test">
</target>

<target name="compile" depends="compile.setup">
<antcall target="compile.j9_core"/>
</target>

<target name="compile.j9_core.minmum">
<echo>Compiling j9_core excluding vm 23/24/26/27/28/29/29_00 </echo>
<echo>JAVAC ARGS: </echo>
<echo>destdir = ${j9_core_bin}</echo>
<echo>src.level = ${src.level}</echo>
<echo>target.level = ${target.level}</echo>
<echo>build.compiler.java = ${build.compiler.java}</echo>
<echo>Source Paths:</echo>
<echo>- j9_core_src = ${j9_core_src}</echo>
<echo>Classpaths :</echo>
<echo>- dtfj.jar = ${dtfj.jar}</echo>
<echo>- dtfj-j9.jar = ${dtfj-j9.jar}</echo>
<echo>- ibmjzos.jar = ${ibmjzos.jar}</echo>
<echo>- junit.jar = ${junit.jar}</echo>
<echo>- traceformat.jar = ${traceformat.jar}</echo>
<javac destdir="${j9_core_bin}" source="${src.level}" target="${target.level}"
debug="true" fork="true" executable="${build.compiler.java}">
<src path="${j9_core_src}"/>
<exclude name="com/ibm/j9ddr/vm*/**" />
<classpath>
<pathelement location="${dtfj.jar}"/>
<pathelement location="${dtfj-j9.jar}"/>
<pathelement location="${ibmjzos.jar}"/>
<pathelement location="${junit.jar}"/>
<pathelement location="${traceformat.jar}"/>
</classpath>
<compilerarg line=" ${compilerarg.javac.addexports} "/>
</javac>
</target>

<target name="compile.j9_core.vmversion">
<echo>Compiling com/ibm/j9ddr/vm${include.core.vmnbr}/** </echo>
<echo>JAVAC ARGS: </echo>
<echo>destdir = ${j9_core_bin}</echo>
<echo>src.level = ${src.level}</echo>
<echo>target.level = ${target.level}</echo>
<echo>build.compiler.java = ${build.compiler.java}</echo>
<echo>Source Paths:</echo>
<echo>- j9_core_src = ${j9_core_src}</echo>
<echo>Classpaths :</echo>
<echo>- ibmjzos.jar = ${ibmjzos.jar}</echo>
<echo>- junit.jar = ${junit.jar}</echo>
<echo>- dtfj.jar = ${dtfj.jar}</echo>
<echo>- dtfj-j9.jar = ${dtfj-j9.jar}</echo>
<javac destdir="${j9_core_bin}" source="${src.level}" target="${target.level}"
debug="true" fork="true" executable="${build.compiler.java}">
<src path="${j9_core_src}"/>
<include name="com/ibm/j9ddr/vm${include.core.vmnbr}/**" />
<classpath>
<pathelement location="${ibmjzos.jar}"/>
<pathelement location="${junit.jar}"/>
<pathelement location="${dtfj.jar}"/>
<pathelement location="${dtfj-j9.jar}"/>
</classpath>
<compilerarg line=" ${compilerarg.javac.addexports} "/>
</javac>
</target>

<target name="compile.j9_core.test.minmum">
<echo>Compiling J9 Core Tests excluding vm 23/24/26/27/28/29/29_00 </echo>
<echo>JAVAC ARGS: </echo>
<echo>srcdir = ${j9_core_tests_src}</echo>
<echo>destdir = ${j9_core_tests_bin}</echo>
<echo>src.level = ${src.level}</echo>
<echo>target.level = ${target.level}</echo>
<echo>build.compiler.java = ${build.compiler.java}</echo>
<echo>Classpaths :</echo>
<echo>- j9_core_bin = ${j9_core_bin}</echo>
<echo>- junit.jar = ${junit.jar}</echo>
<echo>- ${j9_core_lib}/dtfj.j9-head.jar</echo>
<echo>- ${j9_core_lib}/dtfj.pkg.tck-head.jar</echo>
<javac destdir="${j9_core_tests_bin}" source="${src.level}" target="${target.level}"
fork="yes" executable="${build.compiler.java}" debug="true">
<src path="${j9_core_tests_src}"/>
<exclude name="com/ibm/j9ddr/vm*/**" />
<classpath>
<pathelement location="${j9_core_bin}"/>
<pathelement location="${junit.jar}"/>
<pathelement location="${j9_core_lib}/dtfj.j9-head.jar"/>
<pathelement location="${j9_core_lib}/dtfj.pkg.tck-head.jar"/>
</classpath>
</javac>
</target>

<target name="compile.j9_core.test.vmversion">
<echo>Compiling J9 Core Tests com/ibm/j9ddr/vm${include.core.vmnbr}/** </echo>
<echo>JAVAC ARGS: </echo>
<echo>srcdir = ${j9_core_tests_src}</echo>
<echo>destdir = ${j9_core_tests_bin}</echo>
<echo>src.level = ${src.level}</echo>
<echo>target.level = ${target.level}</echo>
<echo>build.compiler.java = ${build.compiler.java}</echo>
<echo>Classpaths :</echo>
<echo>- j9_core_bin = ${j9_core_bin}</echo>
<echo>- junit.jar = ${junit.jar}</echo>
<echo>- ${j9_core_lib}/dtfj.j9-head.jar</echo>
<echo>- ${j9_core_lib}/dtfj.pkg.tck-head.jar</echo>
<javac destdir="${j9_core_tests_bin}" source="${src.level}" target="${target.level}"
fork="yes" executable="${build.compiler.java}" debug="true">
<src path="${j9_core_tests_src}"/>
<include name="com/ibm/j9ddr/vm${include.core.vmnbr}/**" />
<classpath>
<pathelement location="${j9_core_bin}"/>
<pathelement location="${junit.jar}"/>
<pathelement location="${j9_core_lib}/dtfj.j9-head.jar"/>
<pathelement location="${j9_core_lib}/dtfj.pkg.tck-head.jar"/>
</classpath>
</javac>
</target>

<target name="compile.j9_core">
<!-- The 27 stream is compiled separately due to javac going OOM if you try everything at once -->
<antcall target="compile.j9_core.minmum"/>
<for list="${streamList}" param="vmnbr">
<sequential>
<antcall target="compile.j9_core.vmversion">
<param name="include.core.vmnbr" value="@{vmnbr}"/>
</antcall>
</sequential>
</for>

<copy todir="${j9_core_bin}/com/ibm/j9ddr">
<fileset dir="${j9_core_src}/com/ibm/j9ddr/" includes="StructureAliases*.dat"/>
</copy>

<antcall target="compile.j9_core.test.minmum"/>
<for list="${streamList}" param="vmnbr">
<sequential>
<antcall target="compile.j9_core.test.vmversion">
<param name="include.core.vmnbr" value="@{vmnbr}"/>
</antcall>
</sequential>
</for>
</target>

<target name="clean">
<delete file="${j9_core_dir}/coverage.em" failonerror="false" />
<delete dir="${output.dir}" includeemptydirs="true" />
</target>

<target name="compile.setup" depends="clean.bin">
<mkdir dir="${output.dir}"/>
<mkdir dir="${output.libs.dir}"/>
<mkdir dir="${output.bin.dir}"/>
<mkdir dir="${j9_core_bin}"/>
<mkdir dir="${j9_core_tests_bin}"/>
<mkdir dir="${findbugs.dir}"/>
<mkdir dir="${findbugs.results.dir}"/>
<mkdir dir="${findbugs.unpack.dir}"/>
<mkdir dir="${emma_bin}"/>

<if>
<os family="unix"/>
<then>
<if>
<equals arg1="${product}" arg2="java8" />
<then>
<property name="build.compiler.java" value="/bluebird/bin/platform/linux386/ibm-jdk-1.8.0/bin/javac" />
</then>
<else>
<property name="build.compiler.java" value="/bluebird/bin/platform/linux386/ibm-jdk-1.9.0-b136/bin/javac" />
</else>
</if>
</then>
<else>
<echo>dev tools: ${env.DEV_TOOLS}</echo>
<fail unless="env.DEV_TOOLS" message="You must have the DEV_TOOLS environment defined." />
<if>
<equals arg1="${product}" arg2="java8" />
<then>
<property name="build.compiler.java" value="${env.DEV_TOOLS}/ibm-jdk-1.8.0/bin/javac.exe" />
</then>
<else>
<property name="build.compiler.java" value="${env.DEV_TOOLS}/ibm-jdk-1.9.0/bin/javac.exe" />
</else>
</if>
</else>
</if>
</target>

<target name="findbugs">
<!--Unpack it-->
<unzip src="${findbugs.zip}" dest="${findbugs.unpack.dir}"/>

<!--Load the Findbugs task-->
<taskdef name="findbugs" classname="edu.umd.cs.findbugs.anttask.FindBugsTask" classpath="${findbugs.unpack.dir}/findbugs-1.3.9/lib/findbugs-ant.jar"/>

<!--Do the FindBugs analysis-->
<findbugs home="${findbugs.unpack.dir}/findbugs-1.3.9"
output="xml"
outputFile="${findbugs.results.dir}/ddr-fb.xml"
jvmargs="-Xmx1024M"
excludeFilter="findbugs-exclude-filter.xml">
<auxClasspath path="${j9_core_bin}" />
<sourcePath path="${j9_core_src}" />
<class location="${j9_core_jar}" />
</findbugs>
</target>

</project>

0 comments on commit 7c163f0

Please sign in to comment.