README 55 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284
  1. INTRODUCTION
  2. ------------
  3. This build harness permits modules outside of the netbeans.org CVS tree to be
  4. built against a NetBeans-based application: the NB platform, the NB IDE, or any
  5. derivative product. The semantics of configuration files is synchronized with
  6. the NBM project type module, so that you can open any module in the NB IDE and
  7. work with it naturally: build and test it using Ant, use Java code completion,
  8. and so on.
  9. Questions and comments should go to: [email protected]
  10. BASIC FILE LAYOUT
  11. -----------------
  12. Within the netbeans.org CVS tree, modules are detected as projects of the "NBM"
  13. (NetBeans module) type. The project directory may be top-level (e.g. "beans"),
  14. second-level (e.g. "ant/project"), or third-level (e.g.
  15. "objectbrowser/navigator/javanavigation"). The project.xml for the project must
  16. specify
  17. <type>org.netbeans.modules.apisupport.project</type>
  18. to indicate that it is an NBM project, and the configuration must be
  19. <data xmlns="http://www.netbeans.org/ns/nb-module-project/3">
  20. Note that this schema is a change from the /2 schema used in NetBeans 5.0.
  21. (/2 is still supported for compatibility.)
  22. NetBeans 4.0 and 4.1 use schema /1 which is no longer supported.
  23. Outside of the netbeans.org CVS tree, modules can take two forms. They may be
  24. marked with
  25. <standalone/>
  26. in which case they can build into a platform binary but not refer to any other
  27. source modules. Or they may be marked with
  28. <suite-component/>
  29. in which case they are contained within a module suite. The suite enumerates
  30. modules it contains, and each module points back to the suite that contains it.
  31. The meaning of the project.xml elements, as well as property names in
  32. project.properties and other files, will be discussed later.
  33. The project directory should contain "manifest.mf" (more on this later),
  34. "build.xml" (more later), a directory "src" with the main package root of the
  35. module's classes, optionally "test/unit/src" with unit tests, and perhaps some
  36. other files.
  37. If there is a subdirectory "javahelp" it is used to keep JavaHelp documentation,
  38. which will be built automatically.
  39. If there is a file "module-auto-deps.xml" it will automatically be used to
  40. upgrade modules depending on you to new dependencies, as described in the
  41. Modules API.
  42. STANDALONE MODULES: CONFIGURATION FILES
  43. ---------------------------------------
  44. Standalone modules may keep configuration in several properties files, in the
  45. following order of loading:
  46. ${basedir}/nbproject/private/platform-private.properties
  47. ${basedir}/nbproject/platform.properties
  48. ${user.properties.file}
  49. [definition of 'harness.dir' and 'netbeans.dest.dir' or 'cluster.path' based on value of ${nbplatform.active}]
  50. ${basedir}/nbproject/private/private.properties
  51. ${basedir}/nbproject/project.properties
  52. Projects generated by NB 6.5 and earlier:
  53. -----------------------------------------
  54. The properties 'harness.dir' and 'netbeans.dest.dir' must be defined by the
  55. project. Usually this is accomplished by defining the property
  56. 'nbplatform.active' in platform.properties, and ${user.properties.file}
  57. (normally build.properties in the user directory, usually defined in
  58. platform-private.properties) can define properties like
  59. 'nbplatform.NAME.netbeans.dest.dir' (this would be used for 'netbeans.dest.dir'
  60. in case ${nbplatform.active} had the value 'NAME').
  61. Projects generated by NB 6.7 and later (for 6.7 platform):
  62. ----------------------------------------------------------
  63. 6.7 and newer projects may be distinguished by the presence of 'cluster.path'
  64. property in nbproject/platform.properties file or simply by the fact that an
  65. attempt to build a standalone module without it results in error:
  66. 'You must specify path to 'platform' cluster in ${cluster.path} property.'
  67. In such case property 'cluster.path' must be defined by the project. It must
  68. contain classpath-like list of absolute or relative paths to individual clusters
  69. against which will be the module build. "Bare", i.e. not numbered cluster names
  70. can be used, which simplifies later transitions to newer version of the
  71. platform. Content of 'cluster.path' can also reference other properties defined
  72. in the project, properties file generated by the IDE e.g uses property
  73. 'nbplatform.active.dir' pointing to root folder of specified active platform.
  74. 'nbplatform.active' is used like before. Properties 'netbeans.dest.dir',
  75. 'enabled.clusters' and 'disabled.clusters' *must not* be defined in the
  76. projects. They would be ignored anyway so there is a dedicated check that
  77. project is not trying to setup something that would not work anyway.
  78. For more info on uses of 'cluster.path' property and setting it in IDE, see
  79. http://wiki.netbeans.org/DevFaqHowToReuseModules.
  80. MODULE SUITES: CONFIGURATION FILES
  81. ----------------------------------
  82. Modules in a suite have a slightly more complicated list of properties files in
  83. which they may keep configuration:
  84. ${basedir}/nbproject/private/suite-private.properties
  85. ${basedir}/nbproject/suite.properties
  86. ${suite.dir}/nbproject/private/platform-private.properties
  87. ${suite.dir}/nbproject/platform.properties
  88. ${user.properties.file}
  89. [definition of 'harness.dir' and 'netbeans.dest.dir' or 'cluster.path' based on value of ${nbplatform.active}]
  90. ${basedir}/nbproject/private/private.properties
  91. ${basedir}/nbproject/project.properties
  92. 'suite.dir' is normally defined in suite-private.properties (or suite.properties
  93. in case it is a relative path). platform-private.properties and
  94. platform.properties are then used to define the NB platform in the same way as
  95. for standalone modules.
  96. The suite itself (the project located in ${suite.dir}) can load properties from:
  97. ${basedir}/nbproject/private/platform-private.properties
  98. ${basedir}/nbproject/platform.properties
  99. ${user.properties.file}
  100. [definition of 'harness.dir' and 'netbeans.dest.dir' or 'cluster.path' based on value of ${nbplatform.active}]
  101. ${basedir}/nbproject/private/private.properties
  102. ${basedir}/nbproject/project.properties
  103. It must define a property 'modules' enumerating modules it contains (in path
  104. format, with each entry being a module project directory). This is usually done
  105. in project.properties, perhaps also with private.properties to help with
  106. absolute paths.
  107. USING A RELATIVE PATH FOR THE PLATFORM WITH A MODULE SUITE
  108. ----------------------------------------------------------
  109. Though not directly supported by the GUI, it is possible to set up a module
  110. suite in such a way that the path to the NetBeans platform is given as relative,
  111. and sharable in VCS. This may be helpfully especially for multi-developer teams
  112. who frequently develop against new NetBeans builds (or build NetBeans from CVS
  113. sources). You need to:
  114. 1. Make sure that each module's suite.properties specifies 'suite.dir' as
  115. relative to its base directory, not as a bare relative path, e.g.
  116. suite.dir=${basedir}/..
  117. 2. Edit the suite's platform.properties to give a fallback value for 'suite.dir'
  118. (so the suite's own master build script can work), and define *both*
  119. netbeans.dest.dir and harness.dir in terms of the suite directory, e.g.:
  120. suite.dir=${basedir}
  121. # for platform 6.7 and later, use:
  122. # 'platform.base' is only a helper property, it has no meaning in harness
  123. platform.base=${suite.dir}/../nb_sources/nbbuild/netbeans
  124. cluster.path=${platform.base}/platform:<other clusters you need>
  125. harness.dir=${platform.base}/harness
  126. # for platform 6.5 and earlier, use:
  127. netbeans.dest.dir=${suite.dir}/../nb_sources/nbbuild/netbeans
  128. harness.dir=${netbeans.dest.dir}/harness
  129. platform.properties need not define 'nbplatform.active' in this case.
  130. Relative-path source and Javadoc associations for the platform is not yet
  131. supported in this scenario (#70876). Each developer with a checkout of the suite
  132. may need to configure a platform (with an arbitrary name) in the NetBeans
  133. Platform Manager dialog with a binary location matching the value you gave for
  134. ${netbeans.dest.dir}, and with source and/or Javadoc associations of their
  135. choice. However, as a convenience, special associations may be predefined in the
  136. IDE in the special case that the destination directory is the subsubdirectory
  137. "nbbuild/netbeans" of a netbeans.org CVS checkout (i.e. if you build NetBeans
  138. from sources and then build your suite against that).
  139. "CHAINING" SUITES (INTER-SUITE DEPENDENCIES HOWTO)
  140. --------------------------------------------------
  141. As of platform version 6.7, suite-chaining as described here is superseded by
  142. using 'cluster.path' property, see previous chapters and developer FAQ
  143. http://wiki.netbeans.org/DevFaqHowToReuseModules. For platform versions 6.5
  144. and older, read on.
  145. Suppose you have one platform P1, say the bare NetBeans Platform. Then you have
  146. a module suite S1 with modules M1a...M1z which uses P1. Now it may happen that
  147. you want another suite S2 with modules M2a...M2z to depend on S1 as well as P1.
  148. This is possible, though not yet trivial to set up. Basically, you will make a
  149. new platform P2 by building S1 + P1. Here's what you need to do in brief:
  150. 1. Set up S1 with P1 in the normal way.
  151. 2. Edit S1/build.xml to include a target to make a platform P2. For example:
  152. <target name="create-platform" depends="build-zip">
  153. <mkdir dir="${p2}"/>
  154. <unzip src="${dist.dir}/${app.name}.zip" dest="${p2}"/>
  155. </target>
  156. where S1/nbproject/project.properties or S1/nbproject/private/private.properties
  157. defines:
  158. p2=...path.../myplatform
  159. Note that the ZIP will currently contain S1's ${app.name} as its top-level dir,
  160. so you can either move the unpacked files up one dir, or use the dir p2/s1name
  161. as the actual platform location.
  162. As of NetBeans 6.0, you may simply run the 'create-platform' target in your suite's
  163. build.xml, which will create a platform in ${dist.dir}/${app.name}.
  164. 3. Now configure S2 to use P2 as its platform. If an absolute path, you can use
  165. the Platform Manager, else for relative paths see the preceding section.
  166. (Setting harness.dir to ${netbeans.dest.dir}/harness will only work if P2
  167. includes a harness/ subdirectory, for example if S1 was configured to include
  168. the harness cluster. Otherwise, try ${netbeans.home}/../harness, or any location
  169. you prefer to keep a standard copy of the harness in.)
  170. 4. To associate sources with binaries for P2, you will need to use the Platform
  171. Manager. You can select multiple source associations. In this case, use a
  172. netbeans.org CVS checkout or source download for the P1 (NetBeans platform)
  173. portion of P2, and use S1 (the suite directory) for the M1a...M1z modules in P2.
  174. 5. In an S2 module like M2a you should be able to depend on any module in P2,
  175. including both NetBeans modules and modules from S1 like M1a. Code completion,
  176. popup Javadoc, etc. should work if source associations have been correctly
  177. configured in step #5.
  178. 6. In case S1 was an application module with configured branding, you might wish
  179. to use S1's branding in S2 rather than making a new app for S2. Or, in place of
  180. a suite S2 you might have a standalone module M2. In either case, you can use
  181. S1's branding by configuring nbproject/project.properties in S2 (or standalone
  182. module M2):
  183. branding.token=s1
  184. branding.dir=none
  185. where 's1' was the branding token you chose for S1. This will permit Run,
  186. Reload, etc. on S2 and its modules like M2a, or standalone module M2, to work
  187. correctly.
  188. netbeans.org MODULES: CONFIGURATION FILES
  189. -----------------------------------------
  190. Modules inside the netbeans.org CVS tree need not define a platform; it is
  191. always "nbbuild/netbeans" in the CVS tree. They also do not have an explicit
  192. harness; they use various files located in "nbbuild". Unlike external modules
  193. which by default always use the cluster "devel", netbeans.org modules usually
  194. specify a cluster in "nbbuild/cluster.properties" ("extra" by default).
  195. PLATFORM DEFINITIONS
  196. --------------------
  197. The file build.properties in the user directory is used to store all information
  198. about NetBeans platforms. Each platform has an ID string; the default platform's
  199. ID is 'default'. The available properties for each platform are:
  200. 1. nbplatform.ID.netbeans.dest.dir (mandatory) - absolute path to the
  201. destination directory (i.e. NetBeans platform installation).
  202. 2. nbplatform.ID.harness.dir (mandatory) - path to the build harness. Normally
  203. will be "${nbplatform.ID.netbeans.dest.dir}/harness".
  204. 3. nbplatform.ID.sources (optional) - see next section.
  205. 4. nbplatform.ID.javadoc (optional) - see next section.
  206. SOURCE AND JAVADOC ASSOCIATIONS
  207. -------------------------------
  208. Modules inside the netbeans.org CVS tree need not do anything special to
  209. associate sources with binaries (the module JAR files under "nbbuild/netbeans");
  210. it is automatic. Javadoc may be associated with an API-providing module just by
  211. building its Javadoc (into "nbbuild/build/javadoc"), or by downloading the
  212. NetBeans API Documentation module, which will cause 'nbplatform.default.javadoc'
  213. to be defined in build.properties in the user directory (to the location of a
  214. ZIP of Javadoc).
  215. For external modules, sources and Javadoc may be associated with the active
  216. platform by defining in build.properties in the user directory these properties:
  217. 1. nbplatform.ID.sources - an Ant-style path (e.g. ':' separated) containing
  218. source roots you wish to associate with the binary modules in
  219. ${nbplatform.ID.netbeans.dest.dir}. Entries may be a checkout of the
  220. netbeans.org CVS tree, or source roots of other module suites which are included
  221. in the platform in binary form. Defining a source association permits you to
  222. step through sources while debugging, use Go To Class, get popup Javadoc in code
  223. completion, etc.
  224. 2. nbplatform.ID.javadoc - a path containing roots of Javadoc for API-providing
  225. modules in the platform. Useful in case you wish to get Javadoc in View |
  226. Documentation Indices; or in the code completion popup (if you do not have
  227. sources). Each root may be a directory or a ZIP file. Within a root, the API for
  228. org.netbeans.modules.foo is expected to be inside the subdir named
  229. "org-netbeans-modules-foo".
  230. For examples of complete and functioning "external" module suites, see
  231. apisupport/project/test/unit/data/example-external-projects in netbeans.org
  232. sources.
  233. FORMAT OF YOUR project.xml's MAIN CONFIGURATION SECTION
  234. -------------------------------------------------------
  235. The format of project.xml is controlled by XML Schema. For the main section of
  236. new modules, use:
  237. http://www.netbeans.org/ns/nb-module-project/3.xsd
  238. If you wish to edit project.xml by hand rather than using the IDE's GUI, you
  239. should validate all changes against this schema. If using the IDE's XML text
  240. editor, just type Alt-Shift-F9 to validate the current document. (Make sure the
  241. file is valid BEFORE saving it, as the IDE will refuse to load a malformed
  242. project.xml.)
  243. You must specify the "code name base" of your module. This is the value of
  244. OpenIDE-Module in manifest.mf, *except* without any major release version (e.g.
  245. "/1"). In the future OpenIDE-Module might be generated from this, but not yet.
  246. <code-name-base>org.netbeans.modules.foo</code-name-base>
  247. For external modules, you must specify either <suite-component/> or
  248. <standalone/>; for netbeans.org modules, you must not. See above discussion of
  249. file layout.
  250. Specify your dependencies on other modules:
  251. <module-dependencies>
  252. <dependency>
  253. <!-- The code name base, *not* with any major release version: -->
  254. <code-name-base>some.other.module</code-name-base>
  255. <!-- Usually, include this to say that it needs to be built -->
  256. <!-- *before* your module, if in the same suite: -->
  257. <build-prerequisite/>
  258. <!-- Usually also include this, to say that it needs to be in your module's classpath: -->
  259. <compile-dependency/>
  260. <!-- Always include this, to say that the module system should register a dependency: -->
  261. <run-dependency>
  262. <!-- Optional; use if and only if the other module uses e.g. /1 in its code name: -->
  263. <release-version>1</release-version>
  264. <!-- Optional; request a minimum version of another module: -->
  265. <specification-version>3.9</specification-version>
  266. </run-dependency>
  267. </dependency>
  268. <!-- and others as you need them... -->
  269. <!-- use org.openide for openide.jar -->
  270. </module-dependencies>
  271. In a <run-dependency> you can also use just
  272. <implementation-version/>
  273. in place of <specification-version>, meaning to declare an implementation
  274. dependency on another module. The actual version is taken directly from that
  275. module's current JAR so you do not need to keep track of it. *Important*: if you
  276. either *export* or *import* any implementation dependencies, you should probably
  277. use spec.version.base (see below).
  278. Specify your test dependencies on other modules [since 5.0u2, requires /3
  279. schema]. The tags in project.xml are
  280. described below:
  281. <test-dependencies>
  282. <! -- Dependencies for a source root with tests: -->
  283. <test-type>
  284. <!--
  285. Name of test type. Normally you will use 'unit'.
  286. netbeans.org modules also support 'qa-functional' test-type.
  287. -->
  288. <name>unit</name>
  289. <!-- A dependency on a module or its tests: -->
  290. <test-dependency>
  291. <!-- Identification of module our tests depend upon: -->
  292. <code-name-base>org.netbeans.modules.java.project</code-name-base>
  293. <!-- Include also transitive module dependencies of that module: -->
  294. <recursive/>
  295. <!-- Always available when running, but to include at compile time also: -->
  296. <compile-dependency/>
  297. <!-- To request the tests of that module as well: -->
  298. <test/>
  299. </test-dependency>
  300. </test-type>
  301. </test-dependencies>
  302. Source root for a test type:
  303. {project.dir}/test/${test-type.name}/src
  304. {project.dir}/test/unit/src - source root for unit test
  305. For example you have three modules with code name bases A,B,C. A has runtime
  306. dependency on B, B on C. You want to add test dependencies to unit test type
  307. of module D:
  308. Use case 1: Runtime dependency on module.
  309. <test-type>
  310. <name>unit</name>
  311. <test-dependency>
  312. <code-name-base>A</code-name-base>
  313. </test-dependency>
  314. </testtype>
  315. Runtime classpath is D + A.
  316. Compile classpath is D.
  317. Use case 2: Runtime dependency on a module and its recursive runtime classpath.
  318. <test-type>
  319. <name>unit</name>
  320. <test-dependency>
  321. <code-name-base>A</code-name-base>
  322. <recursive/>
  323. </test-dependency>
  324. </testtype>
  325. Runtime classpath is A + B + C + D.
  326. Compile classpath is D.
  327. Use case 3: Compile and runtime dependency on a module its recursive runtime classpath.
  328. <test-type>
  329. <name>unit</name>
  330. <test-dependency>
  331. <code-name-base>A</code-name-base>
  332. <compile-dependency/>
  333. <recursive/>
  334. </test-dependency>
  335. </testtype>
  336. Runtime classpath is A + B + C + D.
  337. Compile classpath is A + B + C + D.
  338. Note one feature of recursive compile-time dependency: modules B and C are added
  339. to compile classpath as well, even if A has only runtime dependency on B and B on C.
  340. Use case 4: Compile and runtime dependency on a module, its recursive runtime classpath
  341. and tests.
  342. <test-type>
  343. <name>unit</name>
  344. <test-dependency>
  345. <code-name-base>A</code-name-base>
  346. <compile-dependency/>
  347. <recursive/>
  348. <test/>
  349. </test-dependency>
  350. </testtype>
  351. Runtime classpath is A + B + C + D + A/test/unit.
  352. Compile classpath is A + B + C + D + A/test/unit.
  353. Declare any public API/SPI packages you export:
  354. <public-packages>
  355. <package>org.netbeans.api.foo</package>
  356. <package>org.netbeans.spi.foo</package>
  357. </public-packages>
  358. If you do not export any API, say so:
  359. <public-packages/>
  360. If you export an API to selected modules only, you can use (NB 5.0+ only!):
  361. <friend-packages>
  362. <friend>org.netbeans.modules.brother</friend>
  363. <package>org.netbeans.modules.foo.spi</package>
  364. </friend-packages>
  365. If you bundle a special library which you want to expose to modules depending on
  366. you, you need not enumerate every package explicitly:
  367. <public-packages>
  368. <subpackages>javax.foo</subpackages>
  369. </public-packages>
  370. Exported implementation "APIs" do not need to be declared; anyone depending on
  371. your module with an implementation dependency gets access to *all* your
  372. packages. Be careful and avoid this situation whenever possible.
  373. If your module bundles one or more third-party libraries, declare them:
  374. <class-path-extension>
  375. <!-- Deployed path, relative to dir containing module: -->
  376. <runtime-relative-path>ext/foolib.jar</runtime-relative-path>
  377. <!-- Path of library in your own sources, relative to project basedir: -->
  378. <binary-origin>external/foolib.jar</binary-origin>
  379. </class-path-extension>
  380. You still need to separately copy the JAR to the output directory (see below).
  381. This just declares that Class-Path in your module's manifest should be defined,
  382. and adds a compile-time classpath entry for your module and modules depending on
  383. it.
  384. If your bundled library is built from sources, just use
  385. <class-path-extension>
  386. <runtime-relative-path>ext/foolib.jar</runtime-relative-path>
  387. </class-path-extension>
  388. Sometimes a module will produce some extra JARs (in modules/ext/ for Class-Path,
  389. in ant/nblib/, etc.), or will just need to have some extra sources for
  390. miscellaneous purposes (e.g. custom Ant tasks). You can declare them, somewhat
  391. similarly to how freeform projects permit compilation units to be declared; you
  392. will still need to explicitly compile and JAR them in your build.xml. For
  393. example, for in-IDE automatic Ant tasks you might use:
  394. <extra-compilation-unit>
  395. <!-- Root of Java packages, relative to project basedir: -->
  396. <package-root>antsrc</package-root>
  397. <!-- Compile-time classpath: -->
  398. <classpath>${ant.home}/lib/ant.jar:${openide.dir}/core/openide.jar</classpath>
  399. <!-- Places where classes are deposited: -->
  400. <built-to>build/antclasses</built-to>
  401. <built-to>${cluster}/ant/nblib/${code.name.base.dashes}.jar</built-to>
  402. </extra-compilation-unit>
  403. Or for a Class-Path extension built from sources, you might use:
  404. <extra-compilation-unit>
  405. <package-root>libsrc</package-root>
  406. <classpath/>
  407. <built-to>build/libclasses</built-to>
  408. <built-to>${cluster}/modules/ext/foolib.jar</built-to>
  409. </extra-compilation-unit>
  410. A custom Ant task (or set of tasks) you use only during your own build might
  411. look like:
  412. <extra-compilation-unit>
  413. <package-root>antsrc</package-root>
  414. <classpath>${ant.home}/lib/ant.jar</classpath>
  415. <built-to>build/antclasses</built-to>
  416. <built-to>build/tasks.jar</built-to>
  417. </extra-compilation-unit>
  418. Note that <classpath> may contain Ant property references, so for a complex
  419. classpath, define it once in project.properties and use that property in
  420. <classpath> as well as in your Ant script.
  421. In order for the IDE to recognize references to those classes defined in the
  422. <extra-compilation-unit>, you may also need add/modify your module's cp.extra
  423. property to include the value specified in the <package-root> element.
  424. AN IMPORTANT NOTE: CUSTOMIZATION OF BUILD SCRIPTS
  425. -------------------------------------------------
  426. Harness scripts allow a great degree of customization in your project's build
  427. script and properties files (see sections on properties and Ant targets
  428. below). Due to open nature of Ant scripts (everything is public) special
  429. attention must be paid to migrating customized build scripts to newer version of
  430. harness. In order to avoid unexpected use of newer version of harness with new
  431. IDE, make sure that your either define harness location explicitly via
  432. harness.dir property or that you use harness supplied with NB platform you are
  433. building against ('Harness supplied with Platform' option on Harness tab in
  434. NetBeans Platform Manager).
  435. Of course sometimes you want to upgrade to newer version of harness. To minimize
  436. the chances that it will break your (customized) build, follow these
  437. simple rules:
  438. * Use only properties listed in the following sections and avoid overriding
  439. those marked 'Do not override' or similarly.
  440. * Depend on/override only targets listed in sections 'Targets available for
  441. overriding...' below
  442. * When overriding targets, use only pre- or post-hooks (described below) for
  443. your code and call original target as a whole in 'depends' attribute of the
  444. target.
  445. Note that even when sticking to these rules, there is always possibility that
  446. migration to newer version of harness will break your build, especially when you
  447. depend on some implementation details, like a property *not* being set in
  448. particular internal target, concrete calling order of targets, etc.
  449. PROPERTIES WHICH MAY BE DEFINED IN YOUR project.properties
  450. ----------------------------------------------------------
  451. If needed, these properties may also be defined in private.properties (to make
  452. them applicable to only your own checkout of sources). Only selected properties
  453. are listed here; others may be interpreted, but see the Ant script for details.
  454. Unless otherwise noted, properties listed here *are* available for use in
  455. selected fields in project.xml, *are* available for use in your build.xml
  456. (depend on some init target to make sure), and *are not* available for use when
  457. defining other properties in project.properties (unless you defined them in
  458. private.properties).
  459. app.icon.icns [since 6.9] - "${harness.dir}/etc/applicationIcon.icns" by default,
  460. path to application's icon in Mac (.icns) format; used for creating ".app"
  461. directory hierarchy in "build-mac" target.
  462. basedir - you cannot define this; it is always the project directory of the
  463. module (as in any Ant script). Available in all other properties files.
  464. build.classes.dir - "build/classes", used to send compiled classes to.
  465. build.compiler.debug - default "true" to include debugging info when compiling
  466. (needed if you want to step through sources).
  467. build.compiler.debuglevel - default "source,lines,vars" to include all debugging info.
  468. build.compiler.deprecation - default "true" to display deprecation warnings when
  469. compiling. If you want to disable deprecations, it is recommended you use
  470. private.properties:
  471. build.compiler.deprecation=false
  472. build.test.unit.classes.dir - "build/test/unit/classes", where unit tests are
  473. compiled to.
  474. buildnumber - generated timestamp for use in
  475. OpenIDE-Module-Implementation-Version (or OpenIDE-Module-Build-Version if
  476. OpenIDE-Module-Implementation-Version was explicitly defined in the manifest).
  477. catalog.base.url [since 6.9] - distribution base for the suite modules NBMs
  478. location for which the catalog is generated. Default is ".".
  479. cluster - cluster directory your module is to be built into. For netbeans.org
  480. modules, this is a subdirectory of nbbuild/netbeans/; the subdirectory name is
  481. defined automatically from nbbuild/cluster.properties, with a fallback to
  482. "extra". For suite component modules, it defaults to
  483. "${suite.dir}/build/cluster", though you could override it if you wanted (e.g.
  484. in platform.properties); similarly, for standalone modules, it defaults to
  485. "${basedir}/build/cluster". Available in project.properties for netbeans.org
  486. modules only.
  487. code.name.base - your code name base as org.netbeans.modules.foo
  488. code.name.base.dashes - your code name base as org-netbeans-modules-foo
  489. code.name.base.slashes - ditto, as org/netbeans/modules/foo
  490. cp.extra - extra JARs you have to compile module sources against. Rarely needed
  491. any more, but if you have defined extra source trees with <extra-compilation-unit>,
  492. it may be necessary to add/modify this value to include the value specified in
  493. its <package-root> element.
  494. extra.module.files - list of special files you build alongside your module JAR
  495. which you want to register for update tracking and include in your NBM.
  496. *Everything* you put into your cluster should be enumerated. Paths are relative
  497. to the cluster directory. Ant-style patternsets (most simply a trailing slash)
  498. are permitted if you can be sure no other modules' files would also match.
  499. Example:
  500. extra.module.files=\
  501. ext/foolib.jar,\
  502. docs/FooAPI.zip,\
  503. SpecialThirdPartyTool1.0/
  504. (You do *not* need to include: the module JAR itself; your JavaHelp JAR if you
  505. build one; your module declaration file; any module-auto-deps.xml; an
  506. ant/nblib/*.jar corresponding to your module; or any files in ${release.dir}.
  507. These are all included by default.)
  508. foo/bar.dir - absolute path of cluster directory to which the netbeans.org
  509. module "foo/bar" is built. Only defined for netbeans.org modules, and only if
  510. foo/bar was *already* built before yours (specify <build-dependency/>).
  511. Available in project.properties.
  512. harness.dir - location of the build harness (for external modules). Usually
  513. "${netbeans.dest.dir}/harness".
  514. is.autoload and is.eager - default false, but if true, make this module an
  515. autoload or eager module.
  516. javac.compilerargs [since 5.0u1] - default none; additional arguments to pass
  517. to the Java compiler, e.g. "-Xlint:unchecked".
  518. javac.source - default "1.4"; to use JDK 1.5 features like generics:
  519. javac.source=1.5
  520. javac.target - default ${javac.source}; controls version of generated bytecode
  521. javadoc.apichanges - optional location of an API changes list. Currently for
  522. netbeans.org modules only.
  523. javadoc.arch - optional location of an architecture XML description. Highly
  524. recommended as it makes your module self-documenting.
  525. javadoc.arch=${basedir}/arch.xml
  526. javadoc.overview - optional location of a Javadoc overview page. Discouraged
  527. since it disables the default content which links to various generated documents
  528. which you would need to manually add to your own overview.
  529. javadoc.title - title for Javadoc build. Optional for external modules.
  530. DEPRECATED since 5.0u1; taken from other module metadata.
  531. javahelp.base - "${code.name.base.slashes}/docs" by default; directory
  532. containing your help set, under "javahelp/".
  533. javahelp.excludes - optionally, list of file name patterns to exclude from
  534. JavaHelp search index construction.
  535. javahelp.jar - "modules/docs/${code.name.base.dashes}.jar". Do not override.
  536. Constructed from ${javahelp.jar.basename} and ${javahelp.jar.dir}.
  537. javahelp.search - "JavaHelpSearch" by default; name of search database
  538. directory, relative to your help set. Must match what your help set specifies.
  539. jhall.jar - for external modules, if you wish to build JavaHelp, you must define
  540. the location of jhall.jar from the JavaHelp distribution, as this is needed to
  541. run the search indexer. DEPRECATED since 5.0u1; the 5.0u1 harness now includes
  542. jsearch-*.jar so you do not need to specify this property any longer.
  543. keystore - Key store for signing NBMs. A candidate for private.properties - you
  544. do *not* want to share this file! Also ${nbm_alias} and ${storepass} are used in
  545. the NBM signing process.
  546. license.file - optional. Location of license text to use when creating an NBM.
  547. (External modules only.)
  548. manifest.mf - JAR manifest location. Avoid overriding.
  549. module.auto.deps.xml - "module-auto-deps.xml" in your project directory by
  550. default. Optional configuration file.
  551. module.classpath - your main module source's compile-time classpath, according
  552. to <module-dependencies>. Since 5.0u1 uses public-package-only JARs where
  553. appropriate.
  554. module.run.classpath [since 5.0u1] - your main module source's run-time
  555. classpath, according to <module-dependencies>. Similar to ${module.classpath}
  556. except does not use public-package-only JARs; includes run-time-only
  557. dependencies; and processes dependencies transitively.
  558. module.jar - location of module JAR relative to cluster directory. Do not
  559. override directly; override ${module.jar.basename} (default
  560. "${code.name.base.dashes}.jar") and/or ${module.jar.dir} (default "modules") if
  561. necessary (not without a good reason!).
  562. module.jar.verifylinkageignores [since 6.0] - regexp pattern for class names
  563. that are excluded from linkage check
  564. module.javadoc.packages - comma-separated list of packages to be included in
  565. Javadoc. Defaulted according to <public-packages> or <friend-packages>, but if
  566. you used <subpackages> (or if you have not specified any public or friend
  567. packages at all) you will need to specify it explicitly.
  568. nbm.distribution - optional URL to location where your NBM can be downloaded
  569. from.
  570. nbm.executable.files [since 6.8] - comma- or space- separated list of patterns of
  571. files relative to cluster directory for which executable permissions should be set
  572. on Unix system when building the module and on NBM installation/update in runtime.
  573. nbm.homepage - optional URL to HTML homepage for background about the module.
  574. nbm.is.global - set to "true" if NBM cannot be installed in user directory.
  575. nbm.module.author - author info for an NBM.
  576. nbm.needs.restart - set to "true" if NBM cannot be installed (even for the first
  577. time) without restarting the IDE.
  578. nbm.target.cluster [since 5.0u2] - allow to declare a target cluster where
  579. install if NBM install globally.
  580. autoupdate.catalog.url - if you want to use module's or suite's update target
  581. during build, you need to specify the URL of your NBMs catalog.
  582. nbplatform.active - optional name of a NB platform to build and run against. See
  583. discussion above for details of how this is used.
  584. netbeans.dest.dir - [up to 6.5.1] absolute pathname of NB platform (or IDE or
  585. whatever) that you are building your module against, and into which your module
  586. will be built. Available in project.properties (and in all properties files for
  587. netbeans.org modules). Specified folder must exist and must contain valid NB
  588. platform. Do not define in suite modules if suite's platform.properties defines
  589. "cluster.path" property. Also do not depend on this property to be defined, it
  590. will not be in projects created with NB 6.7 or later.
  591. netbeans.home - location of "platform*" cluster of the NetBeans IDE installation
  592. you are running. *Only defined* when you run an Ant script *inside* the IDE.
  593. nbjdk.active [since 5.0u1] - name of a Java platform (JDK) to use when building
  594. and running. Will try to load (e.g. from ${userdir}/build.properties, where Java
  595. Platform Manager stores its information) the properties
  596. nbjdk.home=${platforms.${nbjdk.active}.home}
  597. - JDK (not JRE!) home directory
  598. nbjdk.bootclasspath=${platforms.${nbjdk.active}.bootclasspath}
  599. - JRE JARs, e.g. rt.jar (default: ${nbjdk.home}/jre/lib/rt.jar)
  600. nbjdk.java=${platforms.${nbjdk.active}.java}
  601. - java executable (default: ${nbjdk.home}/bin/java)
  602. nbjdk.javac=${platforms.${nbjdk.active}.javac}
  603. - javac executable (default: ${nbjdk.home}/bin/javac)
  604. nbjdk.javadoc=${platforms.${nbjdk.active}.javadoc}
  605. - javadoc executable (default: ${nbjdk.home}/bin/javadoc)
  606. if they are not already defined. Uses <presetdef> to make <java>, <javac>,
  607. <javadoc>, <junit>, and <nbjpdastart> use this JDK. Optional; if unset (or set to
  608. 'default'), will use the current VM's Java platform instead. Define in
  609. platform.properties (in a standalone module, or in the suite for a suite component
  610. module, or in nbbuild/user.build.properties for a netbeans.org module). You may
  611. also define just ${nbjdk.home} directly, without using ${nbjdk.active}, if you do
  612. not need to use the Java Platform Manager to set up the JDK definition.
  613. use.pack200 [since 6.9] - whether to Pack200 compress NBMs; default true.
  614. pack200.excludes [since 6.9] - comma- or space- separated list of patterns of
  615. files relative to cluster directory for which pack200 compression should not be used
  616. while creating NBMs.
  617. project.license [since 6.0] - license to use for newly created files in the project
  618. (applies also to suites); default is 'cddl' for modules inside netbeans.org.
  619. release.dir - "${basedir}/release"; location of a directory full of files to
  620. copy unmodified to the output cluster. Since 6.0 beta2 also applies to module
  621. suite projects. DO NOT ATTEMPT to create files in this directory during the
  622. build; it is ONLY for static content (versioned files present in a clean source
  623. project). Dynamically generated cluster content should be placed directly in
  624. ${cluster} as part of a netbeans-extra target, and be sure to mention such files
  625. in ${extra.module.files}.
  626. run.app.exe - "bin\netbeans.exe"; name of Windows launcher to start (inside
  627. ${netbeans.dest.dir}) if trying to run the application for interactive testing.
  628. Only relevant if ${app.name} is unset.
  629. run.app.sh - "bin/netbeans"; same but for Unix (and Mac OS X).
  630. run.args.extra - empty; any added arguments to pass to the launcher.
  631. run.jdkhome - location of JDK to run application with for interactive testing.
  632. Defaults to JDK the Ant script was using, or that selected by ${nbjdk.active}.
  633. DEPRECATED - for compatibility only. Use ${nbjdk.active} instead.
  634. spec.version.base - this is a little subtle. If you export an implementation
  635. dependency to other modules, *and/or* depend on one or more other modules using
  636. implementation dependencies, you are advised to use this property *in place of*
  637. writing OpenIDE-Module-Specification-Version explicitly in your manifest. It
  638. should be a dotted number to serve as the base of a specification version; keep
  639. the number of components *fixed* even if you branch the module, so e.g. in a
  640. development version use
  641. spec.version.base=1.7.0
  642. and if you need to increment this in a release branch use e.g.
  643. spec.version.base=1.7.1
  644. The harness will automatically append integers to it as follows to create the
  645. actual specification version:
  646. 1. Your OpenIDE-Module-Implementation-Version, if specified and an integer.
  647. 2. The OpenIDE-Module-Implementation-Version of modules you depend on using
  648. implementation dependencies, if integers; ordered by alphabetizing the
  649. dependencies.
  650. (Example: if you have impl version 3, and you depend on org.netbeans.modules.foo
  651. = 6 and org.netbeans.modules.bar = 7, your actual spec version would be
  652. 1.7.0.3.7.6.)
  653. This is very handy for Auto Update: whenever you or anyone else makes a change
  654. to an implementation API, just increment the
  655. OpenIDE-Module-Implementation-Version of the providing module. That module and
  656. any modules depending on its API will get a higher
  657. OpenIDE-Module-Specification-Version automatically, so the whole set of
  658. interdependent modules can be published to users at once on an update center.
  659. src.dir - "src", module source directory. Avoid overriding.
  660. test.timeout [since 6.1] - timeout (in msec) for unit tests, default 600000 (10
  661. minutes). A test running longer than this will be halted.
  662. test.run.args [since 6.5] - general VM arguments to pass when running tests.
  663. Defaults to just "-ea".
  664. test.config [since 6.5] - name of a test configuration to run, specifying a set
  665. of unit and/or functional tests which should be run by the 'test' target.
  666. Defaults to 'default'. ${test.config.NAME.includes} specifies the includes list
  667. (format: classpath resources). The standard value of ${test.config.NAME.includes}
  668. depends on NAME. In case of 'default', it includes every test ('**/*Test.class').
  669. In case of any other NAME the includes list is empty.
  670. ${test.config.NAME.excludes} (default '') specifies an excludes list.
  671. test.unit.cp.extra - any additional classpath you might need to compile your
  672. unit tests. If left empty, you can compile against JUnit; the NB test extensions
  673. in nbjunit.jar; your module; and anything your module compiled against (since
  674. 5.0u1, ${module.run.classpath}). As of 5.0u2 you can and should include other
  675. modules in project.xml's <test-dependencies> but in earlier releases these must
  676. be listed in this property.
  677. test.unit.cp.extra=\
  678. ${tools.jar}:\
  679. ${basedir}/lib/custom-junit-helpers.jar
  680. test.unit.run.cp.extra - any additional classpath you might need to *run* your
  681. unit tests with (beyond what they are already compiled with). As of 5.0u2 you
  682. can and should include other modules in project.xml's <test-dependencies> but in
  683. earlier releases these must be listed in this property.
  684. test.unit.lib.cp - path to some basic libraries which can be used in unit tests:
  685. junit.jar, nbjunit.jar, and insanelib.jar. Not needed for netbeans.org modules.
  686. For external modules, may be needed if you do not have the junit and testtools
  687. modules installed in the target platform *or* the developing IDE, and the target
  688. platform is not inside a netbeans.org build tree (in nbbuild/netbeans).
  689. DEPRECATED as of 6.5; even basic libraries should instead be declared as regular
  690. test dependencies (they are now included in the harness cluster).
  691. test.unit.src.dir - "test/unit/src"; avoid overriding.
  692. test-unit-sys-prop.<NAME> - will set a system property <NAME> when running your
  693. unit tests.
  694. test.dist.dir - directory with test distribution.
  695. test.unit.folder - output directory for tests of module.
  696. test.unit.out.folder - this property can be overriden when you want to change
  697. test.unit.folder property.
  698. continue.after.failing.tests - controls behavior of running tests on all modules
  699. in suite. Default value is "true", which causes suite.test target to continue
  700. with another module even if tests in previous module failed. Set to "false"
  701. in your suite's project.properties to force test target to stop after tests
  702. in one module failed. In module project this controls whether test target
  703. fails when tests fail (when set to "false" or unset) or succeeds even if
  704. test failed (when set to "true").
  705. extra.test.libs.dir - directory with extra libraries needed for test run.
  706. tools.jar [since 5.0u1] - set to location of tools.jar in active JDK. Useful in
  707. case your module needs to compile against JDK-only classes. Meaningless on Mac
  708. OS X.
  709. To support builds of JNLP-based applications additional properties may be used
  710. or redefined in JNLP-related targets:
  711. jnlp.servlet.jar - must point to jnlp-servlet.jar as provided by JDK 5 in
  712. the directory sample/jnlp/servlet/jnlp-servlet.jar if one wants to build
  713. a packaged war file of JNLP version of your suite
  714. jnlp.dest.dir - the location where to generate the JNLP files and signed
  715. jars. By default it is your ${suite.dir}/build/jnlp
  716. jnlp.master.dir - (category='private') location of a directory in which
  717. to generate pieces of master JNLP file to be included in the resources
  718. section.
  719. jnlp.signjar.alias -
  720. jnlp.signjar.keystore -
  721. jnlp.signjar.password - allow you to sign your app with your own private key, if
  722. unspecified then a default keystore is generated. Nice for trying things for
  723. the first time, but not for production, then you very likely want to generate
  724. your key and set these properties
  725. jnlp.signjar.vendor - you can override this to be the default dname for the keystore
  726. jnlp.platform.codebase - can point to a shared repository which can be generated
  727. by ant -f nbbuild/build.xml build-jnlp. Then your WAR file will contain only
  728. modules of your suite and platform modules will be referenced by the value of
  729. this property. Sample values with prebuilt binaries (good for testing):
  730. http://bits.netbeans.org/6.5/jnlp/
  731. http://bits.netbeans.org/6.7/fcs/jnlp/
  732. http://deadlock.netbeans.org/hudson/job/ide-jnlp/lastStableBuild/artifact/nbbuild/build/jnlp/
  733. jnlp.indirect.jars [since 6.0] - optional pattern of JARs in the cluster to load
  734. in JNLP mode even though they are not listed as Class-Path extensions of the
  735. module JAR. The module ought not directly refer to classes in these JARs (it
  736. could not do so in non-JNLP mode) but it may load them reflectively using
  737. InstalledFileLocator using the same path in regular as in JNLP mode. Note that
  738. the physical path on disk to the resulting JAR will not necessarily contain
  739. the directory prefix that the JAR in the cluster uses, so do not expect that
  740. jar.getParentFile() is meaningful. The implementation creates an empty JAR
  741. entry META-INF/clusterpath/$path where $path is the ('/'-separated) path
  742. within the cluster where the JAR would be found in a normal installation.
  743. jnlp.indirect.files [since 7.0M1] - optional pattern of files in the cluster to
  744. load in JNLP mode. The module may load these files using InstalledFileLocator
  745. using the same path in regular as in JNLP mode. Note that the physical path on
  746. disk to the resulting file will not necessarily contain the directory prefix
  747. that the file in the cluster uses, so do not expect that file.getParentFile()
  748. is meaningful. The implementation creates a JAR entry META-INF/files/$path
  749. where $path is the ('/'-separated) path within the cluster where the file
  750. would be found in a normal installation.
  751. jnlp.verify.excludes - the default implementation of "jnlp" task in common.xml
  752. does verification and compares that all files from module NBM are really
  753. referenced from the JNLP file. Sometimes not all of them need to be, for
  754. them you can put their full names (relative to your cluster root) into this
  755. property and separate them by comma.
  756. jnlp.permissions - allows altering of the fragment in the resulting .jnlp file
  757. that sets the permissions for individual modules. The default value is
  758. &lt;security&gt;&lt;all-permissions/&gt;&lt;/security&gt; when jnlp.sign.jars
  759. is true, &lt;security/&gt; when jnlp.sign.jars is false.
  760. If you want to change the default to something else please define the value
  761. of the property.
  762. jnlp.sign.jars [since 6.0] - defaults to true. If set to false the jars
  763. will not be signed, only the main (startup) jar. This should allow for
  764. faster startup but might compromise JNLP security. Use with extreme care.
  765. jnlp.generate.versions [since 6.7] - Defaults to false, which means versioning
  766. info is not generated (see
  767. http://java.sun.com/j2se/1.5.0/docs/guide/javaws/developersguide/downloadservletguide.html#resources).
  768. If set true, build-jnlp target creates versioning info in jnlp descriptors and version.xml files.
  769. This allows for incremental updates of Webstart applications, but requires download via
  770. JnlpDownloadServlet (thus run-jnlp and debug-jnlp does not create versioning info even with this
  771. property set to true).
  772. [XXX some of the above should be listed in "Suite Properties"]
  773. TARGETS AVAILABLE FOR OVERRIDING IN YOUR build.xml
  774. --------------------------------------------------
  775. Obscure or mostly internal targets are skipped here, but again examine the
  776. actual harness script if in doubt. If you want to keep the original
  777. implementation and just add a before hook, try e.g.
  778. <target name="-pre-javahelp">
  779. <!-- your stuff here -->
  780. </target>
  781. <target name="javahelp" depends="-pre-javahelp,harness.javahelp"/>
  782. (some original targets are projectized-common.* rather than harness.*). If you
  783. want to add an after hook, try e.g.
  784. <target name="javahelp" depends="harness.javahelp">
  785. <!-- your stuff here -->
  786. </target>
  787. basic-init - define some properties such as file locations; enough to do a clean
  788. at least.
  789. build-init - define more properties needed for compiling and other build tasks.
  790. clean - remove all build products: the "build" directory under your project
  791. directory, and any files left in the build cluster (including
  792. ${extra.module.files}).
  793. compile - compile Java sources for the module.
  794. compile-single - compile selected Java sources (F9).
  795. compile-test-single - compile selected unit test classes (F9).
  796. debug - build module and then start target platform in debug mode. Use from
  797. within the IDE (there is a context menu item for it) to debug the app.
  798. debug-fix-nb - loads a hotfix for a module class while debugging. Run -> Apply
  799. Code Changes from the IDE.
  800. debug-fix-test-nb - same, for unit test classes.
  801. debug-test-single-nb - run one single unit test in the debugger (e.g. to see why
  802. it is failing). Available from the IDE's menus.
  803. files-init - define list of files in the NBM fileset. Use ${extra.module.files}
  804. rather than overriding this.
  805. init - all normal initialization.
  806. jar - build the module JAR.
  807. jar-prep - prepare to build the module JAR; define ${buildnumber}.
  808. javadoc - build module Javadoc.
  809. jnlp - generetes the JNLP component file for this module and all necessary
  810. resources for it into ${jnlp.dest.dir} directory and also a fragment of
  811. the master JNLP into ${jnlp.master.dir}
  812. javadoc-nb - same, and open it in a web browser (only from the IDE). Available
  813. as Build -> Generate Javadoc.
  814. javahelp - build JavaHelp.
  815. nbm - build the NBM. You might override this to give a complex (multipart)
  816. license text. Copy basic impl from common.xml and edit.
  817. netbeans - build everything needed for the NBM. Do not override; use
  818. netbeans-extra instead.
  819. netbeans-extra - hook target: does nothing unless overridden, but called when
  820. building a module. Override to insert any additional build tasks you need to do:
  821. copying libraries to the cluster, etc.
  822. profile - used from inside the IDE (if the NetBeans profiler is installed) to
  823. profile the entire application.
  824. profile-test-single-nb - run one unit test under the profiler. Available from the
  825. IDE's menus if the NetBeans profiler is installed.
  826. release - copies contents of ${release.dir} to ${cluster}.
  827. reload - reloads the module in the target IDE/app to try out changes interactively.
  828. reload-in-ide - reloads the module in the current IDE to try out changes
  829. interactively. Only available when run from inside NetBeans. Use with care.
  830. run - build module and then run application interactively. Only for external
  831. modules. Either way, available from context menu in Projects tab.
  832. test - run all unit tests for the module. Run -> Test... in the IDE.
  833. test-generate-html [since 6.5 M2] - can be used after test target to generate
  834. test reports in html.
  835. test-build - build unit tests for the module.
  836. test-init - define properties used for building and running unit tests.
  837. test-preinit - I'm not sure, actually.
  838. test-single - run a selected unit test only. Available in the IDE's menus.
  839. testuserdir-delete - deletes just the testing user directory (if not currently in use).
  840. verify-class-linkage [since 5.0u1] - checks for possible linkage errors in your module
  841. and its Class-Path extensions.
  842. SUITE PROPERTIES
  843. ----------------
  844. Some properties are shared with module projects, such as ${cluster}.
  845. app.name - filename of application launchers to create, suite name to create,
  846. etc.
  847. app.version - version of the application, used in building the MacOS application
  848. bundle for example. (Since 6.0 beta2)
  849. app.conf - location of an alternative configuration file. If not specified,
  850. default one from harness/etc/app.conf is taken (Since 6.9)
  851. branding.dir (default "${suite.dir}/branding") - directory containing branding
  852. overrides.
  853. branding.token - optional token defining an application branding.
  854. enabled.clusters - comma-separated list of cluster names in the target platform
  855. (e.g. "platform") which should be included in the application. Should be stored
  856. in platform.properties, not project.properties. Available since 5.0u1. Since 6.5,
  857. can elide version numbers from the end, e.g. just "platform" suffices.
  858. disabled.clusters - comma-separated list of cluster names in the target platform
  859. (e.g. "ide") which should be completely excluded from the application.
  860. DEPRECATED since 5.0u1 in favor of ${enabled.clusters} and ignored if that is nonempty.
  861. disabled.modules - comma-separated list of code name bases of modules in the
  862. target platform (e.g. "org.netbeans.modules.autoupdate") which should be
  863. excluded from the application. There is no need to specify modules already
  864. excluded by ${disabled.clusters} (if used) or by modules from clusters not included
  865. in ${enabled.clusters}. Since 5.0u1, should be stored in platform.properties,
  866. not project.properties.
  867. dist.dir - directory (if not 'dist') to place the final application in. Since 6.1.
  868. modules - list of contained modules. Path format; entries resolved against the
  869. suite directory as needed.
  870. jnlp.codebase [since 5.0u1] - in case one wants to build a static repository not
  871. packaged in a WAR file, one needs to pass in the full URL for it. By default it
  872. is specified as "$$codebase" and replaced dynamically by the servlet packaged in
  873. the WAR file.
  874. TARGETS AVAILABLE FOR OVERRIDING IN YOUR SUITE build.xml
  875. --------------------------------------------------
  876. -init - set up properties. Most importantly, ${modules.sorted} contains a list
  877. of absolute path names to the base directories of the modules in the suite,
  878. topologically sorted by build order; suitable for use with <subant>, for
  879. example. Some other basic properties like ${netbeans.dest.dir} will also be
  880. defined.
  881. branding - building branding JARs, if applicable. Example: if ${branding.token}
  882. is "foo", then a file such as
  883. ${branding.dir}/modules/org-netbeans-modules-x.jar/org/netbeans/modules/x/resources/Bundle.properties
  884. will be packed into
  885. ${cluster}/modules/locale/org-netbeans-modules-x_foo.jar!/org/netbeans/modules/x/resources/Bundle_foo.properties
  886. build - build all suite modules.
  887. build-jnlp - builds a JNLP WAR file from your application suitable for
  888. publishing in a Java EE container.
  889. build-mac [since 5.0u2] - creates a Mac OS X application.
  890. build-zip - builds a ZIP file containing your application including launchers.
  891. clean - clean everything.
  892. debug - like run, but run in the JPDA debugger. (Only available from inside the
  893. IDE.)
  894. debug-jnlp - starts debuging of your JNLP application (works only from NetBeans IDE)
  895. nbms [since 5.0u1] - creates NBMs for all modules in the suite, and generates
  896. an XML descriptor listing them suitable for use from Auto Update.
  897. profile - used from inside the NetBeans IDE to profile the entire suite
  898. run - start application for testing.
  899. run-jnlp - executes your JNLP application (currently from local files)
  900. test - run all module unit tests. Since NetBeans 6.8 runs tests of all suite modules
  901. by default, even if some of them fails and target succeeds regardless of test status.
  902. When property 'continue.after.failing.tests' is set to 'false', this target fails
  903. immediately after tests in some module fail and does not continue testing the rest
  904. of the suite (this was the default up to version 6.7).
  905. testuserdir-delete - deletes just the testing user directory (if not currently in use).
  906. CONTENTS OF YOUR manifest.mf
  907. ----------------------------
  908. This file is just a prototype of the module JAR manifest, as described in the
  909. Modules API. It must contain the attribute OpenIDE-Module and is strongly
  910. encouraged to contain also OpenIDE-Module-Localizing-Bundle; other attributes
  911. are generally optional.
  912. Several attributes in the main section should *not* be written into this file as
  913. they are automatically generated during the build:
  914. Class-Path
  915. OpenIDE-Module-Build-Version
  916. OpenIDE-Module-Friends
  917. OpenIDE-Module-Implementation-Version (unless you are exporting an impl API)
  918. OpenIDE-Module-Module-Dependencies
  919. OpenIDE-Module-Public-Packages
  920. OpenIDE-Module-Specification-Version (unless you are *not* using spec.version.base)
  921. Do not forget that manifest files must begin with the magic phrase
  922. Manifest-Version: 1.0
  923. and to be safe should end in *two* newlines.
  924. TEST COVERAGE SUPPORT SPI
  925. -------------------------
  926. There is a support for test coverage measurement for apisupport projects
  927. since 6.7. There is a general contract under which alternative
  928. implementations may by added (in case of multiple impls present, only
  929. one is used). NetBeans 6.7 and 6.8 use Cobertura implementation.
  930. A contract for test coverage implementation for module projects is to
  931. create Ant script testcoverage.xml in 'harness' cluster. Script
  932. must:
  933. * reside directly in root folder of the cluster
  934. * set property testcoverage.present to true outside of any target
  935. * define target 'coverage-report' in the script
  936. * set property testcoverage.report.dir in 'coverage-report' target to dir
  937. with index.html file with results.
  938. * As of 6.8, unit and functional tests are supported.
  939. A contract for test coverage implementation for suite projects is to
  940. create Ant script testcoverage-suite.xml in 'harness' cluster. Script
  941. must:
  942. * reside directly in root folder of the cluster
  943. * set property testcoverage.suite.present to true outside of any target
  944. * define target 'coverage-report' in the script
  945. * set property testcoverage.report.dir in 'coverage-report' target to dir
  946. with index.html file with results.
  947. * As of 6.8, only unit tests are supported for suite projects.
  948. Clients should make no other assumptions beyond these contracts. All
  949. other related files must be stored in 'testcoverage/<impl name>'
  950. subfolder.
  951. ----------------
  952. Hey Emacs!
  953. Local Variables:
  954. mode: text
  955. fill-column: 80
  956. End: