diff options
Diffstat (limited to 'build')
-rw-r--r-- | build/build.xml | 66 | ||||
-rw-r--r-- | build/common.xml | 53 | ||||
-rw-r--r-- | build/ivy/ivy.xml | 37 |
3 files changed, 83 insertions, 73 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> |