product.xml 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!--
  3. DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
  4. Copyright 1997-2010 Oracle and/or its affiliates. All rights reserved.
  5. Oracle and Java are registered trademarks of Oracle and/or its affiliates.
  6. Other names may be trademarks of their respective owners.
  7. The contents of this file are subject to the terms of either the GNU General Public
  8. License Version 2 only ("GPL") or the Common Development and Distribution
  9. License("CDDL") (collectively, the "License"). You may not use this file except in
  10. compliance with the License. You can obtain a copy of the License at
  11. http://www.netbeans.org/cddl-gplv2.html or nbbuild/licenses/CDDL-GPL-2-CP. See the
  12. License for the specific language governing permissions and limitations under the
  13. License. When distributing the software, include this License Header Notice in
  14. each file and include the License file at nbbuild/licenses/CDDL-GPL-2-CP. Oracle
  15. designates this particular file as subject to the "Classpath" exception as provided
  16. by Oracle in the GPL Version 2 section of the License file that accompanied this code.
  17. If applicable, add the following below the License Header, with the fields enclosed
  18. by brackets [] replaced by your own identifying information:
  19. "Portions Copyrighted [year] [name of copyright owner]"
  20. Contributor(s):
  21. The Original Software is NetBeans. The Initial Developer of the Original Software
  22. is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun Microsystems, Inc. All
  23. Rights Reserved.
  24. If you wish your version of this file to be governed by only the CDDL or only the
  25. GPL Version 2, indicate your decision by adding "[Contributor] elects to include
  26. this software in this distribution under the [CDDL or GPL Version 2] license." If
  27. you do not indicate a single choice of license, a recipient has the option to
  28. distribute your version of this file under either the CDDL, the GPL Version 2 or
  29. to extend the choice of license to its licensees as provided above. However, if you
  30. add GPL Version 2 code and therefore, elected the GPL Version 2 license, then the
  31. option applies only if the new code is made subject to such option by the copyright
  32. holder.
  33. -->
  34. <!--
  35. This is the base build script for an nbi product package.
  36. It is not intended to be used directly, but to be imported into derivative
  37. implementation scripts, which will provide properties' values that are
  38. specific the concrete product implementation. The derivative scripts may also
  39. provide some additional functionality that is required by their respective
  40. product implementations.
  41. This script exposes five primary targets: 'init', 'clean', 'checkout',
  42. 'build' and 'release'; as well as two aggregate targets: 'build-all',
  43. which tranlates into 'init', 'clean', 'checkout', 'build', and
  44. 'release-all' - 'init', 'clean', 'checkout', 'build', 'release'. For the
  45. detailed description of the functionality of these targets, consult the
  46. corresponding documentation.
  47. -->
  48. <project name="product" default="usage" basedir=".">
  49. <!-- a default value for the ${common.dir} property, which allows the user
  50. to see the usage information is he calls this script directly and not
  51. via a derivative (which is the proper way to do this) -->
  52. <property name="common.dir" value="${basedir}"/>
  53. <!-- import the common properties -->
  54. <property file="${common.dir}/common.properties"/>
  55. <!-- import properties specific to the product package's build script -->
  56. <property file="${common.dir}/product.properties"/>
  57. <!-- import the common target library -->
  58. <import file="common.xml" optional="false"/>
  59. <!-- ============================================================================
  60. Initialization
  61. ============================================================================= -->
  62. <!--
  63. Initializes the product package's build script.
  64. This target overrides the '-init' target in common.xml, providing the
  65. custom functionality that is required for the product package's build
  66. script initialization.
  67. In addition to the standard initialization routine, this target defines
  68. several custom ant tasks, which are specific to the product package's build
  69. script.
  70. This target is not intended to be called directly.
  71. -->
  72. <target name="-init" depends=".init">
  73. <!-- define custom ant tasks -->
  74. <taskdef
  75. name="sizeof"
  76. classname="org.netbeans.installer.infra.build.ant.SizeOf"
  77. classpath="${custom.tasks.cls}"/>
  78. <taskdef
  79. name="md5"
  80. classname="org.netbeans.installer.infra.build.ant.Md5"
  81. classpath="${custom.tasks.cls}"/>
  82. <taskdef
  83. name="sum"
  84. classname="org.netbeans.installer.infra.build.ant.Sum"
  85. classpath="${custom.tasks.cls}"/>
  86. <taskdef
  87. name="package"
  88. classname="org.netbeans.installer.infra.build.ant.Package"
  89. classpath="${custom.tasks.cls}"/>
  90. <taskdef
  91. name="load-locales"
  92. classname="org.netbeans.installer.infra.build.ant.LoadLocales"
  93. classpath="${custom.tasks.cls}"/>
  94. <taskdef
  95. name="product-descriptor"
  96. classname="org.netbeans.installer.infra.build.ant.ProductDescriptor"
  97. classpath="${custom.tasks.cls}"/>
  98. <taskdef
  99. name="absolutize"
  100. classname="org.netbeans.installer.infra.build.ant.Absolutize"
  101. classpath="${custom.tasks.cls}"/>
  102. <taskdef
  103. name="uri-to-path"
  104. classname="org.netbeans.installer.infra.build.ant.UriToPath"
  105. classpath="${custom.tasks.cls}"/>
  106. <taskdef
  107. name="n-unzip"
  108. classname="org.netbeans.installer.infra.build.ant.NativeUnzip"
  109. classpath="${custom.tasks.cls}"/>
  110. <taskdef
  111. name="n-untar"
  112. classname="org.netbeans.installer.infra.build.ant.NativeUntar"
  113. classpath="${custom.tasks.cls}"/>
  114. <if property="release.to.server" value="true">
  115. <taskdef
  116. name="release-package-server"
  117. classname="org.netbeans.installer.infra.build.ant.ReleasePackage"
  118. classpath="${custom.tasks.cls}"/>
  119. </if>
  120. <if property="release.to.server" value="false">
  121. <taskdef
  122. name="release-package-filesystem"
  123. classname="org.netbeans.installer.infra.build.ant.registries.AddPackage"
  124. classpath="${custom.tasks.cls}"/>
  125. </if>
  126. <!-- check whether the engine should be built -->
  127. <condition property="do.build.engine">
  128. <equals arg1="${build.engine}" arg2="true"/>
  129. </condition>
  130. <!-- make the engine-related paths absolute -->
  131. <absolutize property="engine.work.dir"/>
  132. <absolutize property="engine.dist.dir"/>
  133. <absolutize property="engine.dist.file"/>
  134. <!-- define the javac.classpath for the netbeans project -->
  135. <property
  136. name="nb.custom.parameter"
  137. value="-Djavac.classpath=${engine.dist.file}"/>
  138. </target>
  139. <!-- ============================================================================
  140. Clean-up
  141. ============================================================================= -->
  142. <!--
  143. Cleans the current working directory and the distributives directory.
  144. This target overrides the '-clean' target in common.xml, providing the
  145. custom functionality that is required for correctly cleaning the product
  146. package.
  147. In addition to the standard behavior the product package distributive file
  148. is removed from the distributives directory.
  149. This target is not intended to be called directly.
  150. -->
  151. <target name="-clean" depends="-clean-engine,.clean">
  152. <!-- remove the product's distributive file from the distributives
  153. directory -->
  154. <delete file="${dist.dir}/${product.dist.file.name}"/>
  155. </target>
  156. <!--
  157. Cleans the engine.
  158. It runs the 'clean' target on the engine's build script.
  159. This target is only executed if the the ${build.engine} property was
  160. set to 'true'.
  161. This target is not intended to be called directly.
  162. -->
  163. <target name="-clean-engine" depends="init" if="do.build.engine">
  164. <exec executable="${ant.executable}"
  165. dir="${engine.dir}"
  166. failonerror="false">
  167. <env key="JAVA_HOME" value="${java.home}"/>
  168. <arg value="clean"/>
  169. <arg value="-Dwork.dir=${engine.work.dir}"/>
  170. <arg value="-Ddist.dir=${engine.dist.dir}"/>
  171. <arg value="-Dbuild.native=false"/>
  172. <arg value="-Ddont.build.custom.tasks=true"/>
  173. <arg value="-Dcustom.tasks.cls=${custom.tasks.cls}"/>
  174. <arg value="-Dengine.dist.file.name=${engine.dist.file.name}"/>
  175. <arg value="-Denvironment.properties=${environment.properties}"/>
  176. </exec>
  177. </target>
  178. <!-- ============================================================================
  179. Check-out
  180. ============================================================================= -->
  181. <!--
  182. The functionality of the checkout procedure for the product package is
  183. indentical to the standard one, thus there is not need to override the
  184. '-checkout' target, whosew default implementation is present in
  185. common.xml.
  186. -->
  187. <!-- ============================================================================
  188. Build
  189. ============================================================================= -->
  190. <!--
  191. Builds the product package.
  192. This target overrides the '-build' target in common.xml, providing the
  193. custom functionality that is required for correctly building the product
  194. package.
  195. The build process for the grup package consists of five steps.
  196. 1) The search-and-replace is run over the product's sources, based on the
  197. [token] => [value] pairs defined in ${product.params.N.token} and
  198. ${product.params.N.value}
  199. 2) The product's icon is copied from its location to the product's package
  200. directory structure and some metadata is calculated
  201. 3) The product's localizing bundle is loaded and the product package
  202. descriptor is generated
  203. 4) The manifest for the product package is generated
  204. 5) The package directory structure is jarred, digitally signed and moved
  205. to the distributives directory
  206. This target is not intended to be called directly.
  207. -->
  208. <target name="-build" depends="-build-engine,.build">
  209. <!-- init the required disk space -->
  210. <set property="product.disk.space"
  211. value="${product.disk.space.modificator}"/>
  212. <!-- init several shorthands -->
  213. <set
  214. property="product.logic.dir"
  215. value="${package.dir}/${product.logic.path}"/>
  216. <set
  217. property="product.data.dir"
  218. value="${package.dir}/${product.data.path}"/>
  219. <!-- some necessary mkdirs -->
  220. <mkdir dir="${packaged.data.dir}"/>
  221. <mkdir dir="${downloads.cache.dir}"/>
  222. <mkdir dir="${product.logic.dir}"/>
  223. <mkdir dir="${product.data.dir}"/>
  224. <!-- fetch the configuration logic jars; the first jar is handled
  225. separately, if the the ${build.nbproject} has been set to true -
  226. we don't need to fetch it, as we ca just copy -->
  227. <if property="build.nbproject" value="true">
  228. <set
  229. property="i"
  230. value="1"/>
  231. <set
  232. property="current.file"
  233. value="${product.logic.dir}/${product.logic.file.name}"/>
  234. <copy
  235. file="${nbproject.dist.dir}/${nbproject.dist.file.name}"
  236. tofile="${current.file}"/>
  237. <!-- sign the current jar file -->
  238. <if property="jarsigner.enabled" value="true">
  239. <signjar jar="${current.file}"
  240. keystore="${jarsigner.keystore}"
  241. storepass="${jarsigner.storepass}"
  242. alias="${jarsigner.alias}"
  243. maxmemory="${jarsigner.xmx}"/>
  244. </if>
  245. <!-- calculate the metadata for the file -->
  246. <sizeof file="${current.file}" property="product.logic.${i}.size"/>
  247. <md5 file="${current.file}" property="product.logic.${i}.md5"/>
  248. <set property="product.logic.${i}.correct.uri"
  249. value="resource:${product.logic.path}/${product.logic.file.name}"/>
  250. <property
  251. name="start.index"
  252. value="2"/>
  253. </if>
  254. <property name="start.index" value="1"/>
  255. <for-each from="${start.index}"
  256. to="${product.logic.length}"
  257. property="i">
  258. <!-- set the properties relevant to the current file -->
  259. <set
  260. property="current.file"
  261. value="${product.logic.dir}/${product.logic.file.name}"/>
  262. <condition property="product.logic.${i}.is.local" value="true" else="false">
  263. <isset property="product.logic.${i}.path"/>
  264. </condition>
  265. <if property="product.logic.${i}.is.local" value="false">
  266. <set
  267. property="current.uri"
  268. source="product.logic.${i}.uri"/>
  269. <get
  270. src="${current.uri}"
  271. dest="${current.file}"
  272. usetimestamp="true"/>
  273. </if>
  274. <if property="product.logic.${i}.is.local" value="true">
  275. <set
  276. property="current.path"
  277. source="product.logic.${i}.path"/>
  278. <copy
  279. file="${current.path}"
  280. tofile="${current.file}"
  281. preservelastmodified="true"/>
  282. </if>
  283. <!-- sign the current jar file -->
  284. <if property="jarsigner.enabled" value="true">
  285. <signjar
  286. jar="${current.file}"
  287. keystore="${jarsigner.keystore}"
  288. storepass="${jarsigner.storepass}"
  289. alias="${jarsigner.alias}"
  290. maxmemory="${jarsigner.xmx}"/>
  291. </if>
  292. <!-- calculate the metadata for the file -->
  293. <sizeof
  294. file="${current.file}"
  295. property="product.logic.${i}.size"/>
  296. <md5
  297. file="${current.file}"
  298. property="product.logic.${i}.md5"/>
  299. <set
  300. property="product.logic.${i}.correct.uri"
  301. value="resource:${product.logic.path}/${product.logic.file.name}"/>
  302. </for-each>
  303. <!-- fetch and repackage installation data zips -->
  304. <set property="current.product.data.length"
  305. value="${product.data.length}"/>
  306. <for-each from="1" to="${current.product.data.length}" property="i">
  307. <!-- define the path to the current working file and the temporary
  308. directory which should be used for repackaging -->
  309. <set
  310. property="current.zip"
  311. value="${product.data.${i}.zip}"/>
  312. <condition property="product.tar.${i}.is.set" value="true" else="false">
  313. <isset property="product.data.${i}.tar"/>
  314. </condition>
  315. <if property="product.tar.${i}.is.set" value="true">
  316. <set
  317. property="current.tar"
  318. value="${product.data.${i}.tar}"/>
  319. </if>
  320. <if property="product.tar.${i}.is.set" value="false">
  321. <set
  322. property="current.tar"
  323. value="false"/>
  324. </if>
  325. <set
  326. property="current.file"
  327. value="${product.data.dir}/${product.data.file.name}"/>
  328. <set
  329. property="current.temp.dir"
  330. value="${work.dir}/temp"/>
  331. <set
  332. property="current.packaged.data.file"
  333. value="${product.packaged.data.file}"/>
  334. <set
  335. property="current.packaged.data.properties.file"
  336. value="${product.packaged.data.properties.file}"/>
  337. <condition property="do.package.data.${i}" value="true">
  338. <or>
  339. <equals arg1="${package.data}" arg2="true"/>
  340. <and>
  341. <equals
  342. arg1="${package.data}"
  343. arg2="default"/>
  344. <not>
  345. <and>
  346. <available
  347. file="${current.packaged.data.file}"/>
  348. <available
  349. file="${current.packaged.data.properties.file}"/>
  350. </and>
  351. </not>
  352. </and>
  353. </or>
  354. </condition>
  355. <condition property="do.package.data.${i}" value="false">
  356. <or>
  357. <equals arg1="${package.data}" arg2="false"/>
  358. <and>
  359. <equals
  360. arg1="${package.data}"
  361. arg2="default"/>
  362. <available
  363. file="${current.packaged.data.file}"/>
  364. <available
  365. file="${current.packaged.data.properties.file}"/>
  366. </and>
  367. </or>
  368. </condition>
  369. <!-- if the data needs to be packaged -->
  370. <if property="do.package.data.${i}" value="true">
  371. <condition property="product.data.${i}.is.local" value="true" else="false">
  372. <isset property="product.data.${i}.path"/>
  373. </condition>
  374. <if property="product.data.${i}.is.local" value="false">
  375. <set
  376. property="current.uri"
  377. source="product.data.${i}.uri"/>
  378. <uri-to-path
  379. property="current.downloaded.path"
  380. uri="${current.uri}"/>
  381. <set
  382. property="current.download"
  383. value="${downloads.cache.dir}/${current.downloaded.path}"/>
  384. <dirname
  385. property="current.download.${i}.dir"
  386. file="${current.download}"/>
  387. <set
  388. property="current.download.dir"
  389. source="current.download.${i}.dir"/>
  390. <mkdir
  391. dir="${current.download.dir}"/>
  392. <get
  393. src="${current.uri}"
  394. dest="${current.download}"
  395. usetimestamp="true"/>
  396. </if>
  397. <if property="product.data.${i}.is.local" value="true">
  398. <set property="current.download"
  399. source="product.data.${i}.path"/>
  400. </if>
  401. <!-- extract the zip file to a temporary directory, if it's a
  402. zip file, or simply move it there if it is the data we
  403. need -->
  404. <mkdir
  405. dir="${current.temp.dir}"/>
  406. <if property="current.zip" value="true">
  407. <n-unzip
  408. src="${current.download}"
  409. dest="${current.temp.dir}"/>
  410. </if>
  411. <if property="current.tar" value="true">
  412. <n-untar
  413. src="${current.download}"
  414. dest="${current.temp.dir}"/>
  415. </if>
  416. <condition property="do.copy.data.${i}" value="true">
  417. <and>
  418. <not>
  419. <equals arg1="${current.zip}" arg2="true"/>
  420. </not>
  421. <not>
  422. <equals arg1="${current.tar}" arg2="true"/>
  423. </not>
  424. </and>
  425. </condition>
  426. <if property="do.copy.data.${i}" value="true">
  427. <copy file="${current.download}"
  428. todir="${current.temp.dir}"/>
  429. </if>
  430. <!-- call the pre-package hook, to allow derivative scripts to
  431. perform any required operations on the data if they
  432. like -->
  433. <antcall target="-pre-package">
  434. <param name="i" value="${i}"/>
  435. <param name="data.directory" value="${current.temp.dir}"/>
  436. </antcall>
  437. <!-- measure its size and add it to the required disk space -->
  438. <sizeof
  439. file="${current.temp.dir}"
  440. property="current.disk.space"/>
  441. <sum
  442. arg1="${product.disk.space}"
  443. arg2="${current.disk.space}"
  444. property="product.disk.space"/>
  445. <!-- repackage (pack200, jar) and build files list -->
  446. <package
  447. directory="${current.temp.dir}"
  448. file="${current.file}"/>
  449. <!-- if we need to release the packaged data - copy the file
  450. and the original size to the specified directory -->
  451. <if property="release.packaged.data" value="true">
  452. <mkdir
  453. dir="${packaged.data.dir}"/>
  454. <copy file="${current.file}"
  455. tofile="${current.packaged.data.file}"/>
  456. <echo
  457. message="product.data.${i}.size=${current.disk.space}"
  458. file="${current.packaged.data.properties.file}"/>
  459. </if>
  460. <!-- remove the temporary directory -->
  461. <delete dir="${current.temp.dir}"/>
  462. </if>
  463. <!-- if the data does not need to be packaged -->
  464. <if property="do.package.data.${i}" value="false">
  465. <copy
  466. file="${current.packaged.data.file}"
  467. tofile="${current.file}"/>
  468. <!-- fetch the real size data -->
  469. <property
  470. file="${current.packaged.data.properties.file}"/>
  471. <set
  472. property="current.disk.space"
  473. source="product.data.${i}.size"/>
  474. <sum
  475. arg1="${product.disk.space}"
  476. arg2="${current.disk.space}"
  477. property="product.disk.space"/>
  478. </if>
  479. <!-- sign the resulting jar file -->
  480. <if property="jarsigner.enabled" value="true">
  481. <signjar
  482. jar="${current.file}"
  483. keystore="${jarsigner.keystore}"
  484. storepass="${jarsigner.storepass}"
  485. alias="${jarsigner.alias}"
  486. maxmemory="${jarsigner.xmx}"/>
  487. </if>
  488. <!-- calculate the metadata for the file -->
  489. <sizeof
  490. file="${current.file}"
  491. property="product.data.${i}.size"/>
  492. <md5
  493. file="${current.file}"
  494. property="product.data.${i}.md5"/>
  495. <set
  496. property="product.data.${i}.correct.uri"
  497. value="resource:${product.data.path}/${product.data.file.name}"/>
  498. </for-each>
  499. <!-- fetch the icon -->
  500. <set
  501. property="product.icon.file"
  502. value="${package.dir}/${product.icon.path}"/>
  503. <copy
  504. file="${product.icon}"
  505. tofile="${product.icon.file}"/>
  506. <sizeof
  507. file="${product.icon.file}"
  508. property="product.icon.size"/>
  509. <md5
  510. file="${product.icon.file}"
  511. property="product.icon.md5"/>
  512. <set
  513. property="product.icon.correct.uri"
  514. value="${product.icon.uri}"/>
  515. <!-- load product's localizing bundle and generate descriptor -->
  516. <load-locales
  517. basename="${product.bundle}"
  518. list="product.locales.list"/>
  519. <product-descriptor
  520. file="${package.dir}/${package.descriptor.path}"/>
  521. <!-- create the distributive jar file and sign it -->
  522. <set
  523. property="product.dist.file"
  524. value="${dist.dir}/${product.dist.file.name}"/>
  525. <jar basedir="${package.dir}"
  526. destfile="${product.dist.file}"
  527. compress="true">
  528. <manifest>
  529. <attribute
  530. name="Product-Descriptor"
  531. value="${package.descriptor.path}"/>
  532. </manifest>
  533. </jar>
  534. <if property="jarsigner.enabled" value="true">
  535. <signjar
  536. jar="${product.dist.file}"
  537. keystore="${jarsigner.keystore}"
  538. storepass="${jarsigner.storepass}"
  539. alias="${jarsigner.alias}"
  540. maxmemory="${jarsigner.xmx}"/>
  541. </if>
  542. </target>
  543. <!--
  544. Builds the engine.
  545. It runs the 'build-all' target on the engine's build script.
  546. This target is only executed if the the ${build.engine} property was
  547. set to 'true'.
  548. This target is not intended to be called directly.
  549. -->
  550. <target name="-build-engine" depends="init" if="do.build.engine">
  551. <exec executable="${ant.executable}"
  552. dir="${engine.dir}"
  553. failonerror="true"
  554. failifexecutionfails="true">
  555. <arg value="checkout,build"/>
  556. <arg value="-Dwork.dir=${engine.work.dir}"/>
  557. <arg value="-Ddist.dir=${engine.dist.dir}"/>
  558. <arg value="-Dbuild.native=false"/>
  559. <arg value="-Ddont.build.custom.tasks=true"/>
  560. <arg value="-Dcustom.tasks.cls=${custom.tasks.cls}"/>
  561. <arg value="-Dengine.dist.file.name=${engine.dist.file.name}"/>
  562. <arg value="-Denvironment.properties=${environment.properties}"/>
  563. </exec>
  564. </target>
  565. <!--
  566. An empty hook.
  567. It allows derivative scripts to perform arbitrary manipulations on the
  568. data prior to it getting packaged. E.g. the netbeans ide build script
  569. might want to remove the 'netbeans' directory and move its contents up one
  570. level.
  571. A special property - 'data.directory' will be set pointing to the
  572. unzipped data.
  573. This target is not intended to be called directly.
  574. -->
  575. <target name="-pre-package"/>
  576. <!-- ============================================================================
  577. Release
  578. ============================================================================= -->
  579. <!--
  580. Releases the product package to the registries server.
  581. This target overrides the '-release' target in common.xml, providing the
  582. custom functionality that is required for correctly releasing the product
  583. package.
  584. It is assumed that the product package has already been built, but a
  585. dependency on the 'build' target is not defined, as it may be desirable
  586. to build once and then release several times to different registries
  587. servers.
  588. This target is not intended to be called directly.
  589. -->
  590. <target name="-release">
  591. <if property="release.to.server" value="true">
  592. <echo message="Release URL is ${release.url}"/>
  593. <echo message="Archive is ${product.dist.file}"/>
  594. <release-package-server
  595. url="${release.url}"
  596. registry="${release.registry}"
  597. uid="${release.parent.uid}"
  598. version="${release.parent.version}"
  599. platforms="${product.platforms}"
  600. archive="${product.dist.file}"/>
  601. </if>
  602. <if property="release.to.server" value="false">
  603. <echo message="Registry root is ${release.registry.dir}"/>
  604. <echo message="Archive is ${product.dist.file}"/>
  605. <release-package-filesystem
  606. root="${release.registry.dir}"
  607. uid="${release.parent.uid}"
  608. version="${release.parent.version}"
  609. platforms="${product.platforms}"
  610. archive="${product.dist.file}"/>
  611. </if>
  612. </target>
  613. <!-- ============================================================================
  614. Default
  615. ============================================================================= -->
  616. <!--
  617. The default target.
  618. Does nothing except printing the usage information.
  619. -->
  620. <target name="usage">
  621. <echo>
  622. This is the base build script for nbi product package and is not
  623. intended to be called directly. In order to create a derivative
  624. implementation script, see
  625. ${basedir}/.templates/product-template.xml
  626. </echo>
  627. </target>
  628. </project>