When creating release use only "package-*" targets:
package-all-platforms, package-windows, package-linux or package-mac.
- NOTE: This build script requires directories named build/gwt/(gwt|linux|windows|mac) .
- It's best that you unpack platform specific binaries under linux, windows and mac directories and
- then depending on your platform link build/gwt/gwt -> build/gwt/<my_platform>
- build/gwt/gwt is used to compile WebContent/ITMILL/widgetsets (depends on your platform, hence we use "gwt") and
- build/gwt/(linux|windows|mac) are used when creating platform specific release ZIP/TGZ packages.
+ NOTE: This build script requires directories named build/gwt/(linux|windows|mac) .
+ You must unpack platform specific binaries under linux, windows and mac directories.
+ build/gwt/(linux|windows|mac) are used for
+ a) compile WebContent/ITMILL/widgetsets
+ b) creating platform specific release ZIP/TGZ packages.
-->
- <target name="package-all-platforms" depends="clean-all, init" description="Build public packages for Windows, Linux and Mac platforms.">
+
+ <!-- Initialization - - - - - - - - - - - - - - - - - - - - - - - - -->
+
+ <target name="init">
+ <!-- Find out which platform we are in -->
+ <if>
+ <equals arg1="${os.name}" arg2="Windows 2000, Windows XP" />
+ <then>
+ <property name="platform" value="windows" />
+ </then>
+ </if>
+ <if>
+ <equals arg1="${os.name}" arg2="Linux" />
+ <then>
+ <property name="platform" value="linux" />
+ </then>
+ </if>
+ <if>
+ <equals arg1="${os.name}" arg2="Mac OS X" />
+ <then>
+ <property name="platform" value="mac" />
+ </then>
+ </if>
+ <property name="lib-gwt-dev" value="gwt-dev-${platform}.jar" />
+ <echo>We are on ${platform} platform, using build/gwt/${platform}/${lib-gwt-dev}.</echo>
+
+ <!-- Create result dir unless already exists -->
+ <mkdir dir="build/result" />
+
+ <property file="build/VERSION" />
+ <property name="product-file" value="itmill-toolkit" />
+ <property name="product-name" value="IT Mill Toolkit" />
+ <property name="toolkit-package" value="com/itmill/toolkit" />
+
+ <property file="build/html-style.properties" />
+
+ <!-- Destination files -->
+ <property name="lib-bin-jar-name" value="${product-file}-${version}.jar" />
+ <property name="lib-dev-jar-name" value="${product-file}-dev-${version}.jar" />
+ <property name="demo-lib-jar-name" value="${product-file}-demo-${version}.jar" />
+ <property name="lib-src-jar-name" value="${product-file}-src-${version}.jar" />
+ <property name="demo-war-name" value="${product-file}-demo-${version}.war" />
+
+ <echo message="Prepared to build ${product-file} version ${version} packages" />
+
+ <!-- Output directory -->
+ <property name="output-dir" value="build/result/${product-file}-${version}" />
+ <mkdir dir="${output-dir}" />
+
+ <!-- Create Output Directory Hierarchy -->
+ <mkdir dir="${output-dir}/doc/manual" />
+ <mkdir dir="${output-dir}/doc/api" />
+ <mkdir dir="${output-dir}/lib" />
+ <mkdir dir="${output-dir}/WebContent" />
+ <mkdir dir="${output-dir}/WebContent/WEB-INF" />
+ <mkdir dir="${output-dir}/WebContent/WEB-INF/classes" />
+ </target>
+
+
+ <target name="package-all-platforms" depends="init, clean-all" description="Build public packages for Windows, Linux and Mac platforms.">
<antcall target="build" />
<antcall target="package-windows" />
<antcall target="package-linux" />
<antcall target="package-osx" />
</target>
- <target name="package-windows" description="Create ZIP package for Windows.">
+ <target name="package-windows" depends="init, clean-all" description="Create ZIP package for Windows.">
<echo>Building package for Windows platform.</echo>
<!-- required when compiling WebContent/ITMILL/widgetsets (and also Java server-side classes) -->
- <property name="lib-gwt-dev" value="gwt-dev-windows.jar" />
<property name="package-file-name" value="${product-file}-windows-${version}" />
- <!-- TODO add platform specific files / other tweaks to package -->
+ <antcall target="add-windows-files" />
<zip zipfile="build/result/${package-file-name}">
- <fileset dir="build/result">
+ <fileset prefix="${product-file}-${version}" dir="build/result/${product-file}-${version}">
<patternset>
- <include name="${product-file}-${version}/**" />
+ <include name="**/*" />
</patternset>
</fileset>
- <fileset dir="build/gwt/windows">
+ <fileset prefix="${product-file}-${version}/gwt" dir="build/gwt/windows">
<patternset>
<include name="**/*" />
</patternset>
</fileset>
</zip>
- <!-- TODO remove platform specific files / other tweaks to package -->
</target>
- <target name="package-linux" description="Create tar.gz package for Linux.">
+ <target name="package-linux" depends="init, clean-all" description="Create tar.gz package for Linux.">
<echo>Building package for Linux platform.</echo>
<!-- required when compiling WebContent/ITMILL/widgetsets (and also Java server-side classes) -->
- <property name="lib-gwt-dev" value="gwt-dev-linux.jar" />
<property name="package-file-name" value="${product-file}-linux-${version}" />
- <antcall target="add-unix-files" />
- <tar dest="build/result/${package-file-name}" compress="gzip">
- <fileset dir="build/result">
+ <antcall target="add-linux-files" />
+ <tar destfile="build/result/${package-file-name}.tar.bz2" compression="bzip2" longfile="gnu">
+ <tarfileset prefix="${product-file}-${version}" dir="build/result/${product-file}-${version}">
<patternset>
- <include name="${product-file}-${version}/**" />
+ <include name="**/*" />
</patternset>
- </fileset>
- <fileset dir="build/gwt/linux">
+ </tarfileset>
+ <tarfileset prefix="${product-file}-${version}/gwt" dir="build/gwt/linux">
<patternset>
<include name="**/*" />
</patternset>
- </fileset>
+ </tarfileset>
</tar>
- <antcall target="remove-unix-files" />
</target>
- <target name="package-mac" description="Create tar.gz package for Mac.">
+ <target name="package-mac" depends="init, clean-all" description="Create tar.gz package for Mac.">
<echo>Building package for Mac platform.</echo>
<!-- required when compiling WebContent/ITMILL/widgetsets (and also Java server-side classes) -->
- <property name="lib-gwt-dev" value="gwt-dev-max.jar" />
<property name="package-file-name" value="${product-file}-mac-${version}" />
- <antcall target="add-unix-files" />
- <tar dest="build/result/${package-file-name}" compress="gzip">
- <fileset dir="build/result">
+ <antcall target="add-mac-files" />
+ <tar destfile="build/result/${package-file-name}.tar.gz" compression="gzip" longfile="gnu">
+ <tarfileset prefix="${product-file}-${version}" dir="build/result/${product-file}-${version}">
<patternset>
- <include name="${product-file}-${version}/**" />
+ <include name="**/*" />
</patternset>
- </fileset>
- <fileset dir="build/gwt/mac">
+ </tarfileset>
+ <tarfileset prefix="${product-file}-${version}/gwt" dir="build/gwt/mac">
<patternset>
<include name="**/*" />
</patternset>
- </fileset>
+ </tarfileset>
</tar>
- <antcall target="remove-unix-files" />
</target>
- <target name="add-unix-files" depends="init">
+ <target name="add-mac-files" depends="init">
+ <antcall target="remove-platform-specific-files" />
<copy todir="${output-dir}">
<filterchain>
<expandproperties />
<replacetokens begintoken="<" endtoken=">">
- <token key="body" value="${html.body.tag}${html.body.start1}${product-name}${html.body.start2}" />
- <token key="/body" value="${html.body.end}${html.body.endtag}" />
<token key="version" value="${version}" />
<token key="/version" value="" />
</replacetokens>
+ <replacetokens begintoken="<" endtoken=">">
+ <token key="platform-specific-entries" value="<classpathentry kind="lib" path="gwt/gwt-dev-mac.jar" />" />
+ <token key="/platform-specific-entries" value="" />
+ </replacetokens>
</filterchain>
- <fileset dir="">
+ <fileset dir="build/package">
<include name="*.sh" />
</fileset>
+ <fileset dir="build/package">
+ <include name=".classpath" />
+ <include name=".project" />
+ </fileset>
</copy>
<chmod file="${output-dir}/start-demo.sh" perm="ugo+x" />
</target>
- <target name="remove-unix-files" depends="init">
+ <target name="remove-platform-specific-files" depends="init">
<delete includeemptydirs="true" defaultexcludes="false">
<fileset dir="${output-dir}">
- <include name="start-demo.sh" />
+ <include name="start-demo.*" />
+ <include name=".project" />
+ <include name=".classpath" />
</fileset>
</delete>
</target>
<target name="build-no-manual" depends="clean-all, root, demo" description="Same as build, but without manual.">
</target>
- <!-- Initialization - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <target name="init">
- <!-- Create result dir unless already exists -->
- <mkdir dir="build/result" />
-
- <property file="build/VERSION" />
- <property name="product-file" value="itmill-toolkit" />
- <property name="product-name" value="IT Mill Toolkit" />
- <property name="toolkit-package" value="com/itmill/toolkit" />
-
- <property file="build/html-style.properties" />
-
- <!-- Destination files -->
- <property name="lib-bin-jar-name" value="${product-file}-${version}.jar" />
- <property name="lib-dev-jar-name" value="${product-file}-dev-${version}.jar" />
- <property name="demo-lib-jar-name" value="${product-file}-demo-${version}.jar" />
- <property name="lib-src-jar-name" value="${product-file}-src-${version}.jar" />
- <property name="demo-war-name" value="${product-file}-demo-${version}.war" />
-
- <echo message="Prepared to build ${product-file} version ${version} packages" />
-
- <!-- Output directory -->
- <property name="output-dir" value="build/result/${product-file}-${version}" />
- <mkdir dir="${output-dir}" />
-
- <!-- Create Output Directory Hierarchy -->
- <mkdir dir="${output-dir}/doc/manual" />
- <mkdir dir="${output-dir}/doc/api" />
- <mkdir dir="${output-dir}/lib" />
- <mkdir dir="${output-dir}/WebContent" />
- <mkdir dir="${output-dir}/WebContent/WEB-INF" />
- <mkdir dir="${output-dir}/WebContent/WEB-INF/classes" />
- </target>
-
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Add and filter root files
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<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="build/gwt/gwt/${lib-gwt-dev}" />
+ <pathelement path="build/gwt/${platform}/gwt-user.jar" />
+ <pathelement path="build/gwt/${platform}/${lib-gwt-dev}" />
<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" />
<arg value="${output-dir}/WebContent/ITMILL/widgetsets" />
<arg value="com.itmill.toolkit.terminal.gwt.DefaultWidgetSet" />
<classpath>
- <pathelement location="build/gwt/gwt/gwt-user.jar" />
- <pathelement location="build/gwt/gwt/${lib-gwt-dev}" />
+ <pathelement location="build/gwt/${platform}/gwt-user.jar" />
+ <pathelement location="build/gwt/${platform}/${lib-gwt-dev}" />
<pathelement location="${output-dir}/lib/itmill-toolkit-src-5.0.0-alpha.jar" />
</classpath>
</java>
<arg value="${output-dir}/WebContent/ITMILL/widgetsets" />
<arg value="com.itmill.toolkit.demo.reservation.gwt.WidgetSet" />
<classpath>
- <pathelement location="build/gwt/gwt/gwt-user.jar" />
- <pathelement location="build/gwt/gwt/${lib-gwt-dev}" />
+ <pathelement location="build/gwt/${platform}/gwt-user.jar" />
+ <pathelement location="build/gwt/${platform}/${lib-gwt-dev}" />
<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" />
<arg value="${output-dir}/WebContent/ITMILL/widgetsets" />
<arg value="com.itmill.toolkit.demo.colorpicker.gwt.WidgetSet" />
<classpath>
- <pathelement location="build/gwt/gwt/gwt-user.jar" />
- <pathelement location="build/gwt/gwt/${lib-gwt-dev}" />
+ <pathelement location="build/gwt/${platform}/gwt-user.jar" />
+ <pathelement location="build/gwt/${platform}/${lib-gwt-dev}" />
<pathelement location="${output-dir}/lib/itmill-toolkit-src-5.0.0-alpha.jar" />
<!-- demo widgetset sources -->
<pathelement path="${output-dir}/WebContent/src" />
+++ /dev/null
-<!--\r
-\r
-Creates two packages:\r
-\r
-1. WAR package that can be deployed to application server or servlet container.\r
-\r
-2. JAR package which requires JRE only, includes embedded web server.\r
-\r
--->\r
-<project name="itmill-toolkit-examples" basedir="." default="package">\r
-\r
- <target name="init">\r
- <echo message="Creating two packages:" />\r
- <echo message="1. WAR package that can be deployed to application server or servlet container." />\r
- <echo message="2. JAR package which requires JRE only, includes embedded web server." />\r
- <property name="server.main.class" value="com.itmill.toolkit.demo.DesktopServer" />\r
- <property name="webserver.jar" value="WebServer/winstone-0.9.9.jar" />\r
- <property file="build.properties" />\r
- <mkdir dir="build" />\r
- </target>\r
-\r
- <target name="clean">\r
- <delete dir="build" />\r
- </target>\r
-\r
- <!-- Compiles your Toolkit application -->\r
- <target name="compile" depends="init">\r
- <echo message="Compiling Toolkit application sources." />\r
- <path id="compile.class.path">\r
- <fileset dir="WebContent">\r
- <include name="WEB-INF/lib/*.jar" />\r
- </fileset>\r
- <fileset dir="WebServer">\r
- <include name="*.jar" />\r
- </fileset>\r
- </path>\r
-\r
- <javac srcdir="WebContent/src" destdir="WebContent/WEB-INF/classes" classpathref="compile.class.path">\r
- </javac>\r
- <javac srcdir="WebServer/src" destdir="WebServer/classes" classpathref="compile.class.path">\r
- </javac>\r
- </target>\r
-\r
- <!-- Creates Toolkit WAR package (requires Application Server / Servlet Container)-->\r
- <target name="war-package" depends="compile">\r
- <echo message="Creating WAR package." />\r
- <war warfile="build/${ant.project.name}.war" webxml="WebContent/WEB-INF/web.xml">\r
- <fileset dir="WebContent">\r
- <include name="**/*" />\r
- <exclude name="WEB-INF/web.xml" />\r
- </fileset>\r
- </war>\r
- </target>\r
-\r
- <!-- Creates Toolkit JAR package that contains embedded WebServer -->\r
- <target name="jar-package" depends="war-package">\r
- <echo message="Creating JAR package." />\r
- <copy tofile="build/WebServer-temp/embedded.war" file="build/${ant.project.name}.war" />\r
- <unjar src="${webserver.jar}" dest="build/WebServer-temp" />\r
- <manifest file="build/WebServer-temp/META-INF/MANIFEST.MF">\r
- <attribute name="Main-Class" value="${server.main.class}" />\r
- </manifest>\r
- <copy todir="build/WebServer-temp">\r
- <fileset dir="WebServer/classes">\r
- <include name="**/*" />\r
- </fileset>\r
- </copy>\r
- </target>\r
-\r
- <!-- Creates both Toolkit WAR and JAR packages -->\r
- <target name="package" depends="jar-package">\r
- <jar destfile="build/${ant.project.name}.jar" basedir="build/WebServer-temp" manifest="build/WebServer-temp/META-INF/MANIFEST.MF" />\r
- <echo message="Created WAR-file to build/${ant.project.name}.war." />\r
- <echo message="Deploy this file to your application server or servlet container." />\r
- <echo message=" " />\r
- <echo message="Created JAR-file to build/${ant.project.name}.jar" />\r
- <echo message="Run your application using command like: java -jar build/${ant.project.name}.jar" />\r
- </target>\r
-\r
-</project>\r