2007-10-16 09:35:08 +02:00
<?xml version="1.0"?>
2009-10-26 20:41:17 +01:00
<project xmlns:antcontrib= "antlib:net.sf.antcontrib"
xmlns:artifact="antlib:org.apache.maven.artifact.ant"
2009-05-14 16:31:22 +02:00
name="Vaadin"
2009-04-07 15:50:23 +02:00
basedir="../" default="package-all">
2007-10-16 09:35:08 +02:00
2010-03-08 14:28:41 +01:00
<!-- Call one of package - * targets unless you understand what you are doing. -->
2011-11-25 15:14:15 +01:00
<target name= "package-all" depends= "clean-all, init, build, javadoc, internal-package-war, internal-package-liferay, differences" description= "Build public packages." >
2009-10-26 20:41:17 +01:00
</target>
2011-08-17 10:32:29 +02:00
<target name= "package-jar" depends= "clean-result, init, vaadin.jar" description= "Create vaadin-x.y.z.jar file." >
2010-01-11 20:02:41 +01:00
</target>
2011-08-18 13:02:10 +02:00
<target name= "package-war" depends= "clean-result, init, build, javadoc, internal-package-war, differences" >
2009-10-26 20:41:17 +01:00
</target>
2011-08-18 09:54:50 +02:00
<target name= "package-liferay-zip" depends= "clean-result, init, build, internal-package-liferay" >
2009-03-25 08:36:55 +01:00
</target>
2011-07-27 10:15:35 +02:00
<!-- 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" />
2011-10-19 15:57:32 +02:00
<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" />
2011-07-27 10:15:35 +02:00
2009-04-07 15:50:23 +02:00
<!-- 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 >
2011-07-27 10:15:35 +02:00
<pathelement location= "${ant.task.jar.antcontrib}" />
2009-04-07 15:50:23 +02:00
</classpath>
</taskdef>
2009-10-26 20:41:17 +01:00
<!-- ant contrib for Maven integration -->
2011-07-27 10:15:35 +02:00
<path id= "maven-ant-tasks.classpath" path= "${ant.task.jar.maven}" />
2009-10-26 20:41:17 +01:00
<typedef resource= "org/apache/maven/artifact/ant/antlib.xml"
uri="antlib:org.apache.maven.artifact.ant"
classpathref="maven-ant-tasks.classpath" />
2012-01-16 08:01:28 +01:00
2009-10-26 20:41:17 +01:00
<!-- Clean results - - - - - - - - - - - - - - - - - - - - - - - - - -->
2012-01-16 08:01:28 +01:00
<target name= "clean-result" depends= "build.properties" >
2009-04-07 15:50:23 +02:00
<!-- Clean build result directory. -->
2009-10-26 20:41:17 +01:00
<delete dir= "${result-path}" includes= "**/*" followsymlinks= "false" defaultexcludes= "false" includeemptydirs= "true" failonerror= "false" />
2009-04-07 15:50:23 +02:00
</target>
2012-01-16 08:01:28 +01:00
<target name= "build.properties" >
<property file= "build/build.properties" />
<property file= "build/VERSION.properties" />
<property file= "build/GWT-VERSION.properties" />
<!-- result source and classes folders -->
<property name= "result-src-core" value= "${result-path}/src/core" />
<property name= "result-src-junit" value= "${result-path}/src/junit" />
<property name= "result-src-testbench" value= "${result-path}/src/testbench" />
<property name= "result-classes-core" value= "${result-path}/classes/core" />
<property name= "result-classes-junit" value= "${result-path}/classes/junit" />
<property name= "result-classes-testbench" value= "${result-path}/classes/testbench" />
2012-01-10 16:29:57 +01:00
<!-- Folder where Emma instrumented classes are placed (if Emma is used) -->
2012-01-12 09:05:53 +01:00
<property name= "result-classes-core-for-emma-war" value= "${result-path}/classes/emma-war" />
<property name= "result-classes-core-for-emma-junit" value= "${result-path}/classes/emma-junit" />
2012-01-16 08:01:28 +01:00
</target>
2010-12-10 09:46:42 +01:00
<target name= "clean-all" depends= "clean-result" >
2009-04-07 15:50:23 +02:00
</target>
2008-12-30 22:34:36 +01:00
<!-- ================================================================== -->
2008-12-31 15:52:39 +01:00
<!-- Check versions. -->
2008-12-30 22:34:36 +01:00
<!-- ================================================================== -->
2008-12-31 15:52:39 +01:00
<!-- Java compiler version. -->
2008-12-30 22:34:36 +01:00
<target name= "check-java-version" >
<condition property= "java.version.matches" >
2009-02-20 13:38:56 +01:00
<or >
<equals arg1= "${ant.java.version}" arg2= "1.5" />
<isset property= "ignoreversion" />
</or>
2008-12-30 22:34:36 +01:00
</condition>
2009-05-14 16:31:22 +02:00
<fail unless= "java.version.matches" message= "Java version is ${ant.java.version}, but Vaadin must be compiled with genuine Java 1.5 compiler. Use -Dignoreversion=1 for ant to ignore the version check." />
2008-12-30 22:34:36 +01:00
<echo > Java version is ${ant.java.version} as required.</echo>
</target>
2008-12-31 15:52:39 +01:00
<!-- Check Servlet API version. -->
<!-- We must use Servlet API 2.3 to catch incompatibilities.. -->
2008-12-30 22:34:36 +01:00
<target name= "check-servlet-version" >
2008-12-31 15:52:39 +01:00
<available classpathref= "compile.classpath" classname= "javax.servlet.Servlet" property= "servlet.available" />
2008-12-30 23:10:00 +01:00
<fail unless= "servlet.available" message= "Java Servlet API library is not available." />
<echo > Java Servlet API is available.</echo>
2008-12-31 15:52:39 +01:00
<available classpathref= "compile.classpath" classname= "javax.servlet.ServletRequestListener" property= "servlet.version.is-2.4" />
2010-01-12 00:11:50 +01:00
<fail if= "servlet.version.is-2.4" message= "Java Servlet API 2.4 or later detected. Vaadin must be compiled exactly with Servlet API 2.3." />
2008-12-30 23:10:00 +01:00
<echo > Java Servlet API specification 2.3 used.</echo>
2008-12-30 22:34:36 +01:00
</target>
<!-- ================================================================== -->
2009-10-26 20:41:17 +01:00
<!-- Initialization - - - - - - - - - - - - - - - - - - - - - - - - - - -->
2008-12-30 22:34:36 +01:00
<!-- ================================================================== -->
2008-12-31 19:28:35 +01:00
2012-01-16 08:01:28 +01:00
<target name= "init" depends= "check-java-version, build.properties" >
2009-10-20 16:46:59 +02:00
<!-- Current timestamp in different formats. -->
2009-05-25 16:02:45 +02:00
<tstamp >
<format property= "build.date" pattern= "yyyy-MM-dd" />
</tstamp>
2009-10-20 16:46:59 +02:00
<tstamp >
<format property= "build.date.compact" pattern= "yyyyMMdd" />
</tstamp>
2011-09-29 14:44:21 +02:00
<antcontrib:propertyregex property= "version.major" input= "${version}" regexp= "([^\.]*)\.([^\.]*)\.([^\.]*)" select= "\1" />
<antcontrib:propertyregex property= "version.minor" input= "${version}" regexp= "([^\.]*)\.([^\.]*)\.([^\.]*)" select= "\2" />
<antcontrib:propertyregex property= "version.revision" input= "${version}" regexp= "([^\.]*)\.([^\.]*)\.([^\.]*)" select= "\3" />
2011-08-18 09:54:50 +02:00
2009-10-26 20:41:17 +01:00
<!-- Default full version name. -->
2009-10-20 16:46:59 +02:00
<!-- Nightly and other TeamCity builds will define their own. -->
<property name= "version.full" value= "${version}.dev-${build.date.compact}" />
2009-10-26 20:41:17 +01:00
<echo > Base Version: ${version}</echo>
<echo > Full Version: ${version.full}</echo>
2009-05-25 16:02:45 +02:00
2011-09-29 14:44:21 +02:00
<!-- Other properties -->
2011-08-18 09:54:50 +02:00
<property file= "build/html-style.properties" />
2012-01-16 08:01:28 +01:00
<echo > Vaadin package is: ${vaadin-package}</echo>
2008-12-31 15:52:39 +01:00
2009-10-26 20:41:17 +01:00
<!-- Create result dir unless already exists -->
<mkdir dir= "${result-path}" />
2008-06-13 15:38:09 +02:00
2011-10-19 15:57:32 +02:00
<!-- Create dirs that might be used by the test coverage generation -->
2012-01-12 10:41:02 +01:00
<mkdir dir= "${result-classes-core-for-emma-war}" />
<mkdir dir= "${result-classes-core-for-emma-junit}" />
2011-10-19 15:57:32 +02:00
<mkdir dir= "${result-path}/coverage" />
2010-01-11 15:16:33 +01:00
<echo > We are using gwt version ${gwt-version}.</echo>
2007-11-25 20:22:35 +01:00
2009-10-26 20:41:17 +01:00
<!-- Destination files -->
2010-04-20 16:43:39 +02:00
<property name= "base-name" value= "${product-file}-${version.full}" />
<property name= "lib-jar-name" value= "${base-name}.jar" />
<property name= "lib-sources-jar-name" value= "${base-name}-sources.jar" />
<property name= "lib-javadoc-jar-name" value= "${base-name}-javadoc.jar" />
2011-09-29 14:44:21 +02:00
<property name= "test-war-filename" value= "${product-file}-tests-${version.full}.war" />
2007-11-25 20:22:35 +01:00
2009-10-26 20:41:17 +01:00
<echo message= "Prepared to build ${product-file} version ${version.full} packages" />
2007-11-25 20:22:35 +01:00
2009-10-26 20:41:17 +01:00
<!-- Output directory -->
2010-04-20 16:43:39 +02:00
<property name= "output-dir" value= "${result-path}/${base-name}" />
2009-10-26 20:41:17 +01:00
<mkdir dir= "${output-dir}" />
2007-11-30 14:06:00 +01:00
2009-10-26 20:41:17 +01:00
<!-- Where widgetsets are written to. -->
2009-10-26 19:45:07 +01:00
<!-- When not building a package, widgetsets should be written to -->
2009-10-26 20:41:17 +01:00
<!-- WebContent/VAADIN/widgetsets, which needs to be set in -->
2009-10-26 19:45:07 +01:00
<!-- init - nonpackage target before calling this main init target. -->
2009-10-26 20:41:17 +01:00
<property name= "widgetsets-output-dir" value= "${output-dir}/WebContent/VAADIN/widgetsets" />
2011-09-29 14:44:21 +02:00
2009-10-26 20:41:17 +01:00
<!-- Create Output Directory Hierarchy -->
<mkdir dir= "${output-dir}/WebContent" />
<mkdir dir= "${output-dir}/WebContent/demo" />
<mkdir dir= "${output-dir}/WebContent/docs" />
<mkdir dir= "${output-dir}/WebContent/docs/api" />
2011-08-17 10:32:29 +02:00
<mkdir dir= "${output-dir}/WebContent/tests" />
2009-10-26 20:41:17 +01:00
<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" />
2011-09-29 14:44:21 +02:00
<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" />
2010-07-01 12:31:40 +02:00
<exclude name= "**/gwt-dev.jar" />
<exclude name= "**/gwt-user.jar" />
2011-09-29 14:44:21 +02:00
</fileset>
<fileset dir= "lib/tests" >
<include name= "**/*.jar" />
</fileset>
2009-10-26 20:41:17 +01:00
</path>
<path id= "compile.classpath.server-side" >
2008-12-31 15:52:39 +01:00
<path refid= "compile.classpath" />
2009-10-26 20:41:17 +01:00
</path>
<path id= "compile.classpath.client-side" >
2008-12-31 15:52:39 +01:00
<path refid= "compile.classpath" />
2009-12-18 15:21:35 +01:00
<pathelement path= "${lib-gwt-user}" />
<pathelement path= "${lib-gwt-dev}" />
2009-10-26 20:41:17 +01:00
</path>
</target>
<target name= "internal-package-war" >
2011-08-17 10:32:29 +02:00
<echo > Building Test WAR</echo>
2009-05-18 14:55:34 +02:00
2011-08-18 13:26:28 +02:00
<echo > Adding test class files and resources and launcher configuration.</echo>
<copy todir= "${output-dir}/WebContent/WEB-INF/classes" >
2012-01-16 08:01:28 +01:00
<fileset dir= "${result-classes-testbench}" >
2012-01-10 16:04:42 +01:00
<include name= "${vaadin-package}/tests/**/*" />
<include name= "${vaadin-package}/launcher/**" />
2011-08-18 13:26:28 +02:00
</fileset>
2012-01-10 17:30:36 +01:00
<fileset dir= "${result-classes-junit}" >
2012-01-10 17:07:34 +01:00
<!-- VaadinClasses is used by both JUnit and TestBench tests -->
2012-01-12 08:59:10 +01:00
<include name= "**/VaadinClasses*.class" />
2012-01-10 17:07:34 +01:00
</fileset>
2011-09-29 14:44:21 +02:00
<!-- test resources -->
<fileset dir= "tests/testbench" >
2012-01-16 08:01:28 +01:00
<include name= "${vaadin-package}/tests/**/*" />
2011-09-29 14:44:21 +02:00
<!-- Pre - processed versions of these copied above -->
<exclude name= "**/*.java" />
<exclude name= "**/*.html" />
<exclude name= "**/*.css" />
<exclude name= "**/*.xml" />
2011-11-28 13:43:27 +01:00
</fileset>
<!-- Include files required by the DemoLauncher/DevelopmentServerLauncher -->
<fileset dir= "tests/testbench" >
2012-01-16 08:01:28 +01:00
<include name= "${vaadin-package}/launcher/jetty-webdefault.xml" />
<include name= "${vaadin-package}/launcher/keystore" />
2011-08-18 13:26:28 +02:00
</fileset>
</copy>
2011-08-17 10:32:29 +02:00
<war warfile= "${result-path}/${test-war-filename}" >
2009-10-26 20:41:17 +01:00
<fileset dir= "${output-dir}/WebContent" >
2011-09-29 14:44:21 +02:00
<!-- Already in JAR -->
2011-10-03 08:39:35 +02:00
<!-- Not excluded because used from WAR by portal integration tests
2011-09-30 14:10:45 +02:00
<exclude name= "VAADIN/themes/base/**/*" />
<exclude name= "VAADIN/themes/chameleon/**/*" />
<exclude name= "VAADIN/themes/liferay/**/*" />
<exclude name= "VAADIN/themes/reindeer/**/*" />
<exclude name= "VAADIN/themes/runo/**/*" />
<exclude name= "VAADIN/widgetsets/com.vaadin.terminal.gwt.DefaultWidgetSet/**/*" />
2011-10-03 08:39:35 +02:00
-->
2011-08-18 09:54:50 +02:00
2011-09-29 14:44:21 +02:00
<!-- Not needed for testing -->
2011-08-18 09:54:50 +02:00
<exclude name= "docs/**/*" />
<exclude name= "docs" />
2011-09-29 14:44:21 +02:00
2009-10-26 20:41:17 +01:00
<include name= "**/*" />
</fileset>
</war>
</target>
<target name= "internal-package-liferay" depends= "internal-package-war" >
<!-- We assume the needed files are put in place by internal - package - war -->
<echo > Building Liferay zip</echo>
2010-04-20 16:43:39 +02:00
<zip zipfile= "${result-path}/${base-name}-liferay.zip" >
2009-10-26 20:41:17 +01:00
<zipfileset prefix= "VAADIN/widgetsets/com.vaadin.portal.gwt.PortalDefaultWidgetSet" dir= "${output-dir}/WebContent/VAADIN/widgetsets/com.vaadin.portal.gwt.PortalDefaultWidgetSet" >
<patternset >
<include name= "**/*" />
</patternset>
</zipfileset>
<zipfileset prefix= "VAADIN/themes" dir= "${output-dir}/WebContent/VAADIN/themes" >
<patternset >
<include name= "base/**/*" />
2011-07-28 15:39:15 +02:00
<include name= "chameleon/**/*" />
2009-10-26 20:41:17 +01:00
<include name= "liferay/**/*" />
<include name= "runo/**/*" />
<include name= "reindeer/**/*" />
</patternset>
</zipfileset>
</zip>
2010-04-20 16:43:39 +02:00
<echo > ##teamcity[publishArtifacts '${result-path}/${base-name}-liferay.zip']</echo>
2009-10-26 20:41:17 +01:00
</target>
2011-08-17 10:32:29 +02:00
<!-- Build server - side, client - side, libraries, and tests. -->
2010-04-20 16:43:39 +02:00
<!-- The client - side needs to be built before vaadin.jar, because the vaadin.jar -->
2009-10-26 19:45:07 +01:00
<!-- require the default widgetset and doing otherwise would build it twice. -->
<!-- However, since compiling the server - side is required by the client - side -->
<!-- compilation, the server - side will actually be built before it. -->
2009-10-26 20:41:17 +01:00
<target name= "build"
2012-01-16 08:01:28 +01:00
depends="compile-server-side, compile-tests, compile-client-side, vaadin.jar, vaadin-sources.jar"
2009-10-26 20:41:17 +01:00
description="Build package required files, without packing them.">
</target>
2012-01-16 08:01:28 +01:00
<target name= "compile-server-side" depends= "compile-core, webcontent" />
2009-10-26 20:41:17 +01:00
<!-- Copy and preprocess sources for packaging
NOTE: Replaces <version > </version> tags with build version tag for some "textual" files
-->
<target name= "preprocess-src" >
2011-09-29 14:44:21 +02:00
<!--
Source directories in the project are
* src (Vaadin core)
* tests/testbench (TestBench test cases)
* tests/server-side (Server-side JUnit test cases)
* tests/client-side (Client-side JUnit test cases)
These are copied to
2012-01-10 15:54:52 +01:00
* ${result-path}/src/core
* ${result-path}/src/tests
* ${result-path}/src/junit
2012-01-16 08:01:28 +01:00
And compiled to
2012-01-10 15:54:52 +01:00
* ${result-path}/classes/core
* ${result-path}/classes/tests
* ${result-path}/classes/junit
2012-01-16 08:01:28 +01:00
2011-09-29 14:44:21 +02:00
Java/HTML/CSS/XML files are filtered so the license is added and the version is set.
Other files are just copied.
-->
2011-12-08 13:31:15 +01:00
<loadfile property= "VaadinApache2LicenseForJavaFiles" srcFile= "build/VaadinApache2LicenseForJavaFiles.txt" />
2011-09-29 14:44:21 +02:00
2012-01-16 08:01:28 +01:00
<mkdir dir= "${result-path}/src" />
<mkdir dir= "${result-src-core}" />
<mkdir dir= "${result-src-testbench}" />
<mkdir dir= "${result-src-junit}" />
2011-09-29 14:44:21 +02:00
<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>
2009-10-27 08:57:12 +01:00
<filterset id= "version-and-license" >
2011-12-08 13:31:15 +01:00
<filter token= "VaadinApache2LicenseForJavaFiles" value= "${VaadinApache2LicenseForJavaFiles}" />
2009-10-27 08:57:12 +01:00
<filter token= "VERSION" value= "${version.full}" />
</filterset>
2011-09-29 14:44:21 +02:00
<!-- Adds a style class to JavaDoc <pre> tags for style customization. -->
2010-03-08 14:28:41 +01:00
<filterset id= "pre-css-style" begintoken= " * <" endtoken= ">" >
<filter token= "pre" value= " * <pre class='code'>" />
</filterset>
2009-10-27 08:57:12 +01:00
2009-10-26 20:41:17 +01:00
<echo > Copying src directory and processing copied files.</echo>
<echo > Replacing < version> tag with build version for java/html/css/xml files.</echo>
2012-01-16 08:01:28 +01:00
<copy todir= "${result-src-core}" overwrite= "yes" >
2011-09-29 14:44:21 +02:00
<filterset refid= "version-and-license" />
2010-03-08 14:28:41 +01:00
<filterset refid= "pre-css-style" />
2009-10-26 20:41:17 +01:00
<fileset dir= "src" >
2009-10-27 08:57:12 +01:00
<patternset refid= "preprocessable-files" />
2009-10-26 20:41:17 +01:00
</fileset>
</copy>
2012-01-16 08:01:28 +01:00
<copy todir= "${result-src-testbench}" >
2011-08-17 10:32:29 +02:00
<filterset refid= "version-and-license" />
2011-09-29 14:44:21 +02:00
<fileset dir= "tests/testbench" >
<patternset refid= "preprocessable-files" />
</fileset>
</copy>
2012-01-16 08:01:28 +01:00
<copy todir= "${result-src-junit}" >
2011-09-29 14:44:21 +02:00
<filterset refid= "version-and-license" />
<fileset dir= "tests/server-side" >
<patternset refid= "preprocessable-files" />
</fileset>
<fileset dir= "tests/client-side" >
<patternset refid= "preprocessable-files" />
</fileset>
</copy>
2009-10-26 20:41:17 +01:00
<!-- 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>
2012-01-16 08:01:28 +01:00
<copy todir= "${result-src-core}" >
2009-10-26 20:41:17 +01:00
<fileset dir= "src" >
2011-09-29 14:44:21 +02:00
<patternset refid= "non-preprocessable-files" />
</fileset>
</copy>
2012-01-16 08:01:28 +01:00
<copy todir= "${result-src-testbench}" >
2011-09-29 14:44:21 +02:00
<fileset dir= "tests/testbench" >
<patternset refid= "non-preprocessable-files" />
</fileset>
</copy>
2012-01-16 08:01:28 +01:00
<copy todir= "${result-src-junit}" >
2011-09-29 14:44:21 +02:00
<fileset dir= "tests/server-side" >
<patternset refid= "non-preprocessable-files" />
</fileset>
<fileset dir= "tests/client-side" >
<patternset refid= "non-preprocessable-files" />
</fileset>
2009-10-27 08:57:12 +01:00
</copy>
2009-10-26 20:41:17 +01:00
</target>
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
2007-10-16 09:35:08 +02:00
WebContent
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
2009-10-26 20:41:17 +01:00
<target name= "webcontent" depends= "preprocess-src,defaulttheme" >
2011-08-17 10:32:29 +02:00
<!-- copy 3rd part libraries used by tests -->
<copy todir= "${output-dir}/WebContent/tests/lib" >
2009-10-27 10:20:23 +01:00
<fileset dir= "lib/core" >
2009-10-26 20:41:17 +01:00
<include name= "jetty/**/*" />
</fileset>
2011-10-19 15:57:32 +02:00
<fileset dir= "build/lib" >
<include name= "emma-2.0.5312-patched.jar" />
</fileset>
2009-10-26 20:41:17 +01:00
</copy>
<!-- Add WebContent -->
2012-01-16 08:01:28 +01:00
<echo > Adding VAADIN/themes and META-INF</echo>
2009-10-26 20:41:17 +01:00
<copy todir= "${output-dir}/WebContent" >
<fileset dir= "WebContent" >
<exclude name= "**/.svn" />
2011-08-03 07:07:28 +02:00
<!-- TODO check what is necessary -->
2009-10-26 20:41:17 +01:00
<include name= "WEB-INF/lib/hsqldb.jar" />
<include name= "VAADIN/themes/**/*" />
<include name= "META-INF/**/*" />
</fileset>
</copy>
2011-08-17 10:32:29 +02:00
<!-- Add servlet and portlet configuration files from WebContent -->
2010-06-21 14:30:45 +02:00
<copy todir= "${output-dir}/WebContent/WEB-INF" >
<fileset dir= "WebContent/WEB-INF" >
<include name= "liferay-*.xml" />
<include name= "portlet.xml" />
2011-08-17 10:32:29 +02:00
<include name= "web.xml" />
2009-10-26 20:41:17 +01:00
</fileset>
</copy>
2011-09-29 14:44:21 +02:00
2011-08-18 11:38:36 +02:00
<!-- These should go to various JARs -->
<copy todir= "${output-dir}/WebContent" >
<filterchain >
<expandproperties />
<replacetokens begintoken= "@" endtoken= "@" >
<token key= "version" value= "${version.full}" />
</replacetokens>
2011-08-23 17:34:08 +02:00
<replacetokens begintoken= "@" endtoken= "@" >
<token key= "version-minor" value= "${version.major}.${version.minor}" />
</replacetokens>
2011-08-18 11:38:36 +02:00
<replacetokens begintoken= "@" endtoken= "@" >
<token key= "builddate" value= "${build.date}" />
</replacetokens>
2011-08-23 17:34:08 +02:00
<replacetokens begintoken= "@" endtoken= "@" >
<token key= "gwt-version" value= "${gwt-version}" />
</replacetokens>
2011-08-18 11:38:36 +02:00
</filterchain>
<fileset dir= "WebContent" >
<exclude name= "**/.svn" />
<include name= "release-notes.html" />
2011-08-23 14:22:37 +02:00
<include name= "license.html" />
2011-09-23 10:21:50 +02:00
<include name= "css/**" />
<include name= "img/**" />
2011-08-18 11:38:36 +02:00
</fileset>
</copy>
2009-10-26 20:41:17 +01:00
</target>
2012-01-16 08:01:28 +01:00
<target name= "compile-core" depends= "init, preprocess-src" >
2009-10-26 20:41:17 +01:00
<echo > Compiling src (server-side)</echo>
2012-01-16 08:01:28 +01:00
<!-- Compile core sources first as the other sources depend on these -->
<mkdir dir= "${result-classes-core}" />
<javac source= "1.5" target= "1.5" classpathref= "compile.classpath.server-side" destdir= "${result-classes-core}" debug= "true" encoding= "UTF-8" includeantruntime= "false" >
<src path= "${result-src-core}" />
</javac>
</target>
<target name= "compile-tests" depends= "compile-core" >
<echo > Compiling src (Server and client side JUnit tests)</echo>
<!-- Compile server and client side JUnit tests -->
<mkdir dir= "${result-classes-junit}" />
<javac source= "1.5" target= "1.5" classpathref= "compile.classpath.server-side" destdir= "${result-classes-junit}" debug= "true" encoding= "UTF-8" includeantruntime= "false" >
<classpath path= "${result-classes-core}" > </classpath>
<src path= "${result-src-junit}" />
</javac>
<echo > Compiling src (TestBench tests)</echo>
<!-- Compile TestBench tests -->
<mkdir dir= "${result-classes-testbench}" />
<javac source= "1.5" target= "1.5" classpathref= "compile.classpath.server-side" destdir= "${result-classes-testbench}" debug= "true" encoding= "UTF-8" includeantruntime= "false" >
<classpath path= "${result-classes-junit}" > </classpath>
<classpath path= "${result-classes-core}" > </classpath>
<src path= "${result-src-testbench}" />
2009-10-26 20:41:17 +01:00
</javac>
2012-01-16 08:01:28 +01:00
2009-10-26 20:41:17 +01:00
</target>
2011-09-29 14:44:21 +02:00
<target name= "compile-helpers" depends= "init" >
2012-01-16 08:01:28 +01:00
<javac source= "1.5" target= "1.5" srcdir= "build/buildhelpers" classpath= "build/smartsprites/lib/smartsprites-0.2.3-itmill.jar" includeantruntime= "false" />
2011-09-29 14:44:21 +02:00
</target>
2010-10-22 15:53:28 +02:00
<target name= "defaulttheme" depends= "init, compile-helpers" >
<echo > Combining default themes css files</echo>
2009-10-26 20:41:17 +01:00
<java classname= "com.vaadin.buildhelpers.CompileDefaultTheme" failonerror= "yes" fork= "yes" >
2011-09-29 14:44:21 +02:00
<arg value= "-version" />
<arg value= "${version.full}" />
2009-10-26 20:41:17 +01:00
<classpath >
<pathelement location= "build/buildhelpers" />
<fileset dir= "build/smartsprites/lib" >
<include name= "*.jar" />
</fileset>
</classpath>
2009-05-19 16:58:50 +02:00
<jvmarg value= "-Djava.awt.headless=true" />
2009-10-26 20:41:17 +01:00
</java>
</target>
2007-11-25 20:22:35 +01:00
2009-10-26 20:41:17 +01:00
<target name= "testtarget" >
<echo > TEST TARGET CALLED</echo>
</target>
2008-06-13 15:38:09 +02:00
2009-10-26 19:45:07 +01:00
<!-- ================================================================== -->
<!-- Widget Set Compilation -->
<!-- ================================================================== -->
<!-- Widget set compilation process: -->
<!-- 1. Preprocess sources -->
<!-- 2. Compile server - side java -->
<!-- 3. Generate widget set definitions and classes -->
<!-- 4. Compile widget sets -->
<!-- -->
<!-- Widget sets can be built for two purposes: -->
<!-- * for building installation packages -->
<!-- * for building single widget sets during development -->
<!-- Targets: widgetset - <name> -->
2009-10-26 20:41:17 +01:00
<target name= "remove-widgetset-gwt-tmp" >
<echo > Removing widgetset temp files</echo>
2011-07-27 10:15:35 +02:00
<delete dir= "${widgetsets-output-dir}/.gwt-tmp" includeemptydirs= "true" />
2011-09-29 14:44:21 +02:00
<!-- This is generated by GWT 2.3+ for rpcPolicyManifest and symbolMaps, cannot disable -->
2011-07-27 10:15:35 +02:00
<delete dir= "${widgetsets-output-dir}/WEB-INF" includeemptydirs= "true" failonerror= "false" />
2009-10-26 20:41:17 +01:00
</target>
2009-04-14 14:13:25 +02:00
2009-10-26 20:41:17 +01:00
<!-- The widgetset generator is currently compiled along with rest of server - side Java. -->
2012-01-16 08:01:28 +01:00
<target name= "compile-widgetset-generator" depends= "compile-core" />
2009-10-26 20:41:17 +01:00
2009-10-27 08:57:12 +01:00
<path id= "widgetset-compile-classpath" >
2009-12-18 15:21:35 +01:00
<pathelement location= "${lib-gwt-user}" />
<pathelement location= "${lib-gwt-dev}" />
2011-04-08 14:13:01 +02:00
<pathelement location= "${lib-gwt-validation}" />
<pathelement location= "${lib-gwt-validation-src}" />
2012-01-16 08:01:28 +01:00
<pathelement location= "${result-classes-core}" />
<pathelement location= "${result-src-core}" />
2009-10-27 08:57:12 +01:00
</path>
2011-09-29 14:44:21 +02:00
<target name= "compile-widgetset" description= "Compiles the widgetset given as the first parameter" >
<fail unless= "widgetset" message= "No widgetset parameter set" />
2011-12-05 13:12:11 +01:00
<property name= "widgetset-style" value= "OBF" />
2012-03-13 10:42:58 +01:00
<property name= "widgetset-localWorkers" value= "4" />
2011-12-05 13:12:11 +01:00
<property name= "widgetset-extraParams" value= "" />
2011-09-29 14:44:21 +02:00
<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" />
2011-12-05 13:12:11 +01:00
<arg value= "${widgetset-style}" />
2011-09-29 14:44:21 +02:00
<arg value= "-localWorkers" />
2011-12-05 13:12:11 +01:00
<arg value= "${widgetset-localWorkers}" />
<arg line= "${widgetset-extraParams}" />
2011-09-29 14:44:21 +02:00
<arg value= "${widgetset}" />
<jvmarg value= "-Xss8M" />
<jvmarg value= "-XX:MaxPermSize=256M" />
<jvmarg value= "-Djava.awt.headless=true" />
</java>
2009-10-26 20:41:17 +01:00
<antcall target= "remove-widgetset-gwt-tmp" />
2011-09-29 14:44:21 +02:00
2009-10-27 08:57:12 +01:00
<echo > Compiled ${widgetset}</echo>
2011-09-29 14:44:21 +02:00
</target>
2009-10-27 08:57:12 +01:00
<target name= "compile-widgetset-default" >
2011-09-29 14:44:21 +02:00
<antcall target= "compile-widgetset" >
<param name= "widgetset" value= "com.vaadin.terminal.gwt.DefaultWidgetSet" />
</antcall>
2009-10-26 20:41:17 +01:00
</target>
2011-09-29 14:44:21 +02:00
2010-02-03 18:47:02 +01:00
<target name= "compile-widgetset-portal-default" unless= "compile.only.default-widgetset" >
2011-09-29 14:44:21 +02:00
<antcall target= "compile-widgetset" >
<param name= "widgetset" value= "com.vaadin.portal.gwt.PortalDefaultWidgetSet" />
</antcall>
2009-10-26 20:41:17 +01:00
</target>
2011-08-17 10:32:29 +02:00
<!-- Compiles all widgetsets. -->
<!-- This is called when building packages and when compiling all -->
<!-- widgetsets, but not when compiling individual widgetsets. -->
<target name= "compile-client-side" depends= "compile-server-side" >
2009-10-26 20:41:17 +01:00
<echo > Compiling widget sets in parallel.</echo>
<parallel threadsperprocessor= "1" >
<antcall target= "compile-widgetset-default" />
<antcall target= "compile-widgetset-portal-default" />
</parallel>
</target>
2009-09-23 16:16:46 +02:00
2009-10-26 20:41:17 +01:00
<!-- Definitions for building local components, i.e., not for an installation package. -->
2012-01-16 08:01:28 +01:00
<target name= "init-nonpackage" depends= "build.properties" >
2009-10-26 20:41:17 +01:00
<!-- Definitions for building the client - side. -->
<property name= "widgetsets-output-dir" value= "WebContent/VAADIN/widgetsets" />
2008-06-19 15:21:54 +02:00
2010-01-11 15:16:33 +01:00
<echo > We are using ${lib-gwt-dev}.</echo>
2009-10-26 20:41:17 +01:00
<echo > Widget sets output dir: ${widgetsets-output-dir}</echo>
</target>
2008-06-28 18:31:44 +02:00
2009-10-26 20:41:17 +01:00
<!-- Builds all widgetsets locally, i.e., not for an installation package. -->
<target name= "widgetsets" depends= "init-nonpackage, init, compile-widgetset-generator, compile-client-side" />
2009-07-07 15:01:04 +02:00
2009-10-26 20:41:17 +01:00
<!-- Build each widgetset locally, i.e., not for an installation package. -->
<target name= "widgetset-default" depends= "init-nonpackage, init, compile-widgetset-generator, compile-widgetset-default" />
<target name= "widgetset-portal-default" depends= "init-nonpackage, init, compile-widgetset-generator, compile-widgetset-portal-default" />
2009-10-26 19:45:07 +01:00
<!-- ================================================================== -->
2011-08-17 10:32:29 +02:00
<!-- Libraries and Tests -->
2009-10-26 19:45:07 +01:00
<!-- ================================================================== -->
<!-- Compile the Vaadin library JAR. -->
<!-- Need only the default widgetset for this, but can't depend -->
<!-- specifically on it, because dependence does not see compiled -->
<!-- individual widgetsets, because antcall does not fulfill -->
<!-- dependencies. -->
2010-10-22 15:53:28 +02:00
<target name= "vaadin.jar" depends= "compile-server-side, compile-client-side, compile-helpers" >
2010-04-20 16:43:39 +02:00
<echo > Creating JAR (server-side) ${lib-jar-name}</echo>
<!-- Create Vaadin JAR -->
2009-10-26 20:41:17 +01:00
<mkdir dir= "${output-dir}/META-INF" />
<echo file= "${output-dir}/META-INF/VERSION" > ${version.full}</echo>
<echo file= "${output-dir}/META-INF/GWT-VERSION" > ${gwt-version}</echo>
2011-10-19 15:57:32 +02:00
<emma enabled= "${emma.enabled}" >
2012-01-16 08:01:28 +01:00
<instr instrpath= "${result-classes-core}"
2012-01-12 09:05:53 +01:00
destdir="${result-classes-core-for-emma-war}"
2011-10-19 15:57:32 +02:00
mode="copy"
metadatafile="${result-path}/war.es"
merge="false"
>
<filter includes= "com.vaadin.*" />
<filter excludes= "com.vaadin.terminal.gwt.*" />
</instr>
</emma>
2009-10-26 20:41:17 +01:00
<jar jarfile= "${output-dir}/WebContent/WEB-INF/lib/${lib-jar-name}"
2011-10-19 15:57:32 +02:00
compress="true" manifest="build/package/META-INF/MANIFEST.MF" duplicate="preserve">
2009-10-26 20:41:17 +01:00
<metainf dir= "${output-dir}/META-INF" />
<manifest >
2010-11-11 23:29:51 +01:00
<attribute name= "Vaadin-Package-Version" value= "1" />
2009-10-26 20:41:17 +01:00
<attribute name= "Vaadin-Widgetsets" value= "com.vaadin.terminal.gwt.DefaultWidgetSet" />
2010-10-14 09:49:28 +02:00
<attribute name= "Implementation-Vendor" value= "Vaadin Ltd" />
<attribute name= "Implementation-URL" value= "http://vaadin.com" />
<attribute name= "Implementation-Version" value= "${version.full}" />
<attribute name= "GWT-Version" value= "${gwt-version}" />
2011-04-21 14:17:16 +02:00
<attribute name= "GWT-Version-Dependencies" value= "${gwt-version-dependencies}" />
2009-10-26 20:41:17 +01:00
<attribute name= "Bundle-Version" value= "${version.full}" />
</manifest>
2011-10-19 15:57:32 +02:00
<!-- Include any instrumented class files before the normal classes -->
2012-01-12 10:41:02 +01:00
<fileset dir= "${result-classes-core-for-emma-war}" />
2012-01-16 08:01:28 +01:00
<fileset dir= "${result-classes-core}" />
2009-10-26 20:41:17 +01:00
<!-- add sources -->
2012-01-16 08:01:28 +01:00
<fileset dir= "${result-src-core}" />
2009-10-26 20:41:17 +01:00
<fileset dir= "${output-dir}/WebContent" >
<patternset >
<include name= "VAADIN/widgetsets/com.vaadin.terminal.gwt.DefaultWidgetSet/**/*" />
<include name= "VAADIN/themes/base/**/*" />
2011-07-28 15:39:15 +02:00
<include name= "VAADIN/themes/chameleon/**/*" />
2011-06-06 11:53:37 +02:00
<include name= "VAADIN/themes/liferay/**/*" />
2009-10-26 20:41:17 +01:00
<include name= "VAADIN/themes/runo/**/*" />
<include name= "VAADIN/themes/reindeer/**/*" />
2011-09-29 14:44:21 +02:00
2011-08-18 11:38:36 +02:00
<include name= "release-notes.html" />
2011-08-23 16:59:38 +02:00
<include name= "license.html" />
2011-09-23 10:21:50 +02:00
<include name= "css/**" />
<include name= "img/**" />
2009-10-26 20:41:17 +01:00
</patternset>
</fileset>
</jar>
2011-09-29 14:44:21 +02:00
<!-- Generate the Export - Package attribute in the manifest of the JAR -->
<java classname= "com.vaadin.buildhelpers.GeneratePackageExports" failonerror= "true" fork= "yes" >
<arg value= "${output-dir}/WebContent/WEB-INF/lib/${lib-jar-name}" />
2010-10-22 15:53:28 +02:00
<classpath >
<pathelement location= "build/buildhelpers" />
</classpath>
</java>
2011-09-29 14:44:21 +02:00
2011-03-16 10:04:05 +01:00
<echo > ##teamcity[publishArtifacts '${output-dir}/WebContent/WEB-INF/lib/${lib-jar-name}']</echo>
2009-10-26 20:41:17 +01:00
</target>
2011-09-29 14:44:21 +02:00
<target name= "vaadin-sources.jar" depends= "init" >
2010-04-20 16:43:39 +02:00
<jar file= "${result-path}/${lib-sources-jar-name}" compress= "true" >
2012-01-16 08:01:28 +01:00
<fileset dir= "${result-src-core}" >
2011-09-29 14:44:21 +02:00
<patternset >
<include name= "**/*.java" />
</patternset>
</fileset>
2011-08-18 11:38:36 +02:00
<fileset dir= "${output-dir}/WebContent" >
<patternset >
<include name= "release-notes.html" />
2011-08-23 16:59:38 +02:00
<include name= "license.html" />
2011-09-23 10:21:50 +02:00
<include name= "css/**" />
<include name= "img/**" />
2011-08-18 11:38:36 +02:00
</patternset>
</fileset>
2010-04-20 16:43:39 +02:00
</jar>
2011-09-29 14:44:21 +02:00
</target>
2009-04-07 15:50:23 +02:00
<!-- ================================================================== -->
<!-- Documentation -->
<!-- ================================================================== -->
2009-10-26 20:41:17 +01:00
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
2009-04-07 15:50:23 +02:00
<!-- Documentation: Add Javadoc to doc -->
2009-10-26 20:41:17 +01:00
<!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
<target name= "javadoc" depends= "init, preprocess-src" >
2010-03-08 14:28:41 +01:00
<property name= "javadoc.destdir" value= "${output-dir}/WebContent/docs/api" />
2011-09-29 14:44:21 +02:00
2010-03-08 14:28:41 +01:00
<javadoc destdir= "${javadoc.destdir}" author= "true" version= "true" use= "true" windowtitle= "${product-name}" classpathref= "compile.classpath.client-side" >
2012-01-10 16:04:42 +01:00
<packageset dir= "${result-src-core}" />
2009-10-26 20:41:17 +01:00
<doctitle > ${javadoc.doctitle}</doctitle>
<!-- <header><![CDATA[<script type="text/javascript" src=".html - style/style.js"></script>]]></header> -->
<bottom > ${javadoc.bottom}</bottom>
<link offline= "true" href= "http://java.sun.com/j2se/1.5.0/docs/api/" packagelistLoc= "build/javadoc/j2se-1.5.0" />
<link offline= "true" href= "http://java.sun.com/j2ee/1.4/docs/api/" packagelistLoc= "build/javadoc/j2ee-1.4" />
</javadoc>
2010-03-08 14:28:41 +01:00
2011-09-29 14:44:21 +02:00
<!-- Create a javadoc jar, mainly for Maven -->
2010-04-20 16:43:39 +02:00
<jar file= "${result-path}/${lib-javadoc-jar-name}" compress= "true" >
2011-09-29 14:44:21 +02:00
<fileset dir= "${javadoc.destdir}" >
<patternset >
<include name= "**" />
</patternset>
</fileset>
2011-08-18 11:38:36 +02:00
<fileset dir= "${output-dir}/WebContent" >
<patternset >
<include name= "release-notes.html" />
2011-08-23 16:59:38 +02:00
<include name= "license.html" />
2011-09-23 10:21:50 +02:00
<include name= "css/**" />
<include name= "img/**" />
2011-08-18 11:38:36 +02:00
</patternset>
</fileset>
2010-04-20 16:43:39 +02:00
</jar>
2010-03-08 14:28:41 +01:00
<!-- Append local style definitions. -->
<echo > Appending local style definitions</echo>
<concat destfile= "${javadoc.destdir}/stylesheet.css" append= "yes" >
<filelist dir= "build/javadoc" files= "stylesheet-local.css" />
</concat>
2009-10-26 20:41:17 +01:00
</target>
2009-09-29 13:22:27 +02:00
<!-- ================================================================== -->
<!-- Difference to previous release package. -->
<!-- ================================================================== -->
2009-10-28 15:55:21 +01:00
<!-- This should be called after the Linux package is ready. -->
<target name= "differences" if= "build.differences" >
2010-01-11 15:36:42 +01:00
<exec executable= "python" searchpath= "true" failonerror= "true" output= "${result-path}/differences.txt" >
2009-10-26 20:41:17 +01:00
<arg value= "build/bin/package-diff.py" />
<arg value= "${version.full}" />
</exec>
2009-10-28 15:55:21 +01:00
2010-01-11 15:36:42 +01:00
<echo > ##teamcity[publishArtifacts '${result-path}/differences.txt']</echo>
2009-10-26 20:41:17 +01:00
</target>
2011-09-29 14:44:21 +02:00
2011-06-23 12:43:26 +02:00
<!-- ================================================================== -->
<!-- Custom build. -->
<!-- ================================================================== -->
<!-- Main target for the custom build. -->
2011-09-29 14:44:21 +02:00
<!-- Need to read custom build configuration before calling clean - result -->
2011-08-25 11:44:53 +02:00
<target name= "custom-build" depends= "custom-build-init, clean-result, nightly-init, init, build" >
2011-06-23 12:43:26 +02:00
</target>
<!-- Initialize a custom build. -->
<target name= "custom-build-init" >
<echo > Preparing a custom build with properties file: ${build.properties.file}</echo>
2011-09-29 14:44:21 +02:00
<!-- Custom build support -->
<antcontrib:if >
<isset property= "build.properties.file" />
<then >
<tstamp >
<format property= "build.date.compact" pattern= "yyyyMMdd" />
</tstamp>
<property file= "${build.properties.file}" />
<property name= "version" value= "${vaadin.version}" />
<property name= "version.full" value= "${version}-${build.date.compact}" />
</then>
<!-- Otherwise version is set by the target "init" -->
</antcontrib:if>
</target>
2011-06-23 12:43:26 +02:00
<target name= "custom-build-maven-publish" >
2011-09-29 14:44:21 +02:00
<antcall target= "nightly-maven-publish" />
2011-06-23 12:43:26 +02:00
</target>
2009-09-29 13:22:27 +02:00
2009-03-25 08:36:55 +01:00
<!-- ================================================================== -->
<!-- Nightly build. -->
<!-- ================================================================== -->
2009-04-07 15:50:23 +02:00
<!-- Main target for the nightly build. -->
2011-09-29 14:44:21 +02:00
<target name= "nightly" depends= "clean-result, nightly-init, init, build, javadoc, differences" >
2009-04-07 15:50:23 +02:00
</target>
2009-03-25 16:50:22 +01:00
<!-- Initialize a nightly build. -->
2012-01-16 08:01:28 +01:00
<target name= "nightly-init" depends= "build.properties" >
2009-03-25 16:50:22 +01:00
<!-- Mandatory parameters. -->
<fail unless= "build.number" message= "The build.number property must be defined." />
<fail unless= "nightly.publish" message= "The nightly.publish property must be defined." />
<!-- Optional parameters. -->
<property name= "build.tag" value= "dev" />
2009-10-20 16:46:59 +02:00
<echo > Base version: ${version}</echo>
2009-03-25 16:50:22 +01:00
<echo > Build number: ${build.number}</echo>
<echo > Build tag: ${build.tag}</echo>
<echo > Publish target: ${nightly.publish}</echo>
2011-09-29 14:44:21 +02:00
<echo > Demo publish target: ${nightly.demo.publish}</echo>
2009-03-25 16:50:22 +01:00
2009-03-25 08:36:55 +01:00
<!-- Set build number. -->
<tstamp >
<format property= "nightly.date" pattern= "yyyyMMdd" />
</tstamp>
2009-10-20 16:46:59 +02:00
<property name= "version.full" value= "${version}.${build.tag}-${nightly.date}-c${build.number}" />
<echo > Version will be: ${version.full}</echo>
2009-03-25 16:50:22 +01:00
<!-- Tell TeamCity the build name. Have to do it this way, because -->
<!-- this script needs to get the plain build number as a parameter. -->
2009-10-26 20:20:06 +01:00
<echo > ##teamcity[buildNumber '${version}-c${build.number}']</echo>
2009-03-25 08:36:55 +01:00
</target>
2009-03-31 14:15:01 +02:00
<target name= "nightly-teamcity-publish" >
<!-- Publish as a TeamCity artifact. -->
<echo > ##teamcity[publishArtifacts '${output-dir}/WebContent/WEB-INF/lib/${lib-jar-name}']</echo>
</target>
2009-04-07 15:50:23 +02:00
<!-- Copies the nightly build artifacts to the download server. -->
2009-03-31 14:15:01 +02:00
<target name= "nightly-download-publish" if= "nightly.publish" >
<!-- Publish to the download server. -->
2011-08-18 09:54:50 +02:00
<echo > Installing ${output-dir}/WebContent/WEB-INF/lib/${lib-jar-name} to ${nightly.publish}</echo>
2009-03-25 16:50:22 +01:00
<echo > Hopefully you have permissions for the copy operation with SSH.</echo>
2011-09-29 14:44:21 +02:00
<!-- FIXME tries to publish a ZIP; how does the download site handle these? -->
2010-04-20 16:43:39 +02:00
<property name= "package.filename" value= "${result-path}/${base-name}.zip" />
2009-04-07 15:50:23 +02:00
<!-- Copy the linux installation package and the JAR. -->
2009-03-25 16:50:22 +01:00
<exec executable= "scp" searchpath= "true" resultproperty= "nightly.install.scp.result" >
<arg value= "-B" />
2011-08-18 09:54:50 +02:00
<arg value= "${output-dir}/WebContent/WEB-INF/lib/${lib-jar-name}" />
2010-01-11 15:16:33 +01:00
<arg value= "${package.filename}" />
2009-03-25 16:50:22 +01:00
<arg value= "${nightly.publish}" />
</exec>
<echo > Result: ${nightly.install.scp.result}</echo>
2009-03-25 08:36:55 +01:00
</target>
2009-03-31 14:15:01 +02:00
2010-04-30 09:58:21 +02:00
<!-- Copies the nightly build artifacts to the download server. -->
2011-08-17 10:32:29 +02:00
<target name= "nightly-tests-publish" if= "nightly.demo.publish" depends= "internal-package-war" >
2011-09-29 14:44:21 +02:00
<fail unless= "version.major" message= "Major version must be defined in version.major" />
<fail unless= "version.minor" message= "Major version must be defined in version.minor" />
2010-04-30 09:58:21 +02:00
<!-- Publish to the demo server. -->
2011-09-29 14:44:21 +02:00
<property name= "src" value= "${result-path}/${test-war-filename}" />
<property name= "target" value= "${nightly.demo.publish}/${version.major}.${version.minor}-${build.tag}.war" />
2010-04-30 09:58:21 +02:00
<echo > Installing ${src} to ${target}</echo>
<!-- Copy the linux installation package and the JAR. -->
<exec executable= "scp" searchpath= "true" resultproperty= "nightly.demo.install.scp.result" >
<arg value= "-B" />
<arg value= "${src}" />
<arg value= "${target}" />
</exec>
<echo > Result: ${nightly.install.scp.result}</echo>
</target>
2011-08-17 10:32:29 +02:00
<target name= "nightly-publish" depends= "nightly-teamcity-publish, nightly-download-publish, nightly-tests-publish" >
2009-03-31 14:15:01 +02:00
</target>
2009-10-26 20:41:17 +01:00
2010-03-01 17:21:01 +01:00
<target name= "nightly-maven-pom.xml" >
2011-09-29 14:44:21 +02:00
<echo > Creating pom.xml for nightly build</echo>
<property name= "vaadin.version.maven" value= "${version.major}.${version.minor}-SNAPSHOT" />
2010-03-01 17:21:01 +01:00
<copy tofile= "build/maven/pom.xml" >
<filterchain >
<expandproperties />
<replacetokens begintoken= "@" endtoken= "@" >
2011-06-29 12:35:26 +02:00
<token key= "MAVEN-VERSION" value= "${vaadin.version.maven}" />
2010-03-01 17:21:01 +01:00
</replacetokens>
</filterchain>
<fileset file= "build/maven/pom-template.xml" />
</copy>
</target>
2011-09-29 14:44:21 +02:00
2010-03-01 17:21:01 +01:00
<target name= "nightly-maven-publish" depends= "nightly-maven-pom.xml" >
2009-10-26 20:41:17 +01:00
<property file= "${gpg.passphrase.file}" />
2010-04-20 16:43:39 +02:00
2011-08-18 09:54:50 +02:00
<echo > Publishing ${output-dir}/WebContent/WEB-INF/lib/${lib-jar-name} to Maven repository</echo>
2011-09-29 14:44:21 +02:00
<artifact:mvn >
2009-10-26 20:41:17 +01:00
<arg value= "gpg:sign-and-deploy-file" />
<!-- .. is a workaround as maven runs in the build directory -->
2011-08-18 09:54:50 +02:00
<sysproperty key= "file" value= "../${output-dir}/WebContent/WEB-INF/lib/${lib-jar-name}" />
2009-10-26 20:41:17 +01:00
<sysproperty key= "pomFile" value= "maven/pom.xml" />
<sysproperty key= "repositoryId" value= "vaadin-snapshots" />
2011-06-23 12:43:26 +02:00
<sysproperty key= "url" value= "${snapshot.repository.url}" />
2010-01-28 11:01:35 +01:00
<sysproperty key= "gpg.passphrase" value= "${gpg.passphrase}" />
2009-10-26 20:41:17 +01:00
</artifact:mvn>
</target>
2011-03-09 16:22:49 +01:00
<target name= "local-maven-pom.xml" >
2011-09-29 14:44:21 +02:00
<echo > Creating pom.xml for local test build</echo>
<fail unless= "version.major" message= "Major version must be defined in version.major" />
<fail unless= "version.minor" message= "Major version must be defined in version.minor" />
<property name= "vaadin.version.maven" value= "${version.major}.${version.minor}" />
2011-03-09 16:22:49 +01:00
<copy tofile= "build/maven/pom.xml" >
<filterchain >
<expandproperties />
<replacetokens begintoken= "@" endtoken= "@" >
2011-06-29 12:53:38 +02:00
<token key= "MAVEN-VERSION" value= "${vaadin.version.maven}" />
2011-03-09 16:22:49 +01:00
</replacetokens>
</filterchain>
<fileset file= "build/maven/pom-template.xml" />
</copy>
</target>
2011-09-29 14:44:21 +02:00
2011-03-09 16:22:49 +01:00
<target name= "local-maven-publish" depends= "local-maven-pom.xml" >
2011-08-18 09:54:50 +02:00
<echo > Publishing ${output-dir}/WebContent/WEB-INF/lib/${lib-jar-name} to the local Maven repository</echo>
2011-09-29 14:44:21 +02:00
<artifact:mvn >
2011-03-09 16:22:49 +01:00
<arg value= "install:install-file" />
<!-- .. is a workaround as maven runs in the build directory -->
2011-08-18 09:54:50 +02:00
<sysproperty key= "file" value= "../${output-dir}/WebContent/WEB-INF/lib/${lib-jar-name}" />
2011-03-09 16:22:49 +01:00
<sysproperty key= "pomFile" value= "maven/pom.xml" />
</artifact:mvn>
</target>
2009-03-31 14:15:01 +02:00
<!-- ================================================================== -->
<!-- Automated tests. -->
<!-- ================================================================== -->
2012-01-16 08:01:28 +01:00
<target name= "tests" depends= "compile-tests, internal-package-war" >
2011-09-29 14:44:21 +02:00
<!-- Run all different types of tests in parallel to decrease testing time -->
<parallel threadcount= "3" >
2011-10-17 15:01:58 +02:00
<sequential >
<!-- Sleep before running integration tests so testbench tests have time to compile and start -->
<sleep minutes= "4" />
<antcall inheritrefs= "true" inheritall= "true" target= "integration-tests" > </antcall>
</sequential>
2011-09-29 14:44:21 +02:00
<antcall inheritrefs= "true" inheritall= "true" target= "testbench-tests" > </antcall>
<antcall inheritrefs= "true" inheritall= "true" target= "server-side-tests" > </antcall>
</parallel>
2011-10-19 15:57:32 +02:00
<!-- Create a combined report from each test's sub report -->
<emma enabled= "${emma.enabled}" >
<merge file= "${result-path}/combined.es" >
<fileset dir= "${result-path}" >
<include name= "*.ec" />
<include name= "*.em" />
</fileset>
</merge>
2012-01-16 08:01:28 +01:00
<report sourcepath= "${result-src-core}" >
2011-10-19 15:57:32 +02:00
<fileset dir= "${result-path}" >
<include name= "combined.es" />
</fileset>
<txt outfile= "../${result-path}/coverage/coverage-combined/coverage.txt" />
<html outfile= "../${result-path}/coverage/coverage-combined/coverage.html" />
</report>
</emma>
<echo > ##teamcity[publishArtifacts '${result-path}/coverage']</echo>
2011-09-29 14:44:21 +02:00
</target>
<!-- Assumes java classes have been compiled but depends does not work out well as this is run from a <parallel> task -->
2012-01-16 08:01:28 +01:00
<target name= "server-side-tests" unless= "tests.serverside.skip" depends= "compile-tests" >
2011-10-19 15:57:32 +02:00
<emma enabled= "${emma.enabled}" >
2012-01-16 08:01:28 +01:00
<instr instrpath= "${result-classes-core}"
destdir="${result-classes-core-for-emma-junit}"
2011-10-19 15:57:32 +02:00
mode="copy"
metadatafile="${result-path}/unittests.em"
2012-01-16 08:01:28 +01:00
merge="false"
>
2011-10-19 15:57:32 +02:00
<filter includes= "com.vaadin.*" />
2012-01-16 08:01:28 +01:00
<filter excludes= "com.vaadin.terminal.gwt.*" />
2011-10-19 15:57:32 +02:00
</instr>
</emma>
2011-09-29 14:44:21 +02:00
<junit printsummary= "yes" >
<classpath >
2012-01-12 09:05:53 +01:00
<pathelement path= "${result-classes-core-for-emma-junit}" />
2012-01-16 08:01:28 +01:00
<pathelement path= "${result-classes-core}" />
<pathelement path= "${result-classes-junit}" />
2011-10-19 15:57:32 +02:00
<path refid= "emma.lib" />
2011-09-29 14:44:21 +02:00
<path refid= "compile.classpath" />
</classpath>
2011-10-19 15:57:32 +02:00
<jvmarg value= "-Demma.coverage.out.file=../${result-path}/unittests.ec" />
2009-11-26 16:31:25 +01:00
2011-09-29 14:44:21 +02:00
<batchtest fork= "yes" >
2012-01-16 08:01:28 +01:00
<fileset dir= "tests/server-side" includes= "**/*.java" excludes= "**/Abstract*.java,**/VaadinClasses.java" />
2011-09-29 14:44:21 +02:00
<fileset dir= "tests/client-side" includes= "**/*.java" excludes= "**/Abstract*.java" />
</batchtest>
</junit>
2011-10-19 15:57:32 +02:00
<emma enabled= "${emma.enabled}" >
2012-01-16 08:01:28 +01:00
<report sourcepath= "${result-src-core}" >
2011-10-19 15:57:32 +02:00
<fileset dir= "${result-path}" >
<include name= "unittests.*" />
</fileset>
<txt outfile= "../${result-path}/coverage/coverage-unittests/unittests_coverage.txt" />
<html outfile= "../${result-path}/coverage/coverage-unittests/unittests_coverage.html" />
</report>
</emma>
<echo > ##teamcity[publishArtifacts '${result-path}/coverage']</echo>
2009-11-26 16:31:25 +01:00
</target>
2010-06-30 14:20:07 +02:00
2011-09-29 14:44:21 +02:00
<!-- Assumes java classes have been compiled but depends does not work out well as this is run from a <parallel> task -->
2011-08-01 12:26:18 +02:00
<target name= "testbench-tests" unless= "tests.testbench.skip" >
2009-10-26 20:41:17 +01:00
<fail unless= "product-file" message= "The 'product-file' property must be defined." />
<fail unless= "version" message= "The 'version' property must be defined." />
<echo > Version: ${version.full}</echo>
<!-- 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.deployment.url" message= "The 'com.vaadin.testbench.deployment.url' property must be defined." />
<fail unless= "com.vaadin.testbench.lib.dir" message= "The 'com.vaadin.testbench.lib.dir' property must be defined." />
2011-09-29 14:44:21 +02:00
<property name= "com.vaadin.testbench.screenshot.block.error" value= "0.025" />
<property name= "com.vaadin.testbench.debug" value= "false" />
2010-04-20 16:43:39 +02:00
<property name= "package.name" value= "${base-name}" />
2009-10-26 20:41:17 +01:00
<!-- Only Linux tests allowed. TODO: Generalize this. -->
2011-08-17 10:32:29 +02:00
<property name= "package.filename" value= "${result-path}/${test-war-filename}" />
2009-10-26 20:41:17 +01:00
<!-- Run the separate test script. -->
<ant antfile= "tests/test.xml" target= "test-package" inheritall= "false" inheritrefs= "true" >
<!-- This is provided so that the test script can copy the -->
<!-- "tests" classes after unpacking the package. -->
<property name= "output-dir" value= "${output-dir}" />
2011-09-29 14:44:21 +02:00
<!-- Convert tests to run multiple times if failed. -->
<property name= "retries" value= "2" />
2010-01-11 15:16:33 +01:00
<property name= "package.filename" value= "${package.filename}" />
2009-10-26 20:41:17 +01:00
<property name= "testing.testarea" value= "/tmp/testarea" />
2010-01-11 15:16:33 +01:00
<property name= "package.name" value= "${package.name}" />
2011-09-29 14:44:21 +02:00
<property name= "test-output-dir" value= "../build/test-output" />
2009-10-26 20:41:17 +01:00
<property name= "com.vaadin.testbench.tester.host" value= "${com.vaadin.testbench.tester.host}" />
<property name= "com.vaadin.testbench.deployment.url" value= "${com.vaadin.testbench.deployment.url}" />
<property name= "com.vaadin.testbench.lib.dir" value= "${com.vaadin.testbench.lib.dir}" />
2011-07-27 10:15:35 +02:00
<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}" />
2009-10-26 20:41:17 +01:00
</ant>
2011-10-19 15:57:32 +02:00
<emma enabled= "${emma.enabled}" >
2012-01-16 08:01:28 +01:00
<report sourcepath= "${result-src-core}" >
2011-10-19 15:57:32 +02:00
<fileset dir= "${result-path}" >
<include name= "war.*" />
</fileset>
<txt outfile= "../${result-path}/coverage/coverage-testbench/testbench_coverage.txt" />
<html outfile= "../${result-path}/coverage/coverage-testbench/testbench_coverage.html" />
</report>
</emma>
<echo > ##teamcity[publishArtifacts '${result-path}/coverage/']</echo>
2009-04-20 07:52:38 +02:00
</target>
2011-09-29 14:44:21 +02:00
<!-- Assumes java classes have been compiled but depends does not work out well as this is run from a <parallel> task -->
2010-07-02 19:28:23 +02:00
<target name= "integration-tests" unless= "tests.integration.skip" >
2009-11-24 10:13:34 +01:00
<!-- 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." />
2009-11-24 10:32:57 +01:00
<fail unless= "sshkey.file" message= "The 'sshkey.file' property must be defined." />
2009-11-24 10:13:34 +01:00
<!-- Empty passphrase if no passphrase defined -->
<property name= "passphrase" value= "" />
2011-09-29 14:44:21 +02:00
<property name= "tests.war" location= "${result-path}/${test-war-filename}" />
2009-11-24 10:13:34 +01:00
<!-- Run the separate test script. -->
2010-05-31 11:20:21 +02:00
<ant antfile= "tests/integration_tests.xml" target= "integration-test-all" inheritall= "false" inheritrefs= "true" >
2009-11-24 10:13:34 +01:00
<!-- This is provided so that the test script can copy the -->
<!-- "tests" classes after unpacking the package. -->
2011-09-29 14:44:21 +02:00
<property name= "output-dir" value= "${output-dir}" />
2009-11-24 10:13:34 +01:00
2011-09-29 14:44:21 +02:00
<property name= "com.vaadin.testbench.tester.host" value= "${com.vaadin.testbench.tester.host}" />
<property name= "com.vaadin.testbench.lib.dir" value= "${com.vaadin.testbench.lib.dir}" />
<property name= "sshkey.file" value= "${sshkey.file}" />
<property name= "passphrase" value= "${passphrase}" />
<property name= "demo.war" value= "${tests.war}" />
2009-11-24 10:13:34 +01:00
</ant>
</target>
2007-10-16 09:35:08 +02:00
</project>
2009-09-23 16:16:46 +02:00
<!-- These are for emacs. -->
<!-- Keep this comment at the end of the file
Local variables:
mode: xml
sgml-omittag:nil
sgml-shorttag:nil
sgml-namecase-general:nil
sgml-general-insert-case:lower
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:4
sgml-indent-data:t
sgml-parent-document:nil
sgml-exposed-tags:nil
sgml-local-catalogs:("/etc/sgml/catalog" "/usr/share/xemacs21/xemacs-packages/etc/psgml-dtds/CATALOG")
sgml-local-ecat-files:("ECAT" "~/sgml/ECAT" "/usr/share/sgml/ECAT" "/usr/local/share/sgml/ECAT" "/usr/local/lib/sgml/ECAT")
End:
-->