Finished ant build.xml file to make javadocs, jar and developer builds.

Added readme-template.txt
This commit is contained in:
joseph.lizier 2012-10-31 04:07:10 +00:00
parent 0521e71e9c
commit 537327d0ea
2 changed files with 156 additions and 13 deletions

View File

@ -6,57 +6,116 @@
<!-- set global properties for this build -->
<property name="version" value="0.1.1"/>
<property name="jarplainname" value="infodynamics.jar" />
<property name="jarversiondistname" value="infodynamics-${version}.jar" />
<property name="mainfilename" value="infodynamics"/>
<property name="jarplainname" value="${mainfilename}.jar" />
<property name="jarversiondistnamezip" value="${mainfilename}-jar-${version}.zip" />
<property name="distname" value="${mainfilename}-dist-${version}" />
<property name="distnamezip" value="${distname}.zip" />
<property name="src" location="java/source"/>
<property name="bin" location="bin"/>
<property name="unittestssrc" location="java/unittests"/>
<property name="unittestsbin" location="unittestsbin"/>
<property name="unittestsbin" location="unittests/bin"/>
<property name="javadocsdir" location="javadocs"/>
<property name="reports.tests" location="unittests/reports"/>
<path id="project.classpath">
<pathelement location="bin"/>
</path>
<!-- Make required directories -->
<target name="init" description="Create the compiled code directories">
<mkdir dir="${bin}"/>
<mkdir dir="${unittestsbin}"/>
<mkdir dir="${reports.tests}"/>
</target>
<!-- Compile the java toolkit -->
<target name="compile" depends="init" description="compile the source and unittests">
<javac srcdir="${src}" destdir="${bin}" includeAntRuntime="false"/>
</target>
<!-- Jar the toolkit -->
<target name="jar" depends="compile" description="Create the jar for distribution">
<!-- Put everything in ${bin} into the infodynamics-${version}.jar file -->
<jar jarfile="${jarversiondistname}" basedir="${bin}"/>
<jar jarfile="${jarplainname}" basedir="${bin}"/>
</target>
<!-- Compile and run the JUnit tests -->
<target name="junit" depends="compile" description="Run the junit tests and make sure they compile">
<!-- Compile the junit tests first -->
<javac destdir="${unittestsbin}" includeAntRuntime="false">
<javac destdir="${unittestsbin}" includeAntRuntime="true">
<!-- Need includeAntRuntime=true if you want to pick up junit.jar and ant-junit.jar in ANT_HOME/lib;
Otherwise you will need to set the classpath to include these here. -->
<src path="${unittestssrc}"/>
<classpath refid="project.classpath"/>
</javac>
<!-- TODO Run the junit tests and make sure they complete ok -->
<!-- Run the junit tests and make sure they complete ok -->
<junit printsummary="yes" showoutput="yes" haltonfailure="yes" haltonerror="yes" includeantruntime="true">
<classpath>
<path refid="project.classpath"/>
<pathelement path="${unittestsbin}"/>
</classpath>
<formatter type="plain"/>
<batchtest todir="${reports.tests}"> <!-- Writes full reports with stdout and stderr to ${reports.tests} -->
<fileset dir="${unittestsbin}">
<include name="**/*.class"/>
</fileset>
</batchtest>
</junit>
</target>
<!-- TODO Compile javadoc -->
<!-- Make javadocs -->
<target name="javadocs" depends="compile" description="Make the javadocs for the toolkit">
<javadoc sourcepath="${src}" destdir="${javadocsdir}"/>
</target>
<!-- Clean up -->
<target name="clean">
<!-- Delete the compiled code directories -->
<delete dir="${bin}"/>
<delete dir="${unittestsbin}"/>
<delete dir="${reports.tests}"/>
<delete dir="${javadocsdir}"/>
</target>
<!-- TODO Have a target for the jar distribution -->
<target depends="jar" name="build" description="build the project for the user">
<!-- Build the project jar for users -->
<target depends="jar" name="build" description="user: build the project jar file">
<echo message="${ant.project.name}: ${ant.file}"/>
<copy file="${jarversiondistname}" tofile="${jarplainname}"/>
</target>
<!-- Developer build - builds everything and makes the jar only distribution file -->
<target name="jardist" depends="build" description="developer: generate the jar distribution">
<tstamp>
<format property="TODAY_DATE" pattern="dd/MM/yyyy" locale="en,UK"/>
<format property="TODAY_YEAR" pattern="yyyy" locale="en,UK"/>
</tstamp>
<copy file="readme-template.txt" toFile="readme.txt" failonerror="false">
<!-- The template file only exists in SVN - this won't crash ant
if users try to run it though because failonerror="false" -->
<filterset>
<filter token="YEAR" value="${TODAY_YEAR}"/>
<filter token="DATE" value="${TODAY_DATE}"/>
<filter token="VERSION" value="${version}"/>
</filterset>
</copy>
<zip destfile="${jarversiondistnamezip}">
<fileset file="${jarplainname}"/>
<fileset file="license-gplv3.txt"/>
<fileset file="readme.txt"/>
</zip>
</target>
<target depends="jar,junit" name="dist" description="generate the full distribution">
<!-- Developer build - builds everything and makes the full distribution file -->
<target name="dist" depends="jar,junit,javadocs" description="developer: generate the full distribution">
<echo message="${ant.project.name}: ${ant.file}"/>
<copy file="${jarversiondistname}" tofile="${jarplainname}"/>
<zip destfile="${distnamezip}">
<fileset file="build.xml"/>
<fileset file="${jarplainname}"/>
<fileset file="license-gplv3.txt"/>
<fileset file="readme.txt"/>
<zipfileset dir="java" includes="**/*.java" prefix="java"/>
<zipfileset dir="demos" includes="**/*.*,**/*" prefix="demos"/>
<zipfileset dir="javadocs" includes="**/*.*,**/*" prefix="javadocs"/>
</zip>
</target>
</project>

