diff options
Diffstat (limited to 'build/build.xml')
-rw-r--r-- | build/build.xml | 285 |
1 files changed, 144 insertions, 141 deletions
diff --git a/build/build.xml b/build/build.xml index a20f81fceb..38a1a3d871 100644 --- a/build/build.xml +++ b/build/build.xml @@ -188,7 +188,6 @@ <!-- Called only when building installation packages. --> <target name="package-init"> - <!-- <property name="build.sampler.disabled" value="false"/> --> </target> <target name="init" depends="check-java-version, init-platform"> @@ -669,46 +668,103 @@ NOTE: Replaces <version></version> tags with build version tag for some "textual" files --> <target name="preprocess-src"> + <!-- + Source directories in the project are + * src (Vaadin core) + * demo/src (Demos and examples) + * tests/src (Test cases) + + These are copied to + * {$result-path}/src/core + * {$result-path}/src/demo + * {$result-path}/src/tests + + Java/HTML/CSS/XML files are filtered so the license is added and the version is set. + Other files are just copied. + + If build.include.tests is not set, then "{$result-path}/src/tests" is created but no files are copied to it. + --> + <loadfile property="ITMillApache2LicenseForJavaFiles" srcFile="build/ITMillApache2LicenseForJavaFiles.txt" /> <mkdir dir="${result-path}/src" /> + + <mkdir dir="${result-path}/src/core" /> + <mkdir dir="${result-path}/src/demo" /> + <mkdir dir="${result-path}/src/tests" /> + + <patternset id="preprocessable-files"> + <include name="**/*.java" /> + <include name="**/*.html" /> + <include name="**/*.css" /> + <include name="**/*.xml" /> + </patternset> + <patternset id="non-preprocessable-files"> + <exclude name="**/.svn" /> + <exclude name="**/*.java" /> + <exclude name="**/*.html" /> + <exclude name="**/*.css" /> + <exclude name="**/*.xml" /> + </patternset> + <filterset id="version-and-license"> + <filter token="ITMillApache2LicenseForJavaFiles" value="${ITMillApache2LicenseForJavaFiles}" /> + <filter token="VERSION" value="${version.full}" /> + </filterset> + <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="${result-path}/src"> - <filterset> - <filter token="ITMillApache2LicenseForJavaFiles" value="${ITMillApache2LicenseForJavaFiles}" /> - <filter token="VERSION" value="${version.full}" /> - </filterset> + <copy todir="${result-path}/src/core"> + <filterset refid="version-and-license"/> <fileset dir="src"> - <patternset> - <include name="**/*.java" /> - <include name="**/*.html" /> - <include name="**/*.css" /> - <include name="**/*.xml" /> - <exclude name="**/tests/**" unless="build.include.tests"/> - <exclude name="**/demo/sampler/**" if="build.sampler.disabled" /> - </patternset> + <patternset refid="preprocessable-files" /> </fileset> </copy> + <copy todir="${result-path}/src/demo"> + <filterset refid="version-and-license"/> + <fileset dir="demo/src"> + <patternset refid="preprocessable-files" /> + </fileset> + </copy> + + + <antcontrib:if> + <isset property="build.include.tests"/> + <then> + <copy todir="${result-path}/src/tests"> + <filterset refid="version-and-license"/> + <fileset dir="tests/src"> + <patternset refid="preprocessable-files" /> + </fileset> + </copy> + </then> + </antcontrib:if> + <!-- 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="${result-path}/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 --> <echo>Copying non java/html/css/xml files such as images.</echo> - <copy todir="${result-path}/src"> + <copy todir="${result-path}/src/core"> <fileset dir="src"> - <patternset> - <exclude name="**/.svn" /> - <exclude name="**/*.java" /> - <exclude name="**/*.html" /> - <exclude name="**/*.css" /> - <exclude name="**/*.xml" /> - <exclude name="**/tests/**" unless="build.include.tests"/> - <exclude name="**/demo/sampler/**" if="build.sampler.disabled" /> - </patternset> - </fileset> + <patternset refid="non-preprocessable-files" /> + </fileset> + </copy> + <copy todir="${result-path}/src/demo"> + <fileset dir="demo/src"> + <patternset refid="non-preprocessable-files" /> + </fileset> </copy> + <antcontrib:if> + <isset property="build.include.tests"/> + <then> + <copy todir="${result-path}/src/tests"> + <fileset dir="tests/src"> + <patternset refid="non-preprocessable-files" /> + </fileset> + </copy> + </then> + </antcontrib:if> </target> @@ -737,9 +793,8 @@ <!-- Add demo sources --> <echo>Adding demo sources to WebContent/WEB-INF/src</echo> <copy todir="${output-dir}/WebContent/WEB-INF/src"> - <fileset dir="${result-path}/src"> - <include name="${toolkit-package}/demo/**/*" /> - <exclude name="${toolkit-package}/demo/sampler/**" if="build.sampler.disabled" /> + <fileset dir="${result-path}/src/demo"> + <include name="**/*" /> </fileset> </copy> @@ -757,7 +812,6 @@ <exclude name="VAADIN/themes/tests-magi/**/*" /> <exclude name="VAADIN/themes/tests-featurebrowser/**/*" /> <exclude name="VAADIN/themes/tests*/**/*"/> - <exclude name="VAADIN/themes/sampler/**" if="build.sampler.disabled" /> <include name="demo/**/*" /> <include name="WEB-INF/lib/hsqldb.jar" /> @@ -797,12 +851,14 @@ <target name="compile-java" depends="init, unpack-gwt, check-servlet-version, compile-fileupload, webcontent"> <echo>Compiling src (server-side)</echo> - <!-- Compile --> + + <!-- Compile all sources at the same time as they depend on each other --> <mkdir dir="${result-path}/classes" /> <javac source="1.5" target="1.5" classpathref="compile.classpath.server-side" destdir="${result-path}/classes" debug="true" encoding="UTF-8"> - <src path="${result-path}/src"/> - <!-- This seems to be included by default: include name="${toolkit-package}/**"/ --> - <exclude name="${toolkit-package}/demo/sampler/**" if="build.sampler.disabled" /> + <src path="${result-path}/src/core"/> + <src path="${result-path}/src/demo"/> + <src path="${result-path}/src/tests"/> + <exclude name="${toolkit-package}/tests/**" unless="build.include.tests"/> </javac> </target> @@ -849,7 +905,7 @@ <target name="compile-widgetset-generator-only" depends="init, preprocess-src, compile-java"> <mkdir dir="${result-path}/classes"/> <javac source="1.5" target="1.5" destdir="${result-path}/classes" debug="true" encoding="UTF-8"> - <src path="${result-path}/src"/> + <src path="${result-path}/src/core"/> <include name="com/vaadin/terminal/gwt/widgetsetutils/WidgetMapGenerator.java" /> <!-- <exclude name="**"/> --> <classpath> @@ -864,45 +920,45 @@ <!-- The widgetset generator is currently compiled along with rest of server-side Java. --> <target name="compile-widgetset-generator" depends="init, preprocess-src, compile-java"/> - <target name="compile-widgetset-default"> - <echo>Widget set output directory: ${widgetsets-output-dir}</echo> - <java classname="com.google.gwt.dev.Compiler" failonerror="yes" fork="yes" maxmemory="512m"> - <arg value="-war" /> - <arg value="${widgetsets-output-dir}" /> - <arg value="com.vaadin.terminal.gwt.DefaultWidgetSet" /> - <arg value="-style" /> - <arg value="OBF" /> - <jvmarg value="-Xss8M"/> - <jvmarg value="-Djava.awt.headless=true"/> - <classpath> - <pathelement location="${gwt-dir}/${platform}/gwt-user.jar" /> - <pathelement location="${gwt-dir}/${platform}/${lib-gwt-dev}" /> - <pathelement location="${result-path}/classes" /> - <pathelement location="${result-path}/src" /> - </classpath> - </java> + + <path id="widgetset-compile-classpath"> + <pathelement location="${gwt-dir}/${platform}/gwt-user.jar" /> + <pathelement location="${gwt-dir}/${platform}/${lib-gwt-dev}" /> + <pathelement location="${result-path}/classes" /> + <pathelement location="${result-path}/src/core" /> + <pathelement location="${result-path}/src/demo" /> + </path> + + <target name="compile-widgetset" description="Compiles the widgetset given as the first parameter"> + <fail unless="widgetset" message="No widgetset parameter set"/> + <echo>Compiling widgetset ${widgetset}. Output directory: ${widgetsets-output-dir}</echo> + <java classname="com.google.gwt.dev.Compiler" failonerror="yes" fork="yes" maxmemory="512m"> + <classpath refid="widgetset-compile-classpath"/> + + <arg value="-war" /> + <arg value="${widgetsets-output-dir}" /> + <arg value="-style" /> + <arg value="OBF" /> + <arg value="${widgetset}" /> + + <jvmarg value="-Xss8M"/> + <jvmarg value="-Djava.awt.headless=true"/> + </java> <antcall target="remove-widgetset-gwt-tmp"/> - <echo>Compiled DefaultWidgetSet</echo> + + <echo>Compiled ${widgetset}</echo> + </target> + + <target name="compile-widgetset-default"> + <antcall target="compile-widgetset"> + <param name="widgetset" value="com.vaadin.terminal.gwt.DefaultWidgetSet"/> + </antcall> </target> - + <target name="compile-widgetset-portal-default"> - <java classname="com.google.gwt.dev.Compiler" failonerror="yes" fork="yes" maxmemory="512m"> - <arg value="-war" /> - <arg value="${widgetsets-output-dir}" /> - <arg value="com.vaadin.portal.gwt.PortalDefaultWidgetSet" /> - <arg value="-style" /> - <arg value="OBF" /> - <jvmarg value="-Xss8M"/> - <jvmarg value="-Djava.awt.headless=true"/> - <classpath> - <pathelement location="${gwt-dir}/${platform}/gwt-user.jar" /> - <pathelement location="${gwt-dir}/${platform}/${lib-gwt-dev}" /> - <pathelement location="${result-path}/src" /> - <pathelement location="${result-path}/classes" /> - </classpath> - </java> - <antcall target="remove-widgetset-gwt-tmp"/> - <echo>Compiled PortalDefaultWidgetSet</echo> + <antcall target="compile-widgetset"> + <param name="widgetset" value="com.vaadin.portal.gwt.PortalDefaultWidgetSet"/> + </antcall> </target> <target name="compile-widgetset-reserver"> @@ -923,7 +979,8 @@ <classpath> <pathelement location="${gwt-dir}/${platform}/gwt-user.jar" /> <pathelement location="${gwt-dir}/${platform}/${lib-gwt-dev}" /> - <pathelement location="${result-path}/src" /> + <pathelement location="${result-path}/src/core" /> + <pathelement location="${result-path}/src/demo" /> <!-- demo jars --> <pathelement location="${googlemaps-jar}" /> <!-- demo widgetset sources --> @@ -935,73 +992,22 @@ <echo>Compiled ReservationWidgetSet</echo> </target> - <!-- Building Sampler for installation package is disabled. --> - <target name="compile-widgetset-sampler" unless="build.sampler.disabled"> - <java classname="com.google.gwt.dev.Compiler" failonerror="yes" fork="yes" maxmemory="512m"> - <arg value="-war" /> - <arg value="${widgetsets-output-dir}" /> - <arg value="com.vaadin.demo.sampler.gwt.SamplerWidgetSet" /> - <arg value="-style" /> - <arg value="OBF" /> - <jvmarg value="-Xss8M"/> - <jvmarg value="-Djava.awt.headless=true"/> - <classpath> - <pathelement location="${gwt-dir}/${platform}/gwt-user.jar" /> - <pathelement location="${gwt-dir}/${platform}/${lib-gwt-dev}" /> - <pathelement location="${result-path}/src" /> - <!-- demo widgetset sources --> - <pathelement path="${output-dir}/WebContent/WEB-INF/src" /> - <pathelement location="${result-path}/classes" /> - </classpath> - </java> - <antcall target="remove-widgetset-gwt-tmp"/> - <echo>Compiled SamplerWidgetSet</echo> - </target> - - <target name="compile-widgetset-coverflow"> - <java classname="com.google.gwt.dev.Compiler" failonerror="yes" fork="yes" maxmemory="512m"> - <arg value="-war" /> - <arg value="${widgetsets-output-dir}" /> - <arg value="com.vaadin.demo.coverflow.gwt.CoverflowWidgetSet" /> - <arg value="-style" /> - <arg value="OBF" /> - <jvmarg value="-Xss8M"/> - <jvmarg value="-Djava.awt.headless=true"/> - <classpath> - <pathelement location="${gwt-dir}/${platform}/gwt-user.jar" /> - <pathelement location="${gwt-dir}/${platform}/${lib-gwt-dev}" /> - <pathelement location="${result-path}/src" /> - <!-- demo widgetset sources --> - <pathelement path="${output-dir}/WebContent/WEB-INF/src" /> - <pathelement location="${result-path}/classes" /> - </classpath> - </java> - <antcall target="remove-widgetset-gwt-tmp"/> - <echo>Compiled CoverflowWidgetSet</echo> - </target> + <target name="compile-widgetset-sampler"> + <antcall target="compile-widgetset"> + <param name="widgetset" value="com.vaadin.demo.sampler.gwt.SamplerWidgetSet"/> + </antcall> + </target> + <target name="compile-widgetset-coverflow"> + <antcall target="compile-widgetset"> + <param name="widgetset" value="com.vaadin.demo.coverflow.gwt.CoverflowWidgetSet"/> + </antcall> + </target> + <target name="compile-widgetset-colorpicker"> + <antcall target="compile-widgetset"> + <param name="widgetset" value="com.vaadin.demo.colorpicker.gwt.ColorPickerWidgetSet"/> + </antcall> + </target> - <target name="compile-widgetset-colorpicker"> - <java classname="com.google.gwt.dev.Compiler" failonerror="yes" fork="yes" maxmemory="512m"> - <arg value="-war" /> - <arg value="${widgetsets-output-dir}" /> - <arg value="com.vaadin.demo.colorpicker.gwt.ColorPickerWidgetSet" /> - <arg value="-style" /> - <arg value="OBF" /> - <jvmarg value="-Xss8M"/> - <jvmarg value="-Djava.awt.headless=true"/> - <classpath> - <pathelement location="${gwt-dir}/${platform}/gwt-user.jar" /> - <pathelement location="${gwt-dir}/${platform}/${lib-gwt-dev}" /> - <pathelement location="${result-path}/src" /> - <!-- demo widgetset sources --> - <pathelement path="${output-dir}/WebContent/WEB-INF/src" /> - <pathelement location="${result-path}/classes" /> - </classpath> - </java> - <antcall target="remove-widgetset-gwt-tmp"/> - <echo>Compiled ColorPickerWidgetSet</echo> - </target> - <!-- Builds the client-side engine, i.e., the widgetsets sequentially. --> <!-- Notice that antcall does not fulfill dependencies. --> <target name="compile-client-side-sequential" unless="build.parallel"> @@ -1236,11 +1242,8 @@ <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <target name="javadoc" depends="init, preprocess-src"> <javadoc destdir="${output-dir}/WebContent/docs/api" author="true" version="true" use="true" windowtitle="${product-name}" classpathref="compile.classpath.client-side"> - <packageset dir="${result-path}/src"> + <packageset dir="${result-path}/src/core"> <include name="${toolkit-package}/**" /> - <exclude name="${toolkit-package}/demo/**" /> - <!-- <exclude name="${toolkit-package}/tests/**" /> --> - <exclude name="${toolkit-package}/automatedtests/**" /> </packageset> <doctitle>${javadoc.doctitle}</doctitle> <!-- <header><![CDATA[<script type="text/javascript" src=".html-style/style.js"></script>]]></header> --> |