1 <?xml version="1.0" encoding="UTF-8"?>
3 DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
5 Copyright 1997-2008 Sun Microsystems, Inc. All rights reserved.
8 The contents of this file are subject to the terms of either the GNU
9 General Public License Version 2 only ("GPL") or the Common
10 Development and Distribution License("CDDL") (collectively, the
11 "License"). You may not use this file except in compliance with the
12 License. You can obtain a copy of the License at
13 http://www.netbeans.org/cddl-gplv2.html
14 or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
15 specific language governing permissions and limitations under the
16 License. When distributing the software, include this License Header
17 Notice in each file and include the License file at
18 nbbuild/licenses/CDDL-GPL-2-CP. Sun designates this
19 particular file as subject to the "Classpath" exception as provided
20 by Sun in the GPL Version 2 section of the License file that
21 accompanied this code. If applicable, add the following below the
22 License Header, with the fields enclosed by brackets [] replaced by
23 your own identifying information:
24 "Portions Copyrighted [year] [name of copyright owner]"
28 The Original Software is NetBeans. The Initial Developer of the Original
29 Software is Sun Microsystems, Inc. Portions Copyright 1997-2008 Sun
30 Microsystems, Inc. All Rights Reserved.
32 If you wish your version of this file to be governed by only the CDDL
33 or only the GPL Version 2, indicate your decision by adding
34 "[Contributor] elects to include this software in this distribution
35 under the [CDDL or GPL Version 2] license." If you do not indicate a
36 single choice of license, a recipient has the option to distribute
37 your version of this file under either the CDDL, the GPL Version 2 or
38 to extend the choice of license to its licensees as provided above.
39 However, if you add GPL Version 2 code and therefore, elected the GPL
40 Version 2 license, then the option applies only if the new code is
41 made subject to such option by the copyright holder.
44 <!ENTITY links SYSTEM "javadoctools/links.xml">
45 <!ENTITY properties SYSTEM "javadoctools/properties.xml">
46 <!ENTITY replaces SYSTEM "javadoctools/replaces.xml">
47 <!ENTITY disallowed-links SYSTEM "javadoctools/disallowed-links.xml">
50 <project name="ml-build" default="build" basedir=".">
51 <import file="../nbbuild/default.xml"/>
53 <target name="assure-ant">
54 <fail message="You need Ant version 1.7.0 or later to build NetBeans.">
57 <antversion atleast="1.7.0"/>
63 <!-- Fallback for ant.core.lib - it is not set in some cases - 124554 -->
64 <available property="ant.core.lib" value="${ant.home}/lib/ant.jar" file="${ant.home}/lib/ant.jar"/>
65 <!-- if the previous location is not correct than find the ant.jar from the java.class.path value -->
66 <pathconvert property="ant.core.lib">
67 <mapper type="regexp" from="${path.separator}([^${path.separator}]*ant.jar)${path.separator}" to="\1"/>
68 <path location="${path.separator}${java.class.path}${path.separator}"/>
71 <target name="bootstrap"
72 description="Bootstrap NetBeans-specific Ant extensions."
74 <property file="build.properties"/>
75 <property name="main.dir" location=".."/>
76 <property name="jh.jar" value="apisupport.harness/external/jsearch*.jar"/>
77 <property name="jsearch.jar" value="javahelp/external/jh*.jar"/>
79 <mkdir dir="build/antclasses"/>
80 <echo message="Bootstrapping NetBeans-specific Ant extensions..."/>
81 <path id="bootstrap-cp">
82 <pathelement location="${ant.core.lib}"/>
83 <fileset dir="${main.dir}">
84 <!-- For JavaHelp indexing: -->
85 <include name="${jh.jar}"/>
86 <!-- For JavaHelp link checking: -->
87 <include name="${jsearch.jar}"/>
88 <include name="nbbuild/nbantext.jar"/>
91 <!-- Sanity check: -->
92 <pathconvert pathsep=":" property="class.files.in.antsrc">
94 <fileset dir="antsrc">
95 <include name="**/*.class"/>
102 <equals arg1="${class.files.in.antsrc}" arg2=""/>
105 You have stray *.class files in ${basedir}/antsrc which you must remove.
106 Probably you failed to clean your sources before updating. Try: ant hg-clean
108 <!-- OK, continue: -->
109 <javac srcdir="antsrc" destdir="build/antclasses" deprecation="true" debug="true" source="1.5" target="1.5">
110 <classpath refid="bootstrap-cp"/>
111 <compilerarg line="-Xlint -Xlint:-serial"/>
113 <jar jarfile="l10nantext.jar">
114 <fileset dir="build/antclasses"/>
115 <fileset dir="antsrc">
116 <exclude name="**/*.java"/>
117 <exclude name="**/package.html"/>
118 <exclude name="package-list"/>
123 <target name="-hg-check-can-clean">
124 <available property="can.hg.clean" type="dir" file="../.hg"/>
126 <target name="-hg-clean-alternative" depends="-hg-check-can-clean" unless="can.hg.clean">
127 <antcall target="-real-clean"/>
129 <target name="hg-clean" depends="-hg-clean-alternative" if="can.hg.clean"
130 description="Clean everything possible.">
131 <antcall target="-do-hg-clean">
132 <!-- <include name="."/> does not seem to work in a dirset -->
133 <param name="basedir" location="."/>
136 <target name="-do-hg-clean">
137 <echo>Cleaning untracked files in ${basedir}...</echo>
138 <exec executable="hg" failonerror="yes" outputproperty="hg.unknown.files">
141 <arg value="status"/>
142 <arg value="--unknown"/>
143 <arg value="--no-status"/>
145 <fail message="Will not run clean; checkout contains unknown and not ignored files (did you forget to hg add?): ${hg.unknown.files}">
148 <equals arg1="${hg.unknown.files}" arg2=""/>
152 <exec executable="hg" failonerror="yes">
155 <arg value="--config"/>
156 <arg value="extensions.purge="/>
157 <arg value="--verbose"/>
160 <arg value="--exclude"/>
161 <!-- Do not use **/nbproject/private/ as this will match some test/{results,work} dirs: -->
162 <arg value="glob:{*/nbproject/private/**,*/*/nbproject/private/**,**/user.build.properties,nbbuild/misc/build-site-local.sh}"/>
166 <target name="build" depends="bootstrap">
167 <taskdef name="jhindexer"
168 classname="org.netbeans.nbbuild.JHIndexer"
169 classpath="${main.dir}/nbbuild/nbantext.jar"/>
170 <taskdef name="locjhindexer"
171 classname="org.netbeans.nbbuild.LocJHIndexer"
172 classpath="${main.dir}/nbbuild/nbantext.jar"/>
173 <taskdef name="repeat"
174 classname="org.netbeans.nbbuild.Repeat"
175 classpath="${main.dir}/nbbuild/nbantext.jar"/>
177 <property name="locjhindexer.jhall" value="${main.dir}/${jh.jar}"/>
178 <property name="locales" value="ja,zh_CN,pt_BR"/>
179 <property name="dist.dir" location="dist"/>
180 <property name="nbms.dist.dir" location="nbms"/>
181 <property name="nbms.dir" location="../nbbuild/nbms"/>
182 <property name="keystore" location=""/>
183 <property name="storepass" value=""/>
184 <property name="nbm_alias" value="nb_ide"/>
186 <taskdef name="package-build" classname="org.netbeans.l10n.Package">
188 <pathelement path="l10nantext.jar"/>
189 <pathelement path="${main.dir}/nbbuild/nbantext.jar"/>
192 <package-build src="src" locales="${locales}" dist="${dist.dir}" nbms="${nbms.dir}" nbmsDist="${nbms.dist.dir}"
193 keystore="${keystore}" storepass="${storepass}" alias="${nbm_alias}"/>
194 <repeat target="copy-docs-for-locale" name="one.locale" values="${locales}"/>
197 <target name="copy-docs-for-locale" if="one.locale">
198 <copy todir="${dist.dir}" flatten="true">
200 <include name="*/other/ide.branding/release-toplevel/*_${one.locale}.html"/>
203 <copy todir="${dist.dir}/nb6.5" flatten="true">
205 <include name="*/other/ide.branding/release/*_${one.locale}.pdf"/>
210 <target name="build-community-nbms" depends="bootstrap,init-tasks">
211 <taskdef name="repeat" classname="org.netbeans.nbbuild.Repeat"
212 classpath="${main.dir}/nbbuild/nbantext.jar"/>
214 <pathconvert property="dlocales" setonempty="false">
215 <path path="${locales}"/>
218 <replacestring from="," to="_"/>
219 <replacestring from="-" to="_"/>
225 <property name="netbeans.dest.dir.ml" location="nbms/community/${dlocales}"/>
226 <mkdir dir="${netbeans.dest.dir.ml}"/>
228 <property name="netbeans.build.dir.ml" location="build/community"/>
229 <delete dir="${netbeans.build.dir.ml}"/>
230 <mkdir dir="${netbeans.build.dir.ml}"/>
233 <format property="spec.version" pattern="yyyy.M.d.kmm" locale="en" />
235 <delete file="build/ml/cluster-nbms-ml.properties"/>
237 <pathconvert property="base.dir" pathsep=",">
239 <pathelement location="dist"/>
243 <echo>Base dir: ${base.dir}</echo>
245 <pathconvert property="comm.clusters.list" pathsep=",">
247 <dirset dir="dist" id="cluster.dirs">
249 <exclude name="nb*.*"/>
252 <map from="${base.dir}/" to=""/>
255 <echo>Cluster dirs: ${comm.clusters.list}</echo>
256 <condition property="is.localized" value="true">
258 <equals arg1="${comm.clusters.list}" arg2="" trim="true"/>
261 <echo>IS localized: ${is.localized}</echo>
263 <mkdir dir="dist/nb6.5"/>
264 <antcall target="build-all-nbm-ml"/>
267 <target name="build-all-nbm-ml" if="is.localized">
268 <repeat target="build-one-nbm-ml" name="one.cluster.dir.ml" values="${comm.clusters.list}"/>
269 <antcall target="build-one-nbm-ml" inheritall="false">
270 <param name="is.kit" value="true"/>
271 <param name="locales" value="${locales}"/>
272 <param name="dlocales" value="${dlocales}"/>
273 <param name="one.cluster.dir.ml" value="nb6.5"/>
274 <param name="nb.cluster.nb" value="${nb.cluster.nb}"/>
275 <param name="comm.clusters.list" value="${comm.clusters.list}"/>
276 <param name="spec.version" value="${spec.version}"/>
277 <param name="netbeans.dest.dir.ml" value="${netbeans.dest.dir.ml}"/>
278 <param name="netbeans.build.dir.ml" value="${netbeans.build.dir.ml}"/>
279 <param name="buildnumber" value="${buildnumber}"/>
284 <target name="-create-cluster-ml-nbm-metadata" unless="is.kit">
285 <echo file="build/ml/nbms/tmp/manifest.mf">OpenIDE-Module: ${code.name}
286 OpenIDE-Module-Localizing-Bundle: ${code.name.base.slashes}/Bundle.properties
287 OpenIDE-Module-Specification-Version: ${spec.version}
289 <echo file="build/ml/nbms/classes/${code.name.base.slashes}/Bundle.properties">
290 OpenIDE-Module-Name=NetBeans 6.5 ${one.cluster.dir.ml} cluster localization (${locales})
291 OpenIDE-Module-Display-Category=Localization
292 OpenIDE-Module-Short-Description=NetBeans 6.5 ${one.cluster.dir.ml} cluster localization (${locales})
293 OpenIDE-Module-Long-Description=Delivers ${locales} localization for all modules in ${one.cluster.dir.ml} cluster of NetBeans 6.5
297 <target name="-prepare-localizing-bundles" if="one.kit.locale">
298 <echo file="build/ml/nbms/classes/${code.name.base.slashes}/Bundle_${one.kit.locale}.properties">
299 OpenIDE-Module-Name=NetBeans 6.5 ${one.kit.locale} localization plugin
300 OpenIDE-Module-Display-Category=Localization
301 OpenIDE-Module-Short-Description=NetBeans 6.5 ${one.kit.locale} localization plugin
302 OpenIDE-Module-Long-Description=Delivers ${one.kit.locale} localization of whole NetBeans 6.5
304 <!-- try to look for Bundle properties file provided by translation team -->
305 <copy file="l10n_uc_kits/${code.name.base.slashes}/../${one.kit.locale}/Bundle.properties"
306 tofile="build/ml/nbms/classes/${code.name.base.slashes}/Bundle_${one.kit.locale}.properties"
308 failonerror="false"/>
309 <!-- enforce display category to be "Localization", the same for all umbrella kit NBMs -->
310 <propertyfile file="build/ml/nbms/classes/${code.name.base.slashes}/Bundle_${one.kit.locale}.properties">
311 <entry key="OpenIDE-Module-Display-Category" value="Localization"/>
315 <target name="-create-kit-ml-nbm-metadata" if="is.kit">
316 <echo file="build/ml/nbms/tmp/manifest.mf">OpenIDE-Module: ${code.name}
317 OpenIDE-Module-Localizing-Bundle: ${code.name.base.slashes}/Bundle.properties
318 OpenIDE-Module-Specification-Version: ${spec.version}
319 OpenIDE-Module-Module-Dependencies: ${kit.deps}
321 <!-- prepare localization jarfiles - it's just for localized info.xml files inf NBMs -->
323 <repeat target="-prepare-localizing-bundles" name="one.kit.locale" values="${locales}"/>
324 <property name="locjar.locales" value="${locales}"/>
325 <locjar jarfile="${cluster}/${module.jar}"
326 basedir="build/ml/nbms/classes"
329 <fileset dir="build/ml/nbms/classes/${code.name.base.slashes}" includes="Bundle_*.properties"/>
333 <!-- create default Bundle properties -->
334 <echo file="build/ml/nbms/classes/${code.name.base.slashes}/Bundle.properties">
335 OpenIDE-Module-Name=NetBeans 6.5 ${locales} localization kit
336 OpenIDE-Module-Display-Category=Localization
337 OpenIDE-Module-Short-Description=NetBeans 6.5 ${locales} localization kit
338 OpenIDE-Module-Long-Description=Delivers ${locales} localization of whole NetBeans 6.5
340 <!-- try to look for Bundle properties file provided by translation team -->
341 <copy file="../translatedfiles/src/nbbuild/${code.name.base.slashes}/Bundle.properties"
342 tofile="build/ml/nbms/classes/${code.name.base.slashes}/Bundle.properties"
344 failonerror="false"/>
345 <!-- enforce display category to be "Localization", the same for all umbrella kit NBMs -->
346 <propertyfile file="build/ml/nbms/classes/${code.name.base.slashes}/Bundle.properties">
347 <entry key="OpenIDE-Module-Display-Category" value="Localization"/>
351 <target name="-check-ml-nbm-props">
352 <condition property="run.ml.nbm.build" value="true">
354 <isset property="locales"/>
355 <isset property="dlocales"/>
356 <isset property="one.cluster.dir.ml"/>
357 <isset property="comm.clusters.list"/>
358 <isset property="spec.version"/>
359 <isset property="netbeans.dest.dir.ml"/>
360 <isset property="netbeans.build.dir.ml"/>
365 <target name="build-one-nbm-ml" depends="init-tasks,-check-ml-nbm-props" if="run.ml.nbm.build">
366 <property file="build/ml/cluster-nbms-ml.properties"/>
368 <echo>Cluster dir: ${one.cluster.dir.ml}</echo>
370 <pathconvert property="cluster.package.dir" setonempty="false">
371 <path path="${one.cluster.dir.ml}"/>
374 <replacestring from="," to="_"/>
375 <replacestring from="-" to="_"/>
376 <replacestring from="." to="_"/>
381 <property name="cluster" location="${netbeans.build.dir.ml}/${one.cluster.dir.ml}"/>
383 <delete dir="build/ml/nbms"/>
384 <delete dir="${netbeans.build.dir.ml}"/>
385 <mkdir dir="${netbeans.build.dir.ml}/${one.cluster.dir.ml}"/>
386 <copy todir="${netbeans.build.dir.ml}/${one.cluster.dir.ml}">
387 <fileset dir="dist/${one.cluster.dir.ml}"/>
390 <condition property="code.name.base" value="org.netbeans.localization.${cluster.package.dir}.${dlocales}">
392 <isset property="is.kit"/>
395 <condition property="code.name.base" value="org.netbeans.localization.kit.${cluster.package.dir}.${dlocales}">
396 <isset property="is.kit"/>
399 <pathconvert property="code.name.base.slashes" setonempty="false">
400 <path path="${code.name.base}"/>
404 <replacestring from="." to="/"/>
408 <pathconvert property="code.name.base.dashes" setonempty="false">
409 <path path="${code.name.base}"/>
413 <replacestring from="." to="-"/>
417 <property name="public.packages" value="${code.name.base}.*"/>
418 <property name="code.name" value="${code.name.base}/1"/>
419 <mkdir dir="build/ml/nbms/classes/${code.name.base.slashes}"/>
420 <mkdir dir="build/ml/nbms/tmp"/>
421 <antcall target="-create-cluster-ml-nbm-metadata"/>
422 <antcall target="-create-kit-ml-nbm-metadata"/>
423 <property name="is.autoload" value="false"/>
424 <property name="is.eager" value="false"/>
425 <condition property="module.jar.dir" value="modules">
426 <!-- set module.jar.dir property only when building kit NBM - leads to AutoUpdate-Show-In-Client manifest attribute is set to true -->
427 <isset property="is.kit"/>
429 <property name="module.jar" value="modules/${code.name.base.dashes}.jar"/> <mkdir dir="${cluster}/modules"/>
430 <jarwithmoduleattributes jarfile="${cluster}/${module.jar}"
431 compress="${build.package.compress}"
432 index="${build.package.index}"
433 manifest="build/ml/nbms/tmp/manifest.mf">
434 <fileset dir="build/ml/nbms/classes"/>
435 </jarwithmoduleattributes>
436 <createmodulexml xmldir="${cluster}/config/Modules">
437 <enabled dir="${cluster}">
438 <include name="${module.jar}"/>
441 <patternset id="module.files">
442 <!-- include name="${module.jar}"/ -->
443 <include name="**/*.jar"/>
444 <include name="config/Modules/${code.name.base.dashes}.xml"/>
446 <property name="module.files.toString" refid="module.files"/>
447 <echo level="verbose">Basic matching module files (${code.name.base.dashes}): ${module.files.toString}</echo>
448 <genlist outputfiledir="${cluster}" module="${module.jar}">
449 <fileset dir="${cluster}">
450 <patternset refid="module.files"/>
453 <property name="license.file.override" location="build/ml/nbms/license"/>
454 <property name="extra.license.files" value=""/>
455 <taskdef name="releasefileslicense" classname="org.netbeans.nbbuild.extlibs.ReleaseFilesLicense" classpath="${nb_all}/nbbuild/nbantext.jar"/>
456 <releasefileslicense license="${license.file.override}" standardlicense="${nb_all}/nbbuild/standard-nbm-license.txt" extralicensefiles="${extra.license.files}"/>
457 <taskdef name="makenbm" classname="org.netbeans.nbbuild.MakeNBM" classpath="${nb_all}/nbbuild/nbantext.jar"/>
458 <property name="nbm_alias" value="nb_ide"/>
459 <makenbm file="build/ml/${code.name.base.dashes}.nbm"
460 productdir="${cluster}"
461 module="${module.jar}"
462 homepage="http://translatedfiles.netbeans.org/"
463 distribution="http://translatedfiles.netbeans.org/"
466 targetcluster="${one.cluster.dir.ml}"
469 <license file="${license.file.override}"/>
470 <signature keystore="${keystore}" storepass="${storepass}" alias="${nbm_alias}"/>
472 <move todir="${netbeans.dest.dir.ml}" file="build/ml/${code.name.base.dashes}.nbm"/>
473 <property file="build/ml/cluster-nbms-ml.properties"/>
474 <condition property="new.kit.deps" value="${code.name} > ${spec.version}">
477 <isset property="kit.deps"/>
480 <isset property="is.kit"/>
484 <condition property="new.kit.deps" value="${kit.deps},${code.name} > ${spec.version}">
486 <isset property="kit.deps"/>
488 <isset property="is.kit"/>
492 <condition property="new.kit.deps" value="${kit.deps}">
493 <isset property="is.kit"/>
495 <propertyfile file="build/ml/cluster-nbms-ml.properties">
496 <entry key="kit.deps" value="${new.kit.deps}"/>