Hello David,
Below is an ant task that I use to build JFreechart. You might like to tweak it and then include it in your distribution.
One issue is that you depend on some other modules, such as Batik. As part of your distribution it would be good if you included a list of these modules, and the version number that you tested against. An ideally the jars themsleves. This means that we can be using the same build. You are not the only one that makes slightly incompatible upgrades (eg. Millisecond changed recently.)
Thanks for your help on nulls, worked great.
Anthony
<?xml version="1.0" encoding="ISO-8859-1"?>
<project name="jfreechart" default="jar" basedir=".">
<property file="${user.home}/.ant-insight.properties"/>
<!-- basedir is where build.xml is -->
<property name="home" value="${basedir}" />
<property name="jcommon.vsn" value="0.6.1" />
<property name="jfreechart.vsn" value="0.8.1" />
<property name="jcommon" value="${home}/jcommon-${jcommon.vsn}"/>
<property name="jfreechart" value="${home}/jfreechart-${jfreechart.vsn}"/>
<path id="default.classpath">
<pathelement location="${home}/build/jcommon"/>
<pathelement location="${home}/build/jfreechart"/>
<fileset dir="${home}/lib">
<include name="**/*.jar"/>
<include name="**/*.zip"/>
</fileset>
</path>
<target name="clean">
<delete dir="${home}/build"/>
</target>
<target name="echo">
<echo message="os.name: ${os.name}"/>
<echo message="home: ${home}"/>
<echo message="user.home: ${user.home}"/>
<echo message="java.home: ${java.home}"/>
</target>
<target name="init">
<tstamp/> <!-- DSTAMP -->
<mkdir dir="${home}/build"/>
<mkdir dir="${home}/build/jcommon"/>
<mkdir dir="${home}/build/jfreechart"/>
</target>
<!-- build compilation -->
<target name="compile" depends="init">
<javac srcdir="${jcommon}/source"
destdir="${home}/build/jcommon"
debug="on"
deprecation="on"
classpathref="default.classpath"/>
<javac srcdir="${jfreechart}/source"
destdir="${home}/build/jfreechart"
debug="on"
deprecation="on"
classpathref="default.classpath"/>
</target>
<!-- build jar packaging -->
<target name="jar" depends="compile">
<jar jarfile="${home}/build/jcommon-${jfreechart.vsn}.jar">
<fileset dir="${home}/build/jcommon"/>
</jar>
<jar jarfile="${home}/build/jfreechart-${jcommon.vsn}.jar">
<fileset dir="${home}/build/jfreechart"/>
</jar>
</target>
<!-- build documentation generation -->
<target name="jdocs" depends="init">
<delete dir="${home}/jdocs"/>
<mkdir dir="${home}/jdocs"/>
<javadoc packagenames="com.*"
sourcepath="${jcommon}/source;${jfreechart}/source"
destdir="${home}/jdocs"
author="true"
version="true"
use="true"
windowtitle="JFreeChart API Documentation"
doctitle="JFreeChart API Documentation"
bottom="Enjoy!"
>
<!--
<source>
<fileset dir="${jcommon}/source">
<exclude name="**/junit/**"/>
</fileset>
<fileset dir="${jfreechart}/source">
<exclude name="**/junit/**"/>
</fileset>
</source>
-->
<link offline="false" href="http://java.sun.com/products/jdk/1.3/docs/api/"/>
<link offline="false" href="http://java.sun.com/j2ee/j2sdkee/techdocs/api/"/>
</javadoc>
</target>
</project>
Ant task to build JFreeChart
Re: Ant task to build JFreeChart
Anthony Berglas wrote:
> Below is an ant task that I use to build JFreechart. You
> might like to tweak it and then include it in your
> distribution.
Thanks! I just downloaded ant yesterday...I think it will take me a little while to figure out how to use it, but your build file will help a lot.
> One issue is that you depend on some other modules, such as
> Batik. As part of your distribution it would be good if you
> included a list of these modules, and the version number that
> you tested against.
I think Batik is only required for the servlet demo. I'd like to isolate the dependency if possible, so that the code still compiles without the extra jar files, but uses them if they are there. I'm going to try this out by adding export to PDF (using the new PDFGraphics2D class in iText-0.91) to JFreeChartPanel.
> An ideally the jars themsleves.
I think this would make the download too large for people on limited bandwidth.
> This means that we can be using the same build. You are not the
> only one that makes slightly incompatible upgrades (eg.
> Millisecond changed recently.)
I hope to freeze the JFreeChart API once version 1.0.0 is reached (not sure how long that will take). I know it is frustrating that each release is incompatible with the last, but (most of the time) the changes are improvements. I could do a better job of documenting the changes, but time is limited and sometimes I am lazy.
Regards,
DG.
> Below is an ant task that I use to build JFreechart. You
> might like to tweak it and then include it in your
> distribution.
Thanks! I just downloaded ant yesterday...I think it will take me a little while to figure out how to use it, but your build file will help a lot.
> One issue is that you depend on some other modules, such as
> Batik. As part of your distribution it would be good if you
> included a list of these modules, and the version number that
> you tested against.
I think Batik is only required for the servlet demo. I'd like to isolate the dependency if possible, so that the code still compiles without the extra jar files, but uses them if they are there. I'm going to try this out by adding export to PDF (using the new PDFGraphics2D class in iText-0.91) to JFreeChartPanel.
> An ideally the jars themsleves.
I think this would make the download too large for people on limited bandwidth.
> This means that we can be using the same build. You are not the
> only one that makes slightly incompatible upgrades (eg.
> Millisecond changed recently.)
I hope to freeze the JFreeChart API once version 1.0.0 is reached (not sure how long that will take). I know it is frustrating that each release is incompatible with the last, but (most of the time) the changes are improvements. I could do a better job of documenting the changes, but time is limited and sometimes I am lazy.
Regards,
DG.
Re: Ant task to build JFreeChart
Thanks, maybe I will write by myself, thought I user JBuilder6.0 to create doc and compile.