diff options
author | Mikael Vappula <mikael@vaadin.com> | 2011-12-02 15:05:24 +0200 |
---|---|---|
committer | Mikael Vappula <mikael@vaadin.com> | 2011-12-02 15:05:24 +0200 |
commit | c1ac1f6b1f0675dece725c5b9d04a8823335cb09 (patch) | |
tree | 2f7eff34d3acba9e9ae2a02fedce6cfab29efa2f | |
parent | c7af8ee743fb3c86d6d369da153ff2a2404a0181 (diff) | |
download | vaadin-framework-c1ac1f6b1f0675dece725c5b9d04a8823335cb09.tar.gz vaadin-framework-c1ac1f6b1f0675dece725c5b9d04a8823335cb09.zip |
Cleaned up Ivy configuration
Targets related to Ivy configuration are now in separate common.xml file
which is imported to main build files.
-rw-r--r-- | build/build.xml | 66 | ||||
-rw-r--r-- | build/common.xml | 53 | ||||
-rw-r--r-- | build/ivy/ivy.xml | 37 | ||||
-rw-r--r-- | tests/integration_tests.xml | 14 | ||||
-rw-r--r-- | tests/ivy.xml | 7 | ||||
-rw-r--r-- | tests/test.xml | 33 | ||||
-rw-r--r-- | tests/vaadin-server.xml | 22 |
7 files changed, 122 insertions, 110 deletions
diff --git a/build/build.xml b/build/build.xml index f06de06ba0..29a39ce896 100644 --- a/build/build.xml +++ b/build/build.xml @@ -6,6 +6,9 @@ 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" description="Build public packages."> </target> @@ -19,55 +22,14 @@ <target name="package-liferay-zip" depends="clean-result, init, build, internal-package-liferay"> </target> - <property name="ivy.install.version" value="2.2.0"/> - <property name="ivy.jar.name" value="ivy-${ivy.install.version}.jar"/> - <property name="ivy.jar.dir" value="${user.home}/.ant/lib" /> - <property name="ivy.jar.file" value="${ivy.jar.dir}/${ivy.jar.name}" /> - - <target name="check-ivy-installed"> - <available property="ivy.installed" file="${ivy.jar.file}"/> - <available property="ivy.installed" classname="org.apache.ivy.ant.IvyConfigure" /> - <antcall target="ivy-download" /> - </target> - - <target name="ivy-download" unless="ivy.installed"> - <mkdir dir="${ivy.jar.dir}"/> - <get src="http://repo2.maven.org/maven2/org/apache/ivy/ivy/${ivy.install.version}/ivy-${ivy.install.version}.jar" dest="${ivy.jar.file}" usetimestamp="true"/> - </target> - - <target name="ivy-configure" depends="check-ivy-installed" unless="ivy.resolved"> - <!-- Ivy task definitions --> - <taskdef resource="org/apache/ivy/ant/antlib.xml" uri="antlib:org.apache.ivy.ant" classpath="${ivy.jar.file}" /> - <!-- Ivy settings --> - <property name="ivy.settings.file" value="build/ivy/ivysettings.xml" /> - <ivy:configure /> - </target> - - <target name="ivy-resolve" depends="ivy-configure" unless="ivy.resolved"> + <target name="init-deps" depends="common.init-deps" > <property name="ivy.resolved" value="1" /> - <ivy:resolve file="build/ivy/ivy.xml" resolveid="common"/> - <ivy:cachepath pathid="compile.classpath" conf="compile"/> - <ivy:cachepath pathid="client-side.compile.classpath" conf="client-side.compile"/> - <ivy:cachepath pathid="test.runtime.classpath" conf="test.runtime"/> - <ivy:cachepath pathid="taskdefs.classpath" conf="ant-tasks"/> + <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> - - <target name="init-taskdefs" depends="ivy-resolve"> - <echo>Loading Ant tasks</echo> - - <taskdef resource="emma_ant.properties" classpathref="taskdefs.classpath" /> - - <!-- 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" - classpathref="taskdefs.classpath" /> - - <!-- ant contrib for Maven integration --> - <taskdef resource="org/apache/maven/artifact/ant/antlib.xml" - uri="antlib:org.apache.maven.artifact.ant" classpathref="taskdefs.classpath" /> - </target> - - + <!-- Clean results - - - - - - - - - - - - - - - - - - - - - - - - - --> <target name="clean-result" depends=""> <property file="build/build.properties" /> @@ -99,7 +61,7 @@ <!-- Initialization - - - - - - - - - - - - - - - - - - - - - - - - - - --> <!-- ================================================================== --> - <target name="init" depends="init-taskdefs"> + <target name="init" depends="init-deps"> <!-- Current timestamp in different formats. --> <tstamp> <format property="build.date" pattern="yyyy-MM-dd"/> @@ -473,7 +435,7 @@ <!-- 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" description="Compiles the widgetset given as the first parameter" depends="ivy-resolve"> + <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}"/> @@ -933,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" depends="init-taskdefs" 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" @@ -977,7 +939,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="testbench-tests" depends="init" unless="tests.testbench.skip"> + <target name="testbench-tests" unless="tests.testbench.skip"> <fail unless="product-file" message="The 'product-file' property must be defined."/> <fail unless="version" message="The 'version' property must be defined."/> @@ -1030,7 +992,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" depends="init-taskdefs" 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."/> diff --git a/build/common.xml b/build/common.xml new file mode 100644 index 0000000000..69e8065231 --- /dev/null +++ b/build/common.xml @@ -0,0 +1,53 @@ +<?xml version="1.0"?> + +<project xmlns:antcontrib="antlib:net.sf.antcontrib" + xmlns:artifact="antlib:org.apache.maven.artifact.ant" + xmlns:ivy="antlib:org.apache.ivy.ant" + name="common" + basedir="../" + default="init-deps" > + + <property name="ivy.install.version" value="2.2.0"/> + <property name="ivy.jar.name" value="ivy-${ivy.install.version}.jar"/> + <property name="ivy.jar.dir" value="${user.home}/.ant/lib" /> + <property name="ivy.jar.file" value="${ivy.jar.dir}/${ivy.jar.name}" /> + + <target name="init-deps" description="Configure Ivy dependency management and load common task definitions" + depends="ivy-configure, init-taskdefs" /> + + <target name="check-ivy-installed"> + <available property="ivy.installed" file="${ivy.jar.file}"/> + <available property="ivy.installed" classname="org.apache.ivy.ant.IvyConfigure" /> + <antcall target="common.ivy-download" /> + </target> + + <target name="ivy-download" unless="ivy.installed"> + <mkdir dir="${ivy.jar.dir}"/> + <get src="http://repo2.maven.org/maven2/org/apache/ivy/ivy/${ivy.install.version}/ivy-${ivy.install.version}.jar" dest="${ivy.jar.file}" usetimestamp="true"/> + </target> + + <target name="ivy-configure" depends="check-ivy-installed" > + <!-- Ivy task definitions --> + <taskdef resource="org/apache/ivy/ant/antlib.xml" uri="antlib:org.apache.ivy.ant" classpath="${ivy.jar.file}" /> + <!-- Ivy settings --> + <property name="ivy.settings.file" value="build/ivy/ivysettings.xml" /> + <ivy:configure/> + </target> + + <target name="init-taskdefs" depends="ivy-configure" > + <echo>Loading Ant tasks</echo> + <ivy:resolve file="build/ivy/ivy.xml" conf="taskdefs" /> + <ivy:cachepath pathid="taskdefs.classpath" conf="taskdefs" /> + <taskdef resource="emma_ant.properties" classpathref="taskdefs.classpath" /> + + <!-- 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" + classpathref="taskdefs.classpath" /> + + <!-- ant contrib for Maven integration --> + <taskdef resource="org/apache/maven/artifact/ant/antlib.xml" + uri="antlib:org.apache.maven.artifact.ant" classpathref="taskdefs.classpath" /> + </target> + +</project> diff --git a/build/ivy/ivy.xml b/build/ivy/ivy.xml index 868c5464c4..9dd69e1abe 100644 --- a/build/ivy/ivy.xml +++ b/build/ivy/ivy.xml @@ -4,19 +4,14 @@ <info organisation="com.vaadin" module="vaadin"/> <configurations > - <conf name="compile" extends="client-side.compile" description="Server side compilation dependencies" visibility="private"/> - <conf name="client-side.compile" description="Client side compilation dependencies" visibility="private"/> - <conf name="test.runtime" description="Test runtime dependencies" visibility="private"/> - <conf name="ant-tasks" description="Ant task definitions" visibility="private" /> - <conf name="emma" description="Emma code coverage" visibility="private" /> + <conf name="ss.compile" extends="cs.compile" description="Server side compilation dependencies" visibility="private"/> + <conf name="cs.compile" description="Client side compilation dependencies" visibility="private"/> + <conf name="ss.test.runtime" description="Test runtime dependencies" visibility="private"/> + <conf name="taskdefs" description="Ant task definitions" visibility="private" /> </configurations> <publications /> - <dependencies defaultconf="compile" defaultconfmapping="compile->master"> - - <!-- Servlet 2.3 API--> - <!-- - <dependency org="javax.servlet" name="servlet-api" rev="2.3" /> - --> + <dependencies defaultconf="ss.compile" defaultconfmapping="ss.compile->master"> + <!-- Liferay Portal Service --> <dependency org="com.liferay.portal" name="portal-service" rev="6.0.2" /> <!--Portlet API version 2.0 (JSR-286) --> @@ -25,23 +20,23 @@ <dependency org="com.google.appengine" name="appengine-api-1.0-sdk" rev="1.2.1" /> <!-- GWT user with dependencies (validation-api) --> - <dependency org="com.google.gwt" name="gwt-user" rev="2.4.0" conf="client-side.compile->master" /> - <dependency org="javax.validation" name="validation-api" rev="1.0.0.GA" conf="client-side.compile->master,sources" /> + <dependency org="com.google.gwt" name="gwt-user" rev="2.4.0" conf="cs.compile->master" /> + <dependency org="javax.validation" name="validation-api" rev="1.0.0.GA" conf="cs.compile->master,sources" /> <!-- GWT dev (incl. servlet-api 2.4 classes) --> - <dependency org="com.google.gwt" name="gwt-dev" rev="2.4.0" conf="client-side.compile->master" /> + <dependency org="com.google.gwt" name="gwt-dev" rev="2.4.0" conf="cs.compile->master" /> <!-- Test frameworks & related --> - <dependency org="junit" name="junit" rev="4.5" conf="test.runtime -> master"/> - <dependency org="org.easymock" name="easymock" rev="3.0" conf="test.runtime -> master, runtime(*)"/> - <dependency org="org.hsqldb" name="hsqldb" rev="2.2.6" conf="test.runtime -> master, runtime(*)"/> + <dependency org="junit" name="junit" rev="4.5" conf="ss.test.runtime -> master"/> + <dependency org="org.easymock" name="easymock" rev="3.0" conf="ss.test.runtime -> master, runtime(*)"/> + <dependency org="org.hsqldb" name="hsqldb" rev="2.2.6" conf="ss.test.runtime -> master, runtime(*)"/> <!-- Ant tasks --> - <dependency org="ant-contrib" name="ant-contrib" rev="1.0b3" conf="ant-tasks ->master"/> - <dependency org="org.apache.maven" name="maven-ant-tasks" rev="2.0.10" conf="ant-tasks ->master"/> + <dependency org="ant-contrib" name="ant-contrib" rev="1.0b3" conf="taskdefs ->master"/> + <dependency org="org.apache.maven" name="maven-ant-tasks" rev="2.0.10" conf="taskdefs ->master"/> <!-- Emma --> - <dependency org="emma" name="emma_ant" rev="2.0.5312" conf="test.runtime,ant-tasks ->master"/> - <dependency org="emma" name="emma" rev="2.0.5312-patched" conf="test.runtime,ant-tasks,emma ->*"/> + <dependency org="emma" name="emma_ant" rev="2.0.5312" conf="ss.test.runtime,taskdefs ->master"/> + <dependency org="emma" name="emma" rev="2.0.5312-patched" conf="ss.test.runtime,taskdefs ->*"/> </dependencies> diff --git a/tests/integration_tests.xml b/tests/integration_tests.xml index 2f10394ee0..c96c93bbe4 100644 --- a/tests/integration_tests.xml +++ b/tests/integration_tests.xml @@ -2,6 +2,9 @@ <project name="Vaadin Integration Tests" basedir="." default="integration-test-all">
+ <!-- Import common targets -->
+ <import file="../build/common.xml" />
+
<!-- Target deploying demo.war -->
<fail unless="test.integration.server" message="test.integration.server must be set for integration tests to run"/>
@@ -27,14 +30,7 @@ <property name="ant.hub" value="${test.integration.antfile}" />
<property name="user" value="${test.integration.user}" />
<property name="passphrase" value="" />
-
- <!-- add ant contrib -->
- <taskdef resource="net/sf/antcontrib/antcontrib.properties">
- <classpath>
- <pathelement location="../build/lib/ant-contrib-1.0b3.jar"/>
- </classpath>
- </taskdef>
-
+
<!-- Upload war to deploy to ssh host -->
<target name="integration-test-upload-demo">
<scp file="${demo.war}" todir="${user}@${test.integration.server}:integration-tests/servers/demo.war" keyfile="${sshkey.file}" passphrase="${passphrase}" />
@@ -261,7 +257,7 @@ </target>
<!-- Upload demo, clean error screenshots and test deployment on all servers -->
- <target name="integration-test-all">
+ <target name="integration-test-all" depends="common.init-deps">
<parallel>
<trycatch property="tried">
diff --git a/tests/ivy.xml b/tests/ivy.xml index 3fdaf81ef1..6c7171166b 100644 --- a/tests/ivy.xml +++ b/tests/ivy.xml @@ -3,11 +3,14 @@ xsi:noNamespaceSchemaLocation= "http://ant.apache.org/ivy/schemas/ivy.xsd"> <info organisation="com.vaadin" module="tests"/> - <configurations defaultconfmapping="*->jetty"> + <configurations> <conf name="jetty" visibility="private" /> + <conf name="emma" visibility="private" /> + <conf name="server" visibility="private" /> </configurations> <publications /> <dependencies> - <dependency org="org.mortbay.jetty" name="jetty" rev="6.1.7" conf="jetty->default(*)" /> + <dependency org="org.mortbay.jetty" name="jetty" rev="6.1.7" conf="server,jetty->default(*)" /> + <dependency org="emma" name="emma" rev="2.0.5312-patched" conf="server,emma -> default(*)"/> </dependencies> </ivy-module>
\ No newline at end of file diff --git a/tests/test.xml b/tests/test.xml index 51d2bae3a6..5ea9547fa4 100644 --- a/tests/test.xml +++ b/tests/test.xml @@ -2,6 +2,12 @@ <project xmlns:antcontrib="antlib:net.sf.antcontrib" xmlns:ivy="antlib:org.apache.ivy.ant" name="Run Vaadin Testbench Tests" basedir="." default="run-and-clean-up"> + + <!-- Import common targets --> + <import file="../build/common.xml" /> + <!-- Import targets for server management --> + <import file="vaadin-server.xml" as="server"/> + <!-- ================================================================== --> <!-- Configuration --> <!-- ================================================================== --> @@ -28,20 +34,19 @@ <property name="com.vaadin.testbench.debug" value="false"/> <!-- Temporary output directory, created and removed by this script --> - <!-- <property name="test-output-dir" value="../build/test-output" /> --> - <fail unless="test-output-dir" message="The 'test-output-dir' property must be defined." /> - - <!-- Include targets for server management --> - <include file="vaadin-server.xml" as="server"/> + <fail unless="test-output-dir" message="The 'test-output-dir' property must be defined." /> <property name="class-dir" value="${test-output-dir}/classes" /> - <!-- classpath must include test bench jar and its dependencies --> - <!-- TODO emma--> - <path id="classpath"> - <fileset dir="${com.vaadin.testbench.lib.dir}" includes="**/*.jar" /> - <fileset dir="../build/lib" includes="emma*.jar" /> - </path> + <target name="initialize" depends="common.init-deps"> + <ivy:resolve conf="emma"/> + <ivy:cachepath pathid="emma.lib" conf="emma" /> + <!-- classpath must include test bench jar and its dependencies --> + <path id="classpath"> + <fileset dir="${com.vaadin.testbench.lib.dir}" includes="**/*.jar" /> + <path refid="emma.lib" /> + </path> + </target> <!-- fileset containing all TestBench tests to run --> <fileset dir=".." id="html-test-files"> @@ -97,6 +102,7 @@ <sequential> <antcall target="execute-tests"> <param name="target" value="@{target}" /> + <reference refid="classpath" /> </antcall> </sequential> </antcontrib:for> @@ -159,14 +165,13 @@ <!-- ================================================================== --> <!-- The default target. --> - <target name="run-and-clean-up" depends="check-parameters,remove-error-screens,run-tests"> - </target> + <target name="run-and-clean-up" depends="check-parameters,remove-error-screens,run-tests" /> <!-- Also starts the server. --> <target name="test-package"> <parallel> <daemons> - <antcall inheritall="true" inheritrefs="true" target="server.deploy-and-start" /> + <ant antfile="vaadin-server.xml" inheritall="true" inheritrefs="true" target="deploy-and-start" /> </daemons> <sequential> <antcall target="server.wait-for-startup" /> diff --git a/tests/vaadin-server.xml b/tests/vaadin-server.xml index 6445106d35..99117238ea 100644 --- a/tests/vaadin-server.xml +++ b/tests/vaadin-server.xml @@ -2,7 +2,10 @@ <project xmlns:antcontrib="antlib:net.sf.antcontrib" xmlns:ivy="antlib:org.apache.ivy.ant" name="vaadin-server" - default="deploy-and-start"> + default="deploy-and-start" basedir="."> + + <!-- Import common targets --> + <import file="../build/common.xml" /> <target name="check-params"> <fail unless="output-dir" message="The 'output-dir' (usually build/result/vaadin-xxx) should be given to test script." /> @@ -11,13 +14,6 @@ <fail unless="testing.testarea" message="The 'testing.testarea' property must be defined." /> <property name="webroot" value="${testing.testarea}/${package.name}/WebContent" /> </target> - - <target name="ivy-resolve"> - <ivy:resolve file="ivy.xml" resolveid="tests"/> - <ivy:cachepath pathid="jetty.lib" conf="jetty" resolveid="tests" /> - <!-- Emma libs from "common" resolve --> - <ivy:cachepath pathid="emma.lib" conf="emma" resolveid="common"/> - </target> <target name="prepare-testing-area" depends="check-params"> <echo> Package name: ${package.name}</echo> @@ -31,15 +27,17 @@ <unzip src="${package.filename}" dest="${testing.testarea}/${package.name}/WebContent" /> </target> - <target name="deploy-and-start" depends="ivy-resolve, prepare-testing-area"> + <target name="deploy-and-start" depends="init-deps, prepare-testing-area"> <property name="webroot" value="${testing.testarea}/${package.name}/WebContent"></property> + + <ivy:resolve file="ivy.xml"/> + <ivy:cachepath pathid="server" conf="server" /> <java classname="com.vaadin.launcher.DemoLauncher" fork="yes" dir="${testing.testarea}/${package.name}" resultproperty="server.start.result"> <arg value="--nogui=1" /> <classpath> <path location="${webroot}/WEB-INF/classes" /> <fileset dir="${webroot}/WEB-INF/lib/" includes="*.jar" /> - <path refid="jetty.lib" /> - <path refid="emma.lib" /> + <path refid="server" /> </classpath> <jvmarg value="-Demma.coverage.out.file=${testing.testarea}/${package.name}/war.ec"/> <jvmarg value="-Djava.awt.headless=true"/> @@ -48,7 +46,7 @@ <target name="wait-for-startup"> <echo>Waiting for Servlet Container to start up.</echo> - <waitfor maxwait="30" maxwaitunit="second" checkevery="1" checkeveryunit="second" timeoutproperty="server.start.failed"> + <waitfor maxwait="30" maxwaitunit="second" checkevery="3" checkeveryunit="second" timeoutproperty="server.start.failed"> <http url="http://localhost:8888"/> </waitfor> <fail if="server.start.failed" message="Server startup failed" /> |