1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280
|
<?xml version="1.0" encoding="UTF-8"?>
<!--
Simple ANT build.xml file for compiling and generating healpix.jar
* Author : F.-X. Pineau [CDS]
-->
<project name="Healpix" default="print_properties" basedir=".">
<description>${title} build.xml</description>
<property file="build.properties"/>
<property name="src" location="src/main/java"/>
<property name="tsrc" location="src/test/java"/>
<property name="lib" location="/usr/share/java"/>
<property name="target" location="target"/>
<property name="classes" location="${target}/classes"/>
<property name="tclasses" location="${target}/test-classes"/>
<property name="tresults" location="${target}/test-results"/>
<property name="doc" location="${target}/docs/apidocs"/>
<property name="extras" location="extras"/>
<property name="tools" location="../Tools"/>
<property name="latexlet" location="${tools}/LateXlet/LaTeXlet-bin-1.2f7" />
<property name="ydoc" location="${tools}/yworks-uml-doclet-3.0_02-jdk1.5" />
<path id="libs">
</path>
<path id="tlibs">
<fileset dir="${lib}/">
<include name="commons-math3.jar" />
<include name="junit4.jar" />
<include name="${jarname}.jar" />
</fileset>
<fileset dir="${target}/" erroronmissingdir="false">
<include name="${jarname}.jar" />
</fileset>
</path>
<!--path id="rtlibs">
<pathelement location="${classes}/" />
<pathelement location="${tclasses}/" />
<fileset dir="${lib}/">
<include name="**/*.jar" />
</fileset>
<fileset dir="${tlib}/">
<include name="**/*.jar" />
</fileset>
</path-->
<tstamp prefix="time">
<format property="current_date" pattern="d-MMMM-yyyy" locale="en" />
<format property="current_time" pattern="hh:mm:ss a z" locale="en" />
<format property="year_month_day" pattern="yyyy-MM-dd" locale="en" />
<format property="year" pattern="yyyy" locale="en" />
</tstamp>
<target name="print_properties" depends="print_default_properties">
<echo message="current_date: ${time.current_date}" />
<echo message="current_time: ${time.current_time}" />
<echo message="year_month_day: ${time.year_month_day}" />
</target>
<target name="print_default_properties" >
<echo message="os.name: ${os.name}" />
<echo message="basdir: ${basedir}" />
<echo message="ant.file: ${ant.file}" />
<echo message="ant.project.name: ${ant.project.name}" />
<echo message="ant.java.version: ${ant.java.version}" />
</target>
<!-- MAIN TARGETS -->
<target name="make.all" description="Compile all the software, run tests, and create the .jar" depends="make.test,make.doc,make.jar"/>
<target name="make.build" description="Compile main classes, to test if the soft compiles" depends="clean.classes,compile"/>
<target name="make.test" description="Compile all classes (main an test), and run tests" depends="clean.classes,clean.tests,test"/>
<target name="make.bench" description="Compile all classes (main an test), and run benches" depends="clean.classes,clean.tests,bench"/>
<target name="make.jar" description="Compile main classes and create both the jar and the fatjar" depends="make.build,jars"/>
<target name="make.doc" description="Compile all the software and create the .jar" depends="clean.doc,doc"/>
<target name="clean" depends="clean.classes,clean.tests,clean.doc"/>
<!-- CLEAN -->
<target name="clean.classes">
<echo>Clean dir: "${classes}"...</echo>
<delete failonerror="false">
<fileset dir="${classes}" includes="**/*.class"/>
</delete>
</target>
<target name="clean.tests">
<echo>Clean dir: "${tclasses}"...</echo>
<delete failonerror="false">
<fileset dir="${tclasses}" includes="**/*.class"/>
</delete>
<echo>Clean dir: "${tresults}"...</echo>
<delete failonerror="false">
<fileset dir="${tresults}" includes="**/*"/>
</delete>
</target>
<target name="clean.doc">
<echo>Clean dir: "${doc}"...</echo>
<delete failonerror="false">
<fileset dir="${doc}" includes="**/*.html"/>
</delete>
</target>
<!-- BUILD CLASSES AND TESTS -->
<target name="compile">
<echo>Compile from "${src}" to "${classes}"...</echo>
<mkdir dir="${lib}"/>
<mkdir dir="${classes}"/>
<javac fork="true" debug="on" srcdir="${src}" destdir="${classes}" encoding="UTF-8">
<compilerarg line="-encoding utf-8"/> <classpath refid="libs"/>
</javac>
</target>
<target name="compile.java6" depends="clean.classes">
<echo>Compile from "${src}" to "${classes}"...</echo>
<mkdir dir="${lib}"/>
<mkdir dir="${classes}"/>
<javac fork="true" debug="on" srcdir="${src}" destdir="${classes}" encoding="UTF-8" source="1.6" target="1.6" bootclasspath="extra/rt_1.6_openjdk.jar">
<compilerarg line="-encoding utf-8"/> <classpath refid="libs"/>
</javac>
</target>
<target name="tcompile">
<echo>Compile from "${tsrc}" to "${tclasses}"...</echo>
<mkdir dir="${tclasses}"/>
<javac fork="true" debug="on" srcdir="${tsrc}" destdir="${tclasses}" encoding="UTF-8">
<compilerarg line="-encoding utf-8"/> <classpath refid="tlibs"/>
</javac>
</target>
<!-- EXEC TESTS -->
<target name="test" depends="tcompile">
<junit haltonfailure="true" fork="true">
<jvmarg value="-ea"/>
<classpath>
<pathelement location="${classes}" />
<pathelement location="${tclasses}" />
<fileset dir="${lib}/">
<include name="commons-math3.jar" />
<include name="junit4.jar" />
<include name="${jarname}.jar" />
</fileset>
<fileset dir="${target}/" erroronmissingdir="false">
<include name="${jarname}.jar" />
</fileset>
</classpath>
<batchtest>
<fileset dir="${tsrc}">
<include name="**/*Test*" />
<exclude name="**/*TestPerf*"/>
</fileset>
</batchtest>
<formatter type="brief" usefile="false"/>
</junit>
</target>
<target name="bench" depends="compile,tcompile">
<junit haltonfailure="true" fork="true">
<classpath>
<pathelement location="${classes}" />
<pathelement location="${tclasses}" />
<fileset dir="${lib}/">
<include name="**/*.jar" />
</fileset>
<fileset dir="${tlib}/">
<include name="**/*.jar" />
</fileset>
</classpath>
<batchtest>
<fileset dir="${tsrc}">
<include name="**/*TestPerf*"/>
</fileset>
</batchtest>
<formatter type="brief" usefile="false"/>
</junit>
</target>
<!-- BUILD DOC -->
<target name="doc">
<echo>Create JavaDoc from "${src}" to "${doc}"...</echo>
<mkdir dir="${doc}"/>
<property name="ps" value="${path.separator}"/>
<javadoc destdir="${doc}" sourcepath="${src}" packagenames="*" author="true" version="true" access="public" charset="UTF-8" docencoding="UTF-8" encoding="UTF-8">
<link href="http://download.oracle.com/javase/8/docs/api/"/>
<!--arg value="-taglet"/>
<arg value="latexlet.InlineBlockLaTeXlet"/>
<arg value="-taglet"/>
<arg value="latexlet.BlockLaTeXlet"/>
<arg value="-taglet"/>
<arg value="latexlet.InlineLaTeXlet"/>
<arg value="-tagletpath"/>
<arg value="${ext}/LaTeXlet/LaTeXlet-1.1.jar"/-->
<!--doclet name="ydoc.doclets.YStandard" path="${ydoc}/lib/ydoc.jar${ps}${ydoc}/resources${ps}${ydoc}/doc">
<param name="-author"/>
<param name="-generic"/>
<param name="-umlautogen"/>
<param name="-filterpath" value="${ydocHome}/lib/ydoc.jar"/>
<param name="-filter" value="ydoc.filters.ExcludeFilter"/>
<param name="-tag" value="y.precondition"/>
<param name="-tag" value="y.postcondition"/>
<param name="-tag" value="y.complexity"/>
<param name="-tag" value="param"/>
<param name="-tag" value="return"/>
<param name="-tag" value="see"/>
<param name="-tag" value="y.uml"/>
</doclet-->
<!--packageset dir="${src}" defaultexcludes="yes">
<include name="${src}/kdtree/**"/-->
<!--exclude name="com/dummy/test/doc-files/**"/-->
<!--/packageset-->
<doctitle><![CDATA[<h1>${title} doc</h1>]]></doctitle>
<bottom><![CDATA[<i>Copyright © ${time.year} ${author}, ${affiliation}. All Rights Reserved.</i>]]></bottom>
</javadoc>
</target>
<!-- BUILD JARS -->
<target name="jars" depends="jar,fatjar"/>
<target name="jar">
<echo>Create jar file "${target}/${jarname}.jar"...</echo>
<mkdir dir="${target}"/>
<delete file="${target}/${jarname}.jar"/>
<jar jarfile="${target}/${jarname}.jar" basedir="${classes}">
<manifest>
<attribute name="Mame" value="${projname}"/>
<attribute name="Specification-Title" value="${title}"/>
<attribute name="Specification-Version" value="${version}"/>
<attribute name="Specification-Vendor" value="${author}, ${affiliation}"/>
<attribute name="Implementation-Title" value="${packagename}"/>
<attribute name="Implementation-Version" value="build${build}"/>
<attribute name="Implementation-Vendor" value="${author}, ${affiliation}"/>
<attribute name="Main-Class" value="${mainclass}"/>
</manifest>
</jar>
</target>
<target name="fatjar">
<echo>Create jar file "${target}/${jarname}.${version}_${build}.jar"...</echo>
<mkdir dir="${target}"/>
<delete file="${target}/${jarname}.${version}_${build}.jar"/>
<jar jarfile="${target}/${jarname}.${version}_${build}.jar" basedir="${classes}" duplicate="fail">
<zipgroupfileset dir="${lib}" includes="**/*.jar" />
<manifest>
<attribute name="Mame" value="${projname}"/>
<attribute name="Specification-Title" value="${title}"/>
<attribute name="Specification-Version" value="${version}"/>
<attribute name="Specification-Vendor" value="${author}, ${affiliation}"/>
<attribute name="Implementation-Title" value="${packagename}"/>
<attribute name="Implementation-Version" value="build${build}"/>
<attribute name="Implementation-Vendor" value="${author}, ${affiliation}"/>
<attribute name="Main-Class" value="${mainclass}"/>
</manifest>
</jar>
</target>
<!-- EXEC -->
<target name="exec" description="Create the JAR and exec the CLI" depends="make.jar">
<java fork="true" jar="${target}/${jarname}.${version}_${build}.jar">
<jvmarg value="-Xmx${xmx}"/>
</java>
</target>
</project>
|