diff options
author | Artur Signell <artur@vaadin.com> | 2011-12-08 13:39:10 +0200 |
---|---|---|
committer | Artur Signell <artur@vaadin.com> | 2011-12-08 13:39:10 +0200 |
commit | 8f95be653356e45692680d595bd96b77df3f949f (patch) | |
tree | 7abcbea316b92f615f6441e5d44526290585e87a /build/build.xml | |
parent | a56ef07855844334323cbd266b3268df505c0335 (diff) | |
parent | 0d5878f6406c02efe3da2371c2482beee14aef72 (diff) | |
download | vaadin-framework-8f95be653356e45692680d595bd96b77df3f949f.tar.gz vaadin-framework-8f95be653356e45692680d595bd96b77df3f949f.zip |
Merge remote-tracking branch 'origin/ivyconfig'
Diffstat (limited to 'build/build.xml')
-rw-r--r-- | build/build.xml | 144 |
1 files changed, 53 insertions, 91 deletions
diff --git a/build/build.xml b/build/build.xml index b62db3d57e..7453d55a5c 100644 --- a/build/build.xml +++ b/build/build.xml @@ -2,11 +2,15 @@ <project xmlns:antcontrib="antlib:net.sf.antcontrib" xmlns:artifact="antlib:org.apache.maven.artifact.ant" + xmlns:ivy="antlib:org.apache.ivy.ant" name="Vaadin" basedir="../" default="package-all"> + <!-- Import common targets --> + <import file="./common.xml" /> + <!--Call one of package-* targets unless you understand what you are doing. --> - <target name="package-all" depends="clean-all, init, build, javadoc, internal-package-war, internal-package-liferay, differences, internal-package-liferay" description="Build public packages."> + <target name="package-all" depends="clean-all, init, build, javadoc, internal-package-war, internal-package-liferay, differences" description="Build public packages."> </target> <target name="package-jar" depends="clean-result, init, vaadin.jar" description="Create vaadin-x.y.z.jar file."> @@ -17,31 +21,14 @@ <target name="package-liferay-zip" depends="clean-result, init, build, internal-package-liferay"> </target> - - <!-- Locations of Ant task JARs - build properties not yet read at this point --> - <property name="ant.task.jar.antcontrib" value="build/lib/ant-contrib-1.0b3.jar" /> - <property name="ant.task.jar.maven" value="build/lib/maven-ant-tasks-2.0.10.jar" /> - - <path id="emma.lib" > - <pathelement location="build/lib/emma_ant.jar" /> - <pathelement location="build/lib/emma-2.0.5312-patched.jar" /> - </path> - <taskdef resource="emma_ant.properties" classpathref="emma.lib" /> - - <!-- ant contrib required for flow control (for loop, if, property override) --> - <!-- Note that we have to use a namespace to avoid clash when running sub-ant. --> - <taskdef uri="antlib:net.sf.antcontrib" resource="net/sf/antcontrib/antlib.xml"> - <classpath> - <pathelement location="${ant.task.jar.antcontrib}" /> - </classpath> - </taskdef> - - <!-- ant contrib for Maven integration --> - <path id="maven-ant-tasks.classpath" path="${ant.task.jar.maven}" /> - <typedef resource="org/apache/maven/artifact/ant/antlib.xml" - uri="antlib:org.apache.maven.artifact.ant" - classpathref="maven-ant-tasks.classpath" /> + <target name="init-deps" depends="common.init-deps" > + <property name="ivy.resolved" value="1" /> + <ivy:resolve file="build/ivy/ivy.xml" resolveid="common" conf="ss.compile, cs.compile, ss.test.runtime"/> + <ivy:cachepath pathid="compile.classpath" conf="ss.compile"/> + <ivy:cachepath pathid="client-side.compile.classpath" conf="cs.compile"/> + <ivy:cachepath pathid="test.runtime.classpath" conf="ss.test.runtime"/> + </target> <!-- Clean results - - - - - - - - - - - - - - - - - - - - - - - - - --> <target name="clean-result" depends=""> @@ -74,7 +61,7 @@ <!-- Initialization - - - - - - - - - - - - - - - - - - - - - - - - - - --> <!-- ================================================================== --> - <target name="init"> + <target name="init" depends="init-deps"> <!-- Current timestamp in different formats. --> <tstamp> <format property="build.date" pattern="yyyy-MM-dd"/> @@ -131,6 +118,9 @@ <!-- init-nonpackage target before calling this main init target. --> <property name="widgetsets-output-dir" value="${output-dir}/WebContent/VAADIN/widgetsets" /> + <!-- Build helpers --> + <property name="buildhelpers-src" value="build/buildhelpers" /> + <property name="buildhelpers-classes" value="${result-path}/buildhelpers/classes" /> <!-- Create Output Directory Hierarchy --> <mkdir dir="${output-dir}/WebContent" /> @@ -141,29 +131,6 @@ <mkdir dir="${output-dir}/WebContent/WEB-INF" /> <mkdir dir="${output-dir}/WebContent/WEB-INF/lib" /> <mkdir dir="${output-dir}/WebContent/WEB-INF/classes" /> - - <!-- Construct classpath used by java and javadoc compilation --> - <path id="compile.classpath"> - <pathelement path="build/lib/servlet.jar" /> - <fileset dir="lib/core"> - <include name="**/*.jar"/> - - <!-- Exclude these as they contain Servlet API 2.4. --> - <!-- The gwt-*-noservlet.jar are then used instead. --> - <exclude name="**/servlet-api*.jar"/> - </fileset> - <fileset dir="lib/tests"> - <include name="**/*.jar"/> - </fileset> - </path> - <path id="compile.classpath.server-side"> - <path refid="compile.classpath"/> - </path> - <path id="compile.classpath.client-side"> - <path refid="compile.classpath"/> - <pathelement path="${lib-gwt-user}" /> - <pathelement path="${lib-gwt-dev}" /> - </path> </target> <target name="internal-package-war"> @@ -356,24 +323,13 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <target name="webcontent" depends="preprocess-src,defaulttheme"> - <!-- copy 3rd part libraries used by tests --> - <copy todir="${output-dir}/WebContent/tests/lib"> - <fileset dir="lib/core"> - <include name="jetty/**/*" /> - </fileset> - <fileset dir="build/lib"> - <include name="emma-2.0.5312-patched.jar" /> - </fileset> - </copy> - <!-- Add WebContent --> - <echo>Adding VAADIN/themes, demo and hsqldb.jar files.</echo> + <echo>Adding VAADIN/themes and demo files.</echo> <copy todir="${output-dir}/WebContent"> <fileset dir="WebContent"> <exclude name="**/.svn" /> <!-- TODO check what is necessary --> <include name="demo/**/*" /> - <include name="WEB-INF/lib/hsqldb.jar" /> <include name="VAADIN/themes/**/*" /> <include name="META-INF/**/*" /> </fileset> @@ -420,7 +376,11 @@ <!-- 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"> + <javac source="1.5" target="1.5" includeantruntime="false" destdir="${result-path}/classes" debug="true" encoding="UTF-8"> + <classpath> + <path refid="compile.classpath" /> + <path refid="test.runtime.classpath" /> + </classpath> <src path="${result-path}/src/core"/> <src path="${result-path}/src/tests"/> <src path="${result-path}/src/junit"/> @@ -428,7 +388,10 @@ </target> <target name="compile-helpers" depends="init"> - <javac source="1.5" target="1.5" srcdir="build/buildhelpers" classpath="build/smartsprites/lib/smartsprites-0.2.3-itmill.jar"/> + <mkdir dir="${buildhelpers-classes}" /> + <ivy:cachepath pathid="buildhelpers.dependencies" resolveId="buildhelpers" conf="compile" file="build/ivy/buildhelpers-ivy.xml"/> + <javac source="1.5" target="1.5" includeantruntime="false" srcdir="${buildhelpers-src}" + classpathref="buildhelpers.dependencies" destdir="${buildhelpers-classes}" debug="true" encoding="UTF-8" /> </target> <target name="defaulttheme" depends="init, compile-helpers"> @@ -437,10 +400,8 @@ <arg value="-version" /> <arg value="${version.full}"/> <classpath> - <pathelement location="build/buildhelpers" /> - <fileset dir="build/smartsprites/lib"> - <include name="*.jar"/> - </fileset> + <path location="${buildhelpers-classes}" /> + <path refid="buildhelpers.dependencies" /> </classpath> <jvmarg value="-Djava.awt.headless=true"/> </java> @@ -473,23 +434,17 @@ <!-- The widgetset generator is currently compiled along with rest of server-side Java. --> <target name="compile-widgetset-generator" depends="init, preprocess-src, compile-java"/> - - - <path id="widgetset-compile-classpath"> - <pathelement location="${lib-gwt-user}" /> - <pathelement location="${lib-gwt-dev}" /> - <pathelement location="${lib-gwt-validation}" /> - <pathelement location="${lib-gwt-validation-src}" /> - <pathelement location="${result-path}/classes" /> - <pathelement location="${result-path}/src/core" /> - </path> - <target name="compile-widgetset" description="Compiles the widgetset given as the first parameter"> + <target name="compile-widgetset" depends="init-deps" 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> + <mkdir dir="${widgetsets-output-dir}"/> <java classname="com.google.gwt.dev.Compiler" failonerror="yes" fork="yes" maxmemory="512m"> - <classpath refid="widgetset-compile-classpath"/> - + <classpath> + <path refid="client-side.compile.classpath" /> + <pathelement location="${result-path}/classes" /> + <pathelement location="${result-path}/src/core" /> + </classpath> <arg value="-war" /> <arg value="${widgetsets-output-dir}" /> <arg value="-style" /> @@ -509,12 +464,14 @@ <target name="compile-widgetset-default"> <antcall target="compile-widgetset"> + <reference refid="client-side.compile.classpath" /> <param name="widgetset" value="com.vaadin.terminal.gwt.DefaultWidgetSet"/> </antcall> </target> <target name="compile-widgetset-portal-default" unless="compile.only.default-widgetset"> <antcall target="compile-widgetset"> + <reference refid="client-side.compile.classpath" /> <param name="widgetset" value="com.vaadin.portal.gwt.PortalDefaultWidgetSet"/> </antcall> </target> @@ -525,8 +482,8 @@ <target name="compile-client-side" depends="compile-server-side"> <echo>Compiling widget sets in parallel.</echo> <parallel threadsperprocessor="1"> - <antcall target="compile-widgetset-default"/> - <antcall target="compile-widgetset-portal-default"/> + <antcall inheritrefs="true" target="compile-widgetset-default"/> + <antcall inheritrefs="true" target="compile-widgetset-portal-default"/> </parallel> </target> @@ -636,7 +593,7 @@ <java classname="com.vaadin.buildhelpers.GeneratePackageExports" failonerror="true" fork="yes"> <arg value="${output-dir}/WebContent/WEB-INF/lib/${lib-jar-name}"/> <classpath> - <pathelement location="build/buildhelpers" /> + <pathelement location="${buildhelpers-classes}" /> </classpath> </java> @@ -672,7 +629,7 @@ <target name="javadoc" depends="init, preprocess-src"> <property name="javadoc.destdir" value="${output-dir}/WebContent/docs/api"/> - <javadoc destdir="${javadoc.destdir}" author="true" version="true" use="true" windowtitle="${product-name}" classpathref="compile.classpath.client-side"> + <javadoc destdir="${javadoc.destdir}" author="true" version="true" use="true" windowtitle="${product-name}" classpathref="compile.classpath"> <packageset dir="${result-path}/src/core"> <include name="${toolkit-package}/**" /> </packageset> @@ -938,7 +895,7 @@ </target> <!-- Assumes java classes have been compiled but depends does not work out well as this is run from a <parallel> task--> - <target name="server-side-tests" unless="tests.serverside.skip"> + <target name="server-side-tests" depends="init-deps" unless="tests.serverside.skip"> <emma enabled="${emma.enabled}" > <instr instrpath="${result-path}/classes" mode="copy" @@ -957,9 +914,9 @@ <junit printsummary="yes"> <classpath> <pathelement path="${result-path}/junit_emma_classes" /> - <pathelement path="${result-path}/classes" /> - <path refid="emma.lib" /> - <path refid="compile.classpath"/> + <pathelement path="${result-path}/classes" /> + <path refid="test.runtime.classpath"></path> + <path refid="compile.classpath"></path> </classpath> <jvmarg value="-Demma.coverage.out.file=../${result-path}/unittests.ec" /> @@ -1008,8 +965,8 @@ <!-- Convert tests to run multiple times if failed. --> <property name="retries" value="2"/> - - <property name="package.filename" value="${package.filename}"/> + + <property name="package.filename" value="${basedir}/${package.filename}"/> <property name="testing.testarea" value="/tmp/testarea"/> <property name="package.name" value="${package.name}"/> <property name="test-output-dir" value="../build/test-output" /> @@ -1018,6 +975,9 @@ <property name="com.vaadin.testbench.lib.dir" value="${com.vaadin.testbench.lib.dir}"/> <property name="com.vaadin.testbench.debug" value="${com.vaadin.testbench.debug}"/> <property name="com.vaadin.testbench.screenshot.block.error" value="${com.vaadin.testbench.screenshot.block.error}"/> + + <property name="deps.initialized" value="${deps.initialized}"/> + </ant> <emma enabled="${emma.enabled}" > @@ -1034,7 +994,7 @@ </target> <!-- Assumes java classes have been compiled but depends does not work out well as this is run from a <parallel> task--> - <target name="integration-tests" unless="tests.integration.skip"> + <target name="integration-tests" depends="init-deps" unless="tests.integration.skip"> <!-- Parameters for the test.xml script. --> <fail unless="com.vaadin.testbench.tester.host" message="The 'com.vaadin.testbench.tester.host' property must be defined."/> <fail unless="com.vaadin.testbench.lib.dir" message="The 'com.vaadin.testbench.lib.dir' property must be defined."/> @@ -1055,6 +1015,8 @@ <property name="sshkey.file" value="${sshkey.file}" /> <property name="passphrase" value="${passphrase}" /> <property name="demo.war" value="${tests.war}"/> + + <property name="deps.initialized" value="${deps.initialized}"/> </ant> </target> </project> |