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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477
  1. <?xml version="1.0"?>
  2. <?xml-stylesheet type="text/xsl" href="./tools/antipede/resources/stylesheets/build.xsl"?>
  3. <!--<!DOCTYPE project SYSTEM "./tools/antipede/build.dtd" >-->
  4. <!DOCTYPE project [
  5. <!-- antipede -->
  6. <!ENTITY import-antipede SYSTEM "./tools/antipede/build.xtarget">
  7. ]>
  8. <project default="interactive" basedir="." name="project build file">
  9. <description>
  10. * ===================================== *
  11. | Krysalis Centipede Build System |
  12. * ===================================== *
  13. by
  14. Nicola Ken Barozzi (nicolaken@apache.org)
  15. Marc Johnson (mjohnson@apache.org)
  16. For a simple interactive build, simply
  17. run the build script (build.bar or build.sh)
  18. </description>
  19. <!-- =================================================================== -->
  20. <!-- Basic build targets for the project -->
  21. <!-- =================================================================== -->
  22. <!-- =================================================================== -->
  23. <!-- Interactive build -->
  24. <!-- =================================================================== -->
  25. <target name="interactive" description="Interactive Build" depends="-init">
  26. <echo>
  27. --------------------------------------------------------------
  28. ${xgump.module.project.name} ${xgump.module.project.version.major}.${xgump.module.project.version.minor} [${YEAR}]
  29. --------------------------------------------------------------
  30. Using ${ant.version}
  31. Build file ${ant.file}
  32. --------------------------------------------------------------
  33. These are the most common build targets.
  34. You can also invoke them directly; see build.xml for more info.
  35. Builds will be in /build directory, distributions in /dist.
  36. all -------------- creates the jars and the site
  37. compile ---------- compiles the source code
  38. test ------------- performs the jUnit tests
  39. jar -------------- create the jar files
  40. docs ------------- generates the html docs - clean not needed
  41. javadocs --------- generates the API documentation
  42. site ------------- generates the html site (docs+reports)
  43. clean ------------ cleans the build directory
  44. dist ------------- creates src and bin distributions
  45. scratchpad ------- build-run scratchpad code
  46. contrib ---------- build-run contributed code
  47. generate-records - generate excel records
  48. generate-types --- generate word types
  49. </echo>
  50. <property name="input.selection" value="all"/>
  51. <centipede-user-input name="input.selection">Please select a target </centipede-user-input>
  52. <antcall target="call-cent">
  53. <param name="cent-name" value="centipede"/>
  54. <param name="cent-target" value="splash"/>
  55. </antcall>
  56. <antcall target="${input.selection}"/>
  57. </target>
  58. <!-- =================================================================== -->
  59. <!-- Interactive scratchpad builds -->
  60. <!-- =================================================================== -->
  61. <target name="scratchpad" depends="compile" description="Interactive Scratchpad Build">
  62. <echo>
  63. --------------------------------------------------------------
  64. ${xgump.module.project.name} ${xgump.module.project.version.major}.${xgump.module.project.version.minor} SCRATCHPAD
  65. --------------------------------------------------------------
  66. Building with ${ant.version}
  67. using build file ${ant.file}
  68. --------------------------------------------------------------
  69. These are SCRATCHPAD BUILDS. They are not guaranteed to work.
  70. You have been warned.
  71. -
  72. -
  73. -
  74. -
  75. -
  76. -
  77. </echo>
  78. <property name="input.selection" value=""/>
  79. <centipede-user-input name="input.selection">Please select a target </centipede-user-input>
  80. <ant antfile="${xlayout.source.scratchpad.targets.dir}/${input.selection}/xbuild.xml"/>
  81. </target>
  82. <!-- =================================================================== -->
  83. <!-- Interactive contrib builds -->
  84. <!-- =================================================================== -->
  85. <target name="contrib" depends="compile" description="Interactive Contributors' Build">
  86. <echo>
  87. --------------------------------------------------------------
  88. ${xgump.module.project.name} ${xgump.module.project.version.major}.${xgump.module.project.version.minor} CONTRIB
  89. --------------------------------------------------------------
  90. Building with ${ant.version}
  91. using build file ${ant.file}
  92. --------------------------------------------------------------
  93. These are CONTRIB BUILDS. They are not guaranteed to work.
  94. You have been warned.
  95. poibrowser - POIBrowser 0.10 GUI POI Viewer
  96. sheetviewer - SheetViewer 0.20 GUI Applet/Application Viewer for XLS files
  97. -
  98. -
  99. -
  100. -
  101. </echo>
  102. <property name="input.selection" value="poibrowser"/>
  103. <centipede-user-input name="input.selection">Please select a target </centipede-user-input>
  104. <ant antfile="${xlayout.source.contributions.targets.dir}/${input.selection}/xbuild.xml"/>
  105. </target>
  106. <!-- ================================== -->
  107. <!-- Compile -->
  108. <!-- ================================== -->
  109. <target name="compile" depends="-init"
  110. description="Compile java source code">
  111. <antcall target="call-cent">
  112. <param name="cent-name" value="automagic"/>
  113. <param name="cent-target" value="compile"/>
  114. </antcall>
  115. </target>
  116. <!-- ================================== -->
  117. <!-- Build jars -->
  118. <!-- ================================== -->
  119. <target name="jar" depends="-init"
  120. description="Compile java source code">
  121. <antcall target="call-cent">
  122. <param name="cent-name" value="automagic"/>
  123. <param name="cent-target" value="jar"/>
  124. </antcall>
  125. </target>
  126. <!-- ====================================== -->
  127. <!-- dist target wo single build checks -->
  128. <!-- ====================================== -->
  129. <target name="dist" depends="-init"
  130. description="Build distribution packages wo single build checks">
  131. <antcall target="call-cent">
  132. <param name="cent-name" value="automagic"/>
  133. <param name="cent-target" value="dist"/>
  134. </antcall>
  135. </target>
  136. <!-- ================================== -->
  137. <!-- Clean build dir -->
  138. <!-- ================================== -->
  139. <target name="clean" depends="-init"
  140. description="Compile java source code">
  141. <antcall target="call-cent">
  142. <param name="cent-name" value="automagic"/>
  143. <param name="cent-target" value="clean"/>
  144. </antcall>
  145. </target>
  146. <!-- ================================== -->
  147. <!-- Run Junit tests -->
  148. <!-- ================================== -->
  149. <target name="test" depends="-init"
  150. description="Compile java source code">
  151. <antcall target="call-cent">
  152. <param name="cent-name" value="automagic"/>
  153. <param name="cent-target" value="test"/>
  154. </antcall>
  155. </target>
  156. <!-- ================================== -->
  157. <!-- Generate project metrics -->
  158. <!-- ================================== -->
  159. <target name="metrics" depends="-init"
  160. description="Generate project metrics">
  161. <antcall target="call-cent">
  162. <param name="cent-name" value="automagic"/>
  163. <param name="cent-target" value="metrics"/>
  164. </antcall>
  165. </target>
  166. <!-- ================================== -->
  167. <!-- Generates the documentation -->
  168. <!-- ================================== -->
  169. <target name="docs" depends="-init"
  170. description="Compile java source code">
  171. <antcall target="call-cent">
  172. <param name="cent-name" value="automagic"/>
  173. <param name="cent-target" value="docs"/>
  174. </antcall>
  175. </target>
  176. <!-- ================================== -->
  177. <!-- Generates the site -->
  178. <!-- ================================== -->
  179. <target name="site"
  180. description="Makes all the site doco"
  181. depends="-init">
  182. <antcall target="call-cent">
  183. <param name="cent-name" value="automagic"/>
  184. <param name="cent-target" value="site"/>
  185. </antcall>
  186. </target>
  187. <!-- ================================== -->
  188. <!-- Generates the java docs -->
  189. <!-- ================================== -->
  190. <target name="javadocs" depends="-init"
  191. description="Compile java source code">
  192. <antcall target="call-cent">
  193. <param name="cent-name" value="automagic"/>
  194. <param name="cent-target" value="javadocs"/>
  195. </antcall>
  196. </target>
  197. <!-- ================================== -->
  198. <!-- Generate records -->
  199. <!-- ================================== -->
  200. <target name="generate-records" depends="-init"
  201. description="generate-records">
  202. <ant antfile="${xlayout.source.targets.dir}/record-generation/xbuild.xml"
  203. target="generate-records"/>
  204. </target>
  205. <!-- ================================== -->
  206. <!-- Generate types -->
  207. <!-- ================================== -->
  208. <target name="generate-types" depends="-init"
  209. description="generate-types">
  210. <ant antfile="${xlayout.source.targets.dir}/record-generation/xbuild.xml"
  211. target="generate-types"/>
  212. </target>
  213. <!-- ================================== -->
  214. <!-- Test the main module stuff -->
  215. <!-- ================================== -->
  216. <target name="testmodule"
  217. depends="clean, docs, compile, test, jar, metrics, javadocs"
  218. description="Testing that all major targets work; useful before a commit"/>
  219. <!-- ================================== -->
  220. <!-- Test the main module stuff 2 -->
  221. <!-- ================================== -->
  222. <target name="testtargets"
  223. description="Testing that all major targets work indipendently; useful before a commit">
  224. <antcall target="clean"/>
  225. <antcall target="compile"/>
  226. <antcall target="clean"/>
  227. <antcall target="test"/>
  228. <antcall target="clean"/>
  229. <antcall target="jar"/>
  230. <antcall target="clean"/>
  231. <antcall target="docs"/>
  232. <antcall target="clean"/>
  233. <antcall target="metrics"/>
  234. <antcall target="clean"/>
  235. <antcall target="javadocs"/>
  236. </target>
  237. <!-- ================================== -->
  238. <!-- Test 4 distribution -->
  239. <!-- ================================== -->
  240. <target name="testall" depends="-init"
  241. description="Make big full test">
  242. <antcall target="gump"/>
  243. <antcall target="dist"/>
  244. </target>
  245. <!-- ================================== -->
  246. <!-- Target used by Gump -->
  247. <!-- ================================== -->
  248. <target name="gump"
  249. depends="-init, compile, test, jar, metrics, javadocs"
  250. description="Target used by Gump"/>
  251. <!-- ================================== -->
  252. <!-- Generate all -->
  253. <!-- ================================== -->
  254. <target name="all"
  255. depends="-init, jar, site"
  256. description="Generate all"/>
  257. <!-- =================================================================== -->
  258. <!-- Import Ant-Centipede -init targets - sets up basic build stuff -->
  259. <!-- =================================================================== -->
  260. <!--
  261. This is the target that initializes tasks and properties used
  262. commonly in every other target.
  263. Remember to add depends="-init" to every target, so that this
  264. target is called before any other.
  265. This target is internal; to make it unusable from the commandline,
  266. its name starts with a hyphen. To make it invisible when
  267. using -projecthelp, it lacks a description.
  268. -->
  269. &import-antipede;
  270. <!-- ================================== -->
  271. <!-- POI specific extensions to the the build file -->
  272. <!-- ================================== -->
  273. <patternset id="teststhatfail">
  274. </patternset>
  275. <!-- ================================== -->
  276. <!-- run tests one at a time -->
  277. <!-- ================================== -->
  278. <target name="single-test" if="testcase" depends="-init,compile-tests"
  279. description="--> runs the single unit test defined in the testcase property">
  280. <junit2 printsummary="no" haltonfailure="${junit.test.haltonfailure}" fork="yes">
  281. <formatter type="xml" />
  282. <formatter type="plain" usefile="no"/>
  283. <sysproperty key="UTIL.testdata.path"
  284. value="${xlayout.source.test.dir}/org/apache/poi/util/data"/>
  285. <sysproperty key="HSSF.testdata.path"
  286. value="${xlayout.source.test.dir}/org/apache/poi/hssf/data"/>
  287. <sysproperty key="HPSF.testdata.path"
  288. value="${xlayout.source.test.dir}/org/apache/poi/hpsf/data"/>
  289. <classpath>
  290. <path>
  291. <fileset dir="." casesensitive="yes">
  292. <patternset>
  293. <include name="${cents.dir}/*.${cent.dir.suffix}/${cent.lib.dir.name}/*.jar"/>
  294. <include name="${cents.dir}/*.${cent.dir.suffix}/${cent.lib.dir.name}/*.zip"/>
  295. </patternset>
  296. </fileset>
  297. <fileset dir="${xlayout.library.dir}" casesensitive="yes">
  298. <patternset>
  299. <include name="*/*.jar"/>
  300. <include name="*/*.zip"/>
  301. </patternset>
  302. </fileset>
  303. <fileset dir="${xlayout.source.scratchpad.library.dir}" casesensitive="yes">
  304. <patternset>
  305. <include name="*.jar"/>
  306. <include name="*.zip"/>
  307. </patternset>
  308. </fileset>
  309. <fileset dir="${xlayout.source.examples.library.dir}" casesensitive="yes">
  310. <patternset>
  311. <include name="*.jar"/>
  312. <include name="*.zip"/>
  313. </patternset>
  314. </fileset>
  315. </path>
  316. <pathelement path="${xlayout.build.classes.dir}" />
  317. <pathelement location="${xlayout.build.test.dir}" />
  318. <pathelement location="${xlayout.build.classes.dir}" />
  319. </classpath>
  320. <test name="${testcase}" />
  321. </junit2>
  322. </target>
  323. <target name="compile-tests" depends="-init,compile">
  324. <mkdir dir="${xlayout.build.test.dir}"/>
  325. <!-- Compile tests -->
  326. <javac srcdir="${xlayout.source.test.dir}"
  327. destdir="${xlayout.build.test.dir}"
  328. debug= "${build.compiler.debug}"
  329. optimize= "${build.compiler.optimize}"
  330. deprecation="${build.compiler.deprecation}"
  331. target= "${build.compiler.vm}"
  332. nowarn= "false">
  333. <classpath>
  334. <path>
  335. <fileset dir="." casesensitive="yes">
  336. <patternset>
  337. <include name="${cents.dir}/*.${cent.dir.suffix}/${cent.lib.dir.name}/*.jar"/>
  338. <include name="${cents.dir}/*.${cent.dir.suffix}/${cent.lib.dir.name}/*.zip"/>
  339. </patternset>
  340. </fileset>
  341. <fileset dir="${xlayout.library.dir}" casesensitive="yes">
  342. <patternset>
  343. <include name="*/*.jar"/>
  344. <include name="*/*.zip"/>
  345. </patternset>
  346. </fileset>
  347. <fileset dir="${xlayout.source.scratchpad.library.dir}" casesensitive="yes">
  348. <patternset>
  349. <include name="*.jar"/>
  350. <include name="*.zip"/>
  351. </patternset>
  352. </fileset>
  353. <fileset dir="${xlayout.source.examples.library.dir}" casesensitive="yes">
  354. <patternset>
  355. <include name="*.jar"/>
  356. <include name="*.zip"/>
  357. </patternset>
  358. </fileset>
  359. </path>
  360. <pathelement path="${xlayout.build.classes.dir}" />
  361. </classpath>
  362. </javac>
  363. </target>
  364. </project>