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.

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379
  1. <?xml version="1.0"?>
  2. <project name="vaadin-uitest" basedir="." default="publish-local"
  3. xmlns:ivy="antlib:org.apache.ivy.ant">
  4. <description>
  5. Provides a uitest WAR containing Vaadin UI tests
  6. </description>
  7. <include file="../common.xml" as="common" />
  8. <include file="../build.xml" as="vaadin" />
  9. <!-- global properties -->
  10. <property name="module.name" value="vaadin-uitest" />
  11. <property name="uitest.dir" location="${vaadin.basedir}/uitest" />
  12. <property name="result.dir" value="result" />
  13. <property name="theme.result.dir" value="${result.dir}/VAADIN/themes" />
  14. <property name="result.war"
  15. location="${result.dir}/lib/${module.name}-${vaadin.version}.war" />
  16. <path id="classpath.compile.custom">
  17. </path>
  18. <target name="dependencies">
  19. <!-- This is copied from common.xml to be able to add server.test.source
  20. to the source path -->
  21. <ivy:resolve log="download-only" resolveid="common"
  22. conf="build, build-provided" />
  23. <ivy:cachepath pathid="classpath.compile.dependencies"
  24. conf="build, build-provided" />
  25. </target>
  26. <target name="compile" description="Compiles the module"
  27. depends="dependencies">
  28. <fail unless="module.name" message="No module name given" />
  29. <property name="result.dir" location="result" />
  30. <property name="src" location="${result.dir}/../src" />
  31. <property name="classes" location="${result.dir}/classes" />
  32. <property name="server.test.sources" location="${result.dir}/../../server/src/test/java" />
  33. <mkdir dir="${classes}" />
  34. <!-- TODO: Get rid of this -->
  35. <javac destdir="${classes}" source="${vaadin.java.version}"
  36. target="${vaadin.java.version}" debug="true" encoding="UTF-8"
  37. includeantruntime="false">
  38. <src path="${server.test.sources}" />
  39. <include name="com/vaadin/tests/data/bean/**" />
  40. <include name="com/vaadin/tests/VaadinClasses.java" />
  41. <include
  42. name="com/vaadin/data/util/sqlcontainer/SQLTestsConstants.java" />
  43. <classpath refid="classpath.compile.dependencies" />
  44. <classpath refid="classpath.compile.custom" />
  45. </javac>
  46. <javac destdir="${classes}" source="${vaadin.java.version}"
  47. target="${vaadin.java.version}" debug="true" encoding="UTF-8"
  48. includeantruntime="false">
  49. <src path="${src}" />
  50. <classpath location="${classes}" />
  51. <classpath refid="classpath.compile.dependencies" />
  52. <classpath refid="classpath.compile.custom" />
  53. </javac>
  54. </target>
  55. <target name="testing-widgetset" depends="dependencies,compile">
  56. <property name="module"
  57. value="com.vaadin.tests.widgetset.TestingWidgetSet" />
  58. <property name="style" value="OBF" />
  59. <property name="localWorkers" value="6" />
  60. <property name="extraParams" value="" />
  61. <property name="module.output.dir" location="${result.dir}/VAADIN/widgetsets" />
  62. <property name="work.dir" location="${result.dir}/work" />
  63. <mkdir dir="${module.output.dir}" />
  64. <echo>Compiling ${module} to ${module.output.dir}</echo>
  65. <!-- compile the module -->
  66. <java classname="com.google.gwt.dev.Compiler" classpathref="classpath.compile.dependencies"
  67. failonerror="yes" fork="yes" maxmemory="512m">
  68. <classpath location="src" />
  69. <classpath location="${classes}" />
  70. <arg value="-workDir" />
  71. <arg value="${work.dir}" />
  72. <arg value="-logLevel" />
  73. <arg value="TRACE" />
  74. <arg value="-war" />
  75. <arg value="${module.output.dir}" />
  76. <arg value="-style" />
  77. <arg value="${style}" />
  78. <arg value="-localWorkers" />
  79. <arg value="${localWorkers}" />
  80. <arg value="-strict" />
  81. <arg line="${extraParams}" />
  82. <arg value="${module}" />
  83. <sysproperty key="vFailIfNotSerializable" value="true" />
  84. <jvmarg value="-Xss8M" />
  85. <jvmarg value="-XX:MaxPermSize=256M" />
  86. <jvmarg value="-Djava.awt.headless=true" />
  87. </java>
  88. </target>
  89. <target name="war"
  90. depends="dependencies, compile, compile-test-themes, testing-widgetset">
  91. <property name="result.dir" location="result" />
  92. <property name="classes" location="${result.dir}/classes" />
  93. <property name="WebContent.dir" location="${vaadin.basedir}/WebContent" />
  94. <property name="deps.dir" location="${result.dir}/deps" />
  95. <property name="src" location="${result.dir}/../src" />
  96. <ivy:resolve log="download-only" resolveid="common"
  97. conf="build" />
  98. <ivy:cachepath pathid="classpath.runtime.dependencies"
  99. conf="build" />
  100. <delete dir="${deps.dir}" />
  101. <mkdir dir="${deps.dir}" />
  102. <copy todir="${deps.dir}" flatten="true">
  103. <path refid="classpath.runtime.dependencies" />
  104. </copy>
  105. <delete>
  106. <!-- Avoid including some potentially conflicting jars in the
  107. war -->
  108. <fileset dir="${deps.dir}" includes="jetty-*.jar" />
  109. <fileset dir="${deps.dir}" includes="servlet-api-*.jar" />
  110. </delete>
  111. <war destfile="${result.war}" duplicate="fail" index="true">
  112. <!-- <fileset dir="${common.jarfiles.dir}" /> -->
  113. <fileset dir="${result.dir}">
  114. <include name="VAADIN/widgetsets/**/*" />
  115. <include name="VAADIN/themes/tests-valo*/**" />
  116. </fileset>
  117. <fileset dir="${WebContent.dir}">
  118. <include name="statictestfiles/**" />
  119. <include name="VAADIN/themes/tests-*/**" />
  120. <!-- Scss themes compiled and included above -->
  121. <exclude name="VAADIN/themes/tests-valo*/**" />
  122. <include name="VAADIN/themes/reindeer-tests/**" />
  123. <include name="VAADIN/jquery.atmosphere.js" />
  124. <include name="WEB-INF/*.xml" />
  125. <include name="WEB-INF/web.xml.2.4" />
  126. </fileset>
  127. <classes dir="${classes}" />
  128. <classes dir="${src}" />
  129. <lib dir="${deps.dir}" />
  130. </war>
  131. </target>
  132. <target name="publish-local" depends="war">
  133. <antcall target="common.publish-local">
  134. <param name="conf" value="build" />
  135. </antcall>
  136. </target>
  137. <target name="clean">
  138. <antcall target="common.clean" />
  139. </target>
  140. <target name="checkstyle">
  141. <echo>Checkstyle is disabled for uitest for now</echo>
  142. </target>
  143. <target name="test" depends="checkstyle">
  144. </target>
  145. <target name="test-testbench" depends="clean-testbench-errors"
  146. description="Run all TestBench based tests, including server tests">
  147. <parallel>
  148. <daemons>
  149. <!-- Start server -->
  150. <ant antfile="${uitest.dir}/vaadin-server.xml"
  151. inheritall="true" inheritrefs="true" target="deploy-and-start" />
  152. </daemons>
  153. <sequential>
  154. <!-- Server tests -->
  155. <!-- Sleep before running integration tests so testbench
  156. 2 tests have time to compile and start -->
  157. <sleep minutes="4" />
  158. <ant antfile="${uitest.dir}/integration_tests.xml"
  159. target="integration-test-all" inheritall="false"
  160. inheritrefs="false">
  161. <property name="demo.war" value="${war.file}" />
  162. </ant>
  163. </sequential>
  164. <sequential>
  165. <!-- Wait for server to start -->
  166. <ant antfile="${uitest.dir}/vaadin-server.xml"
  167. target="wait-for-startup" />
  168. <!-- Run all different kinds of TestBench tests in parallel -->
  169. <parallel>
  170. <!-- Legacy TestBench 2 tests -->
  171. <sequential>
  172. <ant antfile="${uitest.dir}/test.xml"
  173. target="tb2-tests" />
  174. <echo message="TestBench 2 tests complete" />
  175. </sequential>
  176. <!-- TestBench 3 tests -->
  177. <sequential>
  178. <ant antfile="${uitest.dir}/tb3test.xml"
  179. target="run-all-tb3-tests" inheritall="true" />
  180. <echo message="TestBench 3 tests complete" />
  181. </sequential>
  182. </parallel>
  183. </sequential>
  184. </parallel>
  185. </target>
  186. <target name="test-server" depends="clean-testbench-errors">
  187. <property name="war.file"
  188. location="${vaadin.basedir}/result/artifacts/${vaadin.version}/vaadin-uitest/vaadin-uitest-${vaadin.version}.war" />
  189. <parallel>
  190. <daemons>
  191. <ant antfile="${uitest.dir}/vaadin-server.xml"
  192. inheritall="true" inheritrefs="true" target="deploy-and-start" />
  193. </daemons>
  194. <sequential>
  195. <ant antfile="${uitest.dir}/integration_tests.xml"
  196. target="integration-test-all" inheritall="false"
  197. inheritrefs="false">
  198. <property name="demo.war" value="${war.file}" />
  199. </ant>
  200. </sequential>
  201. </parallel>
  202. </target>
  203. <target name="test-tb2" depends="clean-testbench-errors">
  204. <property name="war.file"
  205. location="${vaadin.basedir}/result/artifacts/${vaadin.version}/vaadin-uitest/vaadin-uitest-${vaadin.version}.war" />
  206. <parallel>
  207. <daemons>
  208. <ant antfile="${uitest.dir}/vaadin-server.xml"
  209. inheritall="true" inheritrefs="true" target="deploy-and-start" />
  210. </daemons>
  211. <sequential>
  212. <ant antfile="${uitest.dir}/vaadin-server.xml"
  213. target="wait-for-startup" />
  214. <ant antfile="${uitest.dir}/test.xml" target="tb2-tests" />
  215. </sequential>
  216. </parallel>
  217. </target>
  218. <target name="test-tb3" depends="clean-testbench-errors">
  219. <property name="war.file"
  220. location="${vaadin.basedir}/uitest/result/lib/vaadin-uitest-${vaadin.version}.war" />
  221. <mkdir dir="${vaadin.basedir}/result" />
  222. <parallel>
  223. <daemons>
  224. <ant antfile="${uitest.dir}/vaadin-server.xml"
  225. inheritall="true" inheritrefs="true" target="deploy-and-start" />
  226. </daemons>
  227. <sequential>
  228. <ant antfile="${uitest.dir}/vaadin-server.xml"
  229. target="wait-for-startup" />
  230. <ant antfile="${uitest.dir}/tb3test.xml" target="run-all-tb3-tests"
  231. inheritall="true" />
  232. </sequential>
  233. </parallel>
  234. </target>
  235. <target name="clean-testbench-errors">
  236. <fail unless="com.vaadin.testbench.screenshot.directory"
  237. message="Define screenshot directory using -Dcom.vaadin.testbench.screenshot.directory" />
  238. <mkdir dir="${com.vaadin.testbench.screenshot.directory}/errors" />
  239. <delete>
  240. <fileset
  241. dir="${com.vaadin.testbench.screenshot.directory}/errors">
  242. <include name="*" />
  243. </fileset>
  244. </delete>
  245. </target>
  246. <target name="compile-test-themes">
  247. <antcall target="compile-theme">
  248. <param name="theme" value="tests-valo" />
  249. </antcall>
  250. <antcall target="compile-theme">
  251. <param name="theme" value="tests-valo-dark" />
  252. </antcall>
  253. <antcall target="compile-theme">
  254. <param name="theme" value="tests-valo-metro" />
  255. </antcall>
  256. <antcall target="compile-theme">
  257. <param name="theme" value="tests-valo-flat" />
  258. </antcall>
  259. <antcall target="compile-theme">
  260. <param name="theme" value="tests-valo-flatdark" />
  261. </antcall>
  262. <antcall target="compile-theme">
  263. <param name="theme" value="tests-valo-facebook" />
  264. </antcall>
  265. <antcall target="compile-theme">
  266. <param name="theme" value="tests-valo-blueprint" />
  267. </antcall>
  268. <antcall target="compile-theme">
  269. <param name="theme" value="tests-valo-light" />
  270. </antcall>
  271. <antcall target="compile-theme">
  272. <param name="theme" value="tests-valo-disabled-animations" />
  273. </antcall>
  274. <antcall target="compile-theme">
  275. <param name="theme" value="tests-valo-no-font-awesome" />
  276. </antcall>
  277. </target>
  278. <target name="compile-theme" depends="copy-theme">
  279. <fail unless="theme"
  280. message="You must give the theme name to compile in the 'theme' parameter" />
  281. <ivy:resolve log="download-only" resolveid="common"
  282. conf="compile-theme" />
  283. <ivy:cachepath pathid="classpath.compile.theme"
  284. conf="compile-theme" />
  285. <ivy:cachepath pathid="classpath.runtime.theme"
  286. conf="build" />
  287. <echo>Compiling ${theme}</echo>
  288. <mkdir dir="${theme.result.dir}" />
  289. <!-- compile the theme -->
  290. <java classname="com.vaadin.buildhelpers.CompileTheme"
  291. classpathref="classpath.compile.theme" failonerror="yes"
  292. fork="yes" maxmemory="512m">
  293. <arg value="--theme" />
  294. <arg value="${theme}" />
  295. <arg value="--theme-folder" />
  296. <arg value="${theme.result.dir}" />
  297. <arg value="--version" />
  298. <arg value="${vaadin.version}" />
  299. <jvmarg value="-Xss8M" />
  300. <jvmarg value="-XX:MaxPermSize=256M" />
  301. <jvmarg value="-Djava.awt.headless=true" />
  302. </java>
  303. </target>
  304. <target name="copy-theme">
  305. <fail unless="theme"
  306. message="You must give the theme name to copy n the 'theme' parameter" />
  307. <property name="theme.source.dir" location="../themes/src/main/resources/VAADIN/themes" />
  308. <property name="webcontent.source.dir" location="../WebContent/VAADIN/themes" />
  309. <copy todir="${theme.result.dir}">
  310. <fileset dir="${theme.source.dir}">
  311. <include name="${theme}/**/*.scss" />
  312. </fileset>
  313. <filterset refid="filter-vaadin.version" />
  314. </copy>
  315. <copy todir="${theme.result.dir}">
  316. <fileset dir="${theme.source.dir}">
  317. <exclude name="${theme}/**/*.scss" />
  318. </fileset>
  319. </copy>
  320. <copy todir="${theme.result.dir}">
  321. <fileset dir="${webcontent.source.dir}">
  322. <include name="${theme}/**/*.scss" />
  323. </fileset>
  324. <filterset refid="filter-vaadin.version" />
  325. </copy>
  326. <copy todir="${theme.result.dir}">
  327. <fileset dir="${webcontent.source.dir}">
  328. <exclude name="${theme}/**/*.scss" />
  329. </fileset>
  330. </copy>
  331. </target>
  332. </project>