https://github.com/fmichel/TurtleKit
Tip revision: cadb704f0ed447761a0e3c302e5a1f4fde191273 authored by Fabien Michel on 29 September 2016, 09:06:12 UTC
working on Cuda tools in progress, now stable. Old codes have been fixed
working on Cuda tools in progress, now stable. Old codes have been fixed
Tip revision: cadb704
build.xml
<?xml version="1.0" encoding="UTF-8"?>
<!-- =================================
This ant build.xml file could be used for building TurtleKit projects.
Especially, this file is automatically parsed by Eclipse so that it displays
the available targets that follow:
- compile: compile the project into the build directory
- build-executable-jar (default): Creates a runnable jar file of the application, embedding MDK
- build-agent-jar: Creates a lightweight jar file containing only the project, so that it could be loaded by a MDK kernel
- Java-web-start: Creates .jnlp and .gz files for Java Web Start deployment
- zip-project-src: Creates a zip file of the project
- clean: Cleans resources generated by builds
================================= -->
<!-- =================================
Here, you specify a code name for the project.
This name is used to label the generated files
================================= -->
<project name="TurtleKit" default="jar">
<!-- =================================
OPTIONAL:
Here, you may set your project properties
================================= -->
<property name="project.website" value="http://www.turtlekit.org" />
<!-- defining project general properties -->
<tstamp prefix="time" />
<property name="build.id" value="${time.DSTAMP}-${time.TSTAMP}" />
<property name="src.dir" value="src" />
<property name="turtlekit.properties" value="turtlekit/kernel/turtlekit.properties" />
<property file="${src.dir}/${turtlekit.properties}" />
<property name="resource.dir" value="resource" />
<property file="${resource.dir}/turtlekitBuild.properties" />
<property name="madkit.lib.dir" value="lib" />
<property name="madkit.version" value="5.1" />
<!-- user's specific local properties -->
<property name="server.info.dir" value="${user.home}/.mdk_keystore" />
<!-- =================================
OPTIONAL:
A java web start file (.jnlp) could be also generated if possible.
Here, you can specify the url of the web directory in which you will
put the jar.gz and the jnlp files so that
they will directly work without editing the jnlp.
================================= -->
<property name="web.codebase" value="http://www.madkit.net/repository/jnlps/test" />
<!-- =================================
REQUIRED if using third party libraries
You can specify which third party jars by uncommenting the
following fileset and modifying it (id's value must not be changed).
This is just an example and you can freely define your own fileset (with the same id).
More info on fileset definition at http://ant.apache.org/manual/Types/fileset.html
================================= -->
<fileset id="third.party.libraries" dir="lib">
<include name="jcuda-0.7.5b.jar" />
<include name="jcudaUtils-0.0.4.jar" />
<include name="jcurand-0.7.5b.jar" />
<include name="jfreechart-1.0.19.jar" />
<include name="jcommon-1.0.23.jar" />
</fileset>
<!-- =================================
target: jar
================================= -->
<target name="jar" depends="cleanup,buildResources,build-properties,compile,compile-demos,build-executable-jar" description="description">
<jar destfile="${jar.file}" update="true">
<zipfileset src="${kernel.location}" includes="MDK_ANT.xml,MDKAntTargets.xml,jnlp.template.xml" />
<fileset dir="." includes="lib/*.so,lib/*.dll" />
</jar>
<!-- remove jcuda docs and jfreechart maven files -->
<unzip src="${jar.file}" dest="tmpJar"/>
<delete file="${jar.file}"/>
<jar destfile="${jar.file}"
manifest="tmpJar/META-INF/MANIFEST.MF"
basedir="tmpJar"
includes="**/*"
excludes="doc/**,**/maven/**"
/>
<delete dir="tmpJar"/>
</target>
<!-- - - - - - - - - - - - - - - - - -
target: compile-demos
- - - - - - - - - - - - - - - - - -->
<target name="compile-demos">
<copy todir="${build.dir}">
<fileset dir="${demos.src.dir}" excludes="**/*.java" />
</copy>
<javac debug="false" includeAntRuntime="false" srcdir="${demos.src.dir}" destdir="${build.dir}" deprecation="on">
<classpath location="${madkit.lib.dir}/madkit-${madkit.version}.jar" />
<classpath>
<fileset refid="third.party.libraries" />
</classpath>
</javac>
</target>
<!-- - - - - - - - - - - - - - - - - -
target: compile-demos
- - - - - - - - - - - - - - - - - -->
<target name="compile-bench">
<property name="bench.dir" value="bench" />
<copy todir="${build.dir}">
<fileset dir="${bench.dir}" excludes="**/*.java" />
</copy>
<javac debug="false" includeAntRuntime="false" srcdir="${bench.dir}" destdir="${build.dir}" deprecation="on">
<classpath location="${madkit.lib.dir}/madkit-${madkit.version}.jar" />
<classpath location="${lib.dir}/junit-4.11.jar" />
<classpath>
<fileset refid="third.party.libraries" />
</classpath>
</javac>
</target>
<!-- =================================
target: bench-jar
================================= -->
<target name="bench-jar" depends="cleanup,buildResources,build-properties,compile,compile-demos,compile-bench,build-executable-jar" description="description">
</target>
<!-- =================================
<zipfileset src="${java.io.tmpdir}/madkit.properties" prefix="/madkit/kernel" />
================================= -->
<!-- =================================
DO NOT EDIT WHAT FOLLOWS:
This enables the main targets from the madkit jar file.
================================= -->
<property name="madkit.args" value="--configFile turtlekit/kernel/turtlekit.properties" />
<import>
<javaresource name="MDK_ANT.xml">
<classpath location="${madkit.lib.dir}/madkit-${madkit.version}.jar" />
</javaresource>
</import>
<!-- =================================
target: jws
================================= -->
<target name="jws" depends="jar,Java-web-start" description="description" />
<target name="javadoc" description="build the javadoc">
<javadoc sourcepath="${src.dir}" destdir="${docs.api.dir}" access="protected" docfilessubdirs="true" author="true" version="true" use="true" linksource="no" windowtitle="${project.label}">
<classpath>
<fileset refid="third.party.libraries" />
</classpath>
<classpath location="${madkit.lib.dir}/madkit-${madkit.version}.jar" />
<doctitle>
<![CDATA[<h1>${project.label}</h1>]]>
</doctitle>
<link href="http://docs.oracle.com/javase/7/docs/api/" />
<link href="http://www.madkit.net/docs/api/" />
</javadoc>
</target>
<!-- - - - - - - - - - - - - - - - - -
target: build-properties
- - - - - - - - - - - - - - - - - -->
<target name="build-properties">
<tstamp>
<format property="timestamp.isoformat" pattern="yyyy-mm-dd HH:mm:ss" locale="en" />
</tstamp>
<filterset begintoken="[[" endtoken="]]">
<filter token="TIMESTAMP" value="${timestamp.isoformat}" />
</filterset>
<copy tofile="${build.dir}/${turtlekit.properties}" file="${src.dir}/${turtlekit.properties}" overwrite="true">
<filterchain>
<expandproperties />
</filterchain>
</copy>
</target>
<!-- =================================
target: clean
================================= -->
<target name="cleanup" depends="clean" description="description">
<delete dir="${release.dir}" />
<delete dir="${docs.api.dir}" />
<delete dir="logs" />
<delete file="${src.zip.location}" failonerror="false" />
</target>
<!-- =================================
target: buildResources
<native2ascii src="${i18n.src.dir}" dest="${i18n.build.dir}" encoding="iso-8859-1" includes="*FR*"/>
================================= -->
<target name="buildResources">
<mkdir dir="${build.dir}" />
<mkdir dir="${release.dir}" />
<copy todir="${build.dir}" overwrite="false">
<fileset dir="${src.dir}" excludes="**/*.java" />
</copy>
</target>
<target name="release" depends="cleanup,jar,javadoc,src-zip" description="build TurtleKit release">
<echo> --- Build Release : TurtleKit ${turtlekit.version}${line.separator}</echo>
<mkdir dir="${release.dir}" />
<copy todir="${build.dir}">
<fileset dir="${resource.dir}" excludes="COPYING,${TK.build.properties}" />
<filterchain>
<expandproperties />
</filterchain>
</copy>
<zip destfile="${build.dir}/${eclipse.project.name}" level="9">
<zipfileset dir="${demos.src.dir}" prefix="${src.dir}" />
<zipfileset file="${build.dir}/.classpath" />
<zipfileset file="${resource.dir}/.project" />
<zipfileset file="${release.dir}/${turtlekit.jar.name}" prefix="lib" />
</zip>
<zip destfile="${release.dir}/${distribution.zip.name}" level="9">
<zipfileset dir="${docs.dir}" prefix="${docs.dir}" />
<zipfileset dir="${build.dir}" includes="README.html" />
<zipfileset dir="${build.dir}" includes="VERSION,${doc.html},build.xml,JCuda_License.txt" prefix="${docs.dir}" />
<zipfileset file="${resource.dir}/JCuda_License.txt" prefix="${docs.dir}" />
<zipfileset file="${jar.file}" filemode="755" />
<zipfileset file="${resource.dir}/COPYING" />
<zipfileset file="${build.dir}/${eclipse.project.name}" prefix="demos" />
</zip>
</target>
<!-- =================================
target: src-zip
================================= -->
<target name="src-zip" description="the src zip">
<zip destfile="${src.zip.location}" level="9">
<zipfileset dir="${src.dir}" includes="**/*.java" excludes="**/package-info.java" />
</zip>
</target>
<!-- - - - - - - - - - - - - - - - - -
target: ftp-release
<echo>FTP upload of MDK desktop web start files in ${madkit.ftp.dir}/${javaws.ftp.dir}</echo>
<ftp server="${ftp.server}" userid="${ftp.user}" password="${ftp.password}" action="put" remotedir="${madkit.ftp.dir}/${javaws.ftp.dir}">
<fileset file="${jnlp.jar.gz}" />
<fileset file="${demo.dir}/MaDKit-5-Desktop.jnlp" />
</ftp>
- - - - - - - - - - - - - - - - - -->
<target name="ftp-release" depends="release">
<loadproperties srcFile="${server.info.dir}/MDK.net" />
<unzip src="${release.dir}/${distribution.zip.name}" dest="${release.dir}/web" />
<echo>FTP uploading new release files in ${release.ftp.dir}</echo>
<ftp server="${ftp.server}" userid="${ftp.user}" password="${ftp.password}" action="mkdir" remotedir="${release.ftp.dir}" verbose="yes" />
<ftp server="${ftp.server}" userid="${ftp.user}" password="${ftp.password}" action="put" remotedir="${release.ftp.dir}">
<fileset dir="${release.dir}/web" />
</ftp>
</target>
<target name="update_website" description="update MDK website new release">
<echo file="${build.dir}/LAST">${turtlekit.version}</echo>
<loadproperties srcFile="${server.info.dir}/MDK.net" />
<echo>FTP : updating online LAST version</echo>
<ftp server="${ftp.server}" userid="${ftp.user}" password="${ftp.password}" action="put" remotedir="${turtlekit.ftp.dir}">
<fileset dir="${build.dir}" includes="LAST" />
</ftp>
</target>
</project>