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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  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="result.dir" value="result" />
  11. <property name="result.war" location="${result.dir}/lib/${module.name}-${vaadin.version}.war" />
  12. <path id="classpath.compile.custom">
  13. </path>
  14. <target name="dependencies">
  15. <!-- This is copied from common.xml to be able to add server.test.source
  16. to the source path -->
  17. <ivy:resolve resolveid="common" conf="build, build-provided" />
  18. <ivy:cachepath pathid="classpath.compile.dependencies" conf="build, build-provided" />
  19. </target>
  20. <target name="compile" description="Compiles the module" depends="dependencies">
  21. <fail unless="module.name" message="No module name given" />
  22. <property name="result.dir" location="result" />
  23. <property name="src" location="${result.dir}/../src" />
  24. <property name="classes" location="${result.dir}/classes" />
  25. <property name="server.test.sources" location="${result.dir}/../../server/tests/src" />
  26. <mkdir dir="${classes}" />
  27. <!-- TODO: Get rid of this -->
  28. <javac destdir="${classes}" source="${vaadin.java.version}" target="${vaadin.java.version}" debug="true" encoding="UTF-8" includeantruntime="false">
  29. <src path="${server.test.sources}" />
  30. <include name="com/vaadin/tests/data/bean/**" />
  31. <include name="com/vaadin/tests/VaadinClasses.java" />
  32. <include name="com/vaadin/data/util/sqlcontainer/SQLTestsConstants.java" />
  33. <classpath refid="classpath.compile.dependencies" />
  34. <classpath refid="classpath.compile.custom" />
  35. </javac>
  36. <javac destdir="${classes}" source="${vaadin.java.version}" target="${vaadin.java.version}" debug="true" encoding="UTF-8" includeantruntime="false">
  37. <src path="${src}" />
  38. <classpath location="${classes}" />
  39. <classpath refid="classpath.compile.dependencies" />
  40. <classpath refid="classpath.compile.custom" />
  41. </javac>
  42. </target>
  43. <target name="testing-widgetset" depends="dependencies,compile">
  44. <property name="module" value="com.vaadin.tests.widgetset.TestingWidgetSet" />
  45. <property name="style" value="OBF" />
  46. <property name="localWorkers" value="2" />
  47. <property name="extraParams" value="" />
  48. <property name="module.output.dir" location="${result.dir}/VAADIN/widgetsets" />
  49. <property name="work.dir" location="${result.dir}/work" />
  50. <mkdir dir="${module.output.dir}" />
  51. <echo>Compiling ${module} to ${module.output.dir}</echo>
  52. <!-- compile the module -->
  53. <java classname="com.google.gwt.dev.Compiler" classpathref="classpath.compile.dependencies" failonerror="yes" fork="yes" maxmemory="512m">
  54. <classpath location="src" />
  55. <classpath location="${classes}" />
  56. <arg value="-workDir" />
  57. <arg value="${work.dir}" />
  58. <arg value="-logLevel" />
  59. <arg value="TRACE" />
  60. <arg value="-war" />
  61. <arg value="${module.output.dir}" />
  62. <arg value="-style" />
  63. <arg value="${style}" />
  64. <arg value="-localWorkers" />
  65. <arg value="${localWorkers}" />
  66. <arg value="-strict" />
  67. <arg line="${extraParams}" />
  68. <arg value="${module}" />
  69. <sysproperty key="vFailIfNotSerializable" value="true" />
  70. <jvmarg value="-Xss8M" />
  71. <jvmarg value="-XX:MaxPermSize=256M" />
  72. <jvmarg value="-Djava.awt.headless=true" />
  73. </java>
  74. </target>
  75. <target name="war" depends="dependencies, compile, testing-widgetset">
  76. <property name="result.dir" location="result" />
  77. <property name="classes" location="${result.dir}/classes" />
  78. <property name="WebContent.dir" location="${vaadin.basedir}/WebContent" />
  79. <property name="deps.dir" location="${result.dir}/deps" />
  80. <property name="src" location="${result.dir}/../src" />
  81. <ivy:resolve resolveid="common" conf="build" />
  82. <ivy:cachepath pathid="classpath.runtime.dependencies" conf="build" />
  83. <delete dir="${deps.dir}" />
  84. <mkdir dir="${deps.dir}" />
  85. <copy todir="${deps.dir}" flatten="true">
  86. <path refid="classpath.runtime.dependencies" />
  87. </copy>
  88. <!-- Ensure filtered webcontent files are available -->
  89. <antcall target="common.filter.webcontent" />
  90. <war destfile="${result.war}" duplicate="fail" index="true">
  91. <fileset refid="common.files.for.all.jars" />
  92. <fileset dir="${result.dir}">
  93. <include name="VAADIN/widgetsets/**/*" />
  94. </fileset>
  95. <fileset dir="${WebContent.dir}">
  96. <include name="statictestfiles/**" />
  97. <include name="VAADIN/themes/tests-*/**" />
  98. <include name="VAADIN/themes/reindeer-tests/**" />
  99. <include name="WEB-INF/*.xml" />
  100. </fileset>
  101. <classes dir="${classes}" />
  102. <classes dir="${src}" />
  103. <lib dir="${deps.dir}" />
  104. </war>
  105. </target>
  106. <target name="publish-local" depends="war">
  107. <antcall target="common.publish-local">
  108. <param name="conf" value="build" />
  109. </antcall>
  110. </target>
  111. <target name="clean">
  112. <antcall target="common.clean" />
  113. </target>
  114. <target name="checkstyle">
  115. <echo>Checkstyle is disabled for uitest for now</echo>
  116. </target>
  117. <target name="test" depends="checkstyle">
  118. <!--<antcall target="common.test.run" /> -->
  119. <echo>WHAT? No JUnit tests for ${module.name}!</echo>
  120. </target>
  121. </project>