<?xml version="1.0"?>
+<!-- NOTE: TODO FIXME: This build script works only for OSX platform because of client-side compilation (gwt-dev-mac.jar is platform specific) -->
<project name="IT Mill Toolkit" basedir="../" default="package">
<!-- Package creation - - - - - - - - - - - - - - - - - - - - - - - - - -->
</zip>
</target>
+ <target name="package-no-manual" depends="clean-all, root, demo" description="Build testing release">
+ <zip zipfile="build/result/TESTING-${package-file-name}">
+ <fileset dir="build/result">
+ <patternset>
+ <include name="${product-file}-${version}/**" />
+ </patternset>
+ </fileset>
+ </zip>
+ </target>
+
<!-- Initialization - - - - - - - - - - - - - - - - - - - - - - - - -->
<target name="init">
<property name="toolkit-package" value="com/itmill/toolkit" />
<property file="build/html-style.properties" />
-
+
<!-- Destination files -->
<property name="package-file-name" value="${product-file}-${version}.zip" />
<property name="lib-bin-jar-name" value="${product-file}-${version}.jar" />
<mkdir dir="${output-dir}/WebContent" />
<mkdir dir="${output-dir}/WebContent/WEB-INF" />
<mkdir dir="${output-dir}/WebContent/WEB-INF/classes" />
- <mkdir dir="${output-dir}/WebServer" />
- <mkdir dir="${output-dir}/WebServer/classes" />
-
+
</target>
-
-
-
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
+
+
+
+
+ <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Add and filter root files
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<target name="root" depends="init">
-->
<target name="preprocess-src" depends="init">
<mkdir dir="build/result/src" />
- <echo>Copying src directory and processing copied files.</echo>
+ <echo>Copying src directory and processing copied files.</echo>
<echo>Replacing <version> tag with build version for java/html/css/xml files.</echo>
<copy todir="build/result/src">
<filterset>
</patternset>
</fileset>
</copy>
-
+
<echo>Creating demo source html files</echo>
<java2html srcdir="build/result/src/${toolkit-package}/demo" destdir="build/result/src/${toolkit-package}/demo" includes="**/*.java" style="eclipse" showLineNumbers="false" showFileName="true" showTableBorder="false" />
-
+
</target>
-
+
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
WebContent
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
Copy Eclipse workspace related hidden files (.classpath, .project)
Allows project import from Eclipse
-->
- <echo>Adding Eclipse workspace files, replacing <version> tag with build version</echo>
+ <echo>Adding Eclipse workspace files, replacing <version> tag with build version</echo>
<copy todir="${output-dir}">
<filterchain>
<expandproperties />
</fileset>
</copy>
- <!-- Add WebServer -->
- <echo>Adding WebServer</echo>
- <copy todir="${output-dir}/WebServer">
- <fileset dir="WebServer">
- <exclude name="**/.svn" />
- </fileset>
- </copy>
-
<!-- Add demo sources -->
<echo>Adding demo sources to WebContent/src</echo>
<copy todir="${output-dir}/WebContent/src">
<include name="${toolkit-package}/demo/**/*" />
</fileset>
</copy>
-
-
- <!-- Compile WebServer classes -->
- <echo>Compiling WebServer</echo>
- <javac source="1.4" target="1.4" srcdir="WebServer/src" destdir="${output-dir}/WebServer/classes" classpath="WebServer/winstone-0.9.9.jar" debug="true" />
<!-- Add WebContent -->
<echo>Adding WebContent files, excluding ITMILL/widgetsets and few internal development libraries.</echo>
<echo>Compiling src (server-side)</echo>
<!-- Compile -->
<mkdir dir="build/result/classes" />
- <javac
- source="1.4"
- target="1.4"
- srcdir="build/result/src"
- destdir="build/result/classes"
- includes="${toolkit-package}/**"
- debug="true">
- <classpath>
- <pathelement path="build/gwt/gwt/gwt-user.jar" />
- <pathelement path="WebContent/WEB-INF/lib/commons-fileupload-1.2.jar" />
- <pathelement path="lib/reservr/googlemaps_gwt.jar" />
- </classpath>
+ <javac source="1.4" target="1.4" srcdir="build/result/src" destdir="build/result/classes" includes="${toolkit-package}/**" debug="true">
+ <classpath>
+ <pathelement path="build/gwt/gwt/gwt-user.jar" />
+ <pathelement path="build/gwt/gwt/gwt-dev-mac.jar" />
+ <pathelement path="WebContent/WEB-INF/lib/commons-fileupload-1.2.jar" />
+ <pathelement path="lib/reservr/googlemaps_gwt.jar" />
+ <pathelement path="lib/jetty/jetty-6.1.5.jar" />
+ <pathelement path="lib/jetty/jetty-util-6.1.5.jar" />
+ <pathelement path="lib/jetty/servlet-api-2.5-6.1.5.jar" />
+ </classpath>
</javac>
</target>
<include name="reservr/**/*" />
</fileset>
</copy>
+ <copy todir="${output-dir}/lib">
+ <fileset dir="lib">
+ <include name="jetty/**/*" />
+ </fileset>
+ </copy>
<!-- Create Toolkit deployment / server-side only development JAR -->
- <jar
- jarfile="${output-dir}/lib/${lib-bin-jar-name}"
- compress="true">
- <fileset dir="build/result/classes">
+ <jar jarfile="${output-dir}/lib/${lib-bin-jar-name}" compress="true">
+ <fileset dir="build/result/classes">
<patternset>
<exclude name="${toolkit-package}/demo/**" />
+ <exclude name="${toolkit-package}/launcher/**" />
<exclude name="${toolkit-package}/tests/**" />
</patternset>
</fileset>
</fileset>
</jar>
<!-- Add GWT binaries, required on client-side development -->
- <echo>Adding GWT binaries</echo>
+ <echo>Adding GWT binaries</echo>
<copy todir="${output-dir}/gwt">
<fileset dir="build/gwt/gwt">
<patternset>
</fileset>
</copy>
</target>
-
+
<target name="compile-client-side" depends="libs">
- <echo>Compiling src (client-side)</echo>
- <echo>com.itmill.toolkit.terminal.gwt.DefaultWidgetSet</echo>
- <java classname="com.google.gwt.dev.GWTCompiler" failonerror="yes" fork="yes" maxmemory="512m">
- <arg value="-out" />
- <arg value="${output-dir}/WebContent/ITMILL/widgetsets" />
- <arg value="com.itmill.toolkit.terminal.gwt.DefaultWidgetSet" />
- <classpath>
- <pathelement location="${output-dir}/gwt/gwt-user.jar" />
- <pathelement location="${output-dir}/gwt/gwt-dev-mac.jar" />
- <pathelement location="${output-dir}/lib/itmill-toolkit-src-5.0.0-alpha.jar"/>
- </classpath>
- </java>
-
- <echo>com.itmill.toolkit.demo.reservation.gwt.WidgetSet</echo>
- <java classname="com.google.gwt.dev.GWTCompiler" failonerror="yes" fork="yes" maxmemory="512m">
- <arg value="-out" />
- <arg value="${output-dir}/WebContent/ITMILL/widgetsets" />
- <arg value="com.itmill.toolkit.demo.reservation.gwt.WidgetSet" />
- <classpath>
- <pathelement location="${output-dir}/gwt/gwt-user.jar" />
- <pathelement location="${output-dir}/gwt/gwt-dev-mac.jar" />
- <pathelement location="${output-dir}/lib/itmill-toolkit-src-5.0.0-alpha.jar"/>
- <!-- demo jars -->
- <pathelement location="${output-dir}/lib/demo/reservr/googlemaps_gwt.jar" />
- <!-- demo widgetset sources -->
- <pathelement path="${output-dir}/WebContent/src" />
- </classpath>
- </java>
-
- <echo>com.itmill.toolkit.demo.colorpicker.gwt.WidgetSet</echo>
- <java classname="com.google.gwt.dev.GWTCompiler" failonerror="yes" fork="yes" maxmemory="512m">
- <arg value="-out" />
- <arg value="${output-dir}/WebContent/ITMILL/widgetsets" />
- <arg value="com.itmill.toolkit.demo.colorpicker.gwt.WidgetSet" />
- <classpath>
- <pathelement location="${output-dir}/gwt/gwt-user.jar" />
- <pathelement location="${output-dir}/gwt/gwt-dev-mac.jar" />
- <pathelement location="${output-dir}/lib/itmill-toolkit-src-5.0.0-alpha.jar"/>
- <!-- demo widgetset sources -->
- <pathelement path="${output-dir}/WebContent/src" />
- </classpath>
- </java>
+ <echo>Compiling src (client-side)</echo>
+ <echo>com.itmill.toolkit.terminal.gwt.DefaultWidgetSet</echo>
+ <java classname="com.google.gwt.dev.GWTCompiler" failonerror="yes" fork="yes" maxmemory="512m">
+ <arg value="-out" />
+ <arg value="${output-dir}/WebContent/ITMILL/widgetsets" />
+ <arg value="com.itmill.toolkit.terminal.gwt.DefaultWidgetSet" />
+ <classpath>
+ <pathelement location="${output-dir}/gwt/gwt-user.jar" />
+ <pathelement location="${output-dir}/gwt/gwt-dev-mac.jar" />
+ <pathelement location="${output-dir}/lib/itmill-toolkit-src-5.0.0-alpha.jar" />
+ </classpath>
+ </java>
+
+ <echo>com.itmill.toolkit.demo.reservation.gwt.WidgetSet</echo>
+ <java classname="com.google.gwt.dev.GWTCompiler" failonerror="yes" fork="yes" maxmemory="512m">
+ <arg value="-out" />
+ <arg value="${output-dir}/WebContent/ITMILL/widgetsets" />
+ <arg value="com.itmill.toolkit.demo.reservation.gwt.WidgetSet" />
+ <classpath>
+ <pathelement location="${output-dir}/gwt/gwt-user.jar" />
+ <pathelement location="${output-dir}/gwt/gwt-dev-mac.jar" />
+ <pathelement location="${output-dir}/lib/itmill-toolkit-src-5.0.0-alpha.jar" />
+ <!-- demo jars -->
+ <pathelement location="${output-dir}/lib/demo/reservr/googlemaps_gwt.jar" />
+ <!-- demo widgetset sources -->
+ <pathelement path="${output-dir}/WebContent/src" />
+ </classpath>
+ </java>
+
+ <echo>com.itmill.toolkit.demo.colorpicker.gwt.WidgetSet</echo>
+ <java classname="com.google.gwt.dev.GWTCompiler" failonerror="yes" fork="yes" maxmemory="512m">
+ <arg value="-out" />
+ <arg value="${output-dir}/WebContent/ITMILL/widgetsets" />
+ <arg value="com.itmill.toolkit.demo.colorpicker.gwt.WidgetSet" />
+ <classpath>
+ <pathelement location="${output-dir}/gwt/gwt-user.jar" />
+ <pathelement location="${output-dir}/gwt/gwt-dev-mac.jar" />
+ <pathelement location="${output-dir}/lib/itmill-toolkit-src-5.0.0-alpha.jar" />
+ <!-- demo widgetset sources -->
+ <pathelement path="${output-dir}/WebContent/src" />
+ </classpath>
+ </java>
</target>
-
+
<!-- Demo - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<target name="demo" depends="root, libs, compile-java, compile-client-side, javadoc">
<echo>Building demo</echo>
<copy todir="${output-dir}/WebContent/WEB-INF/classes">
<fileset dir="build/result/classes">
<include name="${toolkit-package}/demo/**/*" />
+ <!-- user might want to tweak launcher classes -->
+ <include name="${toolkit-package}/launcher/**" />
+ <!-- TODO: remove these -->
+ <include name="${toolkit-package}/tests/**" />
</fileset>
</copy>
+
<echo>Adding (duplicating) Toolkit JAR to WebContent/WEB-INF/lib</echo>
<copy todir="${output-dir}/WebContent/WEB-INF/lib">
<fileset dir="${output-dir}/lib">
<include name="${lib-bin-jar-name}" />
</fileset>
</copy>
-
+
+ <echo>Adding (duplicating) source for demo</echo>
+ <copy todir="${output-dir}/WebContent/src">
+ <fileset dir="build/result/src">
+ <include name="**/*" />
+ </fileset>
+ </copy>
+
+ <echo>Adding (duplicating) javadocs for demo</echo>
+ <copy todir="${output-dir}/WebContent/doc">
+ <fileset dir="${output-dir}/doc">
+ <include name="api/**/*" />
+ </fileset>
+ </copy>
+
<echo>Building WAR</echo>
<war warfile="${output-dir}/lib/${product-file}.war" webxml="WebContent/WEB-INF/web.xml">
<fileset dir="${output-dir}/WebContent">
<fileset dir="${output-dir}">
<include name="doc/api/**/*" />
</fileset>
+ <!-- All sources (demos link to these)-->
+ <fileset dir="build/result/src">
+ <include name="**/*" />
+ </fileset>
</war>
</target>