123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329 |
- <?xml version="1.0"?>
-
- <project xmlns:antcontrib="antlib:net.sf.antcontrib"
- xmlns:artifact="antlib:org.apache.maven.artifact.ant"
- name="Vaadin"
- basedir="../" default="package-all">
-
- <!--Call one of package-* targets unless you understand what you are doing. -->
- <target name="package-all" depends="clean-all, package-init, init, build, docs, internal-package-zip, internal-package-war, internal-package-liferay" description="Build public packages.">
- </target>
-
- <target name="package-zip" depends="clean-all, package-init, init, build, docs, internal-package-zip">
- </target>
-
- <target name="package-jar" depends="clean-result, package-init, init, vaadin.jar" description="Create vaadin-x.y.z.jar file.">
- </target>
-
- <!-- Compiles only the default widgetset. -->
- <target name="package-jar-quick" depends="clean-result, package-init, init" description="Create vaadin-x.y.z.jar file quick.">
- <property name="compile.only.default-widgetset" value="1"/>
- <antcall target="vaadin.jar"/>
- </target>
-
- <target name="package-war" depends="clean-result, package-init, init, build, docs, internal-package-zip, internal-package-war">
- </target>
-
- <target name="package-liferay-zip" depends="clean-result, package-init, init, build, docs, internal-package-zip, internal-package-liferay">
- </target>
-
- <target name="package-test" depends="clean-result, nightly-init, package-init, init, build, docs, internal-package-zip, nightly-publish">
- </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" />
-
- <!-- 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" />
-
- <!-- internal tests for packaging -->
-
- <target name="test-build" depends="clean-result, init, build" description="used for testing build.xml">
- </target>
-
- <target name="test-package" depends="init" description="used for testing build.xml">
- <antcontrib:var name="eclipse-launch-vmargs" value="-XstartOnFirstThread -Xms128M -Xmx512M" />
- <antcall target="add-misc-files" inheritAll="true" inheritRefs="true" />
- <delete file="${result-path}/eclipse-test" followsymlinks="false" />
- <exec executable="ln" failonerror="false">
- <arg line="-s" />
- <arg line="${output-dir}" />
- <arg line="${result-path}/eclipse-test" />
- </exec>
- </target>
-
- <!-- Clean results - - - - - - - - - - - - - - - - - - - - - - - - - -->
- <target name="clean-result" depends="">
- <property file="build/build.properties" />
-
- <!-- Clean build result directory. -->
- <delete dir="${result-path}" includes="**/*" followsymlinks="false" defaultexcludes="false" includeemptydirs="true" failonerror="false"/>
- </target>
-
- <target name="clean-all" depends="clean-result">
- </target>
-
- <!-- ================================================================== -->
- <!-- Check versions. -->
- <!-- ================================================================== -->
-
- <!-- Java compiler version. -->
- <target name="check-java-version">
- <condition property="java.version.matches">
- <or>
- <equals arg1="${ant.java.version}" arg2="1.5"/>
- <isset property="ignoreversion"/>
- </or>
- </condition>
- <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."/>
- <echo>Java version is ${ant.java.version} as required.</echo>
- </target>
-
- <!-- Check Servlet API version. -->
- <!-- We must use Servlet API 2.3 to catch incompatibilities.. -->
- <target name="check-servlet-version">
- <available classpathref="compile.classpath" classname="javax.servlet.Servlet" property="servlet.available"/>
- <fail unless="servlet.available" message="Java Servlet API library is not available."/>
- <echo>Java Servlet API is available.</echo>
-
- <available classpathref="compile.classpath" classname="javax.servlet.ServletRequestListener" property="servlet.version.is-2.4"/>
- <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."/>
- <echo>Java Servlet API specification 2.3 used.</echo>
- </target>
-
- <!-- ================================================================== -->
- <!-- Initialization - - - - - - - - - - - - - - - - - - - - - - - - - - -->
- <!-- ================================================================== -->
-
- <!-- Called only when building installation packages. -->
- <target name="package-init">
- </target>
-
- <target name="init" depends="check-java-version">
- <property file="build/build.properties" />
- <property file="build/VERSION.properties" />
- <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"/>
-
- <property file="build/GWT-VERSION.properties" />
- <property file="build/html-style.properties" />
-
- <property name="snapshot.repository.url" value="http://oss.sonatype.org/content/repositories/vaadin-snapshots" />
-
- <!-- Current timestamp in different formats. -->
- <tstamp>
- <format property="build.date" pattern="yyyy-MM-dd"/>
- </tstamp>
- <tstamp>
- <format property="build.date.compact" pattern="yyyyMMdd"/>
- </tstamp>
-
- <!-- Default full version name. -->
- <!-- Nightly and other TeamCity builds will define their own. -->
- <property name="version.full" value="${version}.dev-${build.date.compact}"/>
- <echo>Base Version: ${version}</echo>
- <echo>Full Version: ${version.full}</echo>
-
- <echo>Vaadin package is: ${toolkit-package}</echo>
-
- <!-- Create result dir unless already exists -->
- <mkdir dir="${result-path}" />
-
- <!-- required when compiling WebContent/VAADIN/widgetsets (and also Java server-side classes) -->
- <property name="lib-gwt-dev" location="${gwt-dir}/gwt-dev-noservlet.jar" />
- <property name="lib-gwt-user" location="${gwt-dir}/gwt-user-noservlet.jar" />
- <!-- FIXME: Should use ${gwt-version-dependencies} -->
- <property name="lib-gwt-validation" location="${gwt-dir}/validation-api-1.0.0.GA.jar" />
- <property name="lib-gwt-validation-src" location="${gwt-dir}/validation-api-1.0.0.GA-sources.jar" />
-
- <echo>We are using gwt version ${gwt-version}.</echo>
-
- <!-- Destination files -->
- <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" />
-
- <echo message="Prepared to build ${product-file} version ${version.full} packages" />
-
- <!-- Output directory -->
- <property name="output-dir" value="${result-path}/${base-name}" />
- <mkdir dir="${output-dir}" />
-
- <!-- Where widgetsets are written to. -->
- <!-- When not building a package, widgetsets should be written to -->
- <!-- WebContent/VAADIN/widgetsets, which needs to be set in -->
- <!-- init-nonpackage target before calling this main init target. -->
- <property name="widgetsets-output-dir" value="${output-dir}/WebContent/VAADIN/widgetsets" />
-
- <!-- 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" />
- <mkdir dir="${output-dir}/WebContent/docs/example-source" />
- <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"/>
- <exclude name="**/gwt-dev.jar"/>
- <exclude name="**/gwt-user.jar"/>
- </fileset>
- <fileset dir="lib/demo">
- <include name="**/*.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>
-
- <property name="docdir" value="${checkout-path}/docs"/>
- <available file="${docdir}/manual/book.xml" property="manual.source.available"/>
- </target>
-
- <target name="internal-package-zip" depends="init">
- <antcontrib:var name="eclipse-launch-vmargs" value="-Xms256M -Xmx512M" />
- <antcall target="add-misc-files" inheritAll="true" inheritRefs="true" />
- <zip zipfile="${result-path}/${base-name}.zip">
- <zipfileset prefix="${base-name}" dir="${result-path}/${base-name}">
- <patternset>
- <include name="**/*" />
- </patternset>
- </zipfileset>
- <zipfileset prefix="${base-name}/gwt" dir="${gwt-dir}">
- <patternset>
- <include name="**/*" />
- <exclude name="doc**"/>
- <exclude name="samples**"/>
- <exclude name="**/*-noservlet.jar"/>
- </patternset>
- </zipfileset>
- </zip>
-
- <!-- Notice that the differences comparison is conditional. -->
- <antcall target="differences"/>
- </target>
-
- <target name="internal-package-war">
- <echo>Building WAR</echo>
-
- <!-- Add the files. -->
- <antcontrib:var name="eclipse-launch-vmargs" value="-Xms256M -Xmx512M" />
- <antcall target="add-misc-files" inheritAll="true" inheritRefs="true" />
-
- <!-- Copy source tree to class tree. -->
- <!-- A workaround for not setting classpath properly in WAR. -->
- <copy todir="${output-dir}/WebContent/WEB-INF/classes">
- <fileset dir="${output-dir}/WebContent/WEB-INF/src">
- <include name="**/*" />
- </fileset>
- </copy>
-
- <war warfile="${result-path}/${product-file}-demo-${version.full}.war">
- <fileset dir="${output-dir}/WebContent">
- <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>
-
- <zip zipfile="${result-path}/${base-name}-liferay.zip">
- <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/**/*" />
- <include name="liferay/**/*" />
- <include name="runo/**/*" />
- <include name="reindeer/**/*" />
- <include name="default/**/*" />
- </patternset>
- </zipfileset>
-
- </zip>
-
- <echo>##teamcity[publishArtifacts '${result-path}/${base-name}-liferay.zip']</echo>
- </target>
-
- <target name="add-misc-files">
- <delete includeemptydirs="true" defaultexcludes="false">
- <fileset dir="${output-dir}">
- <include name=".*" />
- <include name="*.launch" />
- <include name="*.txt" />
- <include name="*.bat" />
- <include name="*.sh" />
- <include name="*.app" />
- <include name="build-widgetset.xml" />
- </fileset>
- </delete>
- <copy todir="${output-dir}">
- <filterchain>
- <expandproperties />
- <replacetokens begintoken="@" endtoken="@">
- <token key="version" value="${version.full}" />
- </replacetokens>
- </filterchain>
- <fileset dir="WebContent/license">
- <include name="COPYING" />
- </fileset>
- </copy>
- <copy todir="${output-dir}/WebContent">
- <filterchain>
- <expandproperties />
- <replacetokens begintoken="@" endtoken="@">
- <token key="version" value="${version.full}" />
- </replacetokens>
- <replacetokens begintoken="@" endtoken="@">
- <token key="builddate" value="${build.date}" />
- </replacetokens>
- </filterchain>
- <fileset dir="WebContent">
- <exclude name="**/.svn" />
- <exclude name="windoweddemos.html" />
- <include name="release-notes.html" />
- <include name="*.html" />
- <include name="license/*.html" />
- <include name="license/*.txt" />
- </fileset>
- </copy>
- <copy file="build/package/readme.txt" tofile="${output-dir}/readme.txt">
- <filterchain>
- <expandproperties />
- <replacetokens begintoken="@" endtoken="@">
- <token key="version" value="${version.full}" />
- </replacetokens>
- </filterchain>
- </copy>
- <copy todir="${output-dir}">
- <filterchain>
- <expandproperties />
- <!-- .classpath, *.launch, build-widgetset.xml -->
- <replacetokens begintoken="@" endtoken="@">
- <token key="version" value="${version.full}" />
- </replacetokens>
- <!-- .classpath -->
- <replacetokens begintoken="<" endtoken=">">
- <token key="platform-specific-entries" value="<classpathentry kind="lib" path="gwt/gwt-dev.jar" />" />
- <token key="/platform-specific-entries" value="" />
- </replacetokens>
- <!-- .project, *.launch -->
- <replacetokens begintoken="<" endtoken=">">
- <token key="eclipse-workspace-name" value="${eclipse-workspace-name}" />
- <token key="/eclipse-workspace-name" value="" />
- </replacetokens>
- <!-- HostedMode.launch -->
- <replacetokens begintoken="<" endtoken=">">
- <token key="eclipse-launch-vmargs" value="${eclipse-launch-vmargs}" />
- <token key="/eclipse-launch-vmargs" value="" />
- </replacetokens>
- </filterchain>
- <fileset dir="build/package">
- <include name="eclipse-classpath" />
- <include name="eclipse-project" />
- <include name="eclipse*launch" />
- <include name="build-widgetset.xml" />
- <include name="eclipse-org.eclipse.core.resources.prefs" />
- <include name="eclipse-org.eclipse.jdt.core.prefs" />
- </fileset>
- </copy>
- <move file="${output-dir}/build-widgetset.xml" tofile="${output-dir}/WebContent/docs/example-source/build-widgetset.xml" />
- <move file="${output-dir}/eclipse-classpath" tofile="${output-dir}/.classpath" />
- <move file="${output-dir}/eclipse-project" tofile="${output-dir}/.project" />
- <move file="${output-dir}/eclipse-GWT Development Mode-launch" tofile="${output-dir}/GWT Development Mode.launch" />
- <move file="${output-dir}/eclipse-Vaadin Development Server-launch" tofile="${output-dir}/Vaadin Development Server.launch" />
- <mkdir dir="${output-dir}/.settings" />
- <move file="${output-dir}/eclipse-org.eclipse.core.resources.prefs" tofile="${output-dir}/.settings/org.eclipse.core.resources.prefs" />
- <move file="${output-dir}/eclipse-org.eclipse.jdt.core.prefs" tofile="${output-dir}/.settings/org.eclipse.jdt.core.prefs" />
-
- <copy todir="${output-dir}">
- <fileset dir="build/package">
- <include name="start.bat" />
- <include name="start.sh" />
- </fileset>
- </copy>
-
- <!-- TODO: Why is this set both with <chmod> and <exec>? -->
- <chmod file="${output-dir}/start.sh" perm="ugo+x" />
- <exec executable="chmod" failonerror="false">
- <arg line="ugo+x" />
- <arg line="${output-dir}/start.sh" />
- </exec>
- </target>
-
- <!-- Build server-side, client-side, libraries, and demos. -->
- <!-- The client-side needs to be built before vaadin.jar, because the vaadin.jar -->
- <!-- 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. -->
- <target name="build"
- depends="compile-server-side, compile-client-side, vaadin.jar, vaadin-sources.jar, demo"
- description="Build package required files, without packing them.">
- </target>
-
- <target name="compile-server-side" depends="compile-java, webcontent"/>
-
- <!-- Copy and preprocess sources for packaging
- NOTE: Replaces <version></version> tags with build version tag for some "textual" files
- -->
- <target name="preprocess-src">
- <!--
- Source directories in the project are
- * src (Vaadin core)
- * demo/src (Demos and examples)
- * tests/src (Test cases)
-
- These are copied to
- * {$result-path}/src/core
- * {$result-path}/src/demo
- * {$result-path}/src/tests
-
- Java/HTML/CSS/XML files are filtered so the license is added and the version is set.
- Other files are just copied.
-
- If build.include.tests is not set, then "{$result-path}/src/tests" is created but no files are copied to it.
- -->
-
- <loadfile property="ITMillApache2LicenseForJavaFiles" srcFile="build/ITMillApache2LicenseForJavaFiles.txt" />
- <mkdir dir="${result-path}/src" />
-
- <mkdir dir="${result-path}/src/core" />
- <mkdir dir="${result-path}/src/demo" />
- <mkdir dir="${result-path}/src/tests" />
-
- <patternset id="preprocessable-files">
- <include name="**/*.java" />
- <include name="**/*.html" />
- <include name="**/*.css" />
- <include name="**/*.xml" />
- <exclude name="src/com/vaadin/demo/tools/*"/>
- </patternset>
- <patternset id="non-preprocessable-files">
- <exclude name="**/.svn" />
- <exclude name="**/*.java" />
- <exclude name="**/*.html" />
- <exclude name="**/*.css" />
- <exclude name="**/*.xml" />
- </patternset>
- <filterset id="version-and-license">
- <filter token="ITMillApache2LicenseForJavaFiles" value="${ITMillApache2LicenseForJavaFiles}" />
- <filter token="VERSION" value="${version.full}" />
- </filterset>
-
- <!-- Adds a style class to JavaDoc <pre> tags for style customization. -->
- <filterset id="pre-css-style" begintoken=" * <" endtoken=">">
- <filter token="pre" value=" * <pre class='code'>" />
- </filterset>
-
- <echo>Copying src directory and processing copied files.</echo>
- <echo>Replacing <version> tag with build version for java/html/css/xml files.</echo>
- <copy todir="${result-path}/src/core" overwrite="yes">
- <filterset refid="version-and-license"/>
- <filterset refid="pre-css-style"/>
- <fileset dir="src">
- <patternset refid="preprocessable-files" />
- </fileset>
- </copy>
-
- <copy todir="${result-path}/src/demo">
- <filterset refid="version-and-license"/>
- <fileset dir="demo/src">
- <patternset refid="preprocessable-files" />
- </fileset>
- </copy>
-
- <antcontrib:if>
- <isset property="build.include.tests"/>
- <then>
- <copy todir="${result-path}/src/tests">
- <filterset refid="version-and-license"/>
- <fileset dir="tests/src">
- <patternset refid="preprocessable-files" />
- </fileset>
- </copy>
- </then>
- </antcontrib:if>
-
- <!-- Unify mix usage of mac/Linux/Win characters -->
- <echo>Unifying mix usage of Mac/Linux/Win linefeeds for java/html/css/xml files.</echo>
- <fixcrlf srcdir="${result-path}/src" eol="crlf" tablength="4" tab="asis" includes="**/*.java **/*.html **/*.css **/*.xml" />
-
- <!-- Add other files such as images, these are not filtered or processed by fixcrlf task -->
- <echo>Copying non java/html/css/xml files such as images.</echo>
- <copy todir="${result-path}/src/core">
- <fileset dir="src">
- <patternset refid="non-preprocessable-files" />
- </fileset>
- </copy>
- <copy todir="${result-path}/src/demo">
- <fileset dir="demo/src">
- <patternset refid="non-preprocessable-files" />
- </fileset>
- </copy>
- <antcontrib:if>
- <isset property="build.include.tests"/>
- <then>
- <copy todir="${result-path}/src/tests">
- <fileset dir="tests/src">
- <patternset refid="non-preprocessable-files" />
- </fileset>
- </copy>
- </then>
- </antcontrib:if>
-
- </target>
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- WebContent
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
- <target name="webcontent" depends="preprocess-src,defaulttheme">
-
- <!-- copy 3rd part libraries used by demo -->
- <copy todir="${output-dir}/WebContent/demo/lib">
- <fileset dir="lib/demo">
- <include name="gwt-maps/**/*" />
- </fileset>
- </copy>
- <copy todir="${output-dir}/WebContent/demo/lib">
- <fileset dir="lib/core">
- <include name="jetty/**/*" />
- </fileset>
- </copy>
- <copy todir="${output-dir}/WebContent/demo/lib">
- <fileset dir="lib/core">
- <include name="portlet/**/*" />
- </fileset>
- </copy>
-
- <!-- Add demo sources -->
- <echo>Adding demo sources to WebContent/WEB-INF/src</echo>
- <copy todir="${output-dir}/WebContent/WEB-INF/src">
- <fileset dir="${result-path}/src/demo">
- <include name="**/*" />
- </fileset>
- </copy>
-
- <echo>Creating demo source html files</echo>
- <java2html srcdir="${output-dir}/WebContent/WEB-INF/src/${toolkit-package}/demo" destdir="${output-dir}/WebContent/docs/example-source/${toolkit-package}/demo" includes="**/*.java" style="eclipse" showLineNumbers="false" showFileName="true" showTableBorder="false" />
-
- <!-- Add WebContent -->
- <echo>Adding VAADIN/themes, demo and hsqldb.jar files.</echo>
- <copy todir="${output-dir}/WebContent">
- <fileset dir="WebContent">
- <exclude name="**/.svn" />
- <!-- TODO check what is neccessary -->
- <!-- These are needed for running tests, but are copied during testing. -->
- <exclude name="VAADIN/themes/tests*"/>
- <exclude name="VAADIN/themes/tests-magi/**/*" />
- <exclude name="VAADIN/themes/tests-featurebrowser/**/*" />
- <exclude name="VAADIN/themes/tests*/**/*"/>
-
- <include name="demo/**/*" />
- <include name="WEB-INF/lib/hsqldb.jar" />
- <include name="VAADIN/themes/**/*" />
- <include name="META-INF/**/*" />
- </fileset>
- </copy>
-
- <!-- Add portlet configuration files from WebContent -->
- <copy todir="${output-dir}/WebContent/WEB-INF">
- <fileset dir="WebContent/WEB-INF">
- <include name="liferay-*.xml" />
- <include name="portlet.xml" />
- </fileset>
- </copy>
- <!-- Add package specific WebContent files from build/package/WebContent -->
- <copy todir="${output-dir}/WebContent">
- <fileset dir="build/package/WebContent">
- <exclude name="**/.*" />
- <include name="**/*" />
- </fileset>
- </copy>
- </target>
-
- <target name="compile-java" depends="init, check-servlet-version, webcontent">
- <echo>Compiling src (server-side)</echo>
-
- <!-- Compile all sources at the same time as they depend on each other -->
- <mkdir dir="${result-path}/classes" />
- <javac source="1.5" target="1.5" classpathref="compile.classpath.server-side" destdir="${result-path}/classes" debug="true" encoding="UTF-8">
- <src path="${result-path}/src/core"/>
- <src path="${result-path}/src/demo"/>
- <src path="${result-path}/src/tests"/>
-
- <exclude name="${toolkit-package}/tests/**" unless="build.include.tests"/>
- </javac>
- </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"/>
- </target>
-
- <target name="defaulttheme" depends="init, compile-helpers">
- <echo>Combining default themes css files</echo>
- <java classname="com.vaadin.buildhelpers.CompileDefaultTheme" failonerror="yes" fork="yes">
- <arg value="-version" />
- <arg value="${version.full}"/>
- <classpath>
- <pathelement location="build/buildhelpers" />
- <fileset dir="build/smartsprites/lib">
- <include name="*.jar"/>
- </fileset>
- </classpath>
- <jvmarg value="-Djava.awt.headless=true"/>
- </java>
- </target>
-
- <target name="testtarget">
- <echo>TEST TARGET CALLED</echo>
- </target>
-
- <!-- ================================================================== -->
- <!-- 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> -->
-
- <target name="remove-widgetset-gwt-tmp">
- <echo>Removing widgetset temp files</echo>
- <delete dir="${widgetsets-output-dir}/.gwt-tmp" includeemptydirs="true"/>
- <!-- This is generated by GWT 2.3+ for rpcPolicyManifest and symbolMaps, cannot disable -->
- <delete dir="${widgetsets-output-dir}/WEB-INF" includeemptydirs="true" failonerror="false" />
- </target>
-
- <!-- Note: Probably not needed any longer as all sources need to be compiled. -->
- <target name="compile-widgetset-generator-only" depends="init, preprocess-src, compile-java">
- <mkdir dir="${result-path}/classes"/>
- <javac source="1.5" target="1.5" destdir="${result-path}/classes" debug="true" encoding="UTF-8">
- <src path="${result-path}/src/core"/>
- <include name="com/vaadin/terminal/gwt/widgetsetutils/WidgetMapGenerator.java" />
- <!-- <exclude name="**"/> -->
- <classpath>
- <pathelement location="${lib-gwt-user}" />
- <pathelement location="${lib-gwt-dev}" />
- <pathelement location="${result-path}/classes" />
- <pathelement location="${result-path}/src/core" />
- </classpath>
- </javac>
- </target>
-
- <!-- 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" />
- <pathelement location="${result-path}/src/demo" />
- </path>
-
- <target name="compile-widgetset" description="Compiles the widgetset given as the first parameter">
- <fail unless="widgetset" message="No widgetset parameter set"/>
- <echo>Compiling widgetset ${widgetset}. Output directory: ${widgetsets-output-dir}</echo>
- <java classname="com.google.gwt.dev.Compiler" failonerror="yes" fork="yes" maxmemory="512m">
- <classpath refid="widgetset-compile-classpath"/>
-
- <arg value="-war" />
- <arg value="${widgetsets-output-dir}" />
- <arg value="-style" />
- <arg value="OBF" />
- <arg value="${widgetset}" />
-
- <jvmarg value="-Xss8M"/>
- <jvmarg value="-XX:MaxPermSize=256M"/>
- <jvmarg value="-Djava.awt.headless=true"/>
- </java>
- <antcall target="remove-widgetset-gwt-tmp"/>
-
- <echo>Compiled ${widgetset}</echo>
- </target>
-
- <target name="compile-widgetset-default">
- <antcall target="compile-widgetset">
- <param name="widgetset" value="com.vaadin.terminal.gwt.DefaultWidgetSet"/>
- </antcall>
- </target>
-
- <target name="compile-widgetset-portal-default" unless="compile.only.default-widgetset">
- <antcall target="compile-widgetset">
- <param name="widgetset" value="com.vaadin.portal.gwt.PortalDefaultWidgetSet"/>
- </antcall>
- </target>
-
- <target name="compile-widgetset-sampler" unless="compile.only.default-widgetset">
- <antcall target="compile-widgetset">
- <param name="widgetset" value="com.vaadin.demo.sampler.gwt.SamplerWidgetSet"/>
- </antcall>
- </target>
-
- <target name="compile-widgetset-optimized" unless="compile.only.default-widgetset">
- <antcall target="compile-widgetset">
- <param name="widgetset" value="com.vaadin.demo.gwt.OptimizedWidgetSet"/>
- </antcall>
- </target>
-
- <target name="compile-widgetset-colorpicker" unless="compile.only.default-widgetset">
- <antcall target="compile-widgetset">
- <param name="widgetset" value="com.vaadin.demo.colorpicker.gwt.ColorPickerWidgetSet"/>
- </antcall>
- </target>
-
- <!-- Builds the client-side engine, i.e., the widgetsets sequentially. -->
- <!-- Notice that antcall does not fulfill dependencies. -->
- <target name="compile-client-side-sequential" unless="build.parallel">
- <echo>Compiling widget sets sequentially.</echo>
- <!-- We can't call these with 'depends' because of the 'unless' specifier. -->
- <antcall target="compile-widgetset-default"/>
- <antcall target="compile-widgetset-portal-default"/>
- <antcall target="compile-widgetset-sampler"/>
- <antcall target="compile-widgetset-optimized"/>
- <antcall target="compile-widgetset-colorpicker"/>
- </target>
-
- <!-- Builds the client-side engine, i.e., the widgetsets in parallel. -->
- <!-- Notice that antcall does not fulfill dependencies. -->
- <target name="compile-client-side-parallel" if="build.parallel">
- <echo>Compiling widget sets in parallel.</echo>
- <parallel threadsperprocessor="1">
- <antcall target="compile-widgetset-default"/>
- <antcall target="compile-widgetset-portal-default"/>
- <antcall target="compile-widgetset-sampler"/>
- <antcall target="compile-widgetset-optimized"/>
- <antcall target="compile-widgetset-colorpicker"/>
- </parallel>
- </target>
-
- <!-- Compiles all widgetsets. -->
- <!-- This is called when building packages and when compiling all -->
- <!-- widgetsets, but not when compiling individual widgetsets. -->
- <!-- Builds widgetsets either sequentially or in parallel, depending -->
- <!-- on the 'build.parallel' property. -->
- <target name="compile-client-side" depends="compile-server-side, compile-client-side-sequential, compile-client-side-parallel"/>
-
- <!-- Definitions for building local components, i.e., not for an installation package. -->
- <target name="init-nonpackage">
- <property file="build/build.properties" />
- <property file="build/VERSION.properties" />
- <property file="build/GWT-VERSION.properties" />
-
- <!-- Definitions for building the client-side. -->
- <property name="widgetsets-output-dir" value="WebContent/VAADIN/widgetsets" />
-
- <!-- required when compiling WebContent/VAADIN/widgetsets (and also Java server-side classes) -->
- <property name="lib-gwt-dev" location="${gwt-dir}/gwt-dev.jar" />
- <property name="lib-gwt-user" location="${gwt-dir}/gwt-user.jar" />
-
- <echo>We are using ${lib-gwt-dev}.</echo>
- <echo>Widget sets output dir: ${widgetsets-output-dir}</echo>
- </target>
-
- <!-- Builds all widgetsets locally, i.e., not for an installation package. -->
- <target name="widgetsets" depends="init-nonpackage, init, compile-widgetset-generator, compile-client-side"/>
-
- <!-- 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"/>
- <target name="widgetset-sampler" depends="init-nonpackage, init, compile-widgetset-generator, compile-widgetset-sampler"/>
- <target name="widgetset-colorpicker" depends="init-nonpackage, init, compile-widgetset-generator, compile-widgetset-colorpicker"/>
-
- <!-- ================================================================== -->
- <!-- Libraries and Demos -->
- <!-- ================================================================== -->
-
- <!-- 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. -->
- <target name="vaadin.jar" depends="compile-server-side, compile-client-side, compile-helpers">
- <echo>Creating JAR (server-side) ${lib-jar-name}</echo>
- <!-- Create Vaadin JAR -->
- <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>
- <jar jarfile="${output-dir}/WebContent/WEB-INF/lib/${lib-jar-name}"
- compress="true" manifest="build/package/META-INF/MANIFEST.MF">
- <metainf dir="${output-dir}/META-INF"/>
- <manifest>
- <attribute name="Vaadin-Package-Version" value="1" />
- <attribute name="Vaadin-Widgetsets" value="com.vaadin.terminal.gwt.DefaultWidgetSet" />
- <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}" />
- <attribute name="GWT-Version-Dependencies" value="${gwt-version-dependencies}" />
- <attribute name="Bundle-Version" value="${version.full}" />
- </manifest>
- <fileset dir="${result-path}/classes">
- <patternset>
- <exclude name="${toolkit-package}/demo/**" />
- <exclude name="${toolkit-package}/tests/**"/>
- <exclude name="${toolkit-package}/launcher/**" />
- </patternset>
- </fileset>
- <!-- add sources -->
- <fileset dir="${result-path}/src/core">
- <patternset>
- <exclude name="${toolkit-package}/launcher/**" />
- </patternset>
- </fileset>
- <fileset dir="${output-dir}/WebContent">
- <patternset>
- <include name="VAADIN/widgetsets/com.vaadin.terminal.gwt.DefaultWidgetSet/**/*" />
- <include name="VAADIN/themes/base/**/*" />
- <include name="VAADIN/themes/default/**/*" />
- <include name="VAADIN/themes/liferay/**/*" />
- <include name="VAADIN/themes/runo/**/*" />
- <include name="VAADIN/themes/reindeer/**/*" />
- </patternset>
- </fileset>
- </jar>
-
- <!-- 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}"/>
- <classpath>
- <pathelement location="build/buildhelpers" />
- </classpath>
- </java>
-
- <copy file="${output-dir}/WebContent/WEB-INF/lib/${lib-jar-name}" tofile="${output-dir}/WebContent/${lib-jar-name}" />
- <echo>##teamcity[publishArtifacts '${output-dir}/WebContent/WEB-INF/lib/${lib-jar-name}']</echo>
- </target>
-
- <target name="vaadin-sources.jar" depends="init">
- <jar file="${result-path}/${lib-sources-jar-name}" compress="true">
- <fileset dir="${result-path}/src/core">
- <patternset>
- <exclude name="${toolkit-package}/launcher/**" />
- <include name="**/*.java" />
- </patternset>
- </fileset>
- </jar>
- </target>
-
- <!-- Demos - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
- <target name="demo" depends="vaadin.jar">
- <echo>Building demos</echo>
- <echo>Adding demo class files.</echo>
- <copy todir="${output-dir}/WebContent/WEB-INF/classes">
- <fileset dir="${result-path}/classes">
- <include name="${toolkit-package}/demo/**/*" />
- <!-- user might want to tweak launcher classes -->
- <include name="${toolkit-package}/launcher/**" />
- </fileset>
- </copy>
-
- <echo>Adding source for demos</echo>
- <copy todir="${output-dir}/WebContent/WEB-INF/src">
- <fileset dir="${result-path}/src/demo">
- <include name="${toolkit-package}/demo/**/*" />
- </fileset>
- <fileset dir="${result-path}/src/core">
- <!-- user might want to tweak launcher classes -->
- <include name="${toolkit-package}/launcher/**" />
- </fileset>
- </copy>
- </target>
-
- <!-- ================================================================== -->
- <!-- Documentation -->
- <!-- ================================================================== -->
- <target name="docs" depends="init, javadoc, manual">
- </target>
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
- <!-- Manual: Build from external repository. -->
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
-
- <target name="manual-init" depends="init" if="manual.source.available">
- </target>
-
- <!-- Build manual. -->
- <target name="manual-build" depends="manual-init" if="manual.source.available">
- <!-- The HTML and Eclipse Manual must be built with separate runs -->
- <ant dir="${docdir}" antfile="build/build.xml" inheritAll="false">
- <property name="version" value="${version.full}"/>
- </ant>
- <ant dir="${docdir}" antfile="build/build.xml" target="manual-eclipse" inheritAll="false">
- <property name="version" value="${version.full}"/>
- </ant>
- </target>
-
- <!-- Copy the manual from sub Ant results to our output directory. -->
- <target name="manual-copy" depends="manual-init" if="manual.source.available">
- <copy todir="${output-dir}/WebContent/docs">
- <fileset dir="${docdir}/build/result/package/WebContent/docs">
- <exclude name="**/.svn" />
- <include name="book-of-vaadin.pdf" />
- </fileset>
- </copy>
- </target>
-
- <!-- Package documentation in a documentation Zip package. -->
- <!-- * Built Eclipse plugin is not included in this package. -->
- <target name="manual-package" depends="manual-init, manual-copy" if="manual.source.available">
- <zip destfile="${result-path}/${product-file}-docs-${version.full}.zip">
- <zipfileset prefix="docs" dir="${result-path}/${base-name}/WebContent/docs">
- <patternset>
- <include name="api/**" />
- <include name="book-of-vaadin.pdf" />
- <include name="example-source" />
- </patternset>
- </zipfileset>
- <zipfileset prefix="docs" dir="${docdir}/build/result/package/WebContent/docs">
- <patternset>
- <include name="book/**" />
- <include name="tutorial/**" />
- <include name="vaadin-tutorial.pdf" />
- </patternset>
- </zipfileset>
- </zip>
- </target>
-
- <!-- Publishes Eclipse plugin version of the manual as TeamCity artifacts. -->
- <!-- These are actually published during manual build, but with wrong path. -->
- <target name="manual-publish-eclipse" if="manual.source.available">
- <echo>##teamcity[publishArtifacts '${docdir}/build/result/package/eclipse/plugins/*.jar']</echo>
- <echo>##teamcity[publishArtifacts '${docdir}/build/result/package/eclipse/features/*.jar']</echo>
- </target>
-
- <target name="manual-source-not-available" unless="manual.source.available">
- <echo>Skipping Book of Vaadin build as it is not available in ${checkout-path}/docs</echo>
- </target>
-
- <target name="manual" depends="init, manual-source-not-available, manual-init, manual-build, manual-copy, manual-package, manual-publish-eclipse">
- </target>
-
-
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
- <!-- Documentation: Add Javadoc to doc -->
- <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
- <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">
- <packageset dir="${result-path}/src/core">
- <include name="${toolkit-package}/**" />
- </packageset>
- <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>
-
- <!-- Create a javadoc jar, mainly for Maven -->
- <jar file="${result-path}/${lib-javadoc-jar-name}" compress="true">
- <fileset dir="${javadoc.destdir}">
- <patternset>
- <include name="**" />
- </patternset>
- </fileset>
- </jar>
-
- <!-- 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>
- </target>
-
- <!-- java2html converter -->
- <taskdef name="java2html" classname="de.java2html.anttasks.Java2HtmlTask" classpath="build/lib/java2html.jar" />
-
- <!-- ================================================================== -->
- <!-- Difference to previous release package. -->
- <!-- ================================================================== -->
-
- <!-- This should be called after the Linux package is ready. -->
- <target name="differences" if="build.differences">
- <exec executable="python" searchpath="true" failonerror="true" output="${result-path}/differences.txt">
- <arg value="build/bin/package-diff.py"/>
- <arg value="${version.full}"/>
- </exec>
-
- <echo>##teamcity[publishArtifacts '${result-path}/differences.txt']</echo>
- </target>
-
- <!-- ================================================================== -->
- <!-- Custom build. -->
- <!-- ================================================================== -->
-
- <!-- Main target for the custom build. -->
- <target name="custom-build" depends="clean-result, custom-build-init, nightly-init, package-init, init, build">
- </target>
-
-
- <!-- Initialize a custom build. -->
- <target name="custom-build-init">
- <echo>Preparing a custom build with properties file: ${build.properties.file}</echo>
-
- <!-- 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}.custom-${build.date.compact}"/>
- <!-- <property name="compile.only.default-widgetset" value="1"/> -->
- </then>
- <!-- Otherwise version and snapshot.repository.url come from target "init" -->
- </antcontrib:if>
- </target>
-
- <target name="custom-build-maven-publish">
- <antcall target="nightly-maven-publish" />
- </target>
-
-
- <!-- ================================================================== -->
- <!-- Nightly build. -->
- <!-- ================================================================== -->
-
- <!-- Main target for the nightly build. -->
- <target name="nightly" depends="clean-result, nightly-init, package-init, init, build, docs, internal-package-zip">
- </target>
-
-
- <!-- Initialize a nightly build. -->
- <target name="nightly-init">
-
- <!-- 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"/>
-
- <property file="build/VERSION.properties" />
-
- <echo>Base version: ${version}</echo>
- <echo>Build number: ${build.number}</echo>
- <echo>Build tag: ${build.tag}</echo>
- <echo>Publish target: ${nightly.publish}</echo>
- <echo>Demo publish target: ${nightly.demo.publish}</echo>
-
- <!-- Set build number. -->
- <tstamp>
- <format property="nightly.date" pattern="yyyyMMdd"/>
- </tstamp>
- <property name="version.full" value="${version}.${build.tag}-${nightly.date}-c${build.number}"/>
-
- <echo>Version will be: ${version.full}</echo>
-
- <!-- Tell TeamCity the build name. Have to do it this way, because -->
- <!-- this script needs to get the plain build number as a parameter. -->
- <echo>##teamcity[buildNumber '${version}-c${build.number}']</echo>
- </target>
-
- <target name="nightly-teamcity-publish">
- <!-- Publish as a TeamCity artifact. -->
- <echo>##teamcity[publishArtifacts '${output-dir}/WebContent/WEB-INF/lib/${lib-jar-name}']</echo>
- </target>
-
- <!-- Copies the nightly build artifacts to the download server. -->
- <target name="nightly-download-publish" if="nightly.publish">
- <!-- Publish to the download server. -->
- <echo>Installing ${output-dir}/WebContent/${lib-jar-name} to ${nightly.publish}</echo>
- <echo>Hopefully you have permissions for the copy operation with SSH.</echo>
-
- <property name="package.filename" value="${result-path}/${base-name}.zip"/>
-
- <!-- Copy the linux installation package and the JAR. -->
- <exec executable="scp" searchpath="true" resultproperty="nightly.install.scp.result">
- <arg value="-B"/>
- <arg value="${output-dir}/WebContent/${lib-jar-name}"/>
- <arg value="${package.filename}"/>
- <arg value="${nightly.publish}"/>
- </exec>
-
- <echo>Result: ${nightly.install.scp.result}</echo>
- </target>
-
- <!-- Copies the nightly build artifacts to the download server. -->
- <target name="nightly-demo-publish" if="nightly.demo.publish" depends="internal-package-war">
- <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"/>
-
-
- <!-- Publish to the demo server. -->
- <property name="src" value="${result-path}/${product-file}-demo-${version.full}.war"/>
- <property name="target" value="${nightly.demo.publish}/${version.major}.${version.minor}-${build.tag}.war"/>
-
- <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>
-
- <target name="nightly-publish" depends="nightly-teamcity-publish, nightly-download-publish, nightly-demo-publish">
- </target>
-
-
- <target name="nightly-maven-pom.xml">
- <echo>Creating pom.xml for nightly build</echo>
- <property name="vaadin.version.maven" value="${version.major}.${version.minor}-SNAPSHOT" />
- <copy tofile="build/maven/pom.xml">
- <filterchain>
- <expandproperties />
- <replacetokens begintoken="@" endtoken="@">
- <token key="MAVEN-VERSION" value="${vaadin.version.maven}" />
- </replacetokens>
- </filterchain>
- <fileset file="build/maven/pom-template.xml"/>
- </copy>
- </target>
-
- <target name="nightly-maven-publish" depends="nightly-maven-pom.xml">
- <property file="${gpg.passphrase.file}" />
-
- <!--
-
- <echo>Publishing ${result-path}/${lib-javadoc-jar-name} to Maven repository</echo>
- <artifact:mvn>
- <arg value="gpg:sign-and-deploy-file"/>
- <sysproperty key="file" value="../${result-path}/${lib-javadoc-jar-name}" />
- <sysproperty key="pomFile" value="maven/pom.xml" />
- <sysproperty key="repositoryId" value="vaadin-snapshots" />
- <sysproperty key="url" value="${snapshot.repository.url}" />
- <sysproperty key="classifier" value="javadoc" />
- <sysproperty key="uniqueVersion" value="false" />
- <sysproperty key="gpg.passphrase" value="${gpg.passphrase}" />
- </artifact:mvn>
-
- <echo>Publishing ${result-path}/${lib-sources-jar-name} to Maven repository</echo>
- <artifact:mvn>
- <arg value="gpg:sign-and-deploy-file"/>
- <sysproperty key="file" value="../${result-path}/${lib-sources-jar-name}" />
- <sysproperty key="pomFile" value="maven/pom.xml" />
- <sysproperty key="repositoryId" value="vaadin-snapshots" />
- <sysproperty key="url" value="${snapshot.repository.url}" />
- <sysproperty key="classifier" value="sources" />
- <sysproperty key="uniqueVersion" value="false" />
- <sysproperty key="gpg.passphrase" value="${gpg.passphrase}" />
- </artifact:mvn>
-
- -->
-
- <echo>Publishing ${output-dir}/WebContent/${lib-jar-name} to Maven repository</echo>
- <artifact:mvn>
- <arg value="gpg:sign-and-deploy-file"/>
- <!-- .. is a workaround as maven runs in the build directory -->
- <sysproperty key="file" value="../${output-dir}/WebContent/${lib-jar-name}" />
- <sysproperty key="pomFile" value="maven/pom.xml" />
- <sysproperty key="repositoryId" value="vaadin-snapshots" />
- <sysproperty key="url" value="${snapshot.repository.url}" />
- <sysproperty key="gpg.passphrase" value="${gpg.passphrase}" />
- </artifact:mvn>
- </target>
-
- <target name="local-maven-pom.xml">
- <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}" />
- <copy tofile="build/maven/pom.xml">
- <filterchain>
- <expandproperties />
- <replacetokens begintoken="@" endtoken="@">
- <token key="MAVEN-VERSION" value="${vaadin.version.maven}" />
- </replacetokens>
- </filterchain>
- <fileset file="build/maven/pom-template.xml"/>
- </copy>
- </target>
-
- <target name="local-maven-publish" depends="local-maven-pom.xml">
- <echo>Publishing ${output-dir}/WebContent/${lib-jar-name} to the local Maven repository</echo>
- <artifact:mvn>
- <arg value="install:install-file"/>
- <!-- .. is a workaround as maven runs in the build directory -->
- <sysproperty key="file" value="../${output-dir}/WebContent/${lib-jar-name}" />
- <sysproperty key="pomFile" value="maven/pom.xml" />
- </artifact:mvn>
- </target>
-
- <!-- ================================================================== -->
- <!-- Automated tests. -->
- <!-- ================================================================== -->
-
- <target name="tests" depends="compile-java, internal-package-war">
- <!-- Run all different types of tests in parallel to decrease testing time -->
- <parallel threadcount="3">
- <antcall inheritrefs="true" inheritall="true" target="integration-tests"></antcall>
- <antcall inheritrefs="true" inheritall="true" target="testbench-tests"></antcall>
- <antcall inheritrefs="true" inheritall="true" target="server-side-tests"></antcall>
- </parallel>
- </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">
- <junit printsummary="yes">
- <classpath>
- <pathelement path="${result-path}/classes" />
- <path refid="compile.classpath"/>
- </classpath>
-
- <batchtest fork="yes">
- <fileset dir="tests/src" includes="com/vaadin/tests/server/**/*.java" excludes="**/Abstract*.java" />
- </batchtest>
- </junit>
- </target>
-
- <!-- Assumes java classes have been compiled but depends does not work out well as this is run from a <parallel> task-->
- <target name="generate-sampler-tests" if="build.include.tests">
- <java classname="com.vaadin.demo.tools.GenerateSamplerTest"
- output="tests/scripts/sampler-all-samples.html">
- <classpath>
- <pathelement path="${result-path}/classes" />
- <path refid="compile.classpath"/>
- </classpath>
- </java>
- </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="generate-sampler-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."/>
-
- <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."/>
-
- <property name="com.vaadin.testbench.screenshot.block.error" value="0.025"/>
- <property name="com.vaadin.testbench.debug" value="false"/>
- <property name="package.name" value="${base-name}"/>
-
- <!-- Only Linux tests allowed. TODO: Generalize this. -->
- <property name="package.filename" value="${result-path}/${package.name}.zip"/>
- <property name="package.dir" value="${result-path}/${package.name}.zip"/>
-
- <!-- 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}"/>
-
- <!-- Convert tests to run multiple times if failed. -->
- <property name="retries" value="2"/>
-
- <property name="package.filename" value="${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" />
- <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}"/>
- <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}"/>
- </ant>
- </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">
- <!-- 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."/>
- <fail unless="sshkey.file" message="The 'sshkey.file' property must be defined."/>
-
- <!-- Empty passphrase if no passphrase defined -->
- <property name="passphrase" value="" />
- <property name="demo.war" location="${result-path}/${product-file}-demo-${version.full}.war" />
-
- <!-- Sleep before running integration tests so testbench tests have time to compile and start -->
- <sleep minutes="4" />
-
- <!-- Run the separate test script. -->
- <ant antfile="tests/integration_tests.xml" target="integration-test-all" 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}"/>
-
- <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="${demo.war}"/>
- </ant>
- </target>
- </project>
-
- <!-- 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:
- -->
|