You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

build.xml 52KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107
  1. <?xml version="1.0"?>
  2. <project xmlns:antcontrib="antlib:net.sf.antcontrib"
  3. xmlns:artifact="antlib:org.apache.maven.artifact.ant"
  4. name="Vaadin"
  5. basedir="../" default="package-all">
  6. <!--Call one of package-* targets unless you understand what you are doing. -->
  7. <target name="package-all" depends="clean-all, init, build, javadoc, internal-package-war, internal-package-liferay, differences" description="Build public packages.">
  8. </target>
  9. <target name="package-jar" depends="clean-result, init, vaadin.jar" description="Create vaadin-x.y.z.jar file.">
  10. </target>
  11. <target name="package-war" depends="clean-result, init, build, javadoc, internal-package-war, differences">
  12. </target>
  13. <target name="package-liferay-zip" depends="clean-result, init, build, internal-package-liferay">
  14. </target>
  15. <!-- Locations of Ant task JARs - build properties not yet read at this point -->
  16. <property name="ant.task.jar.antcontrib" value="build/lib/ant-contrib-1.0b3.jar" />
  17. <property name="ant.task.jar.maven" value="build/lib/maven-ant-tasks-2.0.10.jar" />
  18. <path id="emma.lib" >
  19. <pathelement location="build/lib/emma_ant.jar" />
  20. <pathelement location="build/lib/emma-2.0.5312-patched.jar" />
  21. </path>
  22. <taskdef resource="emma_ant.properties" classpathref="emma.lib" />
  23. <!-- ant contrib required for flow control (for loop, if, property override) -->
  24. <!-- Note that we have to use a namespace to avoid clash when running sub-ant. -->
  25. <taskdef uri="antlib:net.sf.antcontrib" resource="net/sf/antcontrib/antlib.xml">
  26. <classpath>
  27. <pathelement location="${ant.task.jar.antcontrib}" />
  28. </classpath>
  29. </taskdef>
  30. <!-- ant contrib for Maven integration -->
  31. <path id="maven-ant-tasks.classpath" path="${ant.task.jar.maven}" />
  32. <typedef resource="org/apache/maven/artifact/ant/antlib.xml"
  33. uri="antlib:org.apache.maven.artifact.ant"
  34. classpathref="maven-ant-tasks.classpath" />
  35. <!-- Clean results - - - - - - - - - - - - - - - - - - - - - - - - - -->
  36. <target name="clean-result" depends="build.properties">
  37. <!-- Clean build result directory. -->
  38. <delete dir="${result-path}" includes="**/*" followsymlinks="false" defaultexcludes="false" includeemptydirs="true" failonerror="false"/>
  39. </target>
  40. <target name="build.properties">
  41. <property file="build/build.properties" />
  42. <property file="build/VERSION.properties" />
  43. <property file="build/GWT-VERSION.properties" />
  44. <!-- result source and classes folders -->
  45. <property name="result-src-core" value="${result-path}/src/core"/>
  46. <property name="result-src-junit" value="${result-path}/src/junit"/>
  47. <property name="result-src-testbench" value="${result-path}/src/testbench"/>
  48. <property name="result-classes-core" value="${result-path}/classes/core"/>
  49. <property name="result-classes-junit" value="${result-path}/classes/junit"/>
  50. <property name="result-classes-testbench" value="${result-path}/classes/testbench"/>
  51. <!-- Folder where Emma instrumented classes are placed (if Emma is used)-->
  52. <property name="result-classes-core-for-emma-war" value="${result-path}/classes/emma-war"/>
  53. <property name="result-classes-core-for-emma-junit" value="${result-path}/classes/emma-junit"/>
  54. </target>
  55. <target name="clean-all" depends="clean-result">
  56. </target>
  57. <!-- ================================================================== -->
  58. <!-- Check versions. -->
  59. <!-- ================================================================== -->
  60. <!-- Java compiler version. -->
  61. <target name="check-java-version">
  62. <condition property="java.version.matches">
  63. <or>
  64. <equals arg1="${ant.java.version}" arg2="1.5"/>
  65. <isset property="ignoreversion"/>
  66. </or>
  67. </condition>
  68. <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."/>
  69. <echo>Java version is ${ant.java.version} as required.</echo>
  70. </target>
  71. <!-- Check Servlet API version. -->
  72. <!-- We must use Servlet API 2.3 to catch incompatibilities.. -->
  73. <target name="check-servlet-version">
  74. <available classpathref="compile.classpath" classname="javax.servlet.Servlet" property="servlet.available"/>
  75. <fail unless="servlet.available" message="Java Servlet API library is not available."/>
  76. <echo>Java Servlet API is available.</echo>
  77. <available classpathref="compile.classpath" classname="javax.servlet.ServletRequestListener" property="servlet.version.is-2.4"/>
  78. <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."/>
  79. <echo>Java Servlet API specification 2.3 used.</echo>
  80. </target>
  81. <!-- ================================================================== -->
  82. <!-- Initialization - - - - - - - - - - - - - - - - - - - - - - - - - - -->
  83. <!-- ================================================================== -->
  84. <target name="init" depends="check-java-version, build.properties">
  85. <!-- Current timestamp in different formats. -->
  86. <tstamp>
  87. <format property="build.date" pattern="yyyy-MM-dd"/>
  88. </tstamp>
  89. <tstamp>
  90. <format property="build.date.compact" pattern="yyyyMMdd"/>
  91. </tstamp>
  92. <antcontrib:propertyregex property="version.major" input="${version}" regexp="([^\.]*)\.([^\.]*)\.([^\.]*)" select="\1"/>
  93. <antcontrib:propertyregex property="version.minor" input="${version}" regexp="([^\.]*)\.([^\.]*)\.([^\.]*)" select="\2"/>
  94. <antcontrib:propertyregex property="version.revision" input="${version}" regexp="([^\.]*)\.([^\.]*)\.([^\.]*)" select="\3"/>
  95. <!-- Default full version name. -->
  96. <!-- Nightly and other TeamCity builds will define their own. -->
  97. <property name="version.full" value="${version}.dev-${build.date.compact}"/>
  98. <echo>Base Version: ${version}</echo>
  99. <echo>Full Version: ${version.full}</echo>
  100. <!-- Other properties -->
  101. <property file="build/html-style.properties" />
  102. <echo>Vaadin package is: ${vaadin-package}</echo>
  103. <!-- Create result dir unless already exists -->
  104. <mkdir dir="${result-path}" />
  105. <!-- Create dirs that might be used by the test coverage generation -->
  106. <mkdir dir="${result-classes-core-for-emma-war}" />
  107. <mkdir dir="${result-classes-core-for-emma-junit}" />
  108. <mkdir dir="${result-path}/coverage" />
  109. <echo>We are using gwt version ${gwt-version}.</echo>
  110. <!-- Destination files -->
  111. <property name="base-name" value="${product-file}-${version.full}" />
  112. <property name="lib-jar-name" value="${base-name}.jar" />
  113. <property name="lib-sources-jar-name" value="${base-name}-sources.jar" />
  114. <property name="lib-javadoc-jar-name" value="${base-name}-javadoc.jar" />
  115. <property name="test-war-filename" value="${product-file}-tests-${version.full}.war"/>
  116. <echo message="Prepared to build ${product-file} version ${version.full} packages" />
  117. <!-- Output directory -->
  118. <property name="output-dir" value="${result-path}/${base-name}" />
  119. <mkdir dir="${output-dir}" />
  120. <!-- Where widgetsets are written to. -->
  121. <!-- When not building a package, widgetsets should be written to -->
  122. <!-- WebContent/VAADIN/widgetsets, which needs to be set in -->
  123. <!-- init-nonpackage target before calling this main init target. -->
  124. <property name="widgetsets-output-dir" value="${output-dir}/WebContent/VAADIN/widgetsets" />
  125. <!-- Create Output Directory Hierarchy -->
  126. <mkdir dir="${output-dir}/WebContent" />
  127. <mkdir dir="${output-dir}/WebContent/demo" />
  128. <mkdir dir="${output-dir}/WebContent/docs" />
  129. <mkdir dir="${output-dir}/WebContent/docs/api" />
  130. <mkdir dir="${output-dir}/WebContent/tests" />
  131. <mkdir dir="${output-dir}/WebContent/WEB-INF" />
  132. <mkdir dir="${output-dir}/WebContent/WEB-INF/lib" />
  133. <mkdir dir="${output-dir}/WebContent/WEB-INF/classes" />
  134. <!-- Construct classpath used by java and javadoc compilation -->
  135. <path id="compile.classpath">
  136. <pathelement path="build/lib/servlet.jar" />
  137. <fileset dir="lib/core">
  138. <include name="**/*.jar"/>
  139. <!-- Exclude these as they contain Servlet API 2.4. -->
  140. <!-- The gwt-*-noservlet.jar are then used instead. -->
  141. <exclude name="**/servlet-api*.jar"/>
  142. <exclude name="**/gwt-dev.jar"/>
  143. <exclude name="**/gwt-user.jar"/>
  144. </fileset>
  145. <fileset dir="lib/tests">
  146. <include name="**/*.jar"/>
  147. </fileset>
  148. </path>
  149. <path id="compile.classpath.server-side">
  150. <path refid="compile.classpath"/>
  151. </path>
  152. <path id="compile.classpath.client-side">
  153. <path refid="compile.classpath"/>
  154. <pathelement path="${lib-gwt-user}" />
  155. <pathelement path="${lib-gwt-dev}" />
  156. </path>
  157. </target>
  158. <target name="internal-package-war">
  159. <echo>Building Test WAR</echo>
  160. <echo>Adding test class files and resources and launcher configuration.</echo>
  161. <copy todir="${output-dir}/WebContent/WEB-INF/classes">
  162. <fileset dir="${result-classes-testbench}">
  163. <include name="${vaadin-package}/tests/**/*" />
  164. <include name="${vaadin-package}/launcher/**" />
  165. </fileset>
  166. <fileset dir="${result-classes-junit}">
  167. <!-- VaadinClasses is used by both JUnit and TestBench tests -->
  168. <include name="**/VaadinClasses*.class" />
  169. </fileset>
  170. <!-- test resources -->
  171. <fileset dir="tests/testbench">
  172. <include name="${vaadin-package}/tests/**/*" />
  173. <!-- Pre-processed versions of these copied above -->
  174. <exclude name="**/*.java" />
  175. <exclude name="**/*.html" />
  176. <exclude name="**/*.css" />
  177. <exclude name="**/*.xml" />
  178. </fileset>
  179. <!-- Include files required by the DemoLauncher/DevelopmentServerLauncher -->
  180. <fileset dir="tests/testbench">
  181. <include name="${vaadin-package}/launcher/jetty-webdefault.xml" />
  182. <include name="${vaadin-package}/launcher/keystore" />
  183. </fileset>
  184. </copy>
  185. <war warfile="${result-path}/${test-war-filename}">
  186. <fileset dir="${output-dir}/WebContent">
  187. <!-- Already in JAR -->
  188. <!-- Not excluded because used from WAR by portal integration tests
  189. <exclude name="VAADIN/themes/base/**/*" />
  190. <exclude name="VAADIN/themes/chameleon/**/*" />
  191. <exclude name="VAADIN/themes/liferay/**/*" />
  192. <exclude name="VAADIN/themes/reindeer/**/*" />
  193. <exclude name="VAADIN/themes/runo/**/*" />
  194. <exclude name="VAADIN/widgetsets/com.vaadin.terminal.gwt.DefaultWidgetSet/**/*" />
  195. -->
  196. <!-- Not needed for testing -->
  197. <exclude name="docs/**/*" />
  198. <exclude name="docs" />
  199. <include name="**/*" />
  200. </fileset>
  201. </war>
  202. </target>
  203. <target name="internal-package-liferay" depends="internal-package-war">
  204. <!-- We assume the needed files are put in place by internal-package-war -->
  205. <echo>Building Liferay zip</echo>
  206. <zip zipfile="${result-path}/${base-name}-liferay.zip">
  207. <zipfileset prefix="VAADIN/widgetsets/com.vaadin.portal.gwt.PortalDefaultWidgetSet" dir="${output-dir}/WebContent/VAADIN/widgetsets/com.vaadin.portal.gwt.PortalDefaultWidgetSet">
  208. <patternset>
  209. <include name="**/*" />
  210. </patternset>
  211. </zipfileset>
  212. <zipfileset prefix="VAADIN/themes" dir="${output-dir}/WebContent/VAADIN/themes">
  213. <patternset>
  214. <include name="base/**/*" />
  215. <include name="chameleon/**/*" />
  216. <include name="liferay/**/*" />
  217. <include name="runo/**/*" />
  218. <include name="reindeer/**/*" />
  219. </patternset>
  220. </zipfileset>
  221. </zip>
  222. <echo>##teamcity[publishArtifacts '${result-path}/${base-name}-liferay.zip']</echo>
  223. </target>
  224. <!-- Build server-side, client-side, libraries, and tests. -->
  225. <!-- The client-side needs to be built before vaadin.jar, because the vaadin.jar -->
  226. <!-- require the default widgetset and doing otherwise would build it twice. -->
  227. <!-- However, since compiling the server-side is required by the client-side -->
  228. <!-- compilation, the server-side will actually be built before it. -->
  229. <target name="build"
  230. depends="compile-server-side, compile-tests, compile-client-side, vaadin.jar, vaadin-sources.jar"
  231. description="Build package required files, without packing them.">
  232. </target>
  233. <target name="compile-server-side" depends="compile-core, webcontent"/>
  234. <!-- Copy and preprocess sources for packaging
  235. NOTE: Replaces <version></version> tags with build version tag for some "textual" files
  236. -->
  237. <target name="preprocess-src">
  238. <!--
  239. Source directories in the project are
  240. * src (Vaadin core)
  241. * tests/testbench (TestBench test cases)
  242. * tests/server-side (Server-side JUnit test cases)
  243. * tests/client-side (Client-side JUnit test cases)
  244. These are copied to
  245. * ${result-path}/src/core
  246. * ${result-path}/src/tests
  247. * ${result-path}/src/junit
  248. And compiled to
  249. * ${result-path}/classes/core
  250. * ${result-path}/classes/tests
  251. * ${result-path}/classes/junit
  252. Java/HTML/CSS/XML files are filtered so the license is added and the version is set.
  253. Other files are just copied.
  254. -->
  255. <loadfile property="VaadinApache2LicenseForJavaFiles" srcFile="build/VaadinApache2LicenseForJavaFiles.txt" />
  256. <mkdir dir="${result-path}/src" />
  257. <mkdir dir="${result-src-core}" />
  258. <mkdir dir="${result-src-testbench}" />
  259. <mkdir dir="${result-src-junit}" />
  260. <patternset id="preprocessable-files">
  261. <include name="**/*.java" />
  262. <include name="**/*.html" />
  263. <include name="**/*.css" />
  264. <include name="**/*.xml" />
  265. </patternset>
  266. <patternset id="non-preprocessable-files">
  267. <exclude name="**/.svn" />
  268. <exclude name="**/*.java" />
  269. <exclude name="**/*.html" />
  270. <exclude name="**/*.css" />
  271. <exclude name="**/*.xml" />
  272. </patternset>
  273. <filterset id="version-and-license">
  274. <filter token="VaadinApache2LicenseForJavaFiles" value="${VaadinApache2LicenseForJavaFiles}" />
  275. <filter token="VERSION" value="${version.full}" />
  276. </filterset>
  277. <!-- Adds a style class to JavaDoc <pre> tags for style customization. -->
  278. <filterset id="pre-css-style" begintoken=" * &lt;" endtoken="&gt;">
  279. <filter token="pre" value=" * &lt;pre class='code'&gt;" />
  280. </filterset>
  281. <echo>Copying src directory and processing copied files.</echo>
  282. <echo>Replacing &lt;version&gt; tag with build version for java/html/css/xml files.</echo>
  283. <copy todir="${result-src-core}" overwrite="yes">
  284. <filterset refid="version-and-license"/>
  285. <filterset refid="pre-css-style"/>
  286. <fileset dir="src">
  287. <patternset refid="preprocessable-files" />
  288. </fileset>
  289. </copy>
  290. <copy todir="${result-src-testbench}">
  291. <filterset refid="version-and-license"/>
  292. <fileset dir="tests/testbench">
  293. <patternset refid="preprocessable-files" />
  294. </fileset>
  295. </copy>
  296. <copy todir="${result-src-junit}">
  297. <filterset refid="version-and-license"/>
  298. <fileset dir="tests/server-side">
  299. <patternset refid="preprocessable-files" />
  300. </fileset>
  301. <fileset dir="tests/client-side">
  302. <patternset refid="preprocessable-files" />
  303. </fileset>
  304. </copy>
  305. <!-- Unify mix usage of mac/Linux/Win characters -->
  306. <echo>Unifying mix usage of Mac/Linux/Win linefeeds for java/html/css/xml files.</echo>
  307. <fixcrlf srcdir="${result-path}/src" eol="crlf" tablength="4" tab="asis" includes="**/*.java **/*.html **/*.css **/*.xml" />
  308. <!-- Add other files such as images, these are not filtered or processed by fixcrlf task -->
  309. <echo>Copying non java/html/css/xml files such as images.</echo>
  310. <copy todir="${result-src-core}">
  311. <fileset dir="src">
  312. <patternset refid="non-preprocessable-files" />
  313. </fileset>
  314. </copy>
  315. <copy todir="${result-src-testbench}">
  316. <fileset dir="tests/testbench">
  317. <patternset refid="non-preprocessable-files" />
  318. </fileset>
  319. </copy>
  320. <copy todir="${result-src-junit}">
  321. <fileset dir="tests/server-side">
  322. <patternset refid="non-preprocessable-files" />
  323. </fileset>
  324. <fileset dir="tests/client-side">
  325. <patternset refid="non-preprocessable-files" />
  326. </fileset>
  327. </copy>
  328. </target>
  329. <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  330. WebContent
  331. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
  332. <target name="webcontent" depends="preprocess-src,defaulttheme">
  333. <!-- copy 3rd part libraries used by tests -->
  334. <copy todir="${output-dir}/WebContent/tests/lib">
  335. <fileset dir="lib/core">
  336. <include name="jetty/**/*" />
  337. </fileset>
  338. <fileset dir="build/lib">
  339. <include name="emma-2.0.5312-patched.jar" />
  340. </fileset>
  341. </copy>
  342. <!-- Add WebContent -->
  343. <echo>Adding VAADIN/themes and META-INF</echo>
  344. <copy todir="${output-dir}/WebContent">
  345. <fileset dir="WebContent">
  346. <exclude name="**/.svn" />
  347. <!-- TODO check what is necessary -->
  348. <include name="WEB-INF/lib/hsqldb.jar" />
  349. <include name="VAADIN/themes/**/*" />
  350. <include name="META-INF/**/*" />
  351. </fileset>
  352. </copy>
  353. <!-- Add servlet and portlet configuration files from WebContent -->
  354. <copy todir="${output-dir}/WebContent/WEB-INF">
  355. <fileset dir="WebContent/WEB-INF">
  356. <include name="liferay-*.xml" />
  357. <include name="portlet.xml" />
  358. <include name="web.xml" />
  359. </fileset>
  360. </copy>
  361. <!-- These should go to various JARs -->
  362. <copy todir="${output-dir}/WebContent">
  363. <filterchain>
  364. <expandproperties />
  365. <replacetokens begintoken="@" endtoken="@">
  366. <token key="version" value="${version.full}" />
  367. </replacetokens>
  368. <replacetokens begintoken="@" endtoken="@">
  369. <token key="version-minor" value="${version.major}.${version.minor}" />
  370. </replacetokens>
  371. <replacetokens begintoken="@" endtoken="@">
  372. <token key="builddate" value="${build.date}" />
  373. </replacetokens>
  374. <replacetokens begintoken="@" endtoken="@">
  375. <token key="gwt-version" value="${gwt-version}" />
  376. </replacetokens>
  377. </filterchain>
  378. <fileset dir="WebContent">
  379. <exclude name="**/.svn" />
  380. <include name="release-notes.html" />
  381. <include name="license.html" />
  382. <include name="css/**" />
  383. <include name="img/**" />
  384. </fileset>
  385. </copy>
  386. </target>
  387. <target name="compile-core" depends="init, preprocess-src">
  388. <echo>Compiling src (server-side)</echo>
  389. <!-- Compile core sources first as the other sources depend on these -->
  390. <mkdir dir="${result-classes-core}" />
  391. <javac source="1.5" target="1.5" classpathref="compile.classpath.server-side" destdir="${result-classes-core}" debug="true" encoding="UTF-8" includeantruntime="false">
  392. <src path="${result-src-core}"/>
  393. </javac>
  394. </target>
  395. <target name="compile-tests" depends="compile-core">
  396. <echo>Compiling src (Server and client side JUnit tests)</echo>
  397. <!-- Compile server and client side JUnit tests -->
  398. <mkdir dir="${result-classes-junit}" />
  399. <javac source="1.5" target="1.5" classpathref="compile.classpath.server-side" destdir="${result-classes-junit}" debug="true" encoding="UTF-8" includeantruntime="false">
  400. <classpath path="${result-classes-core}"></classpath>
  401. <src path="${result-src-junit}"/>
  402. </javac>
  403. <echo>Compiling src (TestBench tests)</echo>
  404. <!-- Compile TestBench tests -->
  405. <mkdir dir="${result-classes-testbench}" />
  406. <javac source="1.5" target="1.5" classpathref="compile.classpath.server-side" destdir="${result-classes-testbench}" debug="true" encoding="UTF-8" includeantruntime="false">
  407. <classpath path="${result-classes-junit}"></classpath>
  408. <classpath path="${result-classes-core}"></classpath>
  409. <src path="${result-src-testbench}"/>
  410. </javac>
  411. </target>
  412. <target name="compile-helpers" depends="init">
  413. <javac source="1.5" target="1.5" srcdir="build/buildhelpers" classpath="build/smartsprites/lib/smartsprites-0.2.3-itmill.jar" includeantruntime="false"/>
  414. </target>
  415. <target name="defaulttheme" depends="init, compile-helpers">
  416. <echo>Combining default themes css files</echo>
  417. <java classname="com.vaadin.buildhelpers.CompileDefaultTheme" failonerror="yes" fork="yes">
  418. <arg value="-version" />
  419. <arg value="${version.full}"/>
  420. <classpath>
  421. <pathelement location="build/buildhelpers" />
  422. <fileset dir="build/smartsprites/lib">
  423. <include name="*.jar"/>
  424. </fileset>
  425. </classpath>
  426. <jvmarg value="-Djava.awt.headless=true"/>
  427. </java>
  428. </target>
  429. <target name="testtarget">
  430. <echo>TEST TARGET CALLED</echo>
  431. </target>
  432. <!-- ================================================================== -->
  433. <!-- Widget Set Compilation -->
  434. <!-- ================================================================== -->
  435. <!-- Widget set compilation process: -->
  436. <!-- 1. Preprocess sources -->
  437. <!-- 2. Compile server-side java -->
  438. <!-- 3. Generate widget set definitions and classes -->
  439. <!-- 4. Compile widget sets -->
  440. <!-- -->
  441. <!-- Widget sets can be built for two purposes: -->
  442. <!-- * for building installation packages -->
  443. <!-- * for building single widget sets during development -->
  444. <!-- Targets: widgetset-<name> -->
  445. <target name="remove-widgetset-gwt-tmp">
  446. <echo>Removing widgetset temp files</echo>
  447. <delete dir="${widgetsets-output-dir}/.gwt-tmp" includeemptydirs="true"/>
  448. <!-- This is generated by GWT 2.3+ for rpcPolicyManifest and symbolMaps, cannot disable -->
  449. <delete dir="${widgetsets-output-dir}/WEB-INF" includeemptydirs="true" failonerror="false" />
  450. </target>
  451. <!-- The widgetset generator is currently compiled along with rest of server-side Java. -->
  452. <target name="compile-widgetset-generator" depends="compile-core"/>
  453. <path id="widgetset-compile-classpath">
  454. <pathelement location="${lib-gwt-user}" />
  455. <pathelement location="${lib-gwt-dev}" />
  456. <pathelement location="${lib-gwt-validation}" />
  457. <pathelement location="${lib-gwt-validation-src}" />
  458. <pathelement location="${result-classes-core}" />
  459. <pathelement location="${result-src-core}" />
  460. </path>
  461. <target name="compile-widgetset" description="Compiles the widgetset given as the first parameter">
  462. <fail unless="widgetset" message="No widgetset parameter set"/>
  463. <property name="widgetset-style" value="OBF" />
  464. <property name="widgetset-localWorkers" value="4" />
  465. <property name="widgetset-extraParams" value="" />
  466. <echo>Compiling widgetset ${widgetset}. Output directory: ${widgetsets-output-dir}</echo>
  467. <java classname="com.google.gwt.dev.Compiler" failonerror="yes" fork="yes" maxmemory="512m">
  468. <classpath refid="widgetset-compile-classpath"/>
  469. <arg value="-war" />
  470. <arg value="${widgetsets-output-dir}" />
  471. <arg value="-style" />
  472. <arg value="${widgetset-style}" />
  473. <arg value="-localWorkers" />
  474. <arg value="${widgetset-localWorkers}" />
  475. <arg line="${widgetset-extraParams}" />
  476. <arg value="${widgetset}" />
  477. <jvmarg value="-Xss8M"/>
  478. <jvmarg value="-XX:MaxPermSize=256M"/>
  479. <jvmarg value="-Djava.awt.headless=true"/>
  480. </java>
  481. <antcall target="remove-widgetset-gwt-tmp"/>
  482. <echo>Compiled ${widgetset}</echo>
  483. </target>
  484. <target name="compile-widgetset-default">
  485. <antcall target="compile-widgetset">
  486. <param name="widgetset" value="com.vaadin.terminal.gwt.DefaultWidgetSet"/>
  487. </antcall>
  488. </target>
  489. <target name="compile-widgetset-portal-default" unless="compile.only.default-widgetset">
  490. <antcall target="compile-widgetset">
  491. <param name="widgetset" value="com.vaadin.portal.gwt.PortalDefaultWidgetSet"/>
  492. </antcall>
  493. </target>
  494. <!-- Compiles all widgetsets. -->
  495. <!-- This is called when building packages and when compiling all -->
  496. <!-- widgetsets, but not when compiling individual widgetsets. -->
  497. <target name="compile-client-side" depends="compile-server-side">
  498. <echo>Compiling widget sets in parallel.</echo>
  499. <parallel threadsperprocessor="1">
  500. <antcall target="compile-widgetset-default"/>
  501. <antcall target="compile-widgetset-portal-default"/>
  502. </parallel>
  503. </target>
  504. <!-- Definitions for building local components, i.e., not for an installation package. -->
  505. <target name="init-nonpackage" depends="build.properties">
  506. <!-- Definitions for building the client-side. -->
  507. <property name="widgetsets-output-dir" value="WebContent/VAADIN/widgetsets" />
  508. <echo>We are using ${lib-gwt-dev}.</echo>
  509. <echo>Widget sets output dir: ${widgetsets-output-dir}</echo>
  510. </target>
  511. <!-- Builds all widgetsets locally, i.e., not for an installation package. -->
  512. <target name="widgetsets" depends="init-nonpackage, init, compile-widgetset-generator, compile-client-side"/>
  513. <!-- Build each widgetset locally, i.e., not for an installation package. -->
  514. <target name="widgetset-default" depends="init-nonpackage, init, compile-widgetset-generator, compile-widgetset-default"/>
  515. <target name="widgetset-portal-default" depends="init-nonpackage, init, compile-widgetset-generator, compile-widgetset-portal-default"/>
  516. <!-- ================================================================== -->
  517. <!-- Libraries and Tests -->
  518. <!-- ================================================================== -->
  519. <!-- Compile the Vaadin library JAR. -->
  520. <!-- Need only the default widgetset for this, but can't depend -->
  521. <!-- specifically on it, because dependence does not see compiled -->
  522. <!-- individual widgetsets, because antcall does not fulfill -->
  523. <!-- dependencies. -->
  524. <target name="vaadin.jar" depends="compile-server-side, compile-client-side, compile-helpers">
  525. <echo>Creating JAR (server-side) ${lib-jar-name}</echo>
  526. <!-- Create Vaadin JAR -->
  527. <mkdir dir="${output-dir}/META-INF"/>
  528. <echo file="${output-dir}/META-INF/VERSION">${version.full}</echo>
  529. <echo file="${output-dir}/META-INF/GWT-VERSION">${gwt-version}</echo>
  530. <emma enabled="${emma.enabled}" >
  531. <instr instrpath="${result-classes-core}"
  532. destdir="${result-classes-core-for-emma-war}"
  533. mode="copy"
  534. metadatafile="${result-path}/war.es"
  535. merge="false"
  536. >
  537. <filter includes="com.vaadin.*" />
  538. <filter excludes="com.vaadin.terminal.gwt.*" />
  539. </instr>
  540. </emma>
  541. <jar jarfile="${output-dir}/WebContent/WEB-INF/lib/${lib-jar-name}"
  542. compress="true" manifest="build/package/META-INF/MANIFEST.MF" duplicate="preserve">
  543. <metainf dir="${output-dir}/META-INF"/>
  544. <manifest>
  545. <attribute name="Vaadin-Package-Version" value="1" />
  546. <attribute name="Vaadin-Widgetsets" value="com.vaadin.terminal.gwt.DefaultWidgetSet" />
  547. <attribute name="Implementation-Vendor" value="Vaadin Ltd" />
  548. <attribute name="Implementation-URL" value="http://vaadin.com" />
  549. <attribute name="Implementation-Version" value="${version.full}" />
  550. <attribute name="GWT-Version" value="${gwt-version}" />
  551. <attribute name="GWT-Version-Dependencies" value="${gwt-version-dependencies}" />
  552. <attribute name="Bundle-Version" value="${version.full}" />
  553. </manifest>
  554. <!-- Include any instrumented class files before the normal classes -->
  555. <fileset dir="${result-classes-core-for-emma-war}" />
  556. <fileset dir="${result-classes-core}"/>
  557. <!-- add sources -->
  558. <fileset dir="${result-src-core}"/>
  559. <fileset dir="${output-dir}/WebContent">
  560. <patternset>
  561. <include name="VAADIN/widgetsets/com.vaadin.terminal.gwt.DefaultWidgetSet/**/*" />
  562. <include name="VAADIN/themes/base/**/*" />
  563. <include name="VAADIN/themes/chameleon/**/*" />
  564. <include name="VAADIN/themes/liferay/**/*" />
  565. <include name="VAADIN/themes/runo/**/*" />
  566. <include name="VAADIN/themes/reindeer/**/*" />
  567. <include name="release-notes.html" />
  568. <include name="license.html" />
  569. <include name="css/**" />
  570. <include name="img/**" />
  571. </patternset>
  572. </fileset>
  573. </jar>
  574. <!-- Generate the Export-Package attribute in the manifest of the JAR -->
  575. <java classname="com.vaadin.buildhelpers.GeneratePackageExports" failonerror="true" fork="yes">
  576. <arg value="${output-dir}/WebContent/WEB-INF/lib/${lib-jar-name}"/>
  577. <classpath>
  578. <pathelement location="build/buildhelpers" />
  579. </classpath>
  580. </java>
  581. <echo>##teamcity[publishArtifacts '${output-dir}/WebContent/WEB-INF/lib/${lib-jar-name}']</echo>
  582. </target>
  583. <target name="vaadin-sources.jar" depends="init">
  584. <jar file="${result-path}/${lib-sources-jar-name}" compress="true">
  585. <fileset dir="${result-src-core}">
  586. <patternset>
  587. <include name="**/*.java" />
  588. </patternset>
  589. </fileset>
  590. <fileset dir="${output-dir}/WebContent">
  591. <patternset>
  592. <include name="release-notes.html" />
  593. <include name="license.html" />
  594. <include name="css/**" />
  595. <include name="img/**" />
  596. </patternset>
  597. </fileset>
  598. </jar>
  599. </target>
  600. <!-- ================================================================== -->
  601. <!-- Documentation -->
  602. <!-- ================================================================== -->
  603. <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
  604. <!-- Documentation: Add Javadoc to doc -->
  605. <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
  606. <target name="javadoc" depends="init, preprocess-src">
  607. <property name="javadoc.destdir" value="${output-dir}/WebContent/docs/api"/>
  608. <javadoc destdir="${javadoc.destdir}" author="true" version="true" use="true" windowtitle="${product-name}" classpathref="compile.classpath.client-side">
  609. <packageset dir="${result-src-core}"/>
  610. <doctitle>${javadoc.doctitle}</doctitle>
  611. <!-- <header><![CDATA[<script type="text/javascript" src=".html-style/style.js"></script>]]></header> -->
  612. <bottom>${javadoc.bottom}</bottom>
  613. <link offline="true" href="http://java.sun.com/j2se/1.5.0/docs/api/" packagelistLoc="build/javadoc/j2se-1.5.0" />
  614. <link offline="true" href="http://java.sun.com/j2ee/1.4/docs/api/" packagelistLoc="build/javadoc/j2ee-1.4" />
  615. </javadoc>
  616. <!-- Create a javadoc jar, mainly for Maven -->
  617. <jar file="${result-path}/${lib-javadoc-jar-name}" compress="true">
  618. <fileset dir="${javadoc.destdir}">
  619. <patternset>
  620. <include name="**" />
  621. </patternset>
  622. </fileset>
  623. <fileset dir="${output-dir}/WebContent">
  624. <patternset>
  625. <include name="release-notes.html" />
  626. <include name="license.html" />
  627. <include name="css/**" />
  628. <include name="img/**" />
  629. </patternset>
  630. </fileset>
  631. </jar>
  632. <!-- Append local style definitions. -->
  633. <echo>Appending local style definitions</echo>
  634. <concat destfile="${javadoc.destdir}/stylesheet.css" append="yes">
  635. <filelist dir="build/javadoc" files="stylesheet-local.css"/>
  636. </concat>
  637. </target>
  638. <!-- ================================================================== -->
  639. <!-- Difference to previous release package. -->
  640. <!-- ================================================================== -->
  641. <!-- This should be called after the Linux package is ready. -->
  642. <target name="differences" if="build.differences">
  643. <exec executable="python" searchpath="true" failonerror="true" output="${result-path}/differences.txt">
  644. <arg value="build/bin/package-diff.py"/>
  645. <arg value="${version.full}"/>
  646. </exec>
  647. <echo>##teamcity[publishArtifacts '${result-path}/differences.txt']</echo>
  648. </target>
  649. <!-- ================================================================== -->
  650. <!-- Custom build. -->
  651. <!-- ================================================================== -->
  652. <!-- Main target for the custom build. -->
  653. <!-- Need to read custom build configuration before calling clean-result -->
  654. <target name="custom-build" depends="custom-build-init, clean-result, nightly-init, init, build">
  655. </target>
  656. <!-- Initialize a custom build. -->
  657. <target name="custom-build-init">
  658. <echo>Preparing a custom build with properties file: ${build.properties.file}</echo>
  659. <!-- Custom build support -->
  660. <antcontrib:if>
  661. <isset property="build.properties.file"/>
  662. <then>
  663. <tstamp>
  664. <format property="build.date.compact" pattern="yyyyMMdd"/>
  665. </tstamp>
  666. <property file="${build.properties.file}" />
  667. <property name="version" value="${vaadin.version}"/>
  668. <property name="version.full" value="${version}-${build.date.compact}"/>
  669. </then>
  670. <!-- Otherwise version is set by the target "init" -->
  671. </antcontrib:if>
  672. </target>
  673. <target name="custom-build-maven-publish">
  674. <antcall target="nightly-maven-publish" />
  675. </target>
  676. <!-- ================================================================== -->
  677. <!-- Nightly build. -->
  678. <!-- ================================================================== -->
  679. <!-- Main target for the nightly build. -->
  680. <target name="nightly" depends="clean-result, nightly-init, init, build, javadoc, differences">
  681. </target>
  682. <!-- Initialize a nightly build. -->
  683. <target name="nightly-init" depends="build.properties">
  684. <!-- Mandatory parameters. -->
  685. <fail unless="build.number" message="The build.number property must be defined."/>
  686. <fail unless="nightly.publish" message="The nightly.publish property must be defined."/>
  687. <!-- Optional parameters. -->
  688. <property name="build.tag" value="dev"/>
  689. <echo>Base version: ${version}</echo>
  690. <echo>Build number: ${build.number}</echo>
  691. <echo>Build tag: ${build.tag}</echo>
  692. <echo>Publish target: ${nightly.publish}</echo>
  693. <echo>Demo publish target: ${nightly.demo.publish}</echo>
  694. <!-- Set build number. -->
  695. <tstamp>
  696. <format property="nightly.date" pattern="yyyyMMdd"/>
  697. </tstamp>
  698. <property name="version.full" value="${version}.${build.tag}-${nightly.date}-c${build.number}"/>
  699. <echo>Version will be: ${version.full}</echo>
  700. <!-- Tell TeamCity the build name. Have to do it this way, because -->
  701. <!-- this script needs to get the plain build number as a parameter. -->
  702. <echo>##teamcity[buildNumber '${version}-c${build.number}']</echo>
  703. </target>
  704. <target name="nightly-teamcity-publish">
  705. <!-- Publish as a TeamCity artifact. -->
  706. <echo>##teamcity[publishArtifacts '${output-dir}/WebContent/WEB-INF/lib/${lib-jar-name}']</echo>
  707. </target>
  708. <!-- Copies the nightly build artifacts to the download server. -->
  709. <target name="nightly-download-publish" if="nightly.publish">
  710. <!-- Publish to the download server. -->
  711. <echo>Installing ${output-dir}/WebContent/WEB-INF/lib/${lib-jar-name} to ${nightly.publish}</echo>
  712. <echo>Hopefully you have permissions for the copy operation with SSH.</echo>
  713. <!-- FIXME tries to publish a ZIP; how does the download site handle these? -->
  714. <property name="package.filename" value="${result-path}/${base-name}.zip"/>
  715. <!-- Copy the linux installation package and the JAR. -->
  716. <exec executable="scp" searchpath="true" resultproperty="nightly.install.scp.result">
  717. <arg value="-B"/>
  718. <arg value="${output-dir}/WebContent/WEB-INF/lib/${lib-jar-name}"/>
  719. <arg value="${package.filename}"/>
  720. <arg value="${nightly.publish}"/>
  721. </exec>
  722. <echo>Result: ${nightly.install.scp.result}</echo>
  723. </target>
  724. <!-- Copies the nightly build artifacts to the download server. -->
  725. <target name="nightly-tests-publish" if="nightly.demo.publish" depends="internal-package-war">
  726. <fail unless="version.major" message="Major version must be defined in version.major"/>
  727. <fail unless="version.minor" message="Major version must be defined in version.minor"/>
  728. <!-- Publish to the demo server. -->
  729. <property name="src" value="${result-path}/${test-war-filename}"/>
  730. <property name="target" value="${nightly.demo.publish}/${version.major}.${version.minor}-${build.tag}.war"/>
  731. <echo>Installing ${src} to ${target}</echo>
  732. <!-- Copy the linux installation package and the JAR. -->
  733. <exec executable="scp" searchpath="true" resultproperty="nightly.demo.install.scp.result">
  734. <arg value="-B"/>
  735. <arg value="${src}"/>
  736. <arg value="${target}"/>
  737. </exec>
  738. <echo>Result: ${nightly.install.scp.result}</echo>
  739. </target>
  740. <target name="nightly-publish" depends="nightly-teamcity-publish, nightly-download-publish, nightly-tests-publish">
  741. </target>
  742. <target name="nightly-maven-pom.xml">
  743. <echo>Creating pom.xml for nightly build</echo>
  744. <property name="vaadin.version.maven" value="${version.major}.${version.minor}-SNAPSHOT" />
  745. <copy tofile="build/maven/pom.xml">
  746. <filterchain>
  747. <expandproperties />
  748. <replacetokens begintoken="@" endtoken="@">
  749. <token key="MAVEN-VERSION" value="${vaadin.version.maven}" />
  750. </replacetokens>
  751. </filterchain>
  752. <fileset file="build/maven/pom-template.xml"/>
  753. </copy>
  754. </target>
  755. <target name="nightly-maven-publish" depends="nightly-maven-pom.xml">
  756. <property file="${gpg.passphrase.file}" />
  757. <echo>Publishing ${output-dir}/WebContent/WEB-INF/lib/${lib-jar-name} to Maven repository</echo>
  758. <artifact:mvn>
  759. <arg value="gpg:sign-and-deploy-file"/>
  760. <!-- .. is a workaround as maven runs in the build directory -->
  761. <sysproperty key="file" value="../${output-dir}/WebContent/WEB-INF/lib/${lib-jar-name}" />
  762. <sysproperty key="pomFile" value="maven/pom.xml" />
  763. <sysproperty key="repositoryId" value="vaadin-snapshots" />
  764. <sysproperty key="url" value="${snapshot.repository.url}" />
  765. <sysproperty key="gpg.passphrase" value="${gpg.passphrase}" />
  766. </artifact:mvn>
  767. </target>
  768. <target name="local-maven-pom.xml">
  769. <echo>Creating pom.xml for local test build</echo>
  770. <fail unless="version.major" message="Major version must be defined in version.major"/>
  771. <fail unless="version.minor" message="Major version must be defined in version.minor"/>
  772. <property name="vaadin.version.maven" value="${version.major}.${version.minor}" />
  773. <copy tofile="build/maven/pom.xml">
  774. <filterchain>
  775. <expandproperties />
  776. <replacetokens begintoken="@" endtoken="@">
  777. <token key="MAVEN-VERSION" value="${vaadin.version.maven}" />
  778. </replacetokens>
  779. </filterchain>
  780. <fileset file="build/maven/pom-template.xml"/>
  781. </copy>
  782. </target>
  783. <target name="local-maven-publish" depends="local-maven-pom.xml">
  784. <echo>Publishing ${output-dir}/WebContent/WEB-INF/lib/${lib-jar-name} to the local Maven repository</echo>
  785. <artifact:mvn>
  786. <arg value="install:install-file"/>
  787. <!-- .. is a workaround as maven runs in the build directory -->
  788. <sysproperty key="file" value="../${output-dir}/WebContent/WEB-INF/lib/${lib-jar-name}" />
  789. <sysproperty key="pomFile" value="maven/pom.xml" />
  790. </artifact:mvn>
  791. </target>
  792. <!-- ================================================================== -->
  793. <!-- Automated tests. -->
  794. <!-- ================================================================== -->
  795. <target name="tests" depends="compile-tests, internal-package-war">
  796. <!-- Run all different types of tests in parallel to decrease testing time -->
  797. <parallel threadcount="3">
  798. <sequential>
  799. <!-- Sleep before running integration tests so testbench tests have time to compile and start -->
  800. <sleep minutes="4" />
  801. <antcall inheritrefs="true" inheritall="true" target="integration-tests"></antcall>
  802. </sequential>
  803. <antcall inheritrefs="true" inheritall="true" target="testbench-tests"></antcall>
  804. <antcall inheritrefs="true" inheritall="true" target="server-side-tests"></antcall>
  805. </parallel>
  806. <!-- Create a combined report from each test's sub report -->
  807. <emma enabled="${emma.enabled}" >
  808. <merge file="${result-path}/combined.es">
  809. <fileset dir="${result-path}" >
  810. <include name="*.ec" />
  811. <include name="*.em" />
  812. </fileset>
  813. </merge>
  814. <report sourcepath="${result-src-core}" >
  815. <fileset dir="${result-path}" >
  816. <include name="combined.es" />
  817. </fileset>
  818. <txt outfile="../${result-path}/coverage/coverage-combined/coverage.txt" />
  819. <html outfile="../${result-path}/coverage/coverage-combined/coverage.html" />
  820. </report>
  821. </emma>
  822. <echo>##teamcity[publishArtifacts '${result-path}/coverage']</echo>
  823. </target>
  824. <!-- Assumes java classes have been compiled but depends does not work out well as this is run from a <parallel> task-->
  825. <target name="server-side-tests" unless="tests.serverside.skip" depends="compile-tests">
  826. <emma enabled="${emma.enabled}" >
  827. <instr instrpath="${result-classes-core}"
  828. destdir="${result-classes-core-for-emma-junit}"
  829. mode="copy"
  830. metadatafile="${result-path}/unittests.em"
  831. merge="false"
  832. >
  833. <filter includes="com.vaadin.*" />
  834. <filter excludes="com.vaadin.terminal.gwt.*" />
  835. </instr>
  836. </emma>
  837. <junit printsummary="yes">
  838. <classpath>
  839. <pathelement path="${result-classes-core-for-emma-junit}" />
  840. <pathelement path="${result-classes-core}" />
  841. <pathelement path="${result-classes-junit}" />
  842. <path refid="emma.lib" />
  843. <path refid="compile.classpath"/>
  844. </classpath>
  845. <jvmarg value="-Demma.coverage.out.file=../${result-path}/unittests.ec" />
  846. <batchtest fork="yes">
  847. <fileset dir="tests/server-side" includes="**/*.java" excludes="**/Abstract*.java,**/VaadinClasses.java" />
  848. <fileset dir="tests/client-side" includes="**/*.java" excludes="**/Abstract*.java" />
  849. </batchtest>
  850. </junit>
  851. <emma enabled="${emma.enabled}" >
  852. <report sourcepath="${result-src-core}" >
  853. <fileset dir="${result-path}" >
  854. <include name="unittests.*" />
  855. </fileset>
  856. <txt outfile="../${result-path}/coverage/coverage-unittests/unittests_coverage.txt" />
  857. <html outfile="../${result-path}/coverage/coverage-unittests/unittests_coverage.html" />
  858. </report>
  859. </emma>
  860. <echo>##teamcity[publishArtifacts '${result-path}/coverage']</echo>
  861. </target>
  862. <!-- Assumes java classes have been compiled but depends does not work out well as this is run from a <parallel> task-->
  863. <target name="testbench-tests" unless="tests.testbench.skip">
  864. <fail unless="product-file" message="The 'product-file' property must be defined."/>
  865. <fail unless="version" message="The 'version' property must be defined."/>
  866. <echo>Version: ${version.full}</echo>
  867. <!-- Parameters for the test.xml script. -->
  868. <fail unless="com.vaadin.testbench.tester.host" message="The 'com.vaadin.testbench.tester.host' property must be defined."/>
  869. <fail unless="com.vaadin.testbench.deployment.url" message="The 'com.vaadin.testbench.deployment.url' property must be defined."/>
  870. <fail unless="com.vaadin.testbench.lib.dir" message="The 'com.vaadin.testbench.lib.dir' property must be defined."/>
  871. <property name="com.vaadin.testbench.screenshot.block.error" value="0.025"/>
  872. <property name="com.vaadin.testbench.debug" value="false"/>
  873. <property name="package.name" value="${base-name}"/>
  874. <!-- Only Linux tests allowed. TODO: Generalize this. -->
  875. <property name="package.filename" value="${result-path}/${test-war-filename}"/>
  876. <!-- Run the separate test script. -->
  877. <ant antfile="tests/test.xml" target="test-package" inheritall="false" inheritrefs="true">
  878. <!-- This is provided so that the test script can copy the -->
  879. <!-- "tests" classes after unpacking the package. -->
  880. <property name="output-dir" value="${output-dir}"/>
  881. <!-- Convert tests to run multiple times if failed. -->
  882. <property name="retries" value="2"/>
  883. <property name="package.filename" value="${package.filename}"/>
  884. <property name="testing.testarea" value="/tmp/testarea"/>
  885. <property name="package.name" value="${package.name}"/>
  886. <property name="test-output-dir" value="../build/test-output" />
  887. <property name="com.vaadin.testbench.tester.host" value="${com.vaadin.testbench.tester.host}"/>
  888. <property name="com.vaadin.testbench.deployment.url" value="${com.vaadin.testbench.deployment.url}"/>
  889. <property name="com.vaadin.testbench.lib.dir" value="${com.vaadin.testbench.lib.dir}"/>
  890. <property name="com.vaadin.testbench.debug" value="${com.vaadin.testbench.debug}"/>
  891. <property name="com.vaadin.testbench.screenshot.block.error" value="${com.vaadin.testbench.screenshot.block.error}"/>
  892. </ant>
  893. <emma enabled="${emma.enabled}" >
  894. <report sourcepath="${result-src-core}" >
  895. <fileset dir="${result-path}" >
  896. <include name="war.*" />
  897. </fileset>
  898. <txt outfile="../${result-path}/coverage/coverage-testbench/testbench_coverage.txt" />
  899. <html outfile="../${result-path}/coverage/coverage-testbench/testbench_coverage.html" />
  900. </report>
  901. </emma>
  902. <echo>##teamcity[publishArtifacts '${result-path}/coverage/']</echo>
  903. </target>
  904. <!-- Assumes java classes have been compiled but depends does not work out well as this is run from a <parallel> task-->
  905. <target name="integration-tests" unless="tests.integration.skip">
  906. <!-- Parameters for the test.xml script. -->
  907. <fail unless="com.vaadin.testbench.tester.host" message="The 'com.vaadin.testbench.tester.host' property must be defined."/>
  908. <fail unless="com.vaadin.testbench.lib.dir" message="The 'com.vaadin.testbench.lib.dir' property must be defined."/>
  909. <fail unless="sshkey.file" message="The 'sshkey.file' property must be defined."/>
  910. <!-- Empty passphrase if no passphrase defined -->
  911. <property name="passphrase" value="" />
  912. <property name="tests.war" location="${result-path}/${test-war-filename}" />
  913. <!-- Run the separate test script. -->
  914. <ant antfile="tests/integration_tests.xml" target="integration-test-all" inheritall="false" inheritrefs="true">
  915. <!-- This is provided so that the test script can copy the -->
  916. <!-- "tests" classes after unpacking the package. -->
  917. <property name="output-dir" value="${output-dir}"/>
  918. <property name="com.vaadin.testbench.tester.host" value="${com.vaadin.testbench.tester.host}"/>
  919. <property name="com.vaadin.testbench.lib.dir" value="${com.vaadin.testbench.lib.dir}"/>
  920. <property name="sshkey.file" value="${sshkey.file}" />
  921. <property name="passphrase" value="${passphrase}" />
  922. <property name="demo.war" value="${tests.war}"/>
  923. </ant>
  924. </target>
  925. </project>
  926. <!-- These are for emacs. -->
  927. <!-- Keep this comment at the end of the file
  928. Local variables:
  929. mode: xml
  930. sgml-omittag:nil
  931. sgml-shorttag:nil
  932. sgml-namecase-general:nil
  933. sgml-general-insert-case:lower
  934. sgml-minimize-attributes:nil
  935. sgml-always-quote-attributes:t
  936. sgml-indent-step:4
  937. sgml-indent-data:t
  938. sgml-parent-document:nil
  939. sgml-exposed-tags:nil
  940. sgml-local-catalogs:("/etc/sgml/catalog" "/usr/share/xemacs21/xemacs-packages/etc/psgml-dtds/CATALOG")
  941. sgml-local-ecat-files:("ECAT" "~/sgml/ECAT" "/usr/share/sgml/ECAT" "/usr/local/share/sgml/ECAT" "/usr/local/lib/sgml/ECAT")
  942. End:
  943. -->