]> source.dussan.org Git - vaadin-framework.git/commitdiff
Added platform specific package creation.
authorJani Laakso <jani.laakso@itmill.com>
Thu, 18 Oct 2007 13:12:36 +0000 (13:12 +0000)
committerJani Laakso <jani.laakso@itmill.com>
Thu, 18 Oct 2007 13:12:36 +0000 (13:12 +0000)
Removed launcher from toolkit jar, they still exists on workspace src and classpath.
Removed excess sources from demo.
Removed tests.

<!-- Package creation - - - - - - - - - - - - - - - - - - - - - - - - -

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.
-->

svn changeset:2552/svn branch:trunk

build/build.xml

index 3bbf44cb345aeb9bebae01a08a92cfcfaa78eea2..2a0eec17b03905cefed37b21523706fa7eefab60 100644 (file)
 <?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">
+<project name="IT Mill Toolkit" basedir="../" default="package-all-platforms">
 
-       <!-- Package creation - - - - - - - - - - - - - - - - - - - - - - - - - -->
+       <!-- Package creation - - - - - - - - - - - - - - - - - - - - - - - - -
 
-       <target name="package" depends="clean-all, root, demo, docs" description="Build public release">
+       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.
+       -->
+       <target name="package-all-platforms" depends="clean-all, init" 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.">
+               <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 -->
                <zip zipfile="build/result/${package-file-name}">
                        <fileset dir="build/result">
                                <patternset>
                                        <include name="${product-file}-${version}/**" />
                                </patternset>
                        </fileset>
+                       <fileset dir="build/gwt/windows">
+                               <patternset>
+                                       <include name="**/*" />
+                               </patternset>
+                       </fileset>
                </zip>
+               <!-- TODO remove platform specific files / other tweaks to package -->
        </target>
 
-       <target name="package-no-manual" depends="clean-all, root, demo" description="Build testing release">
-               <zip zipfile="build/result/TESTING-${package-file-name}">
+       <target name="package-linux" 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">
                                <patternset>
                                        <include name="${product-file}-${version}/**" />
                                </patternset>
                        </fileset>
-               </zip>
+                       <fileset dir="build/gwt/linux">
+                               <patternset>
+                                       <include name="**/*" />
+                               </patternset>
+                       </fileset>
+               </tar>
+               <antcall target="remove-unix-files" />
+       </target>
+
+       <target name="package-mac" 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">
+                               <patternset>
+                                       <include name="${product-file}-${version}/**" />
+                               </patternset>
+                       </fileset>
+                       <fileset dir="build/gwt/mac">
+                               <patternset>
+                                       <include name="**/*" />
+                               </patternset>
+                       </fileset>
+               </tar>
+               <antcall target="remove-unix-files" />
+       </target>
+
+       <target name="add-unix-files" depends="init">
+               <copy todir="${output-dir}">
+                       <filterchain>
+                               <expandproperties />
+                               <replacetokens begintoken="&lt;" 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>
+                       </filterchain>
+                       <fileset dir="">
+                               <include name="*.sh" />
+                       </fileset>
+               </copy>
+               <chmod file="${output-dir}/start-demo.sh" perm="ugo+x" />
+       </target>
+
+       <target name="remove-unix-files" depends="init">
+               <delete includeemptydirs="true" defaultexcludes="false">
+                       <fileset dir="${output-dir}">
+                               <include name="start-demo.sh" />
+                       </fileset>
+               </delete>
+       </target>
+
+       <!-- do not use these directly, use targets named package-* -->
+       <target name="build" depends="clean-all, root, demo, docs" description="Build package required files, without packing them.">
+       </target>
+
+       <!-- do not use these directly, use targets named package-*, retained for build.xml debug purposes only -->
+       <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/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" />
                <property name="lib-dev-jar-name" value="${product-file}-dev-${version}.jar" />
                <property name="demo-lib-jar-name" value="${product-file}-demo-${version}.jar" />
                <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
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
                                <exclude name="release-notes.html" />
                                <include name="*.html" />
                                <include name="*.txt" />
-                               <include name="*.bat" />
-                               <include name="*.sh" />
                        </fileset>
                </copy>
-               <chmod file="${output-dir}/start-demo.sh" perm="ugo+x" />
        </target>
 
 
                        </fileset>
                </copy>
 
-               <!-- Unify mix usage of OSX/Linux/Win characters -->
-               <echo>Unifying mix usage of OSX/Linux/Win linefeeds for java/html/css/xml files.</echo>
+               <!-- Unify mix usage of mac/Linux/Win characters -->
+               <echo>Unifying mix usage of Mac/Linux/Win linefeeds for java/html/css/xml files.</echo>
                <fixcrlf srcdir="build/result/src" eol="crlf" tablength="4" tab="asis" includes="**/*.java **/*.html **/*.css **/*.xml" />
 
                <!-- Add other files such as images, these are not filtered or processed by fixcrlf task -->
                                <exclude name="**/.svn" />
                                <exclude name="openajax/**" />
                                <exclude name="ITMILL/widgetsets" />
+                               <exclude name="ITMILL/themes/tests-*" />
                                <exclude name="WEB-INF/classes/**" />
                                <exclude name="WEB-INF/lib/commons-fileupload-1.2-javadoc.jar" />
                                <exclude name="WEB-INF/lib/commons-fileupload-1.2-sources.jar" />
                <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="build/gwt/gwt/${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" />
                                <patternset>
                                        <exclude name="${toolkit-package}/demo/**" />
                                        <exclude name="${toolkit-package}/tests/**" />
+                                       <exclude name="${toolkit-package}/launcher/**" />
                                </patternset>
                        </fileset>
                </jar>
-               <!-- Add GWT binaries, required on client-side development -->
-               <echo>Adding GWT binaries</echo>
-               <copy todir="${output-dir}/gwt">
-                       <fileset dir="build/gwt/gwt">
-                               <patternset>
-                                       <include name="**/*" />
-                               </patternset>
-                       </fileset>
-               </copy>
        </target>
 
        <target name="compile-client-side" depends="libs">
                        <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="build/gwt/gwt/gwt-user.jar" />
+                               <pathelement location="build/gwt/gwt/${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="${output-dir}/gwt/gwt-user.jar" />
-                               <pathelement location="${output-dir}/gwt/gwt-dev-mac.jar" />
+                               <pathelement location="build/gwt/gwt/gwt-user.jar" />
+                               <pathelement location="build/gwt/gwt/${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="${output-dir}/gwt/gwt-user.jar" />
-                               <pathelement location="${output-dir}/gwt/gwt-dev-mac.jar" />
+                               <pathelement location="build/gwt/gwt/gwt-user.jar" />
+                               <pathelement location="build/gwt/gwt/${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" />
                                <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) source for demo</echo>
                <copy todir="${output-dir}/WebContent/src">
                        <fileset dir="build/result/src">
-                               <include name="**/*" />
+                               <include name="${toolkit-package}/demo/**/*" />
+                               <!-- user might want to tweak launcher classes -->
+                               <include name="${toolkit-package}/launcher/**" />
                        </fileset>
                </copy>