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}">
195 <pathelement location="${main.dir}/nbbuild/nbantext.jar"/>
196 <fileset dir="${main.dir}">
197 <include name="apisupport.harness/external/jsearch*.jar"/>
199 <fileset dir="${netbeans.dest.dir}">
200 <include name="harness/jsearch*.jar"/>
204 <repeat target="copy-docs-for-locale" name="one.locale" values="${locales}"/>
207 <target name="copy-docs-for-locale" if="one.locale">
208 <copy todir="${dist.dir}" flatten="true">
210 <include name="*/other/ide.branding/release-toplevel/*_${one.locale}.html"/>
213 <copy todir="${dist.dir}/nb" flatten="true">
215 <include name="*/other/ide.branding/release/*_${one.locale}.pdf"/>
220 <target name="build-community-nbms" depends="bootstrap,init-tasks">
221 <taskdef name="repeat" classname="org.netbeans.nbbuild.Repeat"
222 classpath="${main.dir}/nbbuild/nbantext.jar"/>
224 <pathconvert property="dlocales" setonempty="false">
225 <path path="${locales}"/>
228 <replacestring from="," to="_"/>
229 <replacestring from="-" to="_"/>
235 <property name="netbeans.dest.dir.ml" location="nbms/community/${dlocales}"/>
236 <mkdir dir="${netbeans.dest.dir.ml}"/>
238 <property name="netbeans.build.dir.ml" location="build/community"/>
239 <delete dir="${netbeans.build.dir.ml}"/>
240 <mkdir dir="${netbeans.build.dir.ml}"/>
243 <format property="spec.version" pattern="yyyy.M.d.kmm" locale="en" />
245 <delete file="build/ml/cluster-nbms-ml.properties"/>
247 <pathconvert property="base.dir" pathsep=",">
249 <pathelement location="dist"/>
253 <echo>Base dir: ${base.dir}</echo>
255 <pathconvert property="comm.clusters.list" pathsep=",">
257 <dirset dir="dist" id="cluster.dirs">
259 <exclude name="nb*.*"/>
262 <map from="${base.dir}/" to=""/>
265 <echo>Cluster dirs: ${comm.clusters.list}</echo>
266 <condition property="is.localized" value="true">
268 <equals arg1="${comm.clusters.list}" arg2="" trim="true"/>
271 <echo>IS localized: ${is.localized}</echo>
273 <antcall target="build-all-nbm-ml"/>
276 <target name="build-all-nbm-ml" if="is.localized">
277 <repeat target="build-one-nbm-ml" name="one.cluster.dir.ml" values="${comm.clusters.list}"/>
278 <antcall target="build-one-nbm-ml" inheritall="false">
279 <param name="is.kit" value="true"/>
280 <param name="locales" value="${locales}"/>
281 <param name="dlocales" value="${dlocales}"/>
282 <param name="one.cluster.dir.ml" value="nb6.7"/>
283 <param name="nb.cluster.nb" value="${nb.cluster.nb}"/>
284 <param name="comm.clusters.list" value="${comm.clusters.list}"/>
285 <param name="spec.version" value="${spec.version}"/>
286 <param name="netbeans.dest.dir.ml" value="${netbeans.dest.dir.ml}"/>
287 <param name="netbeans.build.dir.ml" value="${netbeans.build.dir.ml}"/>
288 <param name="buildnumber" value="${buildnumber}"/>
293 <target name="-create-cluster-ml-nbm-metadata" unless="is.kit">
294 <echo file="build/ml/nbms/tmp/manifest.mf">OpenIDE-Module: ${code.name}
295 OpenIDE-Module-Localizing-Bundle: ${code.name.base.slashes}/Bundle.properties
296 OpenIDE-Module-Specification-Version: ${spec.version}
298 <echo file="build/ml/nbms/classes/${code.name.base.slashes}/Bundle.properties">
299 OpenIDE-Module-Name=NetBeans 6.7 ${one.cluster.dir.ml} cluster localization (${locales})
300 OpenIDE-Module-Display-Category=Localization
301 OpenIDE-Module-Short-Description=NetBeans 6.7 ${one.cluster.dir.ml} cluster localization (${locales})
302 OpenIDE-Module-Long-Description=Delivers ${locales} localization for all modules in ${one.cluster.dir.ml} cluster of NetBeans 6.7
306 <target name="-prepare-localizing-bundles" if="one.kit.locale">
307 <echo file="build/ml/nbms/classes/${code.name.base.slashes}/Bundle_${one.kit.locale}.properties">
308 OpenIDE-Module-Name=NetBeans 6.7 ${one.kit.locale} localization plugin
309 OpenIDE-Module-Display-Category=Localization
310 OpenIDE-Module-Short-Description=NetBeans 6.7 ${one.kit.locale} localization plugin
311 OpenIDE-Module-Long-Description=Delivers ${one.kit.locale} localization of whole NetBeans 6.7
313 <!-- try to look for Bundle properties file provided by translation team -->
314 <copy file="l10n_uc_kits/${code.name.base.slashes}/../${one.kit.locale}/Bundle.properties"
315 tofile="build/ml/nbms/classes/${code.name.base.slashes}/Bundle_${one.kit.locale}.properties"
317 failonerror="false"/>
318 <!-- enforce display category to be "Localization", the same for all umbrella kit NBMs -->
319 <propertyfile file="build/ml/nbms/classes/${code.name.base.slashes}/Bundle_${one.kit.locale}.properties">
320 <entry key="OpenIDE-Module-Display-Category" value="Localization"/>
324 <target name="-create-kit-ml-nbm-metadata" if="is.kit">
325 <echo file="build/ml/nbms/tmp/manifest.mf">OpenIDE-Module: ${code.name}
326 OpenIDE-Module-Localizing-Bundle: ${code.name.base.slashes}/Bundle.properties
327 OpenIDE-Module-Specification-Version: ${spec.version}
328 OpenIDE-Module-Module-Dependencies: ${kit.deps}
330 <!-- prepare localization jarfiles - it's just for localized info.xml files inf NBMs -->
332 <repeat target="-prepare-localizing-bundles" name="one.kit.locale" values="${locales}"/>
333 <property name="locjar.locales" value="${locales}"/>
334 <locjar jarfile="${cluster}/${module.jar}"
335 basedir="build/ml/nbms/classes"
338 <fileset dir="build/ml/nbms/classes/${code.name.base.slashes}" includes="Bundle_*.properties"/>
342 <!-- create default Bundle properties -->
343 <echo file="build/ml/nbms/classes/${code.name.base.slashes}/Bundle.properties">
344 OpenIDE-Module-Name=NetBeans 6.7 ${locales} localization kit
345 OpenIDE-Module-Display-Category=Localization
346 OpenIDE-Module-Short-Description=NetBeans 6.7 ${locales} localization kit
347 OpenIDE-Module-Long-Description=Delivers ${locales} localization of whole NetBeans 6.7
349 <!-- try to look for Bundle properties file provided by translation team -->
350 <copy file="../translatedfiles/src/nbbuild/${code.name.base.slashes}/Bundle.properties"
351 tofile="build/ml/nbms/classes/${code.name.base.slashes}/Bundle.properties"
353 failonerror="false"/>
354 <!-- enforce display category to be "Localization", the same for all umbrella kit NBMs -->
355 <propertyfile file="build/ml/nbms/classes/${code.name.base.slashes}/Bundle.properties">
356 <entry key="OpenIDE-Module-Display-Category" value="Localization"/>
360 <target name="-check-ml-nbm-props">
361 <condition property="run.ml.nbm.build" value="true">
363 <isset property="locales"/>
364 <isset property="dlocales"/>
365 <isset property="one.cluster.dir.ml"/>
366 <isset property="comm.clusters.list"/>
367 <isset property="spec.version"/>
368 <isset property="netbeans.dest.dir.ml"/>
369 <isset property="netbeans.build.dir.ml"/>
374 <target name="build-one-nbm-ml" depends="init-tasks,-check-ml-nbm-props" if="run.ml.nbm.build">
375 <property file="build/ml/cluster-nbms-ml.properties"/>
377 <echo>Cluster dir: ${one.cluster.dir.ml}</echo>
379 <pathconvert property="cluster.package.dir" setonempty="false">
380 <path path="${one.cluster.dir.ml}"/>
383 <replacestring from="," to="_"/>
384 <replacestring from="-" to="_"/>
385 <replacestring from="." to="_"/>
390 <property name="cluster" location="${netbeans.build.dir.ml}/${one.cluster.dir.ml}"/>
392 <delete dir="build/ml/nbms"/>
393 <delete dir="${netbeans.build.dir.ml}"/>
394 <mkdir dir="${netbeans.build.dir.ml}/${one.cluster.dir.ml}"/>
395 <copy todir="${netbeans.build.dir.ml}/${one.cluster.dir.ml}">
396 <fileset dir="dist/${one.cluster.dir.ml}"/>
399 <condition property="code.name.base" value="org.netbeans.localization.${cluster.package.dir}.${dlocales}">
401 <isset property="is.kit"/>
404 <condition property="code.name.base" value="org.netbeans.localization.kit.${cluster.package.dir}.${dlocales}">
405 <isset property="is.kit"/>
408 <pathconvert property="code.name.base.slashes" setonempty="false">
409 <path path="${code.name.base}"/>
413 <replacestring from="." to="/"/>
417 <pathconvert property="code.name.base.dashes" setonempty="false">
418 <path path="${code.name.base}"/>
422 <replacestring from="." to="-"/>
426 <property name="public.packages" value="${code.name.base}.*"/>
427 <property name="code.name" value="${code.name.base}/1"/>
428 <mkdir dir="build/ml/nbms/classes/${code.name.base.slashes}"/>
429 <mkdir dir="build/ml/nbms/tmp"/>
430 <antcall target="-create-cluster-ml-nbm-metadata"/>
431 <antcall target="-create-kit-ml-nbm-metadata"/>
432 <property name="is.autoload" value="false"/>
433 <property name="is.eager" value="false"/>
434 <condition property="module.jar.dir" value="modules">
435 <!-- set module.jar.dir property only when building kit NBM - leads to AutoUpdate-Show-In-Client manifest attribute is set to true -->
436 <isset property="is.kit"/>
438 <property name="module.jar" value="modules/${code.name.base.dashes}.jar"/> <mkdir dir="${cluster}/modules"/>
439 <jarwithmoduleattributes jarfile="${cluster}/${module.jar}"
440 compress="${build.package.compress}"
441 index="${build.package.index}"
442 manifest="build/ml/nbms/tmp/manifest.mf">
443 <fileset dir="build/ml/nbms/classes"/>
444 </jarwithmoduleattributes>
445 <createmodulexml xmldir="${cluster}/config/Modules">
446 <enabled dir="${cluster}">
447 <include name="${module.jar}"/>
450 <patternset id="module.files">
451 <!-- include name="${module.jar}"/ -->
452 <include name="**/*.jar"/>
453 <include name="config/Modules/${code.name.base.dashes}.xml"/>
455 <property name="module.files.toString" refid="module.files"/>
456 <echo level="verbose">Basic matching module files (${code.name.base.dashes}): ${module.files.toString}</echo>
457 <genlist outputfiledir="${cluster}" module="${module.jar}">
458 <fileset dir="${cluster}">
459 <patternset refid="module.files"/>
462 <property name="license.file.override" location="build/ml/nbms/license"/>
463 <property name="extra.license.files" value=""/>
464 <taskdef name="releasefileslicense" classname="org.netbeans.nbbuild.extlibs.ReleaseFilesLicense" classpath="${nb_all}/nbbuild/nbantext.jar"/>
465 <releasefileslicense license="${license.file.override}" standardlicense="${nb_all}/nbbuild/standard-nbm-license.txt" extralicensefiles="${extra.license.files}"/>
466 <taskdef name="makenbm" classname="org.netbeans.nbbuild.MakeNBM" classpath="${nb_all}/nbbuild/nbantext.jar"/>
467 <property name="nbm_alias" value="nb_ide"/>
468 <makenbm file="build/ml/${code.name.base.dashes}.nbm"
469 productdir="${cluster}"
470 module="${module.jar}"
471 homepage="http://translatedfiles.netbeans.org/"
472 distribution="http://translatedfiles.netbeans.org/"
475 targetcluster="${one.cluster.dir.ml}"
478 <license file="${license.file.override}"/>
479 <signature keystore="${keystore}" storepass="${storepass}" alias="${nbm_alias}"/>
481 <move todir="${netbeans.dest.dir.ml}" file="build/ml/${code.name.base.dashes}.nbm"/>
482 <property file="build/ml/cluster-nbms-ml.properties"/>
483 <condition property="new.kit.deps" value="${code.name} > ${spec.version}">
486 <isset property="kit.deps"/>
489 <isset property="is.kit"/>
493 <condition property="new.kit.deps" value="${kit.deps},${code.name} > ${spec.version}">
495 <isset property="kit.deps"/>
497 <isset property="is.kit"/>
501 <condition property="new.kit.deps" value="${kit.deps}">
502 <isset property="is.kit"/>
504 <propertyfile file="build/ml/cluster-nbms-ml.properties">
505 <entry key="kit.deps" value="${new.kit.deps}"/>