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 51KB

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