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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404
  1. <?xml version="1.0"?>
  2. <project xmlns:antcontrib="antlib:net.sf.antcontrib"
  3. xmlns:artifact="antlib:org.apache.maven.artifact.ant"
  4. xmlns:ivy="antlib:org.apache.ivy.ant"
  5. name="Vaadin"
  6. basedir="../" default="package-all">
  7. <property name="project.root" value="."/>
  8. <!-- Import common targets -->
  9. <import file="./common.xml" />
  10. <!--Call one of package-* targets unless you understand what you are doing. -->
  11. <target name="package-all" depends="clean-all, init, build, javadoc, internal-package-war, internal-package-liferay, differences" description="Build public packages.">
  12. </target>
  13. <target name="package-jar" depends="clean-result, init, vaadin.jar" description="Create vaadin-x.y.z.jar file.">
  14. </target>
  15. <target name="package-war" depends="clean-result, init, build, javadoc, internal-package-war, differences">
  16. </target>
  17. <target name="package-liferay-zip" depends="clean-result, init, build, internal-package-liferay">
  18. </target>
  19. <target name="init-deps" depends="common.init-deps" >
  20. <property name="ivy.resolved" value="1" />
  21. <ivy:resolve file="build/ivy/ivy.xml" resolveid="common" conf="server.extdep, shared.extdep, client.extdep, client-compiler.extdep, server.tests.extdep,client-compiler.extdep"/>
  22. <ivy:cachepath pathid="ivy.compile.classpath.server" conf="server.extdep"/>
  23. <ivy:cachepath pathid="ivy.compile.classpath.shared" conf="shared.extdep"/>
  24. <ivy:cachepath pathid="ivy.compile.classpath.client" conf="client.extdep"/>
  25. <ivy:cachepath pathid="ivy.compile.classpath.client-compiler" conf="client-compiler.extdep"/>
  26. <ivy:cachepath pathid="ivy.compile.classpath.server-tests" conf="server.tests.extdep"/>
  27. <ivy:cachepath pathid="buildhelpers.dependencies" resolveId="buildhelpers" conf="compile" file="build/ivy/buildhelpers-ivy.xml"/>
  28. <!-- Extra JARs for custom builds - taken into account before JARs from Ivy. -->
  29. <!-- Note that this should not be used for permanent build dependencies. -->
  30. <path id="additional.jar.path">
  31. <fileset dir="build" includes="lib/**/*.jar" ></fileset>
  32. </path>
  33. <!-- Default location for GWT check-out: trunk and tools in a directory next to Vaadin project -->
  34. <property name="gwt.root" value="${basedir}/../trunk"/>
  35. <property name="gwt.build.dir" value="${gwt.root}/build"/>
  36. <property name="gwt.tools" value="${gwt.root}/../tools"/>
  37. <property name="gwt.tools.lib" value="${gwt.tools}/lib"/>
  38. <property name="gwt.lib.dir" value="${gwt.build.dir}/lib"/>
  39. <property name="gwt.user.jar" value="${gwt.lib.dir}/gwt-user.jar"/>
  40. <property name="gwt.dev.jar" value="${gwt.lib.dir}/gwt-dev.jar"/>
  41. <property name="gwt.codeserver.jar" value="${gwt.lib.dir}/gwt-codeserver.jar"/>
  42. <property name="gwt.elemental.jar" value="${gwt.lib.dir}/gwt-elemental.jar"/>
  43. <property name="gwt.user.dir" value="${gwt.root}/user"/>
  44. <property name="gwt.user.bin" value="${gwt.build.dir}/out/user/bin"/>
  45. <!-- GWT -->
  46. <path id="gwt.dev.user.jars">
  47. <pathelement location="${gwt.user.jar}" />
  48. <pathelement location="${gwt.dev.jar}" />
  49. </path>
  50. <path id="compile.classpath.server">
  51. <path refid="additional.jar.path" />
  52. <path refid="ivy.compile.classpath.server" />
  53. </path>
  54. <path id="compile.classpath.shared">
  55. <path refid="additional.jar.path" />
  56. <path refid="ivy.compile.classpath.shared" />
  57. </path>
  58. <path id="compile.classpath.client">
  59. <path refid="additional.jar.path" />
  60. <path refid="gwt.dev.user.jars"/>
  61. <path refid="ivy.compile.classpath.client" />
  62. </path>
  63. <path id="compile.classpath.client-compiler">
  64. <path refid="additional.jar.path" />
  65. <path refid="gwt.dev.user.jars"/>
  66. <path refid="ivy.compile.classpath.client-compiler" />
  67. </path>
  68. <path id="compile.classpath.sass">
  69. <path refid="additional.jar.path" />
  70. <path refid="ivy.compile.classpath.server" />
  71. <path refid="gwt.dev.user.jars"/>
  72. </path>
  73. <path id="compile.classpath.server-tests">
  74. <path refid="additional.jar.path" />
  75. <path refid="gwt.dev.user.jars"/>
  76. <path refid="ivy.compile.classpath.server-tests" />
  77. </path>
  78. <path id="compile.classpath.buildhelpers">
  79. <path refid="additional.jar.path" />
  80. <path refid="gwt.dev.user.jars"/>
  81. <path refid="buildhelpers.dependencies" />
  82. </path>
  83. </target>
  84. <!-- Clean results - - - - - - - - - - - - - - - - - - - - - - - - - -->
  85. <target name="clean-result" depends="build.properties">
  86. <!-- Clean build result directory. -->
  87. <delete dir="${result-path}" includes="**/*" followsymlinks="false" defaultexcludes="false" includeemptydirs="true" failonerror="false"/>
  88. </target>
  89. <target name="build.properties" depends="init-deps">
  90. <property file="build/build.properties" />
  91. <property file="build/VERSION.properties" />
  92. <property file="build/GWT-VERSION.properties" />
  93. <!-- result source and classes folders -->
  94. <property name="result-src-server" value="${result-path}/src/server"/>
  95. <property name="result-src-client" value="${result-path}/src/client"/>
  96. <property name="result-src-client-compiler" value="${result-path}/src/client-compiler"/>
  97. <property name="result-src-shared" value="${result-path}/src/shared"/>
  98. <property name="result-src-junit" value="${result-path}/src/junit"/>
  99. <property name="result-src-testbench" value="${result-path}/src/testbench"/>
  100. <property name="result-src-sass" value="${result-path}/src/sass"/>
  101. <property name="result-src-sass-junit" value="${result-path}/src/sass-junit"/>
  102. <property name="result-classes-server" value="${result-path}/classes/server"/>
  103. <property name="result-classes-client" value="${result-path}/classes/client"/>
  104. <property name="result-classes-client-compiler" value="${result-path}/classes/client-compiler"/>
  105. <property name="result-classes-shared" value="${result-path}/classes/shared"/>
  106. <property name="result-classes-junit" value="${result-path}/classes/junit"/>
  107. <property name="result-classes-testbench" value="${result-path}/classes/testbench"/>
  108. <property name="result-classes-sass" value="${result-path}/classes/sass"/>
  109. <property name="result-classes-sass-junit" value="${result-path}/classes/sass-junit"/>
  110. <property name="result-precompiled-widgetsets" value="${result-path}/classes/widgetsets"/>
  111. <property name="result-classes-gwt" value="${result-path}/classes/gwt" />
  112. <!-- Default classpath for building widgetsets, overridden for testing widgetset -->
  113. <path id="compile.classpath.widgetset">
  114. <path refid="compile.classpath.client" />
  115. <!-- Needed to resolve classes which @Connect refers to -->
  116. <pathelement location="${result-src-server}" />
  117. <!-- Needed to resolve imports in connector classes -->
  118. <pathelement location="${result-classes-server}" />
  119. <!-- The actual sources we want to compile -->
  120. <pathelement location="${result-src-client}" />
  121. <pathelement location="${result-src-shared}" />
  122. <!-- Contains compiled generators -->
  123. <pathelement location="${result-classes-client-compiler}" />
  124. <!-- Generators depend on shared and client interfaces -->
  125. <pathelement location="${result-classes-shared}" />
  126. <pathelement location="${result-classes-client}" />
  127. <pathelement location="${result-precompiled-widgetsets}" />
  128. </path>
  129. </target>
  130. <target name="clean-all" depends="clean-result">
  131. <delete failonerror="false">
  132. <fileset dir="${com.vaadin.testbench.screenshot.directory}/errors">
  133. <include name="*.png" />
  134. </fileset>
  135. </delete>
  136. <delete failonerror="false" dir="WebContent/VAADIN/gwt-unitCache" />
  137. </target>
  138. <!-- ================================================================== -->
  139. <!-- Check versions. -->
  140. <!-- ================================================================== -->
  141. <!-- Java compiler version. -->
  142. <target name="check-java-version">
  143. <condition property="java.version.matches">
  144. <or>
  145. <equals arg1="${ant.java.version}" arg2="${required.java.version}"/>
  146. <isset property="ignoreversion"/>
  147. </or>
  148. </condition>
  149. <fail unless="java.version.matches" message="Java version is ${ant.java.version}, but Vaadin must be compiled with genuine Java ${required.java.version} compiler. Use -Dignoreversion=1 for ant to ignore the version check."/>
  150. <echo>Java version is ${ant.java.version} as required.</echo>
  151. </target>
  152. <!-- ================================================================== -->
  153. <!-- Initialization - - - - - - - - - - - - - - - - - - - - - - - - - - -->
  154. <!-- ================================================================== -->
  155. <target name="init" depends="init-deps, build.properties, check-java-version">
  156. <!-- Current timestamp in different formats. -->
  157. <tstamp>
  158. <format property="build.date" pattern="yyyy-MM-dd"/>
  159. </tstamp>
  160. <tstamp>
  161. <format property="build.date.compact" pattern="yyyyMMdd"/>
  162. </tstamp>
  163. <antcontrib:propertyregex property="version.major" input="${version}" regexp="([^\.]*)\.([^\.]*)\.([^\.]*)" select="\1"/>
  164. <antcontrib:propertyregex property="version.minor" input="${version}" regexp="([^\.]*)\.([^\.]*)\.([^\.]*)" select="\2"/>
  165. <antcontrib:propertyregex property="version.revision" input="${version}" regexp="([^\.]*)\.([^\.]*)\.([^\.]*)" select="\3"/>
  166. <!-- Default full version name. -->
  167. <!-- Nightly and other TeamCity builds will define their own. -->
  168. <property name="version.full" value="${version}.dev-${build.date.compact}"/>
  169. <echo>Base Version: ${version}</echo>
  170. <echo>Full Version: ${version.full}</echo>
  171. <!-- Other properties -->
  172. <property file="build/html-style.properties" />
  173. <echo>Vaadin package is: ${vaadin-package}</echo>
  174. <!-- Create result dir unless already exists -->
  175. <mkdir dir="${result-path}" />
  176. <echo>We are using gwt version ${gwt-version}.</echo>
  177. <!-- Destination files -->
  178. <property name="base-name" value="${product-file}-${version.full}" />
  179. <property name="lib-jar-name" value="${base-name}.jar" />
  180. <property name="lib-sources-jar-name" value="${base-name}-sources.jar" />
  181. <property name="lib-javadoc-jar-name" value="${base-name}-javadoc.jar" />
  182. <property name="test-war-filename" value="${product-file}-tests-${version.full}.war"/>
  183. <echo message="Prepared to build ${product-file} version ${version.full} packages" />
  184. <!-- Output directory -->
  185. <property name="output-dir" value="${result-path}/${base-name}" />
  186. <mkdir dir="${output-dir}" />
  187. <!-- Where widgetsets are written to. -->
  188. <!-- When not building a package, widgetsets should be written to -->
  189. <!-- WebContent/VAADIN/widgetsets, which needs to be set in -->
  190. <!-- init-nonpackage target before calling this main init target. -->
  191. <property name="widgetsets-output-dir" value="${output-dir}/WebContent/VAADIN/widgetsets" />
  192. <!-- Build helpers -->
  193. <property name="buildhelpers-src" value="build/buildhelpers" />
  194. <property name="buildhelpers-classes" value="${result-path}/buildhelpers/classes" />
  195. <!-- Sass -->
  196. <property name="sass-src" value="sass/src" />
  197. <property name="sass-classes" value="${result-classes-sass}" />
  198. <!-- Create Output Directory Hierarchy -->
  199. <mkdir dir="${output-dir}/WebContent" />
  200. <mkdir dir="${output-dir}/WebContent/demo" />
  201. <mkdir dir="${output-dir}/WebContent/docs" />
  202. <mkdir dir="${output-dir}/WebContent/docs/api" />
  203. <mkdir dir="${output-dir}/WebContent/tests" />
  204. <mkdir dir="${output-dir}/WebContent/WEB-INF" />
  205. <mkdir dir="${output-dir}/WebContent/WEB-INF/lib" />
  206. <mkdir dir="${output-dir}/WebContent/WEB-INF/classes" />
  207. </target>
  208. <target name="internal-package-war">
  209. <echo>Building Test WAR</echo>
  210. <echo>Adding test class files and resources and launcher configuration.</echo>
  211. <copy todir="${output-dir}/WebContent/WEB-INF/classes">
  212. <fileset dir="${result-classes-testbench}">
  213. <include name="${vaadin-package}/tests/**/*" />
  214. <include name="${vaadin-package}/launcher/**" />
  215. </fileset>
  216. <fileset dir="${result-classes-shared}" />
  217. <!-- VaadinClasses and data classes are used by TestBench tests also -->
  218. <fileset dir="${result-classes-junit}" />
  219. <!-- test resources -->
  220. <fileset dir="tests/testbench">
  221. <include name="${vaadin-package}/tests/**/*" />
  222. <!-- Pre-processed versions of these copied above -->
  223. <exclude name="**/*.java" />
  224. <exclude name="**/*.html" />
  225. <exclude name="**/*.css" />
  226. <exclude name="**/*.xml" />
  227. </fileset>
  228. <!-- Include files required by the DemoLauncher/DevelopmentServerLauncher -->
  229. <fileset dir="tests/testbench">
  230. <include name="${vaadin-package}/launcher/jetty-webdefault.xml" />
  231. <include name="${vaadin-package}/launcher/keystore" />
  232. </fileset>
  233. </copy>
  234. <war warfile="${result-path}/${test-war-filename}">
  235. <fileset dir="${output-dir}/WebContent">
  236. <exclude name="VAADIN/gwt-unitCache" />
  237. <!-- Already in JAR -->
  238. <!-- Not excluded because used from WAR by portal integration tests
  239. <exclude name="VAADIN/themes/base/**/*" />
  240. <exclude name="VAADIN/themes/chameleon/**/*" />
  241. <exclude name="VAADIN/themes/liferay/**/*" />
  242. <exclude name="VAADIN/themes/reindeer/**/*" />
  243. <exclude name="VAADIN/themes/runo/**/*" />
  244. <exclude name="VAADIN/widgetsets/com.vaadin.DefaultWidgetSet/**/*" />
  245. -->
  246. <!-- Not needed for testing -->
  247. <exclude name="docs/**/*" />
  248. <exclude name="docs" />
  249. <include name="**/*" />
  250. </fileset>
  251. </war>
  252. </target>
  253. <target name="internal-package-liferay" depends="internal-package-war">
  254. <!-- We assume the needed files are put in place by internal-package-war -->
  255. <echo>Building Liferay zip</echo>
  256. <zip zipfile="${result-path}/${base-name}-liferay.zip">
  257. <zipfileset prefix="VAADIN/widgetsets/com.vaadin.portal.gwt.PortalDefaultWidgetSet" dir="${output-dir}/WebContent/VAADIN/widgetsets/com.vaadin.portal.gwt.PortalDefaultWidgetSet">
  258. <patternset>
  259. <include name="**/*" />
  260. </patternset>
  261. </zipfileset>
  262. <zipfileset prefix="VAADIN/themes" dir="${output-dir}/WebContent/VAADIN/themes">
  263. <patternset>
  264. <include name="base/**/*" />
  265. <include name="chameleon/**/*" />
  266. <include name="liferay/**/*" />
  267. <include name="runo/**/*" />
  268. <include name="reindeer/**/*" />
  269. </patternset>
  270. </zipfileset>
  271. <zipfileset prefix="VAADIN" dir="${output-dir}/WebContent/VAADIN">
  272. <patternset>
  273. <include name="vaadinBootstrap.js" />
  274. </patternset>
  275. </zipfileset>
  276. </zip>
  277. <echo>##teamcity[publishArtifacts '${result-path}/${base-name}-liferay.zip']</echo>
  278. </target>
  279. <!-- Build server-side, client-side, libraries, and tests. -->
  280. <!-- The client-side needs to be built before vaadin.jar, because the vaadin.jar -->
  281. <!-- require the default widgetset and doing otherwise would build it twice. -->
  282. <!-- However, since compiling the server-side is required by the client-side -->
  283. <!-- compilation, the server-side will actually be built before it. -->
  284. <target name="build"
  285. depends="compile-server-side, compile-tests, compile-client-side, vaadin.jar, vaadin-sources.jar"
  286. description="Build package required files, without packing them.">
  287. </target>
  288. <target name="compile-server-side" depends="compile-gwt, compile-server, compile-client, webcontent"/>
  289. <!-- Copy and preprocess sources for packaging
  290. NOTE: Replaces <version></version> tags with build version tag for some "textual" files
  291. -->
  292. <target name="preprocess-src">
  293. <!--
  294. Source directories in the project are
  295. * src (Vaadin core)
  296. * sass/src (SASS compiler)
  297. * tests/testbench (TestBench test cases)
  298. * tests/server-side (Server-side JUnit test cases)
  299. * tests/client-side (Client-side JUnit test cases)
  300. These are copied to
  301. * ${result-path}/src/core
  302. * ${result-path}/src/sass
  303. * ${result-path}/src/tests
  304. * ${result-path}/src/junit
  305. And compiled to
  306. * ${result-path}/classes/core
  307. * ${result-path}/classes/sass
  308. * ${result-path}/classes/tests
  309. * ${result-path}/classes/junit
  310. Java/HTML/CSS/XML files are filtered so the license is added and the version is set.
  311. Other files are just copied.
  312. -->
  313. <loadfile property="VaadinApache2LicenseForJavaFiles" srcFile="build/VaadinApache2LicenseForJavaFiles.txt" />
  314. <mkdir dir="${result-path}/src" />
  315. <mkdir dir="${result-src-sass}/src" />
  316. <mkdir dir="${result-src-server}" />
  317. <mkdir dir="${result-src-client}" />
  318. <mkdir dir="${result-src-client-compiler}" />
  319. <mkdir dir="${result-src-shared}" />
  320. <mkdir dir="${result-src-testbench}" />
  321. <mkdir dir="${result-src-junit}" />
  322. <mkdir dir="${result-src-sass-junit}" />
  323. <patternset id="preprocessable-files">
  324. <include name="**/*.java" />
  325. <include name="**/*.html" />
  326. <include name="**/*.css" />
  327. <include name="**/*.xml" />
  328. </patternset>
  329. <patternset id="non-preprocessable-files">
  330. <exclude name="**/.svn" />
  331. <exclude name="**/*.java" />
  332. <exclude name="**/*.html" />
  333. <exclude name="**/*.css" />
  334. <exclude name="**/*.xml" />
  335. </patternset>
  336. <filterset id="version-and-license">
  337. <filter token="VaadinApache2LicenseForJavaFiles" value="${VaadinApache2LicenseForJavaFiles}" />
  338. <filter token="VERSION" value="${version.full}" />
  339. </filterset>
  340. <!-- Adds a style class to JavaDoc <pre> tags for style customization. -->
  341. <filterset id="pre-css-style" begintoken=" * &lt;" endtoken="&gt;">
  342. <filter token="pre" value=" * &lt;pre class='code'&gt;" />
  343. </filterset>
  344. <echo>Copying src directory and processing copied files.</echo>
  345. <echo>Replacing &lt;version&gt; tag with build version for java/html/css/xml files.</echo>
  346. <copy todir="${result-src-server}" overwrite="yes">
  347. <filterset refid="version-and-license"/>
  348. <filterset refid="pre-css-style"/>
  349. <fileset dir="server/src">
  350. <patternset refid="preprocessable-files" />
  351. </fileset>
  352. </copy>
  353. <copy todir="${result-src-shared}" overwrite="yes">
  354. <filterset refid="version-and-license"/>
  355. <filterset refid="pre-css-style"/>
  356. <fileset dir="shared/src">
  357. <patternset refid="preprocessable-files" />
  358. </fileset>
  359. </copy>
  360. <copy todir="${result-src-client}" overwrite="yes">
  361. <filterset refid="version-and-license"/>
  362. <filterset refid="pre-css-style"/>
  363. <fileset dir="client/src">
  364. <patternset refid="preprocessable-files" />
  365. </fileset>
  366. </copy>
  367. <copy todir="${result-src-client-compiler}" overwrite="yes">
  368. <filterset refid="version-and-license"/>
  369. <filterset refid="pre-css-style"/>
  370. <fileset dir="client-compiler/src">
  371. <patternset refid="preprocessable-files" />
  372. </fileset>
  373. </copy>
  374. <copy todir="${result-src-sass}" overwrite="yes">
  375. <filterset refid="version-and-license"/>
  376. <filterset refid="pre-css-style"/>
  377. <fileset dir="sass/src">
  378. <patternset refid="preprocessable-files" />
  379. </fileset>
  380. </copy>
  381. <copy todir="${result-src-testbench}">
  382. <filterset refid="version-and-license"/>
  383. <fileset dir="tests/testbench">
  384. <patternset refid="preprocessable-files" />
  385. </fileset>
  386. </copy>
  387. <copy todir="${result-src-junit}">
  388. <filterset refid="version-and-license"/>
  389. <fileset dir="tests/server-side">
  390. <patternset refid="preprocessable-files" />
  391. </fileset>
  392. <fileset dir="tests/client-side">
  393. <patternset refid="preprocessable-files" />
  394. </fileset>
  395. </copy>
  396. <copy todir="${result-src-sass-junit}">
  397. <filterset refid="version-and-license"/>
  398. <fileset dir="tests/sass/src">
  399. <patternset refid="preprocessable-files" />
  400. </fileset>
  401. </copy>
  402. <!-- Add other files such as images, these are not filtered or processed by fixcrlf task -->
  403. <echo>Copying non java/html/css/xml files such as images.</echo>
  404. <copy todir="${result-src-server}">
  405. <fileset dir="server/src">
  406. <patternset refid="non-preprocessable-files" />
  407. </fileset>
  408. </copy>
  409. <copy todir="${result-src-shared}">
  410. <fileset dir="shared/src">
  411. <patternset refid="non-preprocessable-files" />
  412. </fileset>
  413. </copy>
  414. <copy todir="${result-src-client}">
  415. <fileset dir="client/src">
  416. <patternset refid="non-preprocessable-files" />
  417. </fileset>
  418. </copy>
  419. <copy todir="${result-src-client-compiler}">
  420. <fileset dir="client-compiler/src">
  421. <patternset refid="non-preprocessable-files" />
  422. </fileset>
  423. </copy>
  424. <copy todir="${result-src-sass}">
  425. <fileset dir="${sass-src}">
  426. <patternset refid="non-preprocessable-files" />
  427. </fileset>
  428. </copy>
  429. <copy todir="${result-src-testbench}">
  430. <fileset dir="tests/testbench">
  431. <patternset refid="non-preprocessable-files" />
  432. </fileset>
  433. </copy>
  434. <copy todir="${result-src-junit}">
  435. <fileset dir="tests/server-side">
  436. <patternset refid="non-preprocessable-files" />
  437. </fileset>
  438. <fileset dir="tests/client-side">
  439. <patternset refid="non-preprocessable-files" />
  440. </fileset>
  441. </copy>
  442. <copy todir="${result-src-sass-junit}">
  443. <fileset dir="tests/sass/src">
  444. <patternset refid="non-preprocessable-files" />
  445. </fileset>
  446. <fileset dir="tests/sass/resources">
  447. <!-- test resources (files to compile and compare etc.) -->
  448. </fileset>
  449. </copy>
  450. </target>
  451. <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  452. WebContent
  453. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
  454. <target name="webcontent" depends="preprocess-src,defaulttheme">
  455. <!-- Add WebContent -->
  456. <echo>Adding VAADIN/themes and META-INF</echo>
  457. <copy todir="${output-dir}/WebContent">
  458. <fileset dir="WebContent">
  459. <exclude name="**/.svn" />
  460. <include name="WEB-INF/lib/hsqldb.jar" />
  461. <include name="VAADIN/themes/**/*" />
  462. <include name="VAADIN/vaadinBootstrap.js" />
  463. <include name="META-INF/**/*" />
  464. <include name="statictestfiles/**" />
  465. </fileset>
  466. </copy>
  467. <!-- Add test files to be included in test war -->
  468. <copy todir="${output-dir}/WebContent">
  469. <fileset dir="WebContent">
  470. <include name="statictestfiles/**" />
  471. </fileset>
  472. </copy>
  473. <!-- Add servlet and portlet configuration files from WebContent -->
  474. <copy todir="${output-dir}/WebContent/WEB-INF">
  475. <fileset dir="WebContent/WEB-INF">
  476. <include name="liferay-*.xml" />
  477. <include name="portlet.xml" />
  478. <include name="web.xml" />
  479. </fileset>
  480. </copy>
  481. <!-- These should go to various JARs -->
  482. <copy todir="${output-dir}/WebContent">
  483. <filterchain>
  484. <expandproperties />
  485. <replacetokens begintoken="@" endtoken="@">
  486. <token key="version" value="${version.full}" />
  487. </replacetokens>
  488. <replacetokens begintoken="@" endtoken="@">
  489. <token key="version-minor" value="${version.major}.${version.minor}" />
  490. </replacetokens>
  491. <replacetokens begintoken="@" endtoken="@">
  492. <token key="builddate" value="${build.date}" />
  493. </replacetokens>
  494. <replacetokens begintoken="@" endtoken="@">
  495. <token key="gwt-version" value="${gwt-version}" />
  496. </replacetokens>
  497. </filterchain>
  498. <fileset dir="WebContent">
  499. <exclude name="**/.svn" />
  500. <include name="release-notes.html" />
  501. <include name="license.html" />
  502. <include name="css/**" />
  503. <include name="img/**" />
  504. </fileset>
  505. </copy>
  506. </target>
  507. <target name="compile-server" depends="init, preprocess-src, compile-shared">
  508. <echo>Compiling server/src</echo>
  509. <!-- Compile core sources first as the other sources depend on these -->
  510. <mkdir dir="${result-classes-server}" />
  511. <javac destdir="${result-classes-server}" source="${required.java.version}" target="${required.java.version}" classpathref="compile.classpath.server" debug="true" encoding="UTF-8" includeantruntime="false">
  512. <classpath location="${result-classes-shared}"></classpath>
  513. <src path="${result-src-server}"/>
  514. </javac>
  515. </target>
  516. <target name="compile-client" depends="init, preprocess-src, compile-server, compile-shared">
  517. <echo>Compiling client/src</echo>
  518. <!-- Compile core sources first as the other sources depend on these -->
  519. <mkdir dir="${result-classes-client}" />
  520. <javac destdir="${result-classes-client}" source="${required.java.version}" target="${required.java.version}" classpathref="compile.classpath.client" debug="true" encoding="UTF-8" includeantruntime="false">
  521. <classpath location="${result-classes-shared}"></classpath>
  522. <classpath location="${result-classes-server}"></classpath>
  523. <src path="${result-src-client}"/>
  524. </javac>
  525. </target>
  526. <target name="compile-client-compiler" depends="init, preprocess-src, compile-client, compile-server, compile-shared">
  527. <echo>Compiling client-compiler/src</echo>
  528. <mkdir dir="${result-classes-client-compiler}" />
  529. <javac destdir="${result-classes-client-compiler}" source="${required.java.version}" target="${required.java.version}" classpathref="compile.classpath.client-compiler" debug="true" encoding="UTF-8" includeantruntime="false">
  530. <src path="${result-src-client-compiler}"/>
  531. <!-- These could be removed by using class names instead of class references in generators -->
  532. <classpath location="${result-classes-shared}"></classpath>
  533. <classpath location="${result-classes-client}"></classpath>
  534. <classpath location="${result-classes-server}"></classpath>
  535. </javac>
  536. </target>
  537. <target name="compile-shared" depends="init, preprocess-src">
  538. <echo>Compiling shared/src</echo>
  539. <!-- Compile core sources first as the other sources depend on these -->
  540. <mkdir dir="${result-classes-shared}" />
  541. <javac destdir="${result-classes-shared}" source="${required.java.version}" target="${required.java.version}" classpathref="compile.classpath.shared" debug="true" encoding="UTF-8" includeantruntime="false">
  542. <src path="${result-src-shared}"/>
  543. </javac>
  544. </target>
  545. <target name="compile-tests" depends="compile-server,compile-client,compile-sass">
  546. <echo>Compiling src (Server and client side JUnit tests)</echo>
  547. <!-- Compile server and client side JUnit tests -->
  548. <mkdir dir="${result-classes-junit}" />
  549. <javac source="${required.java.version}" target="${required.java.version}" classpathref="compile.classpath.server-tests" destdir="${result-classes-junit}" debug="true" encoding="UTF-8" includeantruntime="false">
  550. <classpath path="${result-classes-shared}"></classpath>
  551. <classpath path="${result-classes-server}"></classpath>
  552. <classpath path="${result-classes-client}"></classpath>
  553. <src path="${result-src-junit}"/>
  554. </javac>
  555. <echo>Compiling SASS JUnit tests</echo>
  556. <!-- Compile server and client side JUnit tests -->
  557. <mkdir dir="${result-classes-sass-junit}" />
  558. <javac source="${required.java.version}" target="${required.java.version}" classpathref="compile.classpath.server-tests" destdir="${result-classes-sass-junit}" debug="true" encoding="UTF-8" includeantruntime="false">
  559. <classpath path="${result-classes-sass}"></classpath>
  560. <src path="${result-src-sass-junit}"/>
  561. </javac>
  562. <echo>Compiling src (TestBench tests)</echo>
  563. <!-- Compile TestBench tests -->
  564. <mkdir dir="${result-classes-testbench}" />
  565. <javac source="${required.java.version}" target="${required.java.version}" classpathref="compile.classpath.server" destdir="${result-classes-testbench}" debug="true" encoding="UTF-8" includeantruntime="false">
  566. <classpath path="${result-classes-junit}"></classpath>
  567. <classpath path="${result-classes-server}"></classpath>
  568. <classpath path="${result-classes-shared}"></classpath>
  569. <classpath path="${result-classes-client}"></classpath>
  570. <classpath refid="gwt.dev.user.jars"/>
  571. <src path="${result-src-testbench}"/>
  572. </javac>
  573. </target>
  574. <target name="compile-helpers" depends="init, compile-sass">
  575. <mkdir dir="${buildhelpers-classes}" />
  576. <javac source="${required.java.version}" target="${required.java.version}" includeantruntime="false" classpathref="compile.classpath.buildhelpers" destdir="${buildhelpers-classes}" debug="true" encoding="UTF-8" >
  577. <!-- SASS -->
  578. <classpath path="${result-classes-sass}" />
  579. <src path="${buildhelpers-src}"/>
  580. </javac>
  581. </target>
  582. <target name="compile-sass" depends="init, preprocess-src">
  583. <!-- TODO also perform javacc compilation of the parser -->
  584. <mkdir dir="${result-classes-sass}" />
  585. <javac source="${required.java.version}" target="${required.java.version}" includeantruntime="false" srcdir="${result-src-sass}"
  586. classpathref="compile.classpath.sass" destdir="${result-classes-sass}" debug="true" encoding="UTF-8" />
  587. </target>
  588. <target name="defaulttheme" depends="init, compile-sass, compile-helpers" description="Compile all included themes">
  589. <echo>Combining default themes css files</echo>
  590. <java classname="com.vaadin.buildhelpers.CompileDefaultTheme" failonerror="yes" fork="yes">
  591. <arg value="-version" />
  592. <arg value="${version.full}"/>
  593. <classpath>
  594. <!-- SASS -->
  595. <path path="${result-classes-sass}" />
  596. <path location="${buildhelpers-classes}" />
  597. <path refid="compile.classpath.buildhelpers" />
  598. </classpath>
  599. <jvmarg value="-Djava.awt.headless=true"/>
  600. </java>
  601. </target>
  602. <target name="testtarget">
  603. <echo>TEST TARGET CALLED</echo>
  604. </target>
  605. <!-- ================================================================== -->
  606. <!-- Widget Set Compilation -->
  607. <!-- ================================================================== -->
  608. <!-- Widget set compilation process: -->
  609. <!-- 1. Preprocess sources -->
  610. <!-- 2. Compile server-side java -->
  611. <!-- 3. Generate widget set definitions and classes -->
  612. <!-- 4. Compile widget sets -->
  613. <!-- -->
  614. <!-- Widget sets can be built for two purposes: -->
  615. <!-- * for building installation packages -->
  616. <!-- * for building single widget sets during development -->
  617. <!-- Targets: widgetset-<name> -->
  618. <target name="remove-widgetset-gwt-tmp">
  619. <echo>Removing widgetset temp files</echo>
  620. <delete dir="${widgetsets-output-dir}/.gwt-tmp" includeemptydirs="true"/>
  621. <!-- This is generated by GWT 2.3+ for rpcPolicyManifest and symbolMaps, cannot disable -->
  622. <delete dir="${widgetsets-output-dir}/WEB-INF" includeemptydirs="true" failonerror="false" />
  623. </target>
  624. <!-- The widgetset generator is currently compiled along with rest of server-side Java. -->
  625. <target name="compile-widgetset-generator" depends="compile-server,compile-client, compile-client-compiler"/>
  626. <!-- Compiles the widgetset given as the first parameter -->
  627. <!-- Caller must ensure necessary classes have been compiled -->
  628. <target name="compile-widgetset">
  629. <fail unless="widgetset" message="No widgetset parameter set"/>
  630. <property name="widgetset-style" value="OBF" />
  631. <property name="widgetset-localWorkers" value="2" />
  632. <property name="widgetset-extraParams" value="" />
  633. <echo>Compiling widgetset ${widgetset}. Output directory: ${widgetsets-output-dir}</echo>
  634. <mkdir dir="${widgetsets-output-dir}"/>
  635. <!-- Disabled to reduce JAR size: precompile the widgetset to a .gwtar file -->
  636. <!--
  637. <java classname="com.google.gwt.dev.CompileModule" classpathref="compile.classpath.widgetset" failonerror="yes" fork="yes" maxmemory="512m">
  638. <arg value="-out" />
  639. <arg value="${result-precompiled-widgetsets}" />
  640. <arg value="-strict" />
  641. <arg value="${widgetset}" />
  642. <jvmarg value="-Xss8M"/>
  643. <jvmarg value="-XX:MaxPermSize=256M"/>
  644. <jvmarg value="-Djava.awt.headless=true"/>
  645. </java>
  646. -->
  647. <!-- compile the widgetset -->
  648. <java classname="com.google.gwt.dev.Compiler" classpathref="compile.classpath.widgetset" failonerror="yes" fork="yes" maxmemory="512m">
  649. <arg value="-war" />
  650. <arg value="${widgetsets-output-dir}" />
  651. <arg value="-style" />
  652. <arg value="${widgetset-style}" />
  653. <arg value="-strict" />
  654. <arg value="-localWorkers" />
  655. <arg value="${widgetset-localWorkers}" />
  656. <arg line="${widgetset-extraParams}" />
  657. <arg value="${widgetset}" />
  658. <sysproperty key="vFailIfNotSerializable" value="true" />
  659. <jvmarg value="-Xss8M"/>
  660. <jvmarg value="-XX:MaxPermSize=256M"/>
  661. <jvmarg value="-Djava.awt.headless=true"/>
  662. </java>
  663. <antcall target="remove-widgetset-gwt-tmp"/>
  664. <echo>Compiled ${widgetset}</echo>
  665. </target>
  666. <target name="compile-widgetset-default">
  667. <antcall target="compile-widgetset">
  668. <reference refid="compile.classpath.widgetset" />
  669. <param name="widgetset" value="com.vaadin.DefaultWidgetSet"/>
  670. </antcall>
  671. </target>
  672. <target name="compile-widgetset-testing">
  673. <!-- Create a path reference containing default widgetset classpath + testbench files -->
  674. <path id="compile.classpath.testingwidgetset">
  675. <path refid="compile.classpath.widgetset" />
  676. <pathelement location="${result-classes-testbench}" />
  677. <pathelement location="${result-src-testbench}" />
  678. </path>
  679. <antcall target="compile-widgetset">
  680. <reference refid="compile.classpath.testingwidgetset" torefid="compile.classpath.widgetset" />
  681. <param name="widgetset" value="com.vaadin.tests.widgetset.TestingWidgetSet"/>
  682. </antcall>
  683. </target>
  684. <target name="compile-widgetset-portal-default" unless="compile.only.default-widgetset">
  685. <antcall target="compile-widgetset">
  686. <reference refid="compile.classpath.widgetset" />
  687. <param name="widgetset" value="com.vaadin.portal.gwt.PortalDefaultWidgetSet"/>
  688. </antcall>
  689. </target>
  690. <!-- Compiles all widgetsets. -->
  691. <!-- This is called when building packages and when compiling all -->
  692. <!-- widgetsets, but not when compiling individual widgetsets. -->
  693. <target name="compile-client-side" depends="compile-gwt, compile-server-side, compile-tests, compile-client-compiler">
  694. <echo>Compiling widget sets in parallel.</echo>
  695. <parallel threadsperprocessor="1">
  696. <antcall inheritrefs="true" target="compile-widgetset-default"/>
  697. <antcall inheritrefs="true" target="compile-widgetset-testing"/>
  698. <antcall inheritrefs="true" target="compile-widgetset-portal-default"/>
  699. </parallel>
  700. </target>
  701. <!-- Definitions for building local components, i.e., not for an installation package. -->
  702. <target name="init-nonpackage" depends="build.properties">
  703. <!-- Definitions for building the client-side. -->
  704. <property name="widgetsets-output-dir" value="WebContent/VAADIN/widgetsets" />
  705. <echo>We are using ${gwt.dev.jar}.</echo>
  706. <echo>Widget sets output dir: ${widgetsets-output-dir}</echo>
  707. </target>
  708. <!-- Builds all widgetsets locally, i.e., not for an installation package. -->
  709. <target name="widgetsets" depends="init-nonpackage, init, compile-widgetset-generator, compile-client-side"/>
  710. <!-- Build each widgetset locally, i.e., not for an installation package. -->
  711. <target name="widgetset-default" depends="init-nonpackage, init, compile-gwt, compile-widgetset-generator, compile-widgetset-default" description="Compile the DefaultWidgetSet"/>
  712. <target name="widgetset-testing" depends="init-nonpackage, init, compile-gwt, compile-tests, compile-widgetset-generator, compile-widgetset-testing"/>
  713. <target name="widgetset-portal-default" depends="init-nonpackage, init, compile-gwt, compile-widgetset-generator, compile-widgetset-portal-default"/>
  714. <!-- ================================================================== -->
  715. <!-- Libraries and Tests -->
  716. <!-- ================================================================== -->
  717. <target name="compile-gwt" depends="init" unless="use.precompiled.gwt">
  718. <!-- skipped based on a parameter, use pre-compiled JARs from elsewhere -->
  719. <!-- Compile GWT in a directory defined by properties -->
  720. <ant antfile="${gwt.root}/build.xml" target="user" dir="${gwt.root}" inheritall="false" inheritrefs="false">
  721. <property name="gwt.root" value="${gwt.root}"/>
  722. </ant>
  723. <ant antfile="${gwt.root}/build.xml" target="dev" dir="${gwt.root}" inheritall="false" inheritrefs="false">
  724. <property name="gwt.root" value="${gwt.root}"/>
  725. </ant>
  726. <ant antfile="${gwt.root}/build.xml" target="codeserver" dir="${gwt.root}" inheritall="false" inheritrefs="false">
  727. <property name="gwt.root" value="${gwt.root}"/>
  728. </ant>
  729. <ant antfile="${gwt.root}/build.xml" target="elemental" dir="${gwt.root}" inheritall="false" inheritrefs="false">
  730. <property name="gwt.root" value="${gwt.root}"/>
  731. </ant>
  732. </target>
  733. <!-- Compile the Vaadin library JAR. -->
  734. <!-- Need only the default widgetset for this, but can't depend -->
  735. <!-- specifically on it, because dependence does not see compiled -->
  736. <!-- individual widgetsets, because antcall does not fulfill -->
  737. <!-- dependencies. -->
  738. <target name="vaadin.jar" depends="compile-server-side, compile-client-side, compile-helpers">
  739. <echo>Creating JAR (server-side) ${lib-jar-name}</echo>
  740. <!-- Create Vaadin JAR -->
  741. <mkdir dir="${output-dir}/META-INF"/>
  742. <echo file="${output-dir}/META-INF/VERSION">${version.full}</echo>
  743. <!-- Replace GWT versioning with Vaadin versioning -->
  744. <echo file="${result-classes-gwt}/com/google/gwt/dev/About.properties">gwt.version=${gwt-version}.vaadin${version.full}</echo>
  745. <jarjar jarfile="${output-dir}/WebContent/WEB-INF/lib/${lib-jar-name}"
  746. compress="true" manifest="build/package/META-INF/MANIFEST.MF" duplicate="preserve" index="true" >
  747. <metainf dir="${output-dir}/META-INF"/>
  748. <manifest>
  749. <attribute name="Vaadin-Package-Version" value="1" />
  750. <attribute name="Vaadin-Widgetsets" value="com.vaadin.DefaultWidgetSet" />
  751. <attribute name="Implementation-Vendor" value="Vaadin Ltd" />
  752. <attribute name="Implementation-URL" value="http://vaadin.com" />
  753. <attribute name="Implementation-Version" value="${version.full}" />
  754. <!-- No separate GWT-Version attribute or file -->
  755. <!-- <attribute name="GWT-Version" value="${gwt-version}" /> -->
  756. <attribute name="GWT-Version-Dependencies" value="${gwt-version-dependencies}" />
  757. <attribute name="Bundle-Version" value="${version.full}" />
  758. </manifest>
  759. <fileset dir="${result-classes-server}"/>
  760. <fileset dir="${result-classes-client}"/>
  761. <fileset dir="${result-classes-shared}"/>
  762. <fileset dir="${result-classes-sass}"/>
  763. <fileset dir="${result-classes-client-compiler}"/>
  764. <!-- add sources -->
  765. <fileset dir="${result-src-server}"/>
  766. <fileset dir="${result-src-client}"/>
  767. <fileset dir="${result-src-shared}"/>
  768. <fileset dir="${result-src-sass}"/>
  769. <fileset dir="${result-src-client-compiler}"/>
  770. <fileset dir="${result-classes-gwt}"/>
  771. <fileset dir="${output-dir}/WebContent">
  772. <patternset>
  773. <include name="VAADIN/widgetsets/com.vaadin.DefaultWidgetSet/**/*" />
  774. <include name="VAADIN/themes/base/**/*" />
  775. <include name="VAADIN/themes/chameleon/**/*" />
  776. <include name="VAADIN/themes/liferay/**/*" />
  777. <include name="VAADIN/themes/runo/**/*" />
  778. <include name="VAADIN/themes/reindeer/**/*" />
  779. <include name="VAADIN/vaadinBootstrap.js" />
  780. <include name="release-notes.html" />
  781. <include name="license.html" />
  782. <include name="css/**" />
  783. <include name="img/**" />
  784. </patternset>
  785. </fileset>
  786. <!-- Precompiled widgetset (.gwtar file) not included to limit JAR size -->
  787. <!-- <fileset dir="${result-precompiled-widgetsets}" includes="com/vaadin/DefaultWidgetSet.gwtar" /> -->
  788. <!-- TODO GWT related license files etc. should be in subdirectories -->
  789. <!-- GWT -->
  790. <!-- Precompiled GWT modules (.gwtar file) not included to limit JAR size -->
  791. <zipfileset src="${gwt.user.jar}" excludes="META-INF/**,javax/servlet/**,**/*.gwtar" />
  792. <!-- TODO depends on locally compiled gwt-user -->
  793. <!--
  794. <fileset dir="${gwt.user.dir}/src" excludes="**/package.html" />
  795. <fileset dir="${gwt.user.dir}/super" excludes="**/package.html" />
  796. <fileset dir="${gwt.user.bin}" excludes="**/*.gwtar" />
  797. <zipfileset src="${gwt.tools.lib}/w3c/sac/sac-1.3.jar" />
  798. <zipfileset src="${gwt.tools.lib}/w3c/flute/flute-1.3-gg2.jar" />
  799. <zipfileset src="${gwt.tools.lib}/streamhtmlparser/streamhtmlparser-jsilver-r10/streamhtmlparser-jsilver-r10-1.5-rebased.jar" />
  800. -->
  801. <!-- GWT development JAR contents including many external dependencies -->
  802. <zipfileset src="${gwt.dev.jar}" excludes="javax/servlet/**,javax/xml/**" >
  803. <exclude name="com/google/gwt/dev/About.properties"/>
  804. </zipfileset>
  805. <!-- Alternative approach: GWT compiler and its dependencies only from the dev JAR -->
  806. <!--
  807. <zipfileset src="${gwt.dev.jar}">
  808. <include name="com/google/gwt/core/client/**"/>
  809. <include name="com/google/gwt/core/shared/**"/>
  810. <include name="com/google/gwt/core/ext/**"/>
  811. <include name="com/google/gwt/core/linker/**"/>
  812. <include name="com/google/gwt/dev/About.java"/>
  813. <include name="com/google/gwt/dev/GwtVersion.java"/>
  814. <include name="com/google/gwt/dev/Permutation.java"/>
  815. <include name="com/google/gwt/dev/asm/**"/>
  816. <include name="com/google/gwt/dev/cfg/**"/>
  817. <include name="com/google/gwt/dev/javac/**"/>
  818. <include name="com/google/gwt/dev/jdt/**"/>
  819. <include name="com/google/gwt/dev/jjs/**"/>
  820. <include name="com/google/gwt/dev/js/**"/>
  821. <include name="com/google/gwt/dev/json/**"/>
  822. <include name="com/google/gwt/dev/resource/**"/>
  823. <include name="com/google/gwt/dev/util/**"/>
  824. <include name="com/google/gwt/soyc/**"/>
  825. <include name="com/google/gwt/util/**"/>
  826. <include name="org/eclipse/jdt/**"/>
  827. </zipfileset>
  828. <zipfileset src="${gwt.tools.lib}/apache/ant-1.6.5.jar" />
  829. <zipfileset src="${gwt.tools.lib}/eclipse/jdt-3.4.2_r894.jar" />
  830. <zipfileset src="${gwt.tools.lib}/tomcat/commons-collections-3.1.jar" />
  831. <zipfileset src="${gwt.tools.lib}/guava/guava-10.0.1/guava-10.0.1-rebased.jar" />
  832. <zipfileset src="${gwt.tools.lib}/jscomp/r1649/compiler-rebased.jar" />
  833. -->
  834. <!-- GWT SuperDevMode -->
  835. <zipfileset src="${gwt.codeserver.jar}" />
  836. <!-- GWT Elemental -->
  837. <zipfileset src="${gwt.elemental.jar}" />
  838. <!-- jarjar rules: rebase packages from gwt-dev.jar but not those from gwt-user -->
  839. <!-- Don't rebase these -->
  840. <!-- xalan is used via reflection -->
  841. <rule pattern="org.apache.xalan.**" result="@0"/>
  842. <rule pattern="org.apache.xml.**" result="@0"/>
  843. <!-- Cannot rebase - used in APIs etc. -->
  844. <!-- <rule pattern="org.mortbay.**" result="@0"/> -->
  845. <!-- <rule pattern="org.xml.**" result="@0"/> -->
  846. <!-- Rebase these -->
  847. <rule pattern="com.gargoylesoftware.**" result="com.vaadin.external.@0"/>
  848. <rule pattern="com.ibm.**" result="com.vaadin.external.@0"/>
  849. <rule pattern="com.steadystate.**" result="com.vaadin.external.@0"/>
  850. <rule pattern="mx4j.**" result="com.vaadin.external.@0"/>
  851. <rule pattern="net.sourceforge.htmlunit.**" result="com.vaadin.external.@0"/>
  852. <rule pattern="org.apache.**" result="com.vaadin.external.@0"/>
  853. <rule pattern="org.cyberneko.**" result="com.vaadin.external.@0"/>
  854. <rule pattern="org.eclipse.**" result="com.vaadin.external.@0"/>
  855. <!-- looked up based on class name? -->
  856. <rule pattern="org.hibernate.validator.**" result="com.vaadin.external.@0"/>
  857. <rule pattern="org.jdesktop.swingworker.**" result="com.vaadin.external.@0"/>
  858. <rule pattern="org.kohsuke.args4j.**" result="com.vaadin.external.@0"/>
  859. </jarjar>
  860. <!-- Generate the Export-Package attribute in the manifest of the JAR -->
  861. <java classname="com.vaadin.buildhelpers.GeneratePackageExports" failonerror="true" fork="yes">
  862. <arg value="${output-dir}/WebContent/WEB-INF/lib/${lib-jar-name}"/>
  863. <classpath>
  864. <pathelement location="${buildhelpers-classes}" />
  865. </classpath>
  866. </java>
  867. <echo>##teamcity[publishArtifacts '${output-dir}/WebContent/WEB-INF/lib/${lib-jar-name}']</echo>
  868. </target>
  869. <target name="vaadin-sources.jar" depends="init">
  870. <jar file="${result-path}/${lib-sources-jar-name}" compress="true">
  871. <fileset dir="${result-src-server}">
  872. <patternset>
  873. <include name="**/*.java" />
  874. </patternset>
  875. </fileset>
  876. <fileset dir="${result-src-shared}">
  877. <patternset>
  878. <include name="**/*.java" />
  879. </patternset>
  880. </fileset>
  881. <fileset dir="${result-src-client}">
  882. <patternset>
  883. <include name="**/*.java" />
  884. </patternset>
  885. </fileset>
  886. <fileset dir="${result-src-sass}">
  887. <patternset>
  888. <include name="**/*.java" />
  889. </patternset>
  890. </fileset>
  891. <fileset dir="${output-dir}/WebContent">
  892. <patternset>
  893. <include name="release-notes.html" />
  894. <include name="license.html" />
  895. <include name="css/**" />
  896. <include name="img/**" />
  897. </patternset>
  898. </fileset>
  899. </jar>
  900. </target>
  901. <!-- ================================================================== -->
  902. <!-- Documentation -->
  903. <!-- ================================================================== -->
  904. <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
  905. <!-- Documentation: Add Javadoc to doc -->
  906. <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
  907. <target name="javadoc" depends="init, preprocess-src">
  908. <property name="javadoc.destdir" value="${output-dir}/WebContent/docs/api"/>
  909. <javadoc destdir="${javadoc.destdir}" author="true" version="true" use="true" windowtitle="${product-name}" classpathref="compile.classpath.client">
  910. <packageset dir="${result-src-server}"/>
  911. <packageset dir="${result-src-client}"/>
  912. <packageset dir="${result-src-shared}"/>
  913. <doctitle>${javadoc.doctitle}</doctitle>
  914. <!-- <header><![CDATA[<script type="text/javascript" src=".html-style/style.js"></script>]]></header> -->
  915. <bottom>${javadoc.bottom}</bottom>
  916. <link offline="true" href="http://docs.oracle.com/javase/6/docs/api/" packagelistLoc="build/javadoc/j2se-1.6.0" />
  917. <link offline="true" href="http://java.sun.com/j2ee/1.4/docs/api/" packagelistLoc="build/javadoc/j2ee-1.4" />
  918. </javadoc>
  919. <!-- Create a javadoc jar, mainly for Maven -->
  920. <jar file="${result-path}/${lib-javadoc-jar-name}" compress="true">
  921. <fileset dir="${javadoc.destdir}">
  922. <patternset>
  923. <include name="**" />
  924. </patternset>
  925. </fileset>
  926. <fileset dir="${output-dir}/WebContent">
  927. <patternset>
  928. <include name="release-notes.html" />
  929. <include name="license.html" />
  930. <include name="css/**" />
  931. <include name="img/**" />
  932. </patternset>
  933. </fileset>
  934. </jar>
  935. <!-- Append local style definitions. -->
  936. <echo>Appending local style definitions</echo>
  937. <concat destfile="${javadoc.destdir}/stylesheet.css" append="yes">
  938. <filelist dir="build/javadoc" files="stylesheet-local.css"/>
  939. </concat>
  940. </target>
  941. <!-- ================================================================== -->
  942. <!-- Difference to previous release package. -->
  943. <!-- ================================================================== -->
  944. <!-- This should be called after the Linux package is ready. -->
  945. <target name="differences" if="build.differences">
  946. <exec executable="python" searchpath="true" failonerror="true" output="${result-path}/differences.txt">
  947. <arg value="build/bin/package-diff.py"/>
  948. <arg value="${version.full}"/>
  949. </exec>
  950. <echo>##teamcity[publishArtifacts '${result-path}/differences.txt']</echo>
  951. </target>
  952. <!-- ================================================================== -->
  953. <!-- Custom build. -->
  954. <!-- ================================================================== -->
  955. <!-- Main target for the custom build. -->
  956. <!-- Need to read custom build configuration before calling clean-result -->
  957. <target name="custom-build" depends="custom-build-init, clean-result, nightly-init, init, build">
  958. </target>
  959. <!-- Initialize a custom build. -->
  960. <target name="custom-build-init">
  961. <echo>Preparing a custom build with properties file: ${build.properties.file}</echo>
  962. <!-- Custom build support -->
  963. <antcontrib:if>
  964. <isset property="build.properties.file"/>
  965. <then>
  966. <tstamp>
  967. <format property="build.date.compact" pattern="yyyyMMdd"/>
  968. </tstamp>
  969. <property file="${build.properties.file}" />
  970. <property name="version" value="${vaadin.version}"/>
  971. <property name="version.full" value="${version}-${build.date.compact}"/>
  972. </then>
  973. <!-- Otherwise version is set by the target "init" -->
  974. </antcontrib:if>
  975. </target>
  976. <target name="custom-build-maven-publish">
  977. <antcall target="nightly-maven-publish" />
  978. </target>
  979. <!-- ================================================================== -->
  980. <!-- Nightly build. -->
  981. <!-- ================================================================== -->
  982. <!-- Main target for the nightly build. -->
  983. <target name="nightly" depends="clean-result, nightly-init, init, build, javadoc, differences">
  984. </target>
  985. <!-- Initialize a nightly build. -->
  986. <target name="nightly-init" depends="build.properties">
  987. <!-- Mandatory parameters. -->
  988. <fail unless="build.number" message="The build.number property must be defined."/>
  989. <fail unless="nightly.publish" message="The nightly.publish property must be defined."/>
  990. <!-- Optional parameters. -->
  991. <property name="build.tag" value="dev"/>
  992. <echo>Base version: ${version}</echo>
  993. <echo>Build number: ${build.number}</echo>
  994. <echo>Build tag: ${build.tag}</echo>
  995. <echo>Publish target: ${nightly.publish}</echo>
  996. <echo>Demo publish target: ${nightly.demo.publish}</echo>
  997. <!-- Set build number. -->
  998. <tstamp>
  999. <format property="nightly.date" pattern="yyyyMMdd"/>
  1000. </tstamp>
  1001. <property name="version.full" value="${version}.${build.tag}-${nightly.date}-${build.number}"/>
  1002. <echo>Version will be: ${version.full}</echo>
  1003. <!-- Tell TeamCity the build name. Have to do it this way, because -->
  1004. <!-- this script needs to get the plain build number as a parameter. -->
  1005. <echo>##teamcity[buildNumber '${version}-c${build.number}']</echo>
  1006. </target>
  1007. <target name="nightly-teamcity-publish">
  1008. <!-- Publish as a TeamCity artifact. -->
  1009. <echo>##teamcity[publishArtifacts '${output-dir}/WebContent/WEB-INF/lib/${lib-jar-name}']</echo>
  1010. </target>
  1011. <!-- Copies the nightly build artifacts to the download server. -->
  1012. <target name="nightly-download-publish" if="nightly.publish">
  1013. <!-- Publish to the download server. -->
  1014. <echo>Installing ${output-dir}/WebContent/WEB-INF/lib/${lib-jar-name} to ${nightly.publish}</echo>
  1015. <echo>Hopefully you have permissions for the copy operation with SSH.</echo>
  1016. <!-- Copy the linux installation package and the JAR. -->
  1017. <exec executable="scp" searchpath="true" resultproperty="nightly.install.scp.result">
  1018. <arg value="-B"/>
  1019. <arg value="${output-dir}/WebContent/WEB-INF/lib/${lib-jar-name}"/>
  1020. <arg value="${nightly.publish}"/>
  1021. </exec>
  1022. <echo>Result: ${nightly.install.scp.result}</echo>
  1023. </target>
  1024. <!-- Copies the nightly build artifacts to the download server. -->
  1025. <target name="nightly-tests-publish" if="nightly.demo.publish" depends="internal-package-war">
  1026. <fail unless="version.major" message="Major version must be defined in version.major"/>
  1027. <fail unless="version.minor" message="Major version must be defined in version.minor"/>
  1028. <!-- Publish to the demo server. -->
  1029. <property name="src" value="${result-path}/${test-war-filename}"/>
  1030. <property name="target" value="${nightly.demo.publish}/${version.major}.${version.minor}-${build.tag}.war"/>
  1031. <echo>Installing ${src} to ${target}</echo>
  1032. <!-- Copy the linux installation package and the JAR. -->
  1033. <exec executable="scp" searchpath="true" resultproperty="nightly.demo.install.scp.result">
  1034. <arg value="-B"/>
  1035. <arg value="${src}"/>
  1036. <arg value="${target}"/>
  1037. </exec>
  1038. <echo>Result: ${nightly.install.scp.result}</echo>
  1039. </target>
  1040. <target name="nightly-publish" depends="nightly-teamcity-publish, nightly-download-publish, nightly-tests-publish">
  1041. </target>
  1042. <target name="nightly-maven-pom.xml">
  1043. <echo>Creating pom.xml for nightly build</echo>
  1044. <property name="vaadin.version.maven" value="${version.major}.${version.minor}-SNAPSHOT" />
  1045. <copy tofile="build/maven/pom.xml">
  1046. <filterchain>
  1047. <expandproperties />
  1048. <replacetokens begintoken="@" endtoken="@">
  1049. <token key="MAVEN-VERSION" value="${vaadin.version.maven}" />
  1050. </replacetokens>
  1051. </filterchain>
  1052. <fileset file="build/maven/pom-template.xml"/>
  1053. </copy>
  1054. </target>
  1055. <target name="nightly-maven-publish" depends="nightly-maven-pom.xml">
  1056. <property file="${gpg.passphrase.file}" />
  1057. <echo>Publishing ${output-dir}/WebContent/WEB-INF/lib/${lib-jar-name} to Maven repository</echo>
  1058. <artifact:mvn failonerror="true">
  1059. <arg value="gpg:sign-and-deploy-file"/>
  1060. <!-- .. is a workaround as maven runs in the build directory -->
  1061. <sysproperty key="file" value="../${output-dir}/WebContent/WEB-INF/lib/${lib-jar-name}" />
  1062. <sysproperty key="pomFile" value="maven/pom.xml" />
  1063. <sysproperty key="repositoryId" value="vaadin-snapshots" />
  1064. <sysproperty key="url" value="${snapshot.repository.url}" />
  1065. <sysproperty key="gpg.passphrase" value="${gpg.passphrase}" />
  1066. </artifact:mvn>
  1067. </target>
  1068. <target name="local-maven-pom.xml">
  1069. <echo>Creating pom.xml for local test build</echo>
  1070. <fail unless="version.major" message="Major version must be defined in version.major"/>
  1071. <fail unless="version.minor" message="Major version must be defined in version.minor"/>
  1072. <property name="vaadin.version.maven" value="${version.major}.${version.minor}" />
  1073. <copy tofile="build/maven/pom.xml">
  1074. <filterchain>
  1075. <expandproperties />
  1076. <replacetokens begintoken="@" endtoken="@">
  1077. <token key="MAVEN-VERSION" value="${vaadin.version.maven}" />
  1078. </replacetokens>
  1079. </filterchain>
  1080. <fileset file="build/maven/pom-template.xml"/>
  1081. </copy>
  1082. </target>
  1083. <target name="local-maven-publish" depends="local-maven-pom.xml">
  1084. <echo>Publishing ${output-dir}/WebContent/WEB-INF/lib/${lib-jar-name} to the local Maven repository</echo>
  1085. <artifact:mvn>
  1086. <arg value="install:install-file"/>
  1087. <!-- .. is a workaround as maven runs in the build directory -->
  1088. <sysproperty key="file" value="../${output-dir}/WebContent/WEB-INF/lib/${lib-jar-name}" />
  1089. <sysproperty key="pomFile" value="maven/pom.xml" />
  1090. </artifact:mvn>
  1091. </target>
  1092. <!-- ================================================================== -->
  1093. <!-- Automated tests. -->
  1094. <!-- ================================================================== -->
  1095. <target name="tests" depends="compile-tests, internal-package-war">
  1096. <!-- Run all different types of tests in parallel to decrease testing time -->
  1097. <parallel threadcount="3">
  1098. <sequential>
  1099. <!-- Sleep before running integration tests so testbench tests have time to compile and start -->
  1100. <sleep minutes="4" />
  1101. <antcall inheritrefs="true" inheritall="true" target="integration-tests"></antcall>
  1102. </sequential>
  1103. <antcall inheritrefs="true" inheritall="true" target="testbench-tests"></antcall>
  1104. <antcall inheritrefs="true" inheritall="true" target="server-side-tests"></antcall>
  1105. <antcall inheritrefs="true" inheritall="true" target="sass-tests"></antcall>
  1106. </parallel>
  1107. </target>
  1108. <!-- Assumes java classes have been compiled but depends does not work out well as this is run from a <parallel> task-->
  1109. <target name="server-side-tests" unless="tests.serverside.skip" depends="compile-tests">
  1110. <junit printsummary="yes">
  1111. <classpath>
  1112. <pathelement path="${result-classes-server}" />
  1113. <pathelement path="${result-classes-shared}" />
  1114. <pathelement path="${result-classes-junit}" />
  1115. <path refid="compile.classpath.server-tests"></path>
  1116. </classpath>
  1117. <batchtest fork="yes">
  1118. <fileset dir="tests/server-side" includes="**/*.java" excludes="**/Abstract*.java,com/vaadin/tests/data/bean/*.java,com/vaadin/tests/util/*.java,**/VaadinClasses.java" />
  1119. <fileset dir="tests/client-side" includes="**/*.java" excludes="**/Abstract*.java" />
  1120. </batchtest>
  1121. </junit>
  1122. </target>
  1123. <!-- Assumes java classes have been compiled but depends does not work out well as this is run from a <parallel> task-->
  1124. <target name="sass-tests" unless="tests.serverside.skip" depends="compile-tests">
  1125. <junit printsummary="yes">
  1126. <classpath>
  1127. <pathelement path="${result-src-sass-junit}" />
  1128. <pathelement path="${result-classes-sass}" />
  1129. <pathelement path="${result-classes-sass-junit}" />
  1130. <path refid="compile.classpath.server-tests"></path>
  1131. </classpath>
  1132. <batchtest fork="yes">
  1133. <fileset dir="${result-src-sass-junit}" includes="**/*.java" excludes="**/Abstract*.java" />
  1134. </batchtest>
  1135. </junit>
  1136. </target>
  1137. <!-- Assumes java classes have been compiled but depends does not work out well as this is run from a <parallel> task-->
  1138. <target name="testbench-tests" unless="tests.testbench.skip">
  1139. <fail unless="product-file" message="The 'product-file' property must be defined."/>
  1140. <fail unless="version" message="The 'version' property must be defined."/>
  1141. <echo>Version: ${version.full}</echo>
  1142. <!-- Parameters for the test.xml script. -->
  1143. <fail unless="com.vaadin.testbench.tester.host" message="The 'com.vaadin.testbench.tester.host' property must be defined."/>
  1144. <fail unless="com.vaadin.testbench.deployment.url" message="The 'com.vaadin.testbench.deployment.url' property must be defined."/>
  1145. <fail unless="com.vaadin.testbench.lib.dir" message="The 'com.vaadin.testbench.lib.dir' property must be defined."/>
  1146. <property name="com.vaadin.testbench.screenshot.block.error" value="0.025"/>
  1147. <property name="com.vaadin.testbench.debug" value="false"/>
  1148. <property name="package.name" value="${base-name}"/>
  1149. <!-- Only Linux tests allowed. TODO: Generalize this. -->
  1150. <property name="package.filename" value="${result-path}/${test-war-filename}"/>
  1151. <!-- Run the separate test script. -->
  1152. <ant antfile="tests/test.xml" target="test-package" inheritall="false" inheritrefs="true">
  1153. <!-- This is provided so that the test script can copy the -->
  1154. <!-- "tests" classes after unpacking the package. -->
  1155. <property name="output-dir" value="${output-dir}"/>
  1156. <!-- Convert tests to run multiple times if failed. -->
  1157. <property name="retries" value="2"/>
  1158. <property name="package.filename" value="${basedir}/${package.filename}"/>
  1159. <property name="testing.testarea" value="/tmp/testarea"/>
  1160. <property name="package.name" value="${package.name}"/>
  1161. <property name="test-output-dir" value="../build/test-output" />
  1162. <property name="com.vaadin.testbench.tester.host" value="${com.vaadin.testbench.tester.host}"/>
  1163. <property name="com.vaadin.testbench.deployment.url" value="${com.vaadin.testbench.deployment.url}"/>
  1164. <property name="com.vaadin.testbench.lib.dir" value="${com.vaadin.testbench.lib.dir}"/>
  1165. <property name="com.vaadin.testbench.debug" value="${com.vaadin.testbench.debug}"/>
  1166. <property name="com.vaadin.testbench.screenshot.block.error" value="${com.vaadin.testbench.screenshot.block.error}"/>
  1167. <property name="deps.initialized" value="${deps.initialized}"/>
  1168. </ant>
  1169. </target>
  1170. <!-- Assumes java classes have been compiled but depends does not work out well as this is run from a <parallel> task-->
  1171. <target name="integration-tests" depends="init-deps" unless="tests.integration.skip">
  1172. <!-- Parameters for the test.xml script. -->
  1173. <fail unless="com.vaadin.testbench.tester.host" message="The 'com.vaadin.testbench.tester.host' property must be defined."/>
  1174. <fail unless="com.vaadin.testbench.lib.dir" message="The 'com.vaadin.testbench.lib.dir' property must be defined."/>
  1175. <fail unless="sshkey.file" message="The 'sshkey.file' property must be defined."/>
  1176. <!-- Empty passphrase if no passphrase defined -->
  1177. <property name="passphrase" value="" />
  1178. <property name="tests.war" location="${result-path}/${test-war-filename}" />
  1179. <!-- Run the separate test script. -->
  1180. <ant antfile="tests/integration_tests.xml" target="integration-test-all" inheritall="false" inheritrefs="true">
  1181. <!-- This is provided so that the test script can copy the -->
  1182. <!-- "tests" classes after unpacking the package. -->
  1183. <property name="output-dir" value="${output-dir}"/>
  1184. <property name="com.vaadin.testbench.tester.host" value="${com.vaadin.testbench.tester.host}"/>
  1185. <property name="com.vaadin.testbench.lib.dir" value="${com.vaadin.testbench.lib.dir}"/>
  1186. <property name="sshkey.file" value="${sshkey.file}" />
  1187. <property name="passphrase" value="${passphrase}" />
  1188. <property name="demo.war" value="${tests.war}"/>
  1189. <property name="deps.initialized" value="${deps.initialized}"/>
  1190. </ant>
  1191. </target>
  1192. </project>
  1193. <!-- These are for emacs. -->
  1194. <!-- Keep this comment at the end of the file
  1195. Local variables:
  1196. mode: xml
  1197. sgml-omittag:nil
  1198. sgml-shorttag:nil
  1199. sgml-namecase-general:nil
  1200. sgml-general-insert-case:lower
  1201. sgml-minimize-attributes:nil
  1202. sgml-always-quote-attributes:t
  1203. sgml-indent-step:4
  1204. sgml-indent-data:t
  1205. sgml-parent-document:nil
  1206. sgml-exposed-tags:nil
  1207. sgml-local-catalogs:("/etc/sgml/catalog" "/usr/share/xemacs21/xemacs-packages/etc/psgml-dtds/CATALOG")
  1208. sgml-local-ecat-files:("ECAT" "~/sgml/ECAT" "/usr/share/sgml/ECAT" "/usr/local/share/sgml/ECAT" "/usr/local/lib/sgml/ECAT")
  1209. End:
  1210. -->