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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727
  1. <?xml version="1.0"?>
  2. <project name="IT Mill Toolkit" basedir="../" default="package-all">
  3. <!-- Package creation - - - - - - - - - - - - - - - - - - - - - - - - -
  4. When creating release use only "package-*" targets:
  5. package-all
  6. * creates four release packages for three three platforms (below)
  7. package-windows
  8. * itmill-toolkit-windows-<version>.zip
  9. package-linux
  10. * itmill-toolkit-linux-<version>.tar.bz2
  11. package-mac
  12. * itmill-toolkit-mac-<version>.tar.gz
  13. * itmill-toolkit-mac-<version>.dmg
  14. NOTE: This build script requires directories named build/gwt/(linux|windows|mac) .
  15. You must unpack platform specific binaries under linux, windows and mac directories.
  16. build/gwt/(linux|windows|mac) are used for
  17. a) compile WebContent/ITMILL/widgetsets
  18. b) creating platform specific release ZIP/TGZ packages.
  19. -->
  20. <!--
  21. Call one of package-* targets unless you understand what you are doing
  22. -->
  23. <target name="package-all" depends="clean-all, init, build, internal-package-mac, internal-package-windows, internal-package-linux" description="Build public packages for Windows, Linux and Mac platforms.">
  24. </target>
  25. <target name="package-mac" depends="clean-all, init, build, internal-package-mac" description="Create public tar.gz package for Mac.">
  26. </target>
  27. <target name="package-windows" depends="clean-all, init, build, internal-package-windows" description="Create public ZIP package for Windows.">
  28. </target>
  29. <target name="package-linux" depends="clean-all, init, build, internal-package-linux" description="Create public tar.bz2 package for Linux.">
  30. </target>
  31. <!-- Initialization - - - - - - - - - - - - - - - - - - - - - - - - -->
  32. <target name="init">
  33. <!-- Find out which platform we are in -->
  34. <if>
  35. <equals arg1="${os.name}" arg2="Windows 2000, Windows XP" />
  36. <then>
  37. <property name="platform" value="windows" />
  38. </then>
  39. </if>
  40. <if>
  41. <equals arg1="${os.name}" arg2="Linux" />
  42. <then>
  43. <property name="platform" value="linux" />
  44. </then>
  45. </if>
  46. <if>
  47. <equals arg1="${os.name}" arg2="Mac OS X" />
  48. <then>
  49. <property name="platform" value="mac" />
  50. </then>
  51. </if>
  52. <!-- required when compiling WebContent/ITMILL/widgetsets (and also Java server-side classes) -->
  53. <property name="lib-gwt-dev" value="gwt-dev-${platform}.jar" />
  54. <echo>We are on ${platform} platform, using build/gwt/${platform}/${lib-gwt-dev}.</echo>
  55. <!-- Create result dir unless already exists -->
  56. <mkdir dir="build/result" />
  57. <property file="build/VERSION" />
  58. <property name="product-file" value="itmill-toolkit" />
  59. <property name="product-name" value="IT Mill Toolkit" />
  60. <property name="toolkit-package" value="com/itmill/toolkit" />
  61. <property file="build/html-style.properties" />
  62. <!-- Destination files -->
  63. <property name="lib-bin-jar-name" value="${product-file}-${version}.jar" />
  64. <property name="lib-dev-jar-name" value="${product-file}-dev-${version}.jar" />
  65. <property name="demo-lib-jar-name" value="${product-file}-demo-${version}.jar" />
  66. <property name="lib-src-jar-name" value="${product-file}-src-${version}.jar" />
  67. <property name="demo-war-name" value="${product-file}-demo-${version}.war" />
  68. <echo message="Prepared to build ${product-file} version ${version} packages" />
  69. <!-- Output directory -->
  70. <property name="output-dir" value="build/result/${product-file}-${version}" />
  71. <mkdir dir="${output-dir}" />
  72. <!-- Create Output Directory Hierarchy -->
  73. <mkdir dir="${output-dir}/doc/manual" />
  74. <mkdir dir="${output-dir}/doc/api" />
  75. <mkdir dir="${output-dir}/lib" />
  76. <mkdir dir="${output-dir}/WebContent" />
  77. <mkdir dir="${output-dir}/WebContent/WEB-INF" />
  78. <mkdir dir="${output-dir}/WebContent/WEB-INF/classes" />
  79. <!-- Construct classpath used by java and javadoc compilation -->
  80. <path id="compile.classpath">
  81. <pathelement path="build/gwt/${platform}/gwt-user.jar" />
  82. <pathelement path="build/gwt/${platform}/${lib-gwt-dev}" />
  83. <pathelement path="WebContent/WEB-INF/lib/commons-fileupload-1.2.jar" />
  84. <pathelement path="lib/reservr/googlemaps_gwt.jar" />
  85. <pathelement path="lib/jetty/jetty-6.1.5.jar" />
  86. <pathelement path="lib/jetty/jetty-util-6.1.5.jar" />
  87. <pathelement path="lib/jetty/servlet-api-2.5-6.1.5.jar" />
  88. </path>
  89. </target>
  90. <target name="internal-package-windows">
  91. <echo>Creating package for Windows platform.</echo>
  92. <echo>1: ${package-platform}</echo>
  93. <var name="package-platform" value="windows" />
  94. <echo>2: ${package-platform}</echo>
  95. <antcall target="add-platform-specific-files" inheritAll="true" inheritRefs="true" />
  96. <zip zipfile="build/result/${product-file}-${package-platform}-${version}.zip">
  97. <zipfileset prefix="${product-file}-${package-platform}-${version}" dir="build/result/${product-file}-${version}">
  98. <patternset>
  99. <include name="**/*" />
  100. </patternset>
  101. </zipfileset>
  102. <zipfileset prefix="${product-file}-${package-platform}-${version}/gwt" dir="build/gwt/windows">
  103. <patternset>
  104. <include name="**/*" />
  105. </patternset>
  106. </zipfileset>
  107. </zip>
  108. </target>
  109. <target name="internal-package-linux">
  110. <echo>Creating package for Linux platform.</echo>
  111. <var name="package-platform" value="linux" />
  112. <antcall target="add-platform-specific-files" inheritAll="true" inheritRefs="true" />
  113. <tar destfile="build/result/${product-file}-${package-platform}-${version}.tar.bz2" compression="bzip2" longfile="gnu">
  114. <tarfileset prefix="${product-file}-${package-platform}-${version}" dir="build/result/${product-file}-${version}">
  115. <patternset>
  116. <include name="**/*" />
  117. </patternset>
  118. </tarfileset>
  119. <tarfileset prefix="${product-file}-${package-platform}-${version}/gwt" dir="build/gwt/linux">
  120. <patternset>
  121. <include name="**/*" />
  122. </patternset>
  123. </tarfileset>
  124. </tar>
  125. </target>
  126. <target name="internal-package-mac">
  127. <echo>Creating package for Mac platform.</echo>
  128. <var name="package-platform" value="mac" />
  129. <antcall target="add-platform-specific-files" inheritAll="true" inheritRefs="true" />
  130. <tar destfile="build/result/${product-file}-${package-platform}-${version}.tar.gz" compression="gzip" longfile="gnu">
  131. <tarfileset prefix="${product-file}-${package-platform}-${version}" dir="build/result/${product-file}-${version}">
  132. <patternset>
  133. <include name="**/*" />
  134. </patternset>
  135. </tarfileset>
  136. <tarfileset prefix="${product-file}-${package-platform}-${version}/gwt" dir="build/gwt/mac">
  137. <patternset>
  138. <include name="**/*" />
  139. </patternset>
  140. </tarfileset>
  141. </tar>
  142. <antcall target="create-mac-diskimage" inheritAll="true" inheritRefs="true" />
  143. </target>
  144. <target name="create-mac-diskimage">
  145. <!-- create Mac disk image (dmg) also -->
  146. <property name="mount.dir" value="build/result/mac-mounted-image" />
  147. <mkdir dir="${mount.dir}" />
  148. <delete file="build/result/*.dmg" />
  149. <if>
  150. <equals arg1="${platform}" arg2="mac" />
  151. <then>
  152. <untar src="build/result/${product-file}-${package-platform}-${version}.tar.gz" dest="build/result/" compression="gzip" />
  153. <echo>Creating Mac disk image (dmg)</echo>
  154. <!-- create image -->
  155. <echo>hdiutil create -format UDRW -volname ${product-file}-${version} -srcfolder build/result/${product-file}-${package-platform}-${version} build/result/disk-image.dmg</echo>
  156. <exec executable="hdiutil" failonerror="true">
  157. <arg line="create -format UDRW -volname ${product-file}-${version} -srcfolder build/result/${product-file}-${package-platform}-${version} build/result/disk-image.dmg" />
  158. </exec>
  159. <!-- open image -->
  160. <exec executable="hdiutil" failonerror="true">
  161. <arg line='attach' />
  162. <arg line='-readwrite' />
  163. <arg line='-noverify' />
  164. <arg line='-noautoopen' />
  165. <arg line='-mountpoint ${mount.dir}' />
  166. <arg line='build/result/disk-image.dmg' />
  167. </exec>
  168. <!-- make sure root folder is opened when image is -->
  169. <exec executable="bless" failonerror="true">
  170. <arg line='--folder ${mount.dir}' />
  171. <arg line='--openfolder ${mount.dir}' />
  172. </exec>
  173. <!-- hack: wait for completion -->
  174. <exec executable="sleep" failonerror="true">
  175. <arg line='2' />
  176. </exec>
  177. <!-- here we could position items -->
  178. <!--
  179. <exec executable="osascript" failonerror="true">
  180. <arg line='package/positionItems.scpt ${mount.dir}' />
  181. </exec>
  182. -->
  183. <!-- turn on volume icon -->
  184. <exec executable="/Developer/Tools/SetFile" failonerror="true">
  185. <arg line='-a C' />
  186. <arg line='${mount.dir}' />
  187. </exec>
  188. <!-- set executable bit -->
  189. <chmod file="${mount.dir}/start-demo.sh" perm="ugo+x" />
  190. <!-- close image -->
  191. <exec executable="hdiutil" failonerror="true">
  192. <arg line='detach ${mount.dir}/' />
  193. </exec>
  194. <!-- make read-only -->
  195. <exec executable="hdiutil" failonerror="true">
  196. <arg line='convert build/result/disk-image.dmg' />
  197. <arg line='-format UDZO' />
  198. <arg line='-imagekey zlib-level=9' />
  199. <arg line='-o build/result/${product-file}-${package-platform}-${version}.dmg' />
  200. </exec>
  201. <delete file="build/result/disk-image.dmg" />
  202. <!-- internet-enable -->
  203. <exec executable="hdiutil" failonerror="true">
  204. <arg line='internet-enable build/result/${product-file}-${package-platform}-${version}.dmg' />
  205. </exec>
  206. </then>
  207. </if>
  208. </target>
  209. <target name="add-platform-specific-files">
  210. <delete includeemptydirs="true" defaultexcludes="false">
  211. <fileset dir="${output-dir}">
  212. <include name="start-demo.*" />
  213. <include name=".project" />
  214. <include name=".classpath" />
  215. <include name=".VolumeIcon.icns" />
  216. <include name=".DS_Store" />
  217. </fileset>
  218. </delete>
  219. <copy todir="${output-dir}">
  220. <filterchain>
  221. <expandproperties />
  222. <replacetokens begintoken="&lt;" endtoken=">">
  223. <token key="version" value="${version}" />
  224. <token key="/version" value="" />
  225. </replacetokens>
  226. <replacetokens begintoken="&lt;" endtoken=">">
  227. <token key="platform-specific-entries" value="&lt;classpathentry kind=&quot;lib&quot; path=&quot;gwt/gwt-dev-${package-platform}.jar&quot; /&gt;" />
  228. <token key="/platform-specific-entries" value="" />
  229. </replacetokens>
  230. </filterchain>
  231. <fileset dir="build/package">
  232. <include name=".classpath" />
  233. <include name=".project" />
  234. </fileset>
  235. </copy>
  236. <if>
  237. <equals arg1="${package-platform}" arg2="windows" />
  238. <then>
  239. <copy todir="${output-dir}">
  240. <fileset dir="build/package">
  241. <include name="start-demo.bat" />
  242. </fileset>
  243. </copy>
  244. </then>
  245. </if>
  246. <if>
  247. <equals arg1="${package-platform}" arg2="linux" />
  248. <then>
  249. <copy todir="${output-dir}">
  250. <fileset dir="build/package">
  251. <include name="start-demo.sh" />
  252. </fileset>
  253. </copy>
  254. <chmod file="${output-dir}/start-demo.sh" perm="ugo+x" />
  255. </then>
  256. </if>
  257. <if>
  258. <equals arg1="${package-platform}" arg2="mac" />
  259. <then>
  260. <copy todir="${output-dir}">
  261. <fileset dir="build/package">
  262. <include name="start-demo.sh" />
  263. <include name=".VolumeIcon.icns" />
  264. <include name=".DS_Store" />
  265. </fileset>
  266. </copy>
  267. <!-- TODO: this does not work, why? -->
  268. <chmod file="${output-dir}/start-demo.sh" perm="ugo+x" />
  269. </then>
  270. </if>
  271. </target>
  272. <target name="build" depends="root, demo, docs" description="Build package required files, without packing them.">
  273. </target>
  274. <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  275. Add and filter root files
  276. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
  277. <target name="root">
  278. <copy todir="${output-dir}/license">
  279. <fileset dir="license">
  280. <filename name="*.pdf" />
  281. </fileset>
  282. </copy>
  283. <copy todir="${output-dir}">
  284. <filterchain>
  285. <expandproperties />
  286. <replacetokens begintoken="&lt;" endtoken=">">
  287. <token key="version" value="${version}" />
  288. <token key="/version" value="" />
  289. </replacetokens>
  290. </filterchain>
  291. <fileset dir="">
  292. <filename name="release-notes.html" />
  293. </fileset>
  294. </copy>
  295. <copy todir="${output-dir}">
  296. <filterchain>
  297. <expandproperties />
  298. <replacetokens begintoken="&lt;" endtoken=">">
  299. <token key="body" value="${html.body.tag}${html.body.start1}${product-name}${html.body.start2}" />
  300. <token key="/body" value="${html.body.end}${html.body.endtag}" />
  301. <token key="version" value="${version}" />
  302. <token key="/version" value="" />
  303. </replacetokens>
  304. </filterchain>
  305. <fileset dir="">
  306. <exclude name="**/.svn" />
  307. <exclude name="release-notes.html" />
  308. <include name="*.html" />
  309. <include name="*.txt" />
  310. <include name="license/*.html" />
  311. </fileset>
  312. </copy>
  313. </target>
  314. <!-- Copy and preprocess sources for packaging
  315. NOTE: Replaces <version></version> tags with build version tag for some "textual" files
  316. -->
  317. <target name="preprocess-src">
  318. <mkdir dir="build/result/src" />
  319. <echo>Copying src directory and processing copied files.</echo>
  320. <echo>Replacing &lt;version&gt; tag with build version for java/html/css/xml files.</echo>
  321. <copy todir="build/result/src">
  322. <filterset>
  323. <filter token="VERSION" value="${version}" />
  324. </filterset>
  325. <fileset dir="src">
  326. <patternset>
  327. <include name="**/*.java" />
  328. <include name="**/*.html" />
  329. <include name="**/*.css" />
  330. <include name="**/*.xml" />
  331. </patternset>
  332. </fileset>
  333. </copy>
  334. <!-- Unify mix usage of mac/Linux/Win characters -->
  335. <echo>Unifying mix usage of Mac/Linux/Win linefeeds for java/html/css/xml files.</echo>
  336. <fixcrlf srcdir="build/result/src" eol="crlf" tablength="4" tab="asis" includes="**/*.java **/*.html **/*.css **/*.xml" />
  337. <!-- Add other files such as images, these are not filtered or processed by fixcrlf task -->
  338. <echo>Copying non java/html/css/xml files such as images.</echo>
  339. <copy todir="build/result/src">
  340. <fileset dir="src">
  341. <patternset>
  342. <exclude name="**/.svn" />
  343. <exclude name="**/*.java" />
  344. <exclude name="**/*.html" />
  345. <exclude name="**/*.css" />
  346. <exclude name="**/*.xml" />
  347. </patternset>
  348. </fileset>
  349. </copy>
  350. <echo>Creating demo source html files</echo>
  351. <java2html srcdir="build/result/src/${toolkit-package}/demo" destdir="build/result/src/${toolkit-package}/demo" includes="**/*.java" style="eclipse" showLineNumbers="false" showFileName="true" showTableBorder="false" />
  352. </target>
  353. <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  354. WebContent
  355. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
  356. <target name="webcontent" depends="preprocess-src">
  357. <!-- Add demo sources -->
  358. <echo>Adding demo sources to WebContent/src</echo>
  359. <copy todir="${output-dir}/WebContent/src">
  360. <fileset dir="build/result/src">
  361. <include name="${toolkit-package}/demo/**/*" />
  362. </fileset>
  363. </copy>
  364. <!-- Add WebContent -->
  365. <echo>Adding WebContent files, excluding ITMILL/widgetsets and few internal development libraries.</echo>
  366. <copy todir="${output-dir}/WebContent">
  367. <fileset dir="WebContent">
  368. <exclude name="**/.svn" />
  369. <exclude name="openajax/**" />
  370. <exclude name="ITMILL/widgetsets/**" />
  371. <exclude name="ITMILL/themes/tests-*" />
  372. <exclude name="WEB-INF/classes/**" />
  373. <exclude name="WEB-INF/lib/commons-fileupload-1.2-javadoc.jar" />
  374. <exclude name="WEB-INF/lib/commons-fileupload-1.2-sources.jar" />
  375. <exclude name="WEB-INF/lib/jakarta/**" />
  376. </fileset>
  377. </copy>
  378. </target>
  379. <target name="compile-java" depends="webcontent">
  380. <echo>Compiling src (server-side)</echo>
  381. <!-- Compile -->
  382. <mkdir dir="build/result/classes" />
  383. <javac source="1.4" target="1.4" classpathref="compile.classpath" srcdir="build/result/src" destdir="build/result/classes" includes="${toolkit-package}/**" debug="true">
  384. </javac>
  385. </target>
  386. <target name="libs" depends="compile-java">
  387. <echo>Creating libs (server-side)</echo>
  388. <copy todir="${output-dir}/lib/demo">
  389. <fileset dir="lib">
  390. <include name="reservr/**/*" />
  391. </fileset>
  392. </copy>
  393. <copy todir="${output-dir}/lib">
  394. <fileset dir="lib">
  395. <include name="jetty/**/*" />
  396. </fileset>
  397. </copy>
  398. <!-- Create Toolkit deployment / server-side only development JAR -->
  399. <jar jarfile="${output-dir}/lib/${lib-bin-jar-name}" compress="true">
  400. <fileset dir="build/result/classes">
  401. <patternset>
  402. <exclude name="${toolkit-package}/demo/**" />
  403. <exclude name="${toolkit-package}/launcher/**" />
  404. <exclude name="${toolkit-package}/tests/**" />
  405. </patternset>
  406. </fileset>
  407. </jar>
  408. <!-- Create Toolkit source JAR -->
  409. <jar jarfile="${output-dir}/lib/${lib-src-jar-name}" compress="true">
  410. <fileset dir="build/result/src">
  411. <patternset>
  412. <exclude name="${toolkit-package}/demo/**" />
  413. <exclude name="${toolkit-package}/tests/**" />
  414. <exclude name="${toolkit-package}/launcher/**" />
  415. </patternset>
  416. </fileset>
  417. </jar>
  418. </target>
  419. <target name="compile-client-side" depends="libs">
  420. <echo>Compiling src (client-side)</echo>
  421. <echo>com.itmill.toolkit.terminal.gwt.DefaultWidgetSet</echo>
  422. <java classname="com.google.gwt.dev.GWTCompiler" failonerror="yes" fork="yes" maxmemory="512m">
  423. <arg value="-out" />
  424. <arg value="${output-dir}/WebContent/ITMILL/widgetsets" />
  425. <arg value="com.itmill.toolkit.terminal.gwt.DefaultWidgetSet" />
  426. <classpath>
  427. <pathelement location="build/gwt/${platform}/gwt-user.jar" />
  428. <pathelement location="build/gwt/${platform}/${lib-gwt-dev}" />
  429. <pathelement location="${output-dir}/lib/itmill-toolkit-src-5.0.0-alpha.jar" />
  430. </classpath>
  431. </java>
  432. <echo>com.itmill.toolkit.demo.reservation.gwt.WidgetSet</echo>
  433. <java classname="com.google.gwt.dev.GWTCompiler" failonerror="yes" fork="yes" maxmemory="512m">
  434. <arg value="-out" />
  435. <arg value="${output-dir}/WebContent/ITMILL/widgetsets" />
  436. <arg value="com.itmill.toolkit.demo.reservation.gwt.WidgetSet" />
  437. <classpath>
  438. <pathelement location="build/gwt/${platform}/gwt-user.jar" />
  439. <pathelement location="build/gwt/${platform}/${lib-gwt-dev}" />
  440. <pathelement location="${output-dir}/lib/itmill-toolkit-src-5.0.0-alpha.jar" />
  441. <!-- demo jars -->
  442. <pathelement location="${output-dir}/lib/demo/reservr/googlemaps_gwt.jar" />
  443. <!-- demo widgetset sources -->
  444. <pathelement path="${output-dir}/WebContent/src" />
  445. </classpath>
  446. </java>
  447. <echo>com.itmill.toolkit.demo.colorpicker.gwt.WidgetSet</echo>
  448. <java classname="com.google.gwt.dev.GWTCompiler" failonerror="yes" fork="yes" maxmemory="512m">
  449. <arg value="-out" />
  450. <arg value="${output-dir}/WebContent/ITMILL/widgetsets" />
  451. <arg value="com.itmill.toolkit.demo.colorpicker.gwt.WidgetSet" />
  452. <classpath>
  453. <pathelement location="build/gwt/${platform}/gwt-user.jar" />
  454. <pathelement location="build/gwt/${platform}/${lib-gwt-dev}" />
  455. <pathelement location="${output-dir}/lib/itmill-toolkit-src-5.0.0-alpha.jar" />
  456. <!-- demo widgetset sources -->
  457. <pathelement path="${output-dir}/WebContent/src" />
  458. </classpath>
  459. </java>
  460. </target>
  461. <!-- Demo - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
  462. <target name="demo" depends="libs, compile-java, compile-client-side, javadoc">
  463. <echo>Building demo</echo>
  464. <echo>Adding demo class files.</echo>
  465. <copy todir="${output-dir}/WebContent/WEB-INF/classes">
  466. <fileset dir="build/result/classes">
  467. <include name="${toolkit-package}/demo/**/*" />
  468. <!-- user might want to tweak launcher classes -->
  469. <include name="${toolkit-package}/launcher/**" />
  470. </fileset>
  471. </copy>
  472. <echo>Adding (duplicating) Toolkit JAR to WebContent/WEB-INF/lib</echo>
  473. <copy todir="${output-dir}/WebContent/WEB-INF/lib">
  474. <fileset dir="${output-dir}/lib">
  475. <include name="${lib-bin-jar-name}" />
  476. </fileset>
  477. </copy>
  478. <echo>Adding (duplicating) source for demo</echo>
  479. <copy todir="${output-dir}/WebContent/src">
  480. <fileset dir="build/result/src">
  481. <include name="${toolkit-package}/demo/**/*" />
  482. <!-- user might want to tweak launcher classes -->
  483. <include name="${toolkit-package}/launcher/**" />
  484. </fileset>
  485. </copy>
  486. <echo>Adding (duplicating) javadocs for demo</echo>
  487. <copy todir="${output-dir}/WebContent/doc">
  488. <fileset dir="${output-dir}/doc">
  489. <include name="api/**/*" />
  490. </fileset>
  491. </copy>
  492. <echo>Building WAR</echo>
  493. <war warfile="${output-dir}/lib/${product-file}.war" webxml="WebContent/WEB-INF/web.xml">
  494. <fileset dir="${output-dir}/WebContent">
  495. <exclude name="WEB-INF/web.xml" />
  496. <include name="**/*" />
  497. </fileset>
  498. <lib dir="${output-dir}/lib">
  499. <include name="${lib-bin-jar-name}" />
  500. </lib>
  501. <!-- All javadoc (demos link to these)-->
  502. <fileset dir="${output-dir}">
  503. <include name="doc/api/**/*" />
  504. </fileset>
  505. <!-- All sources (demos link to these)-->
  506. <fileset dir="build/result/src">
  507. <include name="**/*" />
  508. </fileset>
  509. </war>
  510. </target>
  511. <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  512. Documentation
  513. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
  514. <target name="docs" depends="javadoc,manual-pdf,manual-html,package-docs">
  515. </target>
  516. <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  517. Documentation: Add documentation including style files
  518. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
  519. <target name="package-docs">
  520. <copy todir="${output-dir}/doc/manual/html-style">
  521. <fileset dir="doc/manual/html-style">
  522. <exclude name="**/.svn" />
  523. <exclude name="**/test.html" />
  524. </fileset>
  525. </copy>
  526. <copy todir="${output-dir}/doc">
  527. <fileset dir="doc">
  528. <exclude name="**/.svn" />
  529. <include name="dtd/**/*.dtd" />
  530. </fileset>
  531. </copy>
  532. </target>
  533. <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  534. Documentation: Add Javadoc to doc
  535. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
  536. <target name="javadoc" depends="preprocess-src">
  537. <javadoc destdir="${output-dir}/doc/api" author="true" version="true" use="true" windowtitle="${product-name}" classpathref="compile.classpath">
  538. <packageset dir="build/result/src">
  539. <include name="${toolkit-package}/**" />
  540. <exclude name="${toolkit-package}/demo/**" />
  541. <exclude name="${toolkit-package}/tests/**/*" />
  542. </packageset>
  543. <doctitle>${javadoc.doctitle}</doctitle>
  544. <!-- <header><![CDATA[<script type="text/javascript" src=".html-style/style.js"></script>]]></header> -->
  545. <bottom>${javadoc.bottom}</bottom>
  546. <link offline="true" href="http://java.sun.com/j2se/1.5.0/docs/api/" packagelistLoc="build/javadoc/j2se-1.5.0" />
  547. <link offline="true" href="http://java.sun.com/j2ee/1.4/docs/api/" packagelistLoc="build/javadoc/j2ee-1.4" />
  548. </javadoc>
  549. </target>
  550. <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  551. Documentation: Add book part 2 (TBD)
  552. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
  553. <target name="book-part2" depends="dbdoclet">
  554. <!-- TODO Add XSLT to transform dbdoclet results to book part 2 -->
  555. </target>
  556. <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  557. Documentation: Add manual
  558. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
  559. <target name="dbdoclet" depends="preprocess-src">
  560. <javadoc access="public" charset="UTF-8" docencoding="UTF-8" encoding="ISO-8859-15" failonerror="yes" classpath="build/lib/servlet-api.jar" maxmemory="512m" source="1.5">
  561. <packageset dir="build/result/src">
  562. <include name="${toolkit-package}/**" />
  563. <exclude name="${toolkit-package}/demo/**" />
  564. <exclude name="${toolkit-package}/tests/**/*" />
  565. </packageset>
  566. <doclet name="org.dbdoclet.doclet.docbook.DocBookDoclet" path="build/lib/jdk${java.specification.version}/dbdoclet.jar">
  567. <param name="-d" value="result/docbook" />
  568. </doclet>
  569. </javadoc>
  570. </target>
  571. <!-- XEP-based FO building -->
  572. <target name="manual-pdf">
  573. <echo>PDF Manual: processing images (TBD)</echo>
  574. <!-- TBD -->
  575. <echo>PDF Manual: converting xml to fo</echo>
  576. <java classname="org.apache.xalan.xslt.Process" failonerror="yes" fork="yes" maxmemory="512m">
  577. <arg value="-xsl" />
  578. <arg value="build/docbook/conf/custom-fo-docbook.xsl" />
  579. <arg value="-in" />
  580. <arg value="doc/manual/book.xml" />
  581. <arg value="-out" />
  582. <arg value="build/result/book.fo" />
  583. <arg value="-param" />
  584. <arg value="section.autolabel" />
  585. <arg value="1" />
  586. <arg value="-param" />
  587. <arg value="section.label.includes.component.label" />
  588. <arg value="1" />
  589. <arg value="-param" />
  590. <arg value="section.autolabel.max.depth" />
  591. <arg value="2" />
  592. <classpath>
  593. <pathelement location="build/lib/xalan.jar" />
  594. <pathelement location="build/lib/xercesImpl.jar" />
  595. <pathelement location="build/lib/xml-apis.jar" />
  596. </classpath>
  597. </java>
  598. <echo>PDF Manual: converting fo to pdf</echo>
  599. <!-- Run XEP FO processor to convert FO to PDF -->
  600. <java classname="com.renderx.xep.XSLDriver" failonerror="yes" fork="yes" maxmemory="512m" input="build/result/book.fo" output="${output-dir}/doc/manual.pdf">
  601. <arg value="-Dcom.renderx.xep.CONFIG=build/lib/XEP/xep.xml" />
  602. <classpath>
  603. <pathelement location="build/lib/XEP/lib/tools.jar" />
  604. <pathelement location="build/lib/XEP/lib/xep.jar" />
  605. <pathelement location="build/lib/XEP/lib/saxon.jar" />
  606. <pathelement location="build/lib/XEP/lib/xt.jar" />
  607. </classpath>
  608. </java>
  609. </target>
  610. <target name="manual-html">
  611. <delete file="build/docbook/conf/temp.xsl" />
  612. <copy file="build/docbook/conf/custom-html-docbook.xsl" tofile="build/docbook/conf/temp.xsl">
  613. <filterchain>
  614. <replacetokens>
  615. <token key="BODYHEADER" value="${html.body.start1}${docbook.head.title}${html.body.start2}" />
  616. <token key="BODYFOOTER" value="${html.body.end}" />
  617. </replacetokens>
  618. </filterchain>
  619. </copy>
  620. <path id="docbook-xsl.classpath">
  621. <pathelement path="build/lib/fserializer.jar" />
  622. <pathelement path="build/lib/xalan.jar" />
  623. <pathelement path="build/lib/xercesImpl.jar" />
  624. <pathelement path="build/lib/xml-apis.jar" />
  625. </path>
  626. <java classname="org.apache.xalan.xslt.Process" failonerror="yes" fork="yes" maxmemory="1300m">
  627. <arg value="-in" />
  628. <arg value="doc/manual/book.xml" />
  629. <arg value="-xsl" />
  630. <arg value="build/docbook/conf/temp.xsl" />
  631. <arg value="-out" />
  632. <arg value="${output-dir}/doc/manual/index.html" />
  633. <arg value="-param" />
  634. <arg value="use.extensions" />
  635. <arg value="1" />
  636. <classpath refid="docbook-xsl.classpath" />
  637. </java>
  638. <delete file="build/docbook/conf/temp.xsl" />
  639. <copy todir="${output-dir}/doc/manual/img">
  640. <fileset dir="doc/manual/img">
  641. <exclude name="**/.svn" />
  642. </fileset>
  643. </copy>
  644. </target>
  645. <!-- Clean results - - - - - - - - - - - - - - - - - - - - - - - - - -->
  646. <target name="clean-all" depends="">
  647. <delete includeemptydirs="true" defaultexcludes="false">
  648. <fileset dir="build/result" includes="**/*" />
  649. </delete>
  650. </target>
  651. <!-- ant contrib required for flow control (for loop) -->
  652. <taskdef resource="net/sf/antcontrib/antlib.xml">
  653. <classpath>
  654. <pathelement location="build/lib/ant-contrib-1.0b3.jar" />
  655. </classpath>
  656. </taskdef>
  657. <!-- java2html converter -->
  658. <taskdef name="java2html" classname="de.java2html.anttasks.Java2HtmlTask" classpath="build/lib/java2html.jar" />
  659. </project>