2010-02-08 00:15:50 +01:00
|
|
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
|
|
|
|
|
|
<!--+
|
|
|
|
|
|
|
|
|
| Gridworks Build File
|
|
|
|
|
|
|
|
|
+-->
|
2010-02-10 19:47:32 +01:00
|
|
|
|
|
|
|
<!--+
|
|
|
|
| NOTE: this script expects the 'build.dir' and 'dist.dir' properties to be set
|
|
|
|
| when invoking it. This is done like this
|
|
|
|
|
|
2010-03-30 23:24:04 +02:00
|
|
|
| ant -f build.xml -Dbuild.dir="/path/to/build/dir" -Ddist.dir="/path/to/dist/dir" -Drevision="r3934"
|
2010-02-10 19:47:32 +01:00
|
|
|
|
|
2010-03-30 23:24:04 +02:00
|
|
|
| Basically, this build file is designed to be invoked by the 'gridworks' shell
|
|
|
|
| script (this makes it easy to integrate into nightly-build and continuous
|
|
|
|
| integration systems).
|
2010-02-10 19:47:32 +01:00
|
|
|
+-->
|
2010-02-08 00:15:50 +01:00
|
|
|
|
2010-02-10 08:30:16 +01:00
|
|
|
<project name="gridworks" default="build" basedir=".">
|
2010-02-08 00:15:50 +01:00
|
|
|
|
|
|
|
<property environment="env"/>
|
|
|
|
|
|
|
|
<property name="src.dir" value="${basedir}/src/main/java" />
|
2010-04-03 03:01:11 +02:00
|
|
|
<property name="server.src.dir" value="${basedir}/src/server/java" />
|
2010-02-09 21:21:10 +01:00
|
|
|
<property name="graphics.dir" value="${basedir}/src/graphics" />
|
2010-03-31 02:17:40 +02:00
|
|
|
<property name="conf.dir" value="${basedir}/src/conf" />
|
2010-02-08 00:15:50 +01:00
|
|
|
<property name="lib.dir" value="${basedir}/lib" />
|
2010-04-07 03:17:14 +02:00
|
|
|
<property name="tests.dir" value="${basedir}/tests/java" />
|
2010-04-07 02:12:40 +02:00
|
|
|
<property name="tools.dir" value="${basedir}/tools" />
|
2010-02-10 19:47:32 +01:00
|
|
|
|
2010-04-07 19:31:25 +02:00
|
|
|
<property name="reports.dir" value="${build.dir}/reports" />
|
2010-04-03 03:01:11 +02:00
|
|
|
<property name="server_classes.dir" value="${build.dir}/classes" />
|
|
|
|
<property name="webapp_classes.dir" value="${basedir}/src/main/webapp/WEB-INF/classes" />
|
2010-03-09 09:08:35 +01:00
|
|
|
<property name="tests_classes.dir" value="${tests.dir}/classes" />
|
2010-03-31 04:11:53 +02:00
|
|
|
<property name="webapp.name" value="webapp" />
|
|
|
|
<property name="webapp.dir" value="${build.dir}/${webapp.name}" />
|
|
|
|
<property name="mac.dir" value="${build.dir}/mac" />
|
|
|
|
<property name="windows.dir" value="${build.dir}/windows" />
|
|
|
|
<property name="linux.name" value="gridworks-${version}" />
|
|
|
|
<property name="linux.dir" value="${build.dir}/linux/${linux.name}" />
|
2010-02-09 21:21:10 +01:00
|
|
|
|
2010-02-08 00:15:50 +01:00
|
|
|
<path id="class.path">
|
|
|
|
<fileset dir="${lib.dir}">
|
|
|
|
<include name="**/*.jar" />
|
|
|
|
</fileset>
|
|
|
|
</path>
|
2010-03-09 09:08:35 +01:00
|
|
|
|
|
|
|
<path id="tests.class.path">
|
|
|
|
<path refid="class.path"/>
|
|
|
|
<fileset dir="${tests.dir}/lib">
|
|
|
|
<include name="**/*.jar" />
|
|
|
|
</fileset>
|
|
|
|
</path>
|
2010-04-03 03:01:11 +02:00
|
|
|
|
2010-04-03 03:28:54 +02:00
|
|
|
<!-- NOTE(SM): this is needed to support autoreloading, don't remove! -->
|
2010-04-03 03:01:11 +02:00
|
|
|
<target name="build_server">
|
|
|
|
<mkdir dir="${server_classes.dir}" />
|
|
|
|
<javac srcdir="${server.src.dir}" destdir="${server_classes.dir}" debug="true" includeAntRuntime="no">
|
2010-02-08 00:15:50 +01:00
|
|
|
<classpath refid="class.path" />
|
|
|
|
</javac>
|
|
|
|
</target>
|
2010-04-03 03:01:11 +02:00
|
|
|
|
|
|
|
<target name="build" depends="build_server">
|
|
|
|
<mkdir dir="${webapp_classes.dir}" />
|
2010-04-03 03:28:54 +02:00
|
|
|
<javac destdir="${webapp_classes.dir}" debug="true" includeAntRuntime="no">
|
|
|
|
<src path="${server.src.dir}"/>
|
|
|
|
<src path="${src.dir}"/>
|
|
|
|
<classpath refid="class.path" />
|
2010-04-03 03:01:11 +02:00
|
|
|
</javac>
|
|
|
|
</target>
|
2010-02-08 00:15:50 +01:00
|
|
|
|
2010-03-09 09:08:35 +01:00
|
|
|
<target name="build_tests" depends="build">
|
|
|
|
<mkdir dir="${tests_classes.dir}" />
|
|
|
|
<javac srcdir="${tests.dir}/src" destdir="${tests_classes.dir}" debug="true" includeAntRuntime="no">
|
|
|
|
<classpath refid="tests.class.path" />
|
|
|
|
</javac>
|
|
|
|
</target>
|
|
|
|
|
2010-02-10 08:30:16 +01:00
|
|
|
<target name="jar" depends="build">
|
2010-04-03 03:01:11 +02:00
|
|
|
<jar destfile="${build.dir}/gridworks.jar" basedir="${webapp_classes.dir}"/>
|
2010-02-09 21:21:10 +01:00
|
|
|
</target>
|
2010-03-31 02:17:40 +02:00
|
|
|
|
|
|
|
<target name="prepare_webapp">
|
|
|
|
<mkdir dir="${webapp.dir}" />
|
|
|
|
|
|
|
|
<copy todir="${webapp.dir}">
|
|
|
|
<fileset dir="${basedir}/src/main/webapp">
|
|
|
|
<include name="**/*"/>
|
2010-04-03 03:01:11 +02:00
|
|
|
<exclude name="WEB-INF/classes/**"/>
|
2010-03-31 02:17:40 +02:00
|
|
|
</fileset>
|
|
|
|
</copy>
|
|
|
|
|
|
|
|
<replace file="${webapp.dir}/scripts/version.js">
|
|
|
|
<replacefilter token="$VERSION" value="${version}"/>
|
|
|
|
<replacefilter token="$REVISION" value="${revision}"/>
|
|
|
|
</replace>
|
|
|
|
</target>
|
2010-02-09 21:21:10 +01:00
|
|
|
|
2010-03-31 04:11:53 +02:00
|
|
|
<target name="mac" depends="jar, prepare_webapp">
|
2010-02-10 08:30:16 +01:00
|
|
|
<taskdef
|
|
|
|
name="jarbundler"
|
|
|
|
classname="net.sourceforge.jarbundler.JarBundler"
|
2010-04-05 09:15:16 +02:00
|
|
|
classpath="${jarbundler.dir}/jarbundler-2.1.0.jar"
|
2010-02-10 08:30:16 +01:00
|
|
|
/>
|
2010-03-31 02:17:40 +02:00
|
|
|
|
2010-03-31 04:11:53 +02:00
|
|
|
<mkdir dir="${mac.dir}"/>
|
2010-03-31 02:17:40 +02:00
|
|
|
|
2010-02-09 21:21:10 +01:00
|
|
|
<jarbundler
|
2010-03-31 04:11:53 +02:00
|
|
|
dir="${mac.dir}"
|
2010-02-09 21:21:10 +01:00
|
|
|
name="Gridworks"
|
|
|
|
mainclass="com.metaweb.gridworks.Gridworks"
|
|
|
|
icon="${graphics.dir}/icon/gridworks.icns"
|
|
|
|
version="${version}"
|
|
|
|
infostring="Gridworks ${version}"
|
|
|
|
aboutmenuname="Gridworks"
|
|
|
|
workingdirectory="$APP_PACKAGE/Contents/Resources"
|
|
|
|
jvmversion="1.6+"
|
|
|
|
bundleid="com.metaweb.gridworks.Gridworks"
|
2010-04-02 02:52:38 +02:00
|
|
|
vmoptions="-Dgridworks.version=${revision} ${java.options}"
|
2010-02-09 21:21:10 +01:00
|
|
|
antialiasedgraphics="true"
|
|
|
|
antialiasedtext="true"
|
|
|
|
liveresize="true"
|
|
|
|
growboxintrudes="true"
|
|
|
|
screenmenu="true">
|
|
|
|
<jarfileset dir="${lib.dir}">
|
|
|
|
<exclude name="**/.svn" />
|
|
|
|
<include name="**/*.jar" />
|
|
|
|
</jarfileset>
|
|
|
|
<jarfilelist dir="${build.dir}" files="gridworks.jar" />
|
2010-03-31 04:11:53 +02:00
|
|
|
<resourcefileset dir="${webapp.dir}/..">
|
|
|
|
<include name="${webapp.name}/**" />
|
2010-02-09 21:21:10 +01:00
|
|
|
</resourcefileset>
|
|
|
|
</jarbundler>
|
|
|
|
</target>
|
|
|
|
|
2010-03-31 04:11:53 +02:00
|
|
|
<target name="windows" depends="jar, prepare_webapp">
|
|
|
|
<mkdir dir="${windows.dir}"/>
|
2010-03-30 23:24:04 +02:00
|
|
|
<taskdef
|
|
|
|
name="launch4j"
|
|
|
|
classname="net.sf.launch4j.ant.Launch4jTask"
|
2010-04-05 09:15:16 +02:00
|
|
|
classpath="${launch4j.dir}/launch4j.jar:${launch4j.dir}/lib/xstream.jar"
|
2010-03-30 23:24:04 +02:00
|
|
|
/>
|
2010-02-10 08:30:16 +01:00
|
|
|
<launch4j>
|
|
|
|
<config
|
|
|
|
headerType="console"
|
2010-03-31 04:11:53 +02:00
|
|
|
outfile="${windows.dir}/Gridworks.exe"
|
2010-03-30 23:24:04 +02:00
|
|
|
jarPath="lib/gridworks-${version}-${revision}.jar"
|
2010-02-10 08:30:16 +01:00
|
|
|
dontWrapJar="true"
|
|
|
|
icon="${graphics.dir}/icon/gridworks.ico">
|
|
|
|
<classPath mainClass="com.metaweb.gridworks.Gridworks">
|
2010-03-03 03:53:07 +01:00
|
|
|
<cp>lib/*.jar</cp>
|
2010-02-10 08:30:16 +01:00
|
|
|
</classPath>
|
2010-03-31 02:17:40 +02:00
|
|
|
<jre minVersion="1.6.0" jdkPreference="preferJre" initialHeapSize="256" maxHeapSize="1024">
|
2010-04-02 02:52:38 +02:00
|
|
|
<opt>-Djava.library.path=lib/native/windows -Dgridworks.version=${revision}</opt>
|
2010-02-10 08:30:16 +01:00
|
|
|
</jre>
|
|
|
|
<versionInfo
|
2010-02-25 00:52:20 +01:00
|
|
|
fileVersion="${num_version}.0.0"
|
2010-02-10 08:30:16 +01:00
|
|
|
txtFileVersion="${version}"
|
|
|
|
fileDescription="gridworks"
|
|
|
|
copyright="Copyright (c) 2010, Metaweb Technologies, Inc."
|
2010-02-25 00:52:20 +01:00
|
|
|
productVersion="${num_version}.0.0"
|
|
|
|
txtProductVersion="${num_version}.0.0"
|
2010-02-10 08:30:16 +01:00
|
|
|
productName="Gridworks"
|
|
|
|
companyName="Metaweb Technologies, Inc."
|
|
|
|
internalName="gridworks"
|
|
|
|
originalFilename="gridworks.exe"
|
|
|
|
/>
|
|
|
|
</config>
|
|
|
|
</launch4j>
|
2010-03-31 04:11:53 +02:00
|
|
|
<copy todir="${windows.dir}/lib">
|
2010-02-10 08:30:16 +01:00
|
|
|
<fileset dir="${lib.dir}">
|
|
|
|
<include name="**/*.jar"/>
|
|
|
|
</fileset>
|
|
|
|
</copy>
|
2010-03-31 04:11:53 +02:00
|
|
|
<copy todir="${windows.dir}/lib/native/windows">
|
2010-03-03 03:53:07 +01:00
|
|
|
<fileset dir="${lib.dir}/native/windows">
|
|
|
|
<include name="*.dll"/>
|
|
|
|
</fileset>
|
|
|
|
</copy>
|
2010-03-31 04:11:53 +02:00
|
|
|
<copy file="${build.dir}/gridworks.jar" tofile="${windows.dir}/lib/gridworks-${version}-${revision}.jar"/>
|
|
|
|
<copy todir="${windows.dir}/webapp">
|
2010-03-31 02:17:40 +02:00
|
|
|
<fileset dir="${webapp.dir}">
|
|
|
|
<include name="**"/>
|
2010-02-10 19:47:32 +01:00
|
|
|
</fileset>
|
|
|
|
</copy>
|
2010-03-31 02:17:40 +02:00
|
|
|
|
2010-03-31 04:11:53 +02:00
|
|
|
<copy todir="${linux.dir}/licenses">
|
2010-03-31 02:17:40 +02:00
|
|
|
<fileset dir="${basedir}/licenses">
|
|
|
|
<include name="**"/>
|
|
|
|
</fileset>
|
|
|
|
</copy>
|
|
|
|
|
2010-03-31 04:11:53 +02:00
|
|
|
<copy file="${conf.dir}/gridworks.l4j.ini" tofile="${windows.dir}/gridworks.l4j.ini"/>
|
|
|
|
<copy file="${basedir}/gridworks.bat" tofile="${windows.dir}/gridworks.bat"/>
|
|
|
|
<copy file="${basedir}/README.txt" tofile="${windows.dir}/README.txt"/>
|
|
|
|
<copy file="${basedir}/LICENSE.txt" tofile="${windows.dir}/LICENSE.txt"/>
|
2010-03-31 02:17:40 +02:00
|
|
|
|
2010-03-31 04:11:53 +02:00
|
|
|
<zip destfile="${dist.dir}/gridworks-${version}-${revision}.zip" basedir="${windows.dir}"/>
|
2010-03-30 23:24:04 +02:00
|
|
|
</target>
|
|
|
|
|
2010-03-31 04:11:53 +02:00
|
|
|
<target name="linux" depends="jar, prepare_webapp">
|
|
|
|
<mkdir dir="${linux.dir}"/>
|
2010-03-30 23:24:04 +02:00
|
|
|
|
2010-03-31 04:11:53 +02:00
|
|
|
<copy todir="${linux.dir}/lib">
|
2010-03-30 23:24:04 +02:00
|
|
|
<fileset dir="${lib.dir}">
|
|
|
|
<include name="**/*.jar"/>
|
|
|
|
</fileset>
|
|
|
|
</copy>
|
2010-02-10 08:30:16 +01:00
|
|
|
|
2010-03-31 04:11:53 +02:00
|
|
|
<copy file="${build.dir}/gridworks.jar" tofile="${linux.dir}/lib/gridworks-${version}-${revision}.jar"/>
|
2010-03-30 23:24:04 +02:00
|
|
|
|
2010-03-31 04:11:53 +02:00
|
|
|
<copy todir="${linux.dir}/src/main/webapp">
|
2010-03-31 02:17:40 +02:00
|
|
|
<fileset dir="${webapp.dir}">
|
|
|
|
<include name="**"/>
|
2010-03-30 23:24:04 +02:00
|
|
|
</fileset>
|
|
|
|
</copy>
|
2010-03-31 04:11:53 +02:00
|
|
|
<copy todir="${linux.dir}/licenses">
|
2010-03-30 23:24:04 +02:00
|
|
|
<fileset dir="${basedir}/licenses">
|
2010-03-31 02:17:40 +02:00
|
|
|
<include name="**"/>
|
2010-03-30 23:24:04 +02:00
|
|
|
</fileset>
|
|
|
|
</copy>
|
2010-03-31 04:11:53 +02:00
|
|
|
<copy file="${basedir}/gridworks.ini" tofile="${linux.dir}/gridworks.ini"/>
|
|
|
|
<copy file="${basedir}/LICENSE.txt" tofile="${linux.dir}/LICENSE.txt"/>
|
|
|
|
<copy file="${basedir}/README.txt" tofile="${linux.dir}/README.txt"/>
|
|
|
|
<copy file="${basedir}/gridworks" tofile="${linux.dir}/gridworks"/>
|
2010-03-30 23:24:04 +02:00
|
|
|
|
|
|
|
<tar longfile="gnu" compression="gzip" destfile="${dist.dir}/gridworks-${version}-${revision}.tar.gz">
|
2010-03-31 04:11:53 +02:00
|
|
|
<tarfileset dir="${linux.dir}/.." filemode="755">
|
|
|
|
<include name="${linux.name}/gridworks"/>
|
2010-03-30 23:24:04 +02:00
|
|
|
</tarfileset>
|
2010-03-31 04:11:53 +02:00
|
|
|
<tarfileset dir="${linux.dir}/..">
|
|
|
|
<include name="${linux.name}/**"/>
|
|
|
|
<exclude name="${linux.name}/gridworks"/>
|
2010-03-30 23:24:04 +02:00
|
|
|
</tarfileset>
|
|
|
|
</tar>
|
|
|
|
</target>
|
2010-03-17 23:30:16 +01:00
|
|
|
|
2010-04-07 19:31:25 +02:00
|
|
|
<target name="prepare_reports">
|
|
|
|
<mkdir dir="${reports.dir}" />
|
|
|
|
</target>
|
|
|
|
|
|
|
|
<target name="findbugs" depends="build,prepare_reports">
|
2010-04-05 09:15:16 +02:00
|
|
|
<taskdef
|
|
|
|
name="findbugs"
|
|
|
|
classname="edu.umd.cs.findbugs.anttask.FindBugsTask"
|
|
|
|
classpath="${findbugs.dir}/lib/findbugs-ant.jar"
|
|
|
|
/>
|
2010-04-07 19:31:25 +02:00
|
|
|
<findbugs jvmargs="-Xmx1024m" home="${findbugs.dir}" output="html" outputFile="${reports.dir}/findbugs.html" >
|
2010-04-05 09:15:16 +02:00
|
|
|
<auxClasspath refid="class.path" />
|
|
|
|
<sourcePath path="${src.dir}" />
|
|
|
|
<class location="${webapp_classes.dir}" />
|
|
|
|
</findbugs>
|
|
|
|
</target>
|
2010-04-07 19:31:25 +02:00
|
|
|
|
|
|
|
<target name="pmd" depends="prepare_reports">
|
|
|
|
<path id="pmd.path">
|
|
|
|
<fileset dir="${pmd.dir}/lib" includes="*.jar"/>
|
|
|
|
</path>
|
|
|
|
<taskdef
|
|
|
|
name="pmd"
|
|
|
|
classname="net.sourceforge.pmd.ant.PMDTask"
|
|
|
|
classpathref="pmd.path"
|
|
|
|
/>
|
|
|
|
<pmd targetjdk="1.6" encoding="UTF-8">
|
|
|
|
<ruleset>basic</ruleset>
|
|
|
|
<formatter type="html" toFile="${reports.dir}/pmd.html" toConsole="true"/>
|
|
|
|
<fileset dir="${server.src.dir}">
|
|
|
|
<include name="**/*.java"/>
|
|
|
|
</fileset>
|
|
|
|
<fileset dir="${src.dir}">
|
|
|
|
<include name="**/*.java"/>
|
|
|
|
</fileset>
|
|
|
|
</pmd>
|
|
|
|
</target>
|
|
|
|
|
|
|
|
<target name="cpd" depends="prepare_reports">
|
|
|
|
<path id="pmd.path">
|
|
|
|
<fileset dir="${pmd.dir}/lib" includes="*.jar"/>
|
|
|
|
</path>
|
|
|
|
<taskdef
|
|
|
|
name="cpd"
|
|
|
|
classname="net.sourceforge.pmd.cpd.CPDTask"
|
|
|
|
classpathref="pmd.path"
|
|
|
|
/>
|
|
|
|
<cpd minimumTokenCount="100" outputFile="${reports.dir}/cpd.txt" encoding="UTF-8">
|
|
|
|
<fileset dir="${server.src.dir}">
|
|
|
|
<include name="**/*.java"/>
|
|
|
|
</fileset>
|
|
|
|
<fileset dir="${src.dir}">
|
|
|
|
<include name="**/*.java"/>
|
|
|
|
</fileset>
|
|
|
|
</cpd>
|
|
|
|
</target>
|
2010-04-05 09:15:16 +02:00
|
|
|
|
2010-04-07 21:05:04 +02:00
|
|
|
<target name="jslint" depends="prepare_reports">
|
|
|
|
<path id="jslint.path">
|
|
|
|
<fileset dir="${jslint.dir}" includes="*.jar"/>
|
|
|
|
</path>
|
|
|
|
<taskdef
|
|
|
|
name="jslint"
|
|
|
|
classname="com.googlecode.jslint4java.ant.JSLintTask"
|
|
|
|
classpathref="jslint.path"
|
|
|
|
/>
|
|
|
|
<jslint>
|
|
|
|
<formatter type="plain" destfile="${reports.dir}/jslint.txt" />
|
|
|
|
<fileset dir="${basedir}/src/main/webapp/scripts">
|
|
|
|
<include name="**/*.js" />
|
|
|
|
</fileset>
|
|
|
|
</jslint>
|
|
|
|
</target>
|
|
|
|
|
2010-02-08 00:15:50 +01:00
|
|
|
<target name="clean">
|
2010-02-09 21:21:10 +01:00
|
|
|
<delete file="${build.dir}/gridworks.jar" />
|
2010-04-03 03:01:11 +02:00
|
|
|
<delete dir="${server_classes.dir}" />
|
|
|
|
<delete dir="${webapp_classes.dir}" />
|
2010-03-09 09:08:35 +01:00
|
|
|
<delete dir="${tests_classes.dir}" />
|
2010-02-08 00:15:50 +01:00
|
|
|
</target>
|
|
|
|
|
2010-04-03 03:01:11 +02:00
|
|
|
<target name="distclean" depends="clean">
|
2010-02-08 00:15:50 +01:00
|
|
|
<delete dir="${build.dir}" />
|
2010-02-09 21:21:10 +01:00
|
|
|
<delete dir="${dist.dir}" />
|
2010-04-07 02:12:40 +02:00
|
|
|
<delete dir="${tools.dir}" />
|
2010-02-08 00:15:50 +01:00
|
|
|
</target>
|
|
|
|
|
|
|
|
</project>
|