84
readme-template.txt Executable file
View File

@ -0,0 +1,84 @@
Java Information Dynamics Toolkit
Copyright (C) 2012 Joseph T. Lizier
Version @VERSION@
=============
License
=============
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
=============
Citation
=============
Please cite your use of this toolkit as:
Joseph T. Lizier, "JIDT: An information-theoretic toolkit for studying the dynamics of complex systems", 2012, https://code.google.com/p/information-dynamics-toolkit/
=============
Website
=============
Full information on the JIDT (usage, etc) is provided at the project page on google code:
http://code.google.com/p/information-dynamics-toolkit/
=============
Installation
=============
"Full" description of any required installation is at: http://code.google.com/p/information-dynamics-toolkit/wiki/Installation
However, if you are reading this file, you've downloaded a distribution and you're halfway there!
There are no dependencies to download; unless:
a. You don't have java installed - download it from http://www.java.com/
b. You wish to build the project using the build.xml script - this requires ant: http://ant.apache.org/
c. You wish to run the JUnit test cases - this requires JUnit: http://www.junit.org/ - for how to run JUnit with our ant script see http://code.google.com/p/information-dynamics-toolkit/wiki/JUnitTestCases
Then just put the jar in a relevant location in your file structure.
That's it.
=============
Documentation
=============
Javadocs for the toolkit are included in the full distribution at javadocs.
They can also be generated using "ant javadocs" (useful if you are on an SVN view).
Further, they will soon be posted on the web.
A research paper describing the toolkit and its use is in preparation and will be included in the distribution in future.
Further documentation is provided by the Usage examples below.
=============
Usage
=============
Several sets of demonstration code are distributed with the toolkit:
a. demos/octave - basic examples on easily using the Java toolkit from Octave or Matlab environments - see description at http://code.google.com/p/information-dynamics-toolkit/wiki/OctaveMatlabExamples
Note that this also provides useful examples on how to use the Java code in general!
b. demos/octave/CellularAutomata - using the Java toolkit to plot local information dynamics profiles in cellular automata; the toolkit is run under Octave or Matlab - see description at http://code.google.com/p/information-dynamics-toolkit/wiki/CellularAutomataDemos
c. java/unittests - the JUnit test cases for the Java toolkit are included in the distribution - these case also be browsed to see simple use cases for the toolkit - see description at http://code.google.com/p/information-dynamics-toolkit/wiki/JUnitTestCases
=============
Joseph T. Lizier, @DATE@