Jon Blower wrote:
> Hi all,
>
> Does anyone know if the Java-NetCDF libraries (particularly version 4)
> are in a Maven repository anywhere? If they are not, I could have a
> go at creating one, since I think it would help one of the projects
> I'm working on (perhaps it would be useful to others too). But in
> order to do this I'd need someone (John C perhaps) to send a
> definitive list of nj4's dependencies, and what they are needed for.
>
> Cheers, Jon
>
Hi Jon:
Theres been various interest in the past,including this from sometime in 2007:
"Lorenzo Bigagli has offered a maven build for Netcdf-Java. I havent had a
chance to try it but if anyone else can, please do so:
http://ulisse.pin.unifi.it:8080/archiva/browse/essi-unidata/netcdf-java"
whose link still seems to work. you can also email bigagli@xxxxxxxxxxx
Anyway the set of dependencies for netcdf-java 4.0.39 can be found in the ant
build file (attached), and also at:
http://www.unidata.ucar.edu/software/netcdf-java/reference/JarDependencies.html
Note that in this list from the build.xml:
<fileset dir="${lib.dir}">
<include name="release/${bufrTables.jar}"/>
<include name="release/${grib.jar}"/>
<include name="external/${jdom.jar}"/>
<include name="external/${jpeg2000.jar}"/>
<include name="external/${httpclient.jar}"/>
<include name="external/${http-codec.jar}"/>
<include name="external/${http-logging.jar}"/>
<include name="external/${loggingAPI.jar}"/>
<include name="external/${logging-minimal.jar}"/>
<include name="release/${opendap.jar}"/>
<include name="release/${visadNoDods.jar}"/>
</fileset>
jars from "release" directory are ones that we build, and "external" are from
external places.
Let me know what else I can tell you....
<?xml version="1.0"?>
<project name="cdm" default="makeMain" basedir=".">
<property name="release.version" value="4.0"/>
<property name="minor" value="39" />
<!-- "build.number" is already set for TeamCity builds. -->
<tstamp>
<format property="build.time.number" pattern="yyyyMMdd.HHmm"
timezone="GMT"/>
</tstamp>
<condition property="release.version.minor"
value="${release.version}.${minor}.${build.number}"
else="${release.version}.${minor}.${build.time.number}" >
<isset property="build.number" />
</condition>
<property name="build.debug" value="on"/>
<property name="build.release" value="false"/>
<tstamp>
<format property="buildtime" pattern="yyyy-MM-dd HH:mm:ss" timezone="GMT"/>
</tstamp>
<tstamp>
<format property="buildtime2" pattern="yyyy-MM-dd'T'HH.mm.ss"
timezone="GMT"/>
</tstamp>
<!-- Load environment and user properties. -->
<property environment="env"/>
<property file="${user.home}/build.properties"/>
<!-- Directories for releasing to FTP or WWW site, defaults are John's.
Override by adding to build.properties file.
-->
<property name="uni.ftp.dir" value="O:"/>
<property name="uni.www.dir" value="Z:"/>
<property name="root.dir" location="${basedir}"/>
<property name="src.dir" location="${root.dir}/src/main/java"/>
<property name="timingSrc.dir" location="${root.dir}/src/timing/java"/>
<property name="commonSrc.dir" location="${root.dir}/../common/src/java"/>
<property name="resources.dir" location="${root.dir}/src/main/resources"/>
<property name="doc.dir" location="${root.dir}/doc"/>
<property name="lib.dir" location="${root.dir}/../lib"/>
<property name="build.dir" value="${root.dir}/target"/>
<property name="build.classes.dir" value="${build.dir}/classes"/>
<property name="javadoc.dir" value="${build.dir}/javadoc"/>
<property name="javadocAll.dir" value="${build.dir}/javadocAll"/>
<property name="release.library.dir"
value="${uni.ftp.dir}/pub/netcdf-java/v${release.version}/"/>
<property name="release.doc.dir"
value="${uni.ftp.dir}/pub/netcdf-java/v${release.version}/"/>
<property name="release.html.dir"
value="${uni.www.dir}/content/software/netcdf-java/v${release.version}/"/>
<property name="release.schema.dir" value="${uni.www.dir}/content/schema"/>
<property name="release.javadoc.dir"
value="${uni.www.dir}/content/software/netcdf-java/v${release.version}/javadoc/"/>
<property name="release.javadocAll.dir"
value="${uni.www.dir}/content/software/netcdf-java/v${release.version}/javadocAll/"/>
<property name="webstart_dir"
value="${uni.www.dir}/content/software/netcdf-java/v${release.version}/webstart"/>
<!-- property name="bzip2.jar" value="bzip2.jar"/ -->
<!-- property name="gnu-regexp.jar" value="gnu-regexp-1.1.4.jar"/ -->
<property name="bufrTables.jar" value="bufrTables-1.5.jar"/>
<property name="ehcache.jar" value="ehcache-1.6.0-beta3.jar"/>
<property name="grib.jar" value="grib-6.0.jar"/>
<property name="httpclient.jar" value="commons-httpclient-3.1.jar"/>
<property name="http-logging.jar" value="commons-logging-1.1.jar"/>
<property name="http-codec.jar" value="commons-codec-1.3.jar"/>
<property name="jdom.jar" value="jdom.jar"/>
<property name="jgoodies.jar" value="forms-1.0.7.jar"/>
<property name="jpeg2000.jar" value="jpeg2000.jar"/>
<property name="junit.jar" value="junit.jar"/>
<property name="loggingAPI.jar" value="slf4j-api-1.5.6.jar"/>
<property name="logging-minimal.jar" value="slf4j-jdk14-1.5.6.jar"/>
<property name="logging-maximal.jar" value="slf4j-log4j12-1.5.6.jar"/>
<property name="log4j.jar" value="log4j-1.2.15.jar"/>
<property name="lucene.jar" value="lucene.jar"/>
<property name="opendap.jar" value="opendap-2.1.jar"/>
<property name="resourcesOptional.jar" value="resourcesOptional.jar"/>
<property name="spring.jar" value="spring-2.5.jar"/>
<property name="stax.jar" value="stax-api-1.0.1.jar"/>
<property name="visadNoDods.jar" value="visadNoDods.jar"/>
<!-- source -->
<path id="sourcepath">
<pathelement location="${src.dir}"/>
<pathelement location="${commonSrc.dir}"/>
</path>
<!-- Libraries -->
<fileset id="compile.libraries" dir="${lib.dir}">
<include name="external/${ehcache.jar}"/>
<include name="release/${grib.jar}"/>
<include name="release/${opendap.jar}"/>
<include name="external/${httpclient.jar}"/>
<include name="external/${jdom.jar}"/>
<include name="external/${loggingAPI.jar}"/>
<include name="release/${visadNoDods.jar}"/>
<include name="external/${stax.jar}"/>
</fileset>
<fileset id="compileFromSrc.libraries" dir="${root.dir}">
<include name="lib/${ehcache.jar}"/>
<include name="lib/${grib.jar}"/>
<include name="lib/${opendap.jar}"/>
<include name="lib/${httpclient.jar}"/>
<include name="lib/${jdom.jar}"/>
<include name="lib/${loggingAPI.jar}"/>
<include name="lib/${visadNoDods.jar}"/>
<include name="lib/${jgoodies.jar}"/>
<include name="lib/${lucene.jar}"/>
<include name="lib/${spring.jar}"/>
<include name="lib/${stax.jar}"/>
</fileset>
<path id="compile.classpath">
<fileset refid="compile.libraries"/>
</path>
<path id="compileFromSrc.classpath">
<fileset refid="compileFromSrc.libraries"/>
</path>
<fileset id="runtime.libraries" dir="${lib.dir}">
<include name="release/${bufrTables.jar}"/>
<include name="external/${http-codec.jar}"/>
<include name="external/${http-logging.jar}"/>
<include name="external/${logging-minimal.jar}"/>
<include name="external/${jpeg2000.jar}"/>
</fileset>
<path id="runtime.classpath">
<fileset refid="compile.libraries"/>
<fileset refid="runtime.libraries"/>
</path>
<!-- LOOK can we generate with pathconvert? -->
<property name="Class-Path"
value="${jgoodies.jar} ${grib.jar} ${jdom.jar} ${opendap.jar}
${http-codec.jar} ${httpclient.jar} ${http-logging.jar} ${loggingAPI.jar}
${logging-minimal.jar} ${jpeg2000.jar} ${resourcesOptional.jar} ${spring.jar}
${visadNoDods.jar}"/>
<property name="ClassPath-CommandLine"
value="lib/${grib.jar}:lib/${jdom.jar}:lib/${httpclient.jar}:lib/${http-codec.jar}:lib/${http-logging.jar}:lib/${jpeg2000.jar}:lib/${loggingAPI.jar}:lib/${logging-minimal.jar}:lib/${jgoodies.jar}:lib/${spring.jar}:lib/${visadNoDods.jar}"/>
<target name="test-pathconvert">
<echo>Class-Path=${Class-Path}</echo>
<pathconvert property="runtime.classpath.prop" refid="runtime.classpath"
pathsep=" ">
<mapper type="flatten"/>
</pathconvert>
<echo>runtime.classpath.prop=${runtime.classpath.prop}</echo>
</target>
<!-- targets -->
<target name="init">
<mkdir dir="${build.classes.dir}"/>
<echo message="Initialize ${ant.project.name}"/>
</target>
<target name="clean" description="Deletes all files that are generated by the
build.">
<delete dir="${build.dir}" failonerror="false"/>
</target>
<target name="release-settings">
<condition property="build.debuglevel" value="lines">
<istrue value="${build.release}"/>
</condition>
<property name="build.debuglevel" value="lines,vars,source"/>
<!-- echo>release.build=${release.build}</echo>
<echo>build.debuglevel=${build.debuglevel}</echo -->
</target>
<!-- $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ -->
<!-- core library -->
<patternset id="sources-core">
<include name="ucar/ma2/*.java"/>
<include name="ucar/nc2/*.java"/>
<include name="ucar/nc2/iosp/netcdf3/N3iosp.java"/>
<include name="ucar/nc2/util/DebugFlagsImpl.java"/>
<include name="ucar/nc2/util/TimeSocket.java"/>
</patternset>
<target name="compile-core" depends="release-settings" description="library
compile">
<delete dir="${build.classes.dir}" failonerror="false"/>
<mkdir dir="${build.classes.dir}"/>
<javac destdir="${build.classes.dir}" debug="${build.debug}"
debuglevel="${build.debuglevel}"
includeAntRuntime="false" source="1.5" target="1.5">
<src refid="sourcepath"/>
<patternset refid="sources-core"/>
<classpath refid="compile.classpath"/>
</javac>
</target>
<!-- make core library jars -->
<property name="core.dir" value="${build.dir}/core"/>
<property name="jarCore" value="ncCore-${release.version}.jar"/>
<target name="makeCore" depends="compile-core" description="make core library
jar">
<delete dir="${core.dir}" failonerror="false"/>
<mkdir dir="${core.dir}"/>
<unzip dest="${core.dir}">
<fileset dir="${lib.dir}">
<include name="external/${loggingAPI.jar}"/>
<include name="external/${logging-minimal.jar}"/>
</fileset>
</unzip>
<copy file="README.TEMPLATE" tofile="${build.dir}/README" overwrite="true">
<filterset>
<filter token="BUILDTIME" value="${buildtime}"/>
<filter token="VERSION" value="${release.version}"/>
<filter token="VERSION.MINOR" value="${release.version.minor}"/>
</filterset>
</copy>
<copy file="CHANGES.txt" tofile="${build.dir}/CHANGES" overwrite="true">
<filterset>
<filter token="BUILDTIME" value="${buildtime}"/>
<filter token="VERSION" value="${release.version}"/>
<filter token="VERSION.MINOR" value="${release.version.minor}"/>
</filterset>
</copy>
<jar jarfile="${build.dir}/${jarCore}" index="true">
<fileset dir="${build.classes.dir}"/>
<fileset dir="${build.dir}" includes="README"/>
<fileset dir="${build.dir}" includes="CHANGES"/>
<fileset dir="${core.dir}"/>
<manifest>
<attribute name="Built-By" value="${user.name}"/>
<attribute name="Built-On" value="${buildtime}"/>
<attribute name="Implementation-Title"
value="NetCDF-Java-MinimalLibrary"/>
<attribute name="Implementation-Version"
value="${release.version.minor}"/>
<attribute name="Implementation-Vendor" value="UCAR/Unidata"/>
</manifest>
</jar>
</target>
<!-- $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ -->
<!-- main library -->
<patternset id="sources">
<include name="thredds/catalog/*.java"/>
<include name="thredds/catalog/parser/jdom/*.java"/>
<include name="thredds/catalog2/**/*.java"/>
<include name="thredds/filesystem/**/*.java"/>
<include name="thredds/util/**/*.java"/>
<!-- The following includes, to ***, are needed by TDS. -->
<include name="thredds/catalog/crawl/*.java"/>
<include name="thredds/catalog/dl/*.java"/>
<include name="thredds/catalog/query/*.java"/>
<include name="thredds/cataloggen/**/*.java"/>
<include name="thredds/crawlabledataset/**/*.java"/>
<include name="thredds/wcs/**/*.java"/>
<!-- *** -->
<include name="ucar/**/*.java"/>
<exclude name="ucar/nc2/dataset/grid/*"/>
<exclude name="ucar/nc2/jni/**"/>
<exclude name="ucar/nc2/util/reflect/*"/>
<!--exclude name="ucar/unidata/geoloc/ogc/*"/--> <!-- Also needed by TDS.
-->
<!-- include name="dods/**/*.java"/ -->
</patternset>
<target name="compile" depends="release-settings" description="library
compile">
<delete dir="${build.classes.dir}" failonerror="false"/>
<mkdir dir="${build.classes.dir}"/>
<javac destdir="${build.classes.dir}" debug="${build.debug}"
debuglevel="${build.debuglevel}"
includeAntRuntime="false" source="1.5" target="1.5">
<src refid="sourcepath"/>
<patternset refid="sources"/>
<classpath refid="compile.classpath"/>
</javac>
</target>
<!-- make library jars -->
<property name="jarMain" value="netcdf-${release.version}.jar"/>
<target name="makeMain" depends="compile" description="make library jars">
<copy file="README.TEMPLATE" tofile="${build.dir}/README" overwrite="true">
<filterset>
<filter token="BUILDTIME" value="${buildtime}"/>
<filter token="VERSION" value="${release.version}"/>
<filter token="VERSION.MINOR" value="${release.version.minor}"/>
</filterset>
</copy>
<copy file="CHANGES.txt" tofile="${build.dir}/CHANGES" overwrite="true">
<filterset>
<filter token="BUILDTIME" value="${buildtime}"/>
<filter token="VERSION" value="${release.version}"/>
<filter token="VERSION.MINOR" value="${release.version.minor}"/>
</filterset>
</copy>
<jar jarfile="${build.dir}/${jarMain}" index="true">
<fileset dir="${build.classes.dir}">
<exclude name="thredds/catalog2/**"/>
<!-- exclude name="thredds/wcs/**"/ -->
<!-- exclude name="ucar/unidata/geoloc/ogc/**"/ -->
</fileset>
<fileset dir="${build.dir}" includes="README"/>
<fileset dir="${build.dir}" includes="CHANGES"/>
<fileset dir="${resources.dir}">
<include name="resources/nj22/**"/>
<include name="resources/thredds/**"/>
</fileset>
<manifest>
<attribute name="Built-By" value="${user.name}"/>
<attribute name="Built-On" value="${buildtime}"/>
<attribute name="Implementation-Title" value="NetCDF-Java-Library"/>
<attribute name="Implementation-Version"
value="${release.version.minor}"/>
<attribute name="Implementation-Vendor" value="UCAR/Unidata"/>
</manifest>
</jar>
</target>
<property name="jarMainComplete" value="netcdfAll-${release.version}.jar"/>
<property name="main.dir" value="${build.dir}/main"/>
<target name="makeMainComplete" depends="makeMain" description="make
netcdfAll jar">
<delete dir="${main.dir}" failonerror="false"/>
<mkdir dir="${main.dir}"/>
<unzip dest="${main.dir}">
<fileset dir="${lib.dir}">
<include name="release/${bufrTables.jar}"/>
<include name="release/${grib.jar}"/>
<include name="external/${jdom.jar}"/>
<include name="external/${jpeg2000.jar}"/>
<include name="external/${httpclient.jar}"/>
<include name="external/${http-codec.jar}"/>
<include name="external/${http-logging.jar}"/>
<include name="external/${loggingAPI.jar}"/>
<include name="external/${logging-minimal.jar}"/>
<include name="release/${opendap.jar}"/>
<include name="release/${visadNoDods.jar}"/>
</fileset>
</unzip>
<unzip dest="${main.dir}">
<fileset dir="${build.dir}">
<include name="${jarMain}"/>
</fileset>
</unzip>
<jar jarfile="${build.dir}/${jarMainComplete}" index="true"
duplicate="preserve">
<fileset dir="${main.dir}"/>
<manifest>
<attribute name="Built-By" value="${user.name}"/>
<attribute name="Built-On" value="${buildtime}"/>
<attribute name="Implementation-Title" value="NetCDF-Java-Library
Complete"/>
<attribute name="Implementation-Version"
value="${release.version.minor}"/>
<attribute name="Implementation-Vendor" value="UCAR/Unidata"/>
</manifest>
</jar>
</target>
<property name="testJar.dir" value="${build.dir}/testJar"/>
<target name="makeTestJar" description="make test jar">
<delete dir="${testJar.dir}" failonerror="false"/>
<mkdir dir="${testJar.dir}"/>
<unzip dest="${testJar.dir}">
<fileset dir="${lib.dir}">
<include name="external/${ehcache.jar}"/>
<include name="external/${loggingAPI.jar}"/>
<include name="external/${logging-minimal.jar}"/>
</fileset>
</unzip>
<unzip dest="${testJar.dir}">
<fileset dir="${build.dir}">
<include name="${jarMain}"/>
</fileset>
</unzip>
<jar jarfile="${build.dir}/test.jar" index="true" duplicate="preserve">
<fileset dir="${testJar.dir}"/>
<manifest>
<attribute name="Built-By" value="${user.name}"/>
<attribute name="Built-On" value="${buildtime}"/>
<attribute name="Implementation-Title" value="test Jar"/>
<attribute name="Implementation-Version"
value="${release.version.minor}"/>
<attribute name="Implementation-Vendor" value="UCAR/Unidata"/>
</manifest>
</jar>
</target>
<property name="zip.dir" value="${build.dir}/zip"/>
<property name="uiZip.dir" value="${build.dir}/uiZip"/>
<!-- $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ -->
<!-- idv library -->
<property name="jarIdv" value="ncIdv.jar"/>
<property name="idv.dir" value="${build.dir}/idv"/>
<target name="makeIDVjar" depends="makeMain" description="create jar for idv">
<mkdir dir="${idv.dir}"/>
<unzip dest="${idv.dir}">
<fileset dir="${lib.dir}">
<include name="release/${bufrTables.jar}"/>
<include name="release/${grib.jar}"/>
<include name="external/${jdom.jar}"/>
<include name="external/${httpclient.jar}"/>
<include name="external/${http-codec.jar}"/>
<include name="external/${http-logging.jar}"/>
<include name="external/${loggingAPI.jar}"/>
<include name="external/${logging-minimal.jar}"/>
<include name="release/${opendap.jar}"/>
</fileset>
</unzip>
<unzip dest="${idv.dir}">
<fileset dir="${build.dir}">
<include name="${jarMain}"/>
</fileset>
</unzip>
<jar jarfile="${build.dir}/${jarIdv}" index="true" duplicate="preserve">
<fileset dir="${build.dir}" includes="README"/>
<fileset dir="${build.dir}" includes="CHANGES"/>
<fileset dir="${idv.dir}"/>
<manifest>
<attribute name="Built-By" value="${user.name}"/>
<attribute name="Built-On" value="${buildtime}"/>
<attribute name="Implementation-Title" value="NetCDF-Java-IDV-library"/>
<attribute name="Implementation-Version"
value="${release.version.minor}"/>
<attribute name="Implementation-Vendor" value="UCAR/Unidata"/>
</manifest>
</jar>
</target>
<!-- $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ -->
<!-- source release -->
<property name="ncSrcRelease.jar" value="ncSrc-${release.version}.zip"/>
<target name="makeSrc-CDM" description="create CDM source release">
<jar jarfile="${build.dir}/${ncSrcRelease.jar}" index="true"
duplicate="preserve">
<fileset dir="${root.dir}/..">
<include name="cdm/build.xml"/>
<include name="cdm/README.TEMPLATE"/>
<include name="cdm/src/main/**"/>
<include name="common/src/**"/>
<include name="lib/external/**"/>
<include name="lib/release/**"/>
<include name="ui/src/main/**"/>
</fileset>
<manifest>
<attribute name="Built-By" value="${user.name}"/>
<attribute name="Built-On" value="${buildtime2}"/>
<attribute name="Implementation-Title" value="netCDF-Java/CDM and
ToolsUI Source"/>
<attribute name="Implementation-Version"
value="${release.version.minor}"/>
<attribute name="Implementation-Vendor" value="UCAR/Unidata"/>
</manifest>
</jar>
</target>
<property name="fullSrc.jar" value="threddsSrc-${release.version.minor}.jar"/>
<target name="makeSrc-Full" description="make nj22/tds full source jar =
threddsSrc-${release.version.minor}.jar">
<jar jarfile="${build.dir}/${fullSrc.jar}" index="true"
duplicate="preserve">
<fileset dir="${root.dir}/..">
<include name="cdm/src/main/**"/>
<include name="common/src/**"/>
<include name="lib/external/**"/>
<include name="lib/release/**"/>
<include name="ui/src/main/**"/>
<include name="tds/src/main/**"/>
</fileset>
<manifest>
<attribute name="Built-By" value="${user.name}"/>
<attribute name="Built-On" value="${buildtime2}"/>
<attribute name="Implementation-Title" value="THREDDS Source (CDM, TDS,
ToolsUI)"/>
<attribute name="Implementation-Version"
value="${release.version.minor}"/>
<attribute name="Implementation-Vendor" value="UCAR/Unidata"/>
</manifest>
</jar>
</target>
<!-- $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ -->
<!-- get rid of dods stuff in visad.jar -->
<property name="visad.jar" value="C:/dev/lib/visad/visad.jar"/>
<!-- checkout visad.jar from cvs -->
<property name="visadNoDods.tempdir" location="C:/dev/lib/visad/temp/"/>
<target name="makeVisadNoDods" description="remove dods from visad">
<delete dir="${visadNoDods.tempdir}" failonerror="false"/>
<mkdir dir="${visadNoDods.tempdir}"/>
<unzip dest="${visadNoDods.tempdir}">
<fileset file="${visad.jar}"/>
</unzip>
<delete dir="${visadNoDods.tempdir}/dods" failonerror="true"/>
<delete dir="${visadNoDods.tempdir}/gnu/regexp" failonerror="true"/>
<delete dir="${visadNoDods.tempdir}/HTTPClient" failonerror="true"/>
<delete dir="${visadNoDods.tempdir}/ucar" failonerror="true"/>
<jar jarfile="${lib.dir}/release/${visadNoDods.jar}" index="true"
duplicate="preserve">
<fileset dir="${visadNoDods.tempdir}"/>
</jar>
</target>
<!-- temp
<property name="makeViewerJar.tempdir" location="C:/TEMP/viewerJar/"/>
<target name="makeViewerJar">
<!- delete dir="${makeViewerJar.tempdir}" failonerror="false"/>
<mkdir dir="${makeViewerJar.tempdir}"/>
<mkdir dir="${makeViewerJar.tempdir}/saidinViewer"/>
<copy todir="${makeViewerJar.tempdir}/saidinViewer" overwrite="true"
preservelastmodified="true">
<fileset dir="C:/dev/thredds/tds/target/classes/saidinViewer"/>
</copy ->
<jar jarfile="${lib.dir}/external/viewerJar.jar" index="true"
duplicate="preserve">
<fileset dir="${makeViewerJar.tempdir}"/>
</jar>
</target -->
<!-- $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ -->
<!-- make javadoc -->
<property name="jarJavadoc" value="javadoc-${release.version}.jar"/>
<target name="javadoc" description="make the javadocs">
<mkdir dir="${javadoc.dir}"/>
<javadoc Doctitle="NetCDF-Java ${release.version} API" Use="true"
Windowtitle="NetCDF-Java ${release.version} Public API"
maxmemory="256m" sourcepathref="sourcepath"
destdir="${javadoc.dir}" public="true" source="1.5">
<classpath refid="compile.classpath"/>
<package name="thredds.catalog"/>
<package name="ucar.ma2"/>
<package name="ucar.nc2"/>
<package name="ucar.nc2.constants"/>
<package name="ucar.nc2.dataset"/>
<package name="ucar.nc2.dataset.conv"/>
<package name="ucar.nc2.dataset.transform"/>
<package name="ucar.nc2.dt"/>
<package name="ucar.nc2.ft"/>
<package name="ucar.nc2.units"/>
<package name="ucar.nc2.util"/>
<package name="ucar.unidata.geoloc"/>
<package name="ucar.unidata.geoloc.projection"/>
<package name="ucar.unidata.geoloc.vertical"/>
<package name="ucar.unidata.io"/>
<package name="ucar.unidata.util"/>
</javadoc>
<jar jarfile="${build.dir}/${jarJavadoc}" index="true" duplicate="preserve">
<fileset dir="${javadoc.dir}"/>
<manifest>
<attribute name="Built-By" value="${user.name}"/>
<attribute name="Built-On" value="${buildtime}"/>
<attribute name="Implementation-Title" value="Public Javadoc for
NetCDF-Java-library "/>
<attribute name="Implementation-Version"
value="${release.version.minor}"/>
<attribute name="Implementation-Vendor" value="UCAR/Unidata"/>
</manifest>
</jar>
</target>
<property name="jarJavadocAll" value="javadocAll-${release.version}.jar"/>
<target name="javadocAll" description="make all javadocs">
<mkdir dir="${javadocAll.dir}"/>
<javadoc Doctitle="NetCDF-Java ${release.version} API" Use="true"
Windowtitle="NetCDF-Java ${release.version} Public and Private API"
maxmemory="256m" sourcepathref="sourcepath"
destdir="${javadocAll.dir}" protected="true" source="1.5">
<classpath refid="compile.classpath"/>
<classpath refid="compileUI.classpath"/>
<package name="dods.*"/>
<package name="thredds.*"/>
<package name="ucar.*"/>
<excludepackage name="ucar/nc2/dataset/grid"/>
<excludepackage name="ucar/nc2/stream/**"/>
<excludepackage name="ucar/nc2/jni"/>
<excludepackage name="ucar/nc2/jni/**"/>
<excludepackage name="ucar/nc2/util/reflect"/>
<excludepackage name="thredds/catalog2/**"/>
<!-- excludepackage name="ucar/unidata/geoloc/ogc"/>
<excludepackage name="thredds/wcs/**" / -->
</javadoc>
<jar jarfile="${build.dir}/${jarJavadocAll}" index="true"
duplicate="preserve">
<fileset dir="${javadocAll.dir}"/>
<manifest>
<attribute name="Built-By" value="${user.name}"/>
<attribute name="Built-On" value="${buildtime}"/>
<attribute name="Implementation-Title" value="All Javadoc for
NetCDF-Java-library "/>
<attribute name="Implementation-Version"
value="${release.version.minor}"/>
<attribute name="Implementation-Vendor" value="UCAR/Unidata"/>
</manifest>
</jar>
</target>
<!-- release user manual -->
<target name="releaseDoc" description="Release user manual">
<copy todir="${release.doc.dir}" overwrite="true">
<fileset dir="${doc.dir}"
includes="NetcdfJavaUserManual-${release.version}.doc"/>
<fileset dir="${doc.dir}"
includes="NetcdfJavaUserManual-${release.version}.pdf"/>
</copy>
<copy todir="${release.html.dir}" overwrite="true">
<fileset dir="${doc.dir}"
includes="NetcdfJavaUserManual-${release.version}.htm"/>
</copy>
</target>
<!-- $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ -->
<!-- UI -->
<property name="srcUI.dir" location="${root.dir}/../ui/src/main/java"/>
<property name="resourcesUI.dir"
location="${root.dir}/../ui/src/main/resources"/>
<fileset id="compileUI.libraries" dir="${lib.dir}">
<include name="external/${jgoodies.jar}"/>
<include name="external/${lucene.jar}"/>
<include name="external/${spring.jar}"/>
</fileset>
<path id="compileUI.classpath">
<fileset refid="compileUI.libraries"/>
</path>
<path id="sourcepathUI">
<pathelement location="${src.dir}"/>
<pathelement location="${srcUI.dir}"/>
<pathelement location="${commonSrc.dir}"/>
</path>
<target name="compileUI" depends="init, release-settings"
description="toolsUI compile">
<pathconvert property="sourcepath.prop" refid="sourcepath"
targetos="windows"/>
<echo>sourcepath=${sourcepath.prop}</echo>
<javac destdir="${build.classes.dir}" debug="${build.debug}"
debuglevel="${build.debuglevel}"
includeAntRuntime="false" source="1.5" target="1.5">
<src refid="sourcepathUI"/>
<patternset refid="sources"/>
<patternset>
<include name="ucar/nc2/ui/**/*.java"/>
<include name="thredds/monitor/*.java"/>
<exclude name="ucar/nc2/thredds/monitor/**" />
</patternset>
<classpath refid="compile.classpath"/>
<classpath refid="compileUI.classpath"/>
</javac>
<!-- Setup runToolsUI script -->
<pathconvert property="toolsUI.runtime.classpath.prop">
<path>
<path location="${build.classes.dir}"/>
<path location="${resources.dir}"/>
<path location="${resourcesUI.dir}"/>
<fileset refid="compile.libraries"/>
<fileset refid="compileUI.libraries"/>
<fileset refid="runtime.libraries"/>
</path>
</pathconvert>
<!-- todo Should move template file to src/main/scripts/runToolsUI.sh -->
<copy file="${root.dir}/runToolsUI.TEMPLATE"
tofile="${build.dir}/runToolsUI" overwrite="true">
<filterset>
<filter token="CLASSPATH" value="${toolsUI.runtime.classpath.prop}"/>
</filterset>
</copy>
</target>
<property name="jarUI" value="netcdfUI-${release.version}.jar"/>
<target name="makeUI" depends="compile, compileUI" description="make toolsUI
jar">
<copy file="README.TEMPLATE" tofile="${build.dir}/README" overwrite="true">
<filterset>
<filter token="BUILDTIME" value="${buildtime}"/>
<filter token="VERSION" value="${release.version}"/>
<filter token="VERSION.MINOR" value="${release.version.minor}"/>
</filterset>
</copy>
<copy file="CHANGES.txt" tofile="${build.dir}/CHANGES" overwrite="true">
<filterset>
<filter token="BUILDTIME" value="${buildtime}"/>
<filter token="VERSION" value="${release.version}"/>
<filter token="VERSION.MINOR" value="${release.version.minor}"/>
</filterset>
</copy>
<!-- Ant jar task with index="true" will create JARs hiding any Class-Path:
... entries ! -->
<jar jarfile="${build.dir}/${jarUI}" duplicate="preserve">
<fileset dir="${build.dir}" includes="README"/>
<fileset dir="${build.dir}" includes="CHANGES"/>
<fileset dir="${build.classes.dir}"/>
<zipfileset dir="${resources.dir}/resources" prefix="resources"/>
<zipfileset dir="${resourcesUI.dir}/resources" prefix="resources"/>
<manifest>
<attribute name="Main-Class" value="ucar.nc2.ui.ToolsUI"/>
<attribute name="Class-Path" value="${Class-Path}"/>
<attribute name="Built-By" value="${user.name}"/>
<attribute name="Built-On" value="${buildtime}"/>
<attribute name="Implementation-Title" value="NetCDF-Java-UITools"/>
<attribute name="Implementation-Version"
value="${release.version.minor}"/>
<attribute name="Implementation-Vendor" value="UCAR/Unidata"/>
</manifest>
<indexjars>
<path refid="compile.classpath"/>
<path refid="compileUI.classpath"/>
<pathelement location="${lib.dir}/release/${resourcesOptional.jar}"/>
</indexjars>
</jar>
</target>
<property name="ncAll" value="netcdfAll-${release.version}.zip"/>
<target name="makeAllzip" depends="makeMain, makeUI" description="create
netcdfAll zip file">
<copy file="${build.dir}/${jarUI}" todir="${zip.dir}" overwrite="true"
preservelastmodified="true"/>
<copy file="${build.dir}/${jarMain}" todir="${zip.dir}" overwrite="true"
preservelastmodified="true"/>
<!--gather jars for the application and make netcdfAll.zip -->
<copy todir="${zip.dir}" flatten="true" overwrite="true"
preservelastmodified="true">
<fileset refid="compile.libraries"/>
<fileset refid="compileUI.libraries"/>
<fileset refid="runtime.libraries"/>
<fileset file="${lib.dir}/release/${resourcesOptional.jar}"/>
<fileset file="${lib.dir}/external/${log4j.jar}"/>
<fileset file="${lib.dir}/external/${logging-maximal.jar}"/>
</copy>
<zip destfile="${build.dir}/${ncAll}" basedir="${zip.dir}"/>
</target>
<property name="toolsUI" value="toolsUI-${release.version}.jar"/>
<target name="makeToolsUI" depends="makeMain, makeUI" description="create
toolsUI jar file">
<!--unzip all so we can make uiAll -->
<mkdir dir="${uiZip.dir}"/>
<unzip dest="${uiZip.dir}">
<fileset refid="compile.libraries"/>
<fileset refid="compileUI.libraries"/>
<fileset refid="runtime.libraries"/>
<fileset file="${build.dir}/${jarUI}"/>
<fileset file="${lib.dir}/release/${resourcesOptional.jar}"/>
</unzip>
<jar jarfile="${build.dir}/${toolsUI}" index="true" duplicate="preserve">
<fileset dir="${build.dir}" includes="README"/>
<fileset dir="${build.dir}" includes="CHANGES"/>
<fileset dir="${uiZip.dir}"/>
<manifest>
<attribute name="Main-Class" value="ucar.nc2.ui.ToolsUI"/>
<attribute name="Built-By" value="${user.name}"/>
<attribute name="Built-On" value="${buildtime}"/>
<attribute name="Implementation-Title" value="NetCDF-Java-ToolsUI"/>
<attribute name="Implementation-Version"
value="${release.version.minor}"/>
<attribute name="Implementation-Vendor" value="UCAR/Unidata"/>
</manifest>
</jar>
</target>
<target name="makeAll" depends="makeCore, makeMain, makeMainComplete, makeUI,
makeAllzip, makeToolsUI" description="create netcdfAll zip file"/>
<property name="jarResourcesOptional"
value="resourcesOptional-${release.version}.jar"/>
<target name="makeResourcesOptional" description="make resourcesOptional.jar">
<jar jarfile="${build.dir}/${jarResourcesOptional}" index="true"
duplicate="preserve">
<zipfileset dir="${resources.dir}/optional" prefix="optional"/>
<manifest>
<attribute name="Built-By" value="${user.name}"/>
<attribute name="Built-On" value="${buildtime}"/>
<attribute name="Implementation-Title" value="NetCDF-Java Optional
Resources"/>
<attribute name="Implementation-Version"
value="${release.version.minor}"/>
<attribute name="Implementation-Vendor" value="UCAR/Unidata"/>
</manifest>
</jar>
</target>
<target name="releaseResourcesOptionalInternal"
depends="makeResourcesOptional">
<copy todir="${lib.dir}/release" overwrite="true"
preservelastmodified="true">
<fileset dir="${build.dir}" includes="${jarResourcesOptional}"/>
</copy>
</target>
<!-- $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ -->
<target name="dist" depends="makeAll, makeIDVjar, makeSrc-CDM, javadoc,
javadocAll"
description="create a full distribution"/>
<!-- release library -->
<target name="releaseInternal" depends="makeMain" description="internal
release to lib">
<copy todir="${lib.dir}/release" overwrite="true">
<fileset dir="${build.dir}" includes="${jarMain}"/>
</copy>
</target>
<!-- release library -->
<target name="release" description="Release library and source jar files to
release directory: do 'ant dist' first">
<copy todir="${release.library.dir}" overwrite="true">
<fileset dir="${build.dir}" includes="${jarCore}"/>
<fileset dir="${build.dir}" includes="${jarMain}"/>
<fileset dir="${build.dir}" includes="${jarMainComplete}"/>
<fileset dir="${build.dir}" includes="${ncSrcRelease.jar}"/>
<fileset dir="${build.dir}" includes="${jarIdv}"/>
<fileset dir="${build.dir}" includes="${jarUI}"/>
<fileset dir="${build.dir}" includes="${toolsUI}"/>
<fileset dir="${build.dir}" includes="${ncAll}"/>
<fileset dir="${build.dir}" includes="${jarJavadoc}"/>
<fileset dir="${build.dir}" includes="${jarJavadocAll}"/>
</copy>
<checksum>
<fileset dir="${release.library.dir}">
<include name="*.jar"/>
<include name="*.zip"/>
</fileset>
</checksum>
<copy todir="${lib.dir}/release" overwrite="true">
<fileset dir="${build.dir}" includes="${jarMain}"/>
<fileset dir="${build.dir}" includes="${jarIdv}"/>
</copy>
<copy todir="${release.javadoc.dir}" overwrite="true">
<fileset dir="${javadoc.dir}"/>
</copy>
<copy todir="${release.javadocAll.dir}" overwrite="true">
<fileset dir="${javadocAll.dir}"/>
</copy>
<copy todir="${release.html.dir}" overwrite="true">
<fileset file="${build.dir}/README"/>
<fileset file="${build.dir}/CHANGES"/>
</copy>
</target>
<target name="releaseInvCatSchema" description="Release InvCatalog schema to
web.">
<copy todir="${release.schema.dir}/thredds" overwrite="true">
<fileset
file="${resources.dir}/resources/thredds/schemas/InvCatalog.1.0.2.xsd"/>
</copy>
</target>
<!-- netcdfUI webstart release -->
<target name="releaseWebstart" description="make webstart release; do dist or
release first">
<signjar alias="idv" jar="${build.dir}/${jarUI}" keystore="${keystore}"
signedjar="${webstart_dir}/netcdfUI.jar"
storepass="${keystore.password}"/>
<signjar alias="idv" jar="${lib.dir}/release/${bufrTables.jar}"
keystore="${keystore}"
signedjar="${webstart_dir}/bufrTables.jar"
storepass="${keystore.password}"/>
<signjar alias="idv" jar="${lib.dir}/release/${grib.jar}"
keystore="${keystore}"
signedjar="${webstart_dir}/grib.jar"
storepass="${keystore.password}"/>
<signjar alias="idv" jar="${lib.dir}/external/${jdom.jar}"
keystore="${keystore}"
signedjar="${webstart_dir}/jdom.jar"
storepass="${keystore.password}"/>
<signjar alias="idv" jar="${lib.dir}/external/${jgoodies.jar}"
keystore="${keystore}"
signedjar="${webstart_dir}/jgoodies.jar"
storepass="${keystore.password}"/>
<signjar alias="idv" jar="${lib.dir}/external/${jpeg2000.jar}"
keystore="${keystore}"
signedjar="${webstart_dir}/jpeg2000.jar"
storepass="${keystore.password}"/>
<signjar alias="idv" jar="${lib.dir}/external/${httpclient.jar}"
keystore="${keystore}"
signedjar="${webstart_dir}/httpclient.jar"
storepass="${keystore.password}"/>
<signjar alias="idv" jar="${lib.dir}/external/${http-codec.jar}"
keystore="${keystore}"
signedjar="${webstart_dir}/codec.jar"
storepass="${keystore.password}"/>
<signjar alias="idv" jar="${lib.dir}/external/${http-logging.jar}"
keystore="${keystore}"
signedjar="${webstart_dir}/httplogging.jar"
storepass="${keystore.password}"/>
<signjar alias="idv" jar="${lib.dir}/external/${loggingAPI.jar}"
keystore="${keystore}"
signedjar="${webstart_dir}/loggingAPI.jar"
storepass="${keystore.password}"/>
<signjar alias="idv" jar="${lib.dir}/external/${logging-minimal.jar}"
keystore="${keystore}"
signedjar="${webstart_dir}/logging.jar"
storepass="${keystore.password}"/>
<signjar alias="idv" jar="${lib.dir}/external/${lucene.jar}"
keystore="${keystore}"
signedjar="${webstart_dir}/lucene.jar"
storepass="${keystore.password}"/>
<signjar alias="idv" jar="${lib.dir}/external/${spring.jar}"
keystore="${keystore}"
signedjar="${webstart_dir}/spring.jar"
storepass="${keystore.password}"/>
<signjar alias="idv" jar="${lib.dir}/release/${opendap.jar}"
keystore="${keystore}"
signedjar="${webstart_dir}/opendap.jar"
storepass="${keystore.password}"/>
<signjar alias="idv" jar="${lib.dir}/release/${resourcesOptional.jar}"
keystore="${keystore}"
signedjar="${webstart_dir}/resourcesOptional.jar"
storepass="${keystore.password}"/>
<signjar alias="idv" jar="${lib.dir}/external/${stax.jar}"
keystore="${keystore}"
signedjar="${webstart_dir}/stax.jar"
storepass="${keystore.password}"/>
<signjar alias="idv" jar="${lib.dir}/release/${visadNoDods.jar}"
keystore="${keystore}"
signedjar="${webstart_dir}/visadNoDods.jar"
storepass="${keystore.password}"/>
</target>
<!-- $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$ -->
<property name="test.src.dir" location="${root.dir}/src/test/java"/>
<property name="test.dir" value="${build.dir}/build/test"/>
<property name="test.classes.dir" value="${test.dir}/classes"/>
<property name="test.reports.dir" value="${test.dir}/reports"/>
<path id="test.sourcepath">
<path refid="sourcepathUI"/>
<pathelement location="${test.src.dir}"/>
</path>
<fileset id="test.libraries" dir="${lib.dir}">
<include name="external/${junit.jar}"/>
</fileset>
<path id="test.classpath">
<fileset refid="compile.libraries"/>
<fileset refid="compileUI.libraries"/>
<fileset refid="runtime.libraries"/>
<pathelement location="${build.classes.dir}"/>
<pathelement location="${test.classes.dir}"/>
<pathelement location="${resources.dir}"/>
<pathelement location="${resourcesUI.dir}"/>
<fileset refid="test.libraries"/>
</path>
<target name="test-setup" depends="compile" description="setup for running
junit tests">
<mkdir dir="${test.dir}"/>
<mkdir dir="${test.classes.dir}"/>
<!-- debugging path -->
<property name="test.classpath" refid="test.classpath"/>
<echo>test.classpath=${test.classpath}</echo>
<javac srcdir="${test.src.dir}" destdir="${test.classes.dir}"
debug="${build.debug}" debuglevel="${build.debuglevel}"
includeAntRuntime="false"
source="1.5" target="1.5">
<exclude name="examples/**"/>
<exclude name="ucar/nc2/jni/**"/>
<classpath refid="test.classpath"/>
</javac>
</target>
<target name="unit-test" depends="compile, test-setup" description="run nc
unit tests">
<antcall target="unit-test-nc" />
</target>
<target name="unit-test-nc" description="run nc unit tests">
<antcall target="unit-test-base">
<param name="unit.test.name" value="unit-test-nc" />
<param name="unit.test" value="ucar.nc2.TestAll" />
</antcall>
</target>
<target name="unit-test-thredds" description="run thredds unit tests">
<antcall target="unit-test-base">
<param name="unit.test.name" value="unit-test-thredds" />
<param name="unit.test" value="thredds.catalog.TestCatalogAll" />
</antcall>
</target>
<target name="unit-test-base" description="run junit tests">
<mkdir dir="${test.reports.dir}/${unit.test.name}"/>
<junit printsummary="false" errorProperty="test.failed"
failureProperty="test.failed" fork="on" dir="${root.dir}">
<classpath refid="test.classpath"/>
<jvmarg value="-ea"/>
<jvmarg value="-Xmx1024m"/>
<formatter type="xml"/>
<formatter type="brief" usefile="false"/>
<test todir="${test.reports.dir}/${unit.test.name}" name="${unit.test}"/>
</junit>
<!-- #Generate test reports -->
<junitreport todir="${test.reports.dir}/${unit.test.name}">
<fileset dir="${test.reports.dir}/${unit.test.name}">
<include name="TEST-*.xml"/>
</fileset>
<report format="frames" todir="${test.reports.dir}/${unit.test.name}"/>
</junitreport>
<!-- create temporary file indicating these tests failed -->
<!-- #Test case bypass trick -->
<echo message="last build failed tests"
file="${test.reports.dir}/${unit.test.name}/failed"/>
<fail if="test.failed">FAILED! Unit tests failed. Look at
${test.reports.dir}/${unit.test.name}/index.html for details.</fail>
<!-- Remove test failed file, as these tests succeeded -->
<delete file="${test.reports.dir}/${unit.test.name}/failed"/>
<echo message="SUCCESS! Unit tests succeeded. Look at
${test.reports.dir}/${unit.test.name}/index.html for details."/>
</target>
<!-- -->
</project>