+++ /dev/null
-<?xml version="1.0" ?>
-
-<!--
- build.xml - the JPF core build script
- using Ant (http://jakarta.apache.org/ant)
- public targets:
-
- build (default) compile classes and build JPF jar files
- compile compile JPF and its specific (modeled) environment libraries
- test run all JPF tests
- clean remove the files that have been generated by the build process
- buildinfo create buildinfo properties file
--->
-
-<project name="jpf-core" default="build" basedir=".">
-
- <!-- ===================== ===== COMMON SECTION ========================== -->
-
- <!--
- local props have to come first, because Ant properties are immutable
- NOTE: this file is local - it is never in the repository!
- -->
- <property file="local.properties"/>
- <property environment="env"/>
-
- <!-- compiler settings -->
- <property name="debug" value="on"/>
- <property name="deprecation" value="on"/>
-
- <uptodate property="build_uptodate" targetfile="build/main/gov/nasa/jpf/build.properties" srcfile="build.properties"/>
-
-
- <!-- generic classpath settings -->
- <path id="lib.path">
- <pathelement location="build/main"/>
- <pathelement location="build/peers"/>
- <pathelement location="build/annotations"/>
- <fileset dir=".">
- <include name="lib/*.jar"/>
- </fileset>
- </path>
-
-
- <!-- init: common initialization -->
- <target name="-init">
- <tstamp/>
-
- <mkdir dir="build"/> <!-- the build root -->
-
- <!-- the things that have to be in the classpath of whatever runs Ant -->
- <available property="have_javac" classname="com.sun.tools.javac.Main"/>
- <fail unless="have_javac">no javac was found __or__ check http://babelfish.arc.nasa.gov/trac/jpf/wiki/install/build for possible solutions</fail>
-
-
- <available file="src/main" type="dir" property="have_main"/>
- <available file="src/annotations" type="dir" property="have_annotations"/>
- <available file="src/peers" type="dir" property="have_peers"/>
- <available file="src/classes" type="dir" property="have_classes"/>
- <available file="src/tests" type="dir" property="have_tests"/>
- <available file="src/examples" type="dir" property="have_examples"/>
-
- <available file=".hg" type="dir" property="have_hg"/>
-
- <!-- for the core, it's a fail if any of these is missing -->
- <fail unless="have_main">no src/main</fail>
- <fail unless="have_annotations">no src/annotations</fail>
- <fail unless="have_peers">no src/peers</fail>
- <fail unless="have_classes">no src/classes</fail>
- <fail unless="have_tests">no src/tests</fail>
- <fail unless="have_examples">no src/examples</fail>
-
- <condition property="have_java8">
- <equals arg1="${ant.java.version}" arg2="1.8"/>
- </condition>
-
- </target>
-
-
- <!-- ======================= COMPILE SECTION ============================= -->
-
- <!-- public compile -->
- <target name="compile" depends="-init,-compile-annotations,-compile-main,-compile-peers,-compile-classes,-compile-tests,-compile-examples"
- description="compile all JPF core sources" >
- <copy file="build.properties" todir="build/main/gov/nasa/jpf" failonerror="false"/>
- </target>
-
- <target name="-compile-annotations" if="have_annotations">
- <mkdir dir="build/annotations"/>
- <javac srcdir="src/annotations" destdir="build/annotations" includeantruntime="false"
- debug="${debug}" deprecation="${deprecation}" classpath=""/>
- </target>
-
- <target name="-compile-main" if="have_main">
- <mkdir dir="build/main"/>
- <javac srcdir="src/main" destdir="build/main" includeantruntime="false"
- debug="${debug}" deprecation="${deprecation}" classpathref="lib.path">
- <!--
- <compilerarg value="-XDenableSunApiLintControl"/>
- <compilerarg value="-Xlint:all"/>
- -->
- </javac>
-
- </target>
-
- <target name="-compile-peers" if="have_peers" depends="-compile-main" >
- <mkdir dir="build/peers"/>
- <javac srcdir="src/peers" destdir="build/peers" includeantruntime="false"
- debug="${debug}" deprecation="${deprecation}" classpathref="lib.path">
- <compilerarg value="-XDenableSunApiLintControl"/>
- <compilerarg value="-Xlint:all,-sunapi,-serial"/>
- </javac>
- </target>
-
- <target name="-compile-classes" if="have_classes" depends="-compile-annotations,-compile-main" >
- <mkdir dir="build/classes"/>
- <javac srcdir="src/classes" destdir="build/classes" includeantruntime="false"
- debug="${debug}" deprecation="${deprecation}">
- <compilerarg value="-XDenableSunApiLintControl"/>
- <compilerarg value="-Xlint:all,-sunapi"/>
- <classpath>
- <path refid="lib.path"/>
- <pathelement location="build/annotations"/>
- </classpath>
- </javac>
- </target>
-
- <target name="-compile-tests" if="have_tests" depends="-compile-annotations,-compile-main,-compile-classes">
- <mkdir dir="build/tests"/>
-
- <javac sourcepath="" srcdir="src/tests" destdir="build/tests" includeantruntime="false"
- debug="${debug}" deprecation="${deprecation}"
- includes="*,gov/nasa/jpf/**,classloader_specific_tests/**">
- <compilerarg value="-XDenableSunApiLintControl"/>
- <compilerarg value="-Xlint:all,-sunapi,-serial,-rawtypes,-unchecked"/>
-
- <include name="*gov/nasa/jpf/**"/>
- <include name="classloader_specific_tests/**"/>
- <include name="java8/**" if="have_java8"/>
-
- <classpath>
- <path refid="lib.path"/>
- <pathelement location="build/annotations"/>
- <pathelement location="build/classes"/>
- </classpath>
- </javac>
- </target>
-
- <target name="-compile-examples" if="have_examples" depends="-compile-annotations,-compile-main">
- <mkdir dir="build/examples" />
- <javac srcdir="src/examples" destdir="build/examples" includeantruntime="false"
- debug="${debug}" deprecation="${deprecation}"
- classpathref="lib.path"/>
- </target>
-
-
- <!-- ======================= MISC SECTION ================================ -->
-
- <target name="-version" if="have_hg">
- <exec executable="hg" outputproperty="version" searchpath="true" failonerror="false" failifexecutionfails="false">
- <arg value="identify"/>
- <arg value="-n"/>
- </exec>
-
- <!-- .version is in .hgignore -->
- <echo message="${version}${line.separator}" file=".version"/>
- </target>
-
- <!-- build jars -->
- <target name="build" depends="-cond-clean,compile,-version"
- description="generate the core JPF jar files" >
-
- <copy file=".version" todir="build/main/gov/nasa/jpf" failonerror="false"/>
-
- <jar jarfile="build/jpf-classes.jar">
- <fileset dir="build/classes"/>
- <fileset dir="build/annotations"/>
-
- <fileset dir="build/main">
- <!-- we need this one in case a SUT uses the Verify API -->
- <include name="gov/nasa/jpf/vm/Verify.class"/>
-
- <!-- these are required if we run TestJPF derived test classes -->
- <include name="gov/nasa/jpf/JPFShell.class"/>
- <include name="gov/nasa/jpf/util/TypeRef.class"/>
- <include name="gov/nasa/jpf/util/test/TestJPF.class"/>
- <include name="gov/nasa/jpf/util/test/TestMultiProcessJPF.class"/>
- <include name="gov/nasa/jpf/util/test/TestJPFHelper.class"/>
- </fileset>
- </jar>
-
- <jar jarfile="build/jpf.jar" index="true">
- <fileset dir="build/main"/>
- <fileset dir="build/peers"/>
- <!-- this is redundant, but if JPF is executed from java.class.path it wouldn't find annotations -->
- <fileset dir="build/annotations"/>
-
- <!-- this is for annotations used by JPF regression tests, which can also be executed outside of junit -->
- <fileset dir="build/classes">
- <include name="org/junit/*.class"/>
- </fileset>
-
- <manifest>
- <attribute name="Built-By" value="${user.name}"/>
- <attribute name="Implementation-Vendor" value="NASA Ames Research Center"/>
- <attribute name="Implementation-Title" value="Java Pathfinder core system"/>
- <attribute name="Implementation-Version" value="${jpf.version}"/>
- </manifest>
- </jar>
-
- <!-- optional jar that contains annotations to be used in non-JPF dependent apps -->
- <jar jarfile="build/jpf-annotations.jar">
- <fileset dir="build/annotations"/>
- </jar>
-
- <!-- this jar is needed to test classloaders, it is used by URLClassLoaderTest -->
- <jar jarfile="build/classloader_specific_tests.jar">
- <fileset dir="build/tests">
- <include name="classloader_specific_tests/*.class"/>
- </fileset>
- </jar>
-
- <jar jarfile="build/RunJPF.jar">
- <fileset dir="build/main">
- <include name="gov/nasa/jpf/tool/Run.class"/>
- <include name="gov/nasa/jpf/tool/RunJPF.class"/>
- <include name="gov/nasa/jpf/Config.class"/>
- <include name="gov/nasa/jpf/ConfigChangeListener.class"/>
- <include name="gov/nasa/jpf/Config$MissingRequiredKeyException.class"/>
- <include name="gov/nasa/jpf/JPFClassLoader.class"/>
- <include name="gov/nasa/jpf/JPFShell.class"/>
- <include name="gov/nasa/jpf/JPFException.class"/>
- <include name="gov/nasa/jpf/JPFConfigException.class"/>
- <include name="gov/nasa/jpf/JPFTargetException.class"/>
- <include name="gov/nasa/jpf/util/JPFSiteUtils.class"/>
- <include name="gov/nasa/jpf/util/FileUtils.class"/>
- <include name="gov/nasa/jpf/util/StringMatcher.class"/>
- <include name="gov/nasa/jpf/util/Pair.class"/>
- </fileset>
-
- <manifest>
- <attribute name="Built-By" value="${user.name}"/>
- <attribute name="Implementation-Vendor" value="NASA Ames Research Center"/>
- <attribute name="Implementation-Title" value="Java Pathfinder core launch system"/>
- <attribute name="Implementation-Version" value="${jpf.version}"/>
- <attribute name="Main-Class" value="gov.nasa.jpf.tool.RunJPF"/>
- </manifest>
- </jar>
-
- <jar jarfile="build/RunTest.jar">
- <fileset dir="build/main">
- <include name="gov/nasa/jpf/tool/Run.class"/>
- <include name="gov/nasa/jpf/tool/RunTest.class"/>
- <include name="gov/nasa/jpf/tool/RunTest$Failed.class"/>
- <include name="gov/nasa/jpf/Config.class"/>
- <include name="gov/nasa/jpf/ConfigChangeListener.class"/>
- <include name="gov/nasa/jpf/Config$MissingRequiredKeyException.class"/>
- <include name="gov/nasa/jpf/JPFClassLoader.class"/>
- <include name="gov/nasa/jpf/JPFException.class"/>
- <include name="gov/nasa/jpf/JPFConfigException.class"/>
- <include name="gov/nasa/jpf/util/JPFSiteUtils.class"/>
- <include name="gov/nasa/jpf/util/FileUtils.class"/>
- <include name="gov/nasa/jpf/util/StringMatcher.class"/>
- <include name="gov/nasa/jpf/util/DevNullPrintStream.class"/>
- </fileset>
- <manifest>
- <attribute name="Built-By" value="${user.name}"/>
- <attribute name="Implementation-Vendor" value="NASA Ames Research Center"/>
- <attribute name="Implementation-Title" value="Java Pathfinder test launch system"/>
- <attribute name="Implementation-Version" value="${jpf.version}"/>
- <attribute name="Main-Class" value="gov.nasa.jpf.tool.RunTest"/>
- </manifest>
- </jar>
-
- </target>
-
-
- <!-- public clean: cleanup from previous tasks/builds -->
- <target name="clean"
- description="remove all build artifacts and temporary files">
- <delete dir="build" failonerror="false"/>
- <delete dir="tmp" failonerror="false"/>
- <delete>
- <fileset dir="." includes="**/*~" defaultexcludes="no" />
- <fileset dir="." includes="**/*.bak" defaultexcludes="no" />
- <fileset dir="." includes="**/error.xml" />
- </delete>
- </target>
-
- <target name="-cond-clean" unless="build_uptodate"
- description="remove all build artifacts and temporaries if build.properties has been changed">
- <antcall target="clean"/>
- </target>
-
-
- <!-- generate buildinfo file -->
- <target name="buildinfo" description="create buildinfo properties">
-
- <!-- make this fail if there are uncommitted changes -->
- <exec executable="hg" outputproperty="uncommitted_changes" failifexecutionfails="true">
- <arg value="status"/>
- </exec>
- <condition property="have_uncommitted_changes">
- <length string="${uncommitted_changes}" trim="true" when="greater" length="0"/>
- </condition>
-<!--
- <fail if="have_uncommitted_changes">hg status shows uncommitted changes:
- ${uncommitted_changes}
- </fail>
--->
- <exec executable="hg" outputproperty="hg.tip.id" failifexecutionfails="false">
- <arg value="tip"/>
- <arg value="--template"/>
- <arg value="{rev}:{node|short}\n"/>
- </exec>
- <exec executable="hg" outputproperty="hg.author" failifexecutionfails="false">
- <arg value="tip"/>
- <arg value="--template"/>
- <arg value="{author}\n"/>
- </exec>
- <exec executable="hg" outputproperty="hg.tip.date" failifexecutionfails="false">
- <arg value="tip"/>
- <arg value="--template"/>
- <arg value="{date|isodate}\n"/>
- </exec>
- <exec executable="hg" outputproperty="hg.paths.default" failifexecutionfails="false">
- <arg value="showconfig"/>
- <arg value="paths.default"/>
- </exec>
-
- <exec executable="hostname" failifexecutionfails="false" outputproperty="env.COMPUTERNAME"/>
- <property name="hostname" value="${env.COMPUTERNAME}"/> <!-- Windows doesn't have hostname -->
-
- <!-- it seems the 'propertyfile' task just appends -->
- <delete file="build.properties" failonerror="false"/>
-
- <propertyfile file="build.properties" comment="JPF core build info">
- <entry key="revision" value="${hg.tip.id}"/>
- <entry key="date.tip" value="${hg.tip.date}"/>
-
- <entry key="author" value="${hg.author}"/>
- <entry key="repository" value="file://${hostname}${basedir}"/>
- <entry key="upstream" value="${hg.paths.default}"/>
-
- <entry key="java.version" value="${java.version}"/>
-
- <entry key="os.arch" value="${os.arch}"/>
- <entry key="os.name" value="${os.name}"/>
- <entry key="os.version" value="${os.version}"/>
- <entry key="user.country" value="${user.country}"/>
-
- </propertyfile>
-
- </target>
-
- <target name="dist" description="build binary distribution">
- <delete file="build/${ant.project.name}*.zip"/>
-
- <exec executable="hg" outputproperty="hg.tip.rev" failifexecutionfails="false">
- <arg value="tip"/>
- <arg value="--template"/>
- <arg value="-r{rev}"/>
- </exec>
-
- <!-- 2do this seems stupid - there needs to be a better way to re-base (zip basedir fails miserably) -->
- <zip destfile="build/${ant.project.name}${hg.tip.rev}.zip" update="false" excludes="*">
- <zipfileset file="jpf.properties" prefix="${ant.project.name}"/>
- <zipfileset file="build.properties" prefix="${ant.project.name}"/>
- <zipfileset dir="lib" prefix="${ant.project.name}/lib"/>
- <zipfileset dir="bin" prefix="${ant.project.name}/bin" filemode="754"/>
- <zipfileset dir="build" includes="*.jar" prefix="${ant.project.name}/build"/>
- </zip>
- </target>
-
- <target name="src-dist" description="build source distribution">
- <delete file="build/${ant.project.name}*-src.zip"/>
-
- <exec executable="hg" outputproperty="hg.tip.rev" failifexecutionfails="false">
- <arg value="tip"/>
- <arg value="--template"/>
- <arg value="-r{rev}"/>
- </exec>
-
- <zip destfile="build/${ant.project.name}${hg.tip.rev}-src.zip" update="false" excludes="*" whenempty="skip">
- <zipfileset file="jpf.properties" prefix="${ant.project.name}"/>
- <zipfileset file="build.properties" prefix="${ant.project.name}"/>
- <zipfileset file="build.xml" prefix="${ant.project.name}"/>
- <zipfileset file="LICENSE-2.0.txt" prefix="${ant.project.name}"/>
- <zipfileset file="README" prefix="${ant.project.name}"/>
- <zipfileset dir="src" prefix="${ant.project.name}/src"/>
- <zipfileset dir="lib" prefix="${ant.project.name}/lib" erroronmissingdir="false"/>
- <zipfileset dir="bin" prefix="${ant.project.name}/bin" filemode="754"/>
- <zipfileset dir="tools" prefix="${ant.project.name}/tools" erroronmissingdir="false"/>
-
- <!-- IDE related configuration files -->
- <zipfileset file=".project" prefix="${ant.project.name}"/>
- <zipfileset file=".classpath" prefix="${ant.project.name}"/>
- <zipfileset dir="eclipse" prefix="${ant.project.name}/eclipse"/>
-
- <zipfileset dir="nbproject" prefix="${ant.project.name}/nbproject"/>
- </zip>
- </target>
-
- <!-- ======================= TEST SECTION ================================ -->
-
-
-
- <target name="test" depends="build"
- description="run core regression tests" if="have_tests">
-
- <!-- note this can be directly set in local.properties, which overrides this setting -->
- <property name="junit.home" value="${env.JUNIT_HOME}"/>
-
- <condition property="junit.usefile">
- <!-- don't set if this is running from within an IDE that collects output -->
- <not>
- <isset property="netbeans.home"/>
- </not>
- </condition>
-
- <junit printsummary="on" showoutput="off"
- haltonfailure="no" logfailedtests="true" failureproperty="test.failed"
- dir="${basedir}" fork="yes" forkmode="perTest" maxmemory="1024m" outputtoformatters="true">
- <formatter type="plain" usefile="${junit.usefile}"/>
-
- <assertions>
- <enable/>
- </assertions>
-
- <classpath>
- <path refid="lib.path"/>
- <pathelement location="build/tests"/>
- <pathelement location="build/classes"/>
- <pathelement location="build/annotations"/>
-
- <fileset dir="${junit.home}">
- <include name="**/*.jar"/>
- </fileset>
- </classpath>
-
- <batchtest todir="build/tests">
- <fileset dir="build/tests">
- <exclude name="**/JPF_*.class"/>
- <include name="**/*Test.class"/>
-
- <exclude name="**/SplitInputStreamTest.class"/>
- </fileset>
- </batchtest>
-
- </junit>
-
- <fail if="test.failed" />
-
- </target>
-
-
-</project>