Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

build.xml 13KB

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