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=".">
52 <import file="../nbbuild/default.xml"/>
54 <target name="assure-ant">
55 <fail message="You need Ant version 1.7.0 or later to build NetBeans.">
58 <antversion atleast="1.7.0"/>
64 <!-- Fallback for ant.core.lib - it is not set in some cases - 124554 -->
65 <available property="ant.core.lib" value="${ant.home}/lib/ant.jar" file="${ant.home}/lib/ant.jar"/>
66 <!-- if the previous location is not correct than find the ant.jar from the java.class.path value -->
67 <pathconvert property="ant.core.lib">
68 <mapper type="regexp" from="${path.separator}([^${path.separator}]*ant.jar)${path.separator}" to="\1"/>
69 <path location="${path.separator}${java.class.path}${path.separator}"/>
72 <target name="bootstrap"
73 description="Bootstrap NetBeans-specific Ant extensions."
75 <property file="build.properties"/>
76 <property name="main.dir" location=".."/>
77 <property name="jh.jar" value="apisupport.harness/external/jsearch*.jar"/>
78 <property name="jsearch.jar" value="javahelp/external/jh*.jar"/>
80 <mkdir dir="build/antclasses"/>
81 <echo message="Bootstrapping NetBeans-specific Ant extensions..."/>
82 <path id="bootstrap-cp">
83 <pathelement location="${ant.core.lib}"/>
84 <fileset dir="${main.dir}">
85 <!-- For JavaHelp indexing: -->
86 <include name="${jh.jar}"/>
87 <!-- For JavaHelp link checking: -->
88 <include name="${jsearch.jar}"/>
89 <include name="nbbuild/nbantext.jar"/>
92 <!-- Sanity check: -->
93 <pathconvert pathsep=":" property="class.files.in.antsrc">
95 <fileset dir="antsrc">
96 <include name="**/*.class"/>
103 <equals arg1="${class.files.in.antsrc}" arg2=""/>
106 You have stray *.class files in ${basedir}/antsrc which you must remove.
107 Probably you failed to clean your sources before updating. Try: ant hg-clean
109 <!-- OK, continue: -->
110 <javac srcdir="antsrc" destdir="build/antclasses" deprecation="true" debug="true" source="1.5" target="1.5">
111 <classpath refid="bootstrap-cp"/>
112 <compilerarg line="-Xlint -Xlint:-serial"/>
114 <jar jarfile="l10nantext.jar">
115 <fileset dir="build/antclasses"/>
116 <fileset dir="antsrc">
117 <exclude name="**/*.java"/>
118 <exclude name="**/package.html"/>
119 <exclude name="package-list"/>
124 <target name="-hg-check-can-clean">
125 <available property="can.hg.clean" type="dir" file="../.hg"/>
127 <target name="-hg-clean-alternative" depends="-hg-check-can-clean" unless="can.hg.clean">
128 <antcall target="-real-clean"/>
130 <target name="hg-clean" depends="-hg-clean-alternative" if="can.hg.clean"
131 description="Clean everything possible.">
132 <antcall target="-do-hg-clean">
133 <!-- <include name="."/> does not seem to work in a dirset -->
134 <param name="basedir" location="."/>
137 <target name="-do-hg-clean">
138 <echo>Cleaning untracked files in ${basedir}...</echo>
139 <exec executable="hg" failonerror="yes" outputproperty="hg.unknown.files">
142 <arg value="status"/>
143 <arg value="--unknown"/>
144 <arg value="--no-status"/>
146 <fail message="Will not run clean; checkout contains unknown and not ignored files (did you forget to hg add?): ${hg.unknown.files}">
149 <equals arg1="${hg.unknown.files}" arg2=""/>
153 <exec executable="hg" failonerror="yes">
156 <arg value="--config"/>
157 <arg value="extensions.purge="/>
158 <arg value="--verbose"/>
161 <arg value="--exclude"/>
162 <!-- Do not use **/nbproject/private/ as this will match some test/{results,work} dirs: -->
163 <arg value="glob:{*/nbproject/private/**,*/*/nbproject/private/**,**/user.build.properties,nbbuild/misc/build-site-local.sh}"/>
167 <target name="build" depends="bootstrap">
168 <taskdef name="jhindexer"
169 classname="org.netbeans.nbbuild.JHIndexer"
170 classpath="${main.dir}/nbbuild/nbantext.jar"/>
171 <taskdef name="locjhindexer"
172 classname="org.netbeans.nbbuild.LocJHIndexer"
173 classpath="${main.dir}/nbbuild/nbantext.jar"/>
175 <property name="locjhindexer.jhall" value="${main.dir}/${jh.jar}"/>
176 <property name="locales" value="ja,zh_CN,pt_BR"/>
177 <property name="dist.dir" location="dist"/>
178 <property name="nbms.dist.dir" location="nbms"/>
179 <property name="nbms.dir" location="../nbbuild/nbms"/>
180 <property name="keystore" location=""/>
181 <property name="storepass" value=""/>
182 <property name="nbm_alias" value="nb_ide"/>
184 <taskdef name="package-build" classname="org.netbeans.l10n.Package">
186 <pathelement path="l10nantext.jar"/>
187 <pathelement path="${main.dir}/nbbuild/nbantext.jar"/>
190 <package-build src="src" locales="${locales}" dist="${dist.dir}" nbms="${nbms.dir}" nbmsDist="${nbms.dist.dir}"
191 keystore="${keystore}" storepass="${storepass}" alias="${nbm_alias}"/>
192 <copy todir="${dist.dir}" flatten="true">
194 <include name="*/other/ide.branding/release/*.html"/>
197 <copy todir="${dist.dir}/nb6.1" flatten="true">
199 <include name="*/other/ide.branding/release/*.pdf"/>
204 <target name="build-community-nbms" depends="bootstrap,init-tasks">
205 <taskdef name="repeat" classname="org.netbeans.nbbuild.Repeat"
206 classpath="${main.dir}/nbbuild/nbantext.jar"/>
208 <pathconvert property="dlocales" setonempty="false">
209 <path path="${locales}"/>
212 <replacestring from="," to="_"/>
213 <replacestring from="-" to="_"/>
219 <property name="netbeans.dest.dir.ml" location="nbms/community/${dlocales}"/>
220 <mkdir dir="${netbeans.dest.dir.ml}"/>
222 <property name="netbeans.build.dir.ml" location="build/community"/>
223 <delete dir="${netbeans.build.dir.ml}"/>
224 <mkdir dir="${netbeans.build.dir.ml}"/>
227 <format property="spec.version" pattern="yyyy.M.d.kmm" locale="en" />
229 <delete file="build/ml/cluster-nbms-ml.properties"/>
231 <pathconvert property="base.dir" pathsep=",">
233 <pathelement location="dist"/>
237 <echo>Base dir: ${base.dir}</echo>
239 <pathconvert property="comm.clusters.list" pathsep=",">
241 <dirset dir="dist" id="cluster.dirs">
243 <exclude name="nb*.*"/>
246 <map from="${base.dir}/" to=""/>
249 <echo>Cluster dirs: ${comm.clusters.list}</echo>
250 <condition property="is.localized" value="true">
252 <equals arg1="${comm.clusters.list}" arg2="" trim="true"/>
255 <echo>IS localized: ${is.localized}</echo>
257 <antcall target="build-all-nbm-ml"/>
260 <target name="build-all-nbm-ml" if="is.localized">
261 <repeat target="build-one-nbm-ml" name="one.cluster.dir.ml" values="${comm.clusters.list}"/>
262 <antcall target="build-one-nbm-ml" inheritall="false">
263 <param name="is.kit" value="true"/>
264 <param name="locales" value="${locales}"/>
265 <param name="dlocales" value="${dlocales}"/>
266 <param name="one.cluster.dir.ml" value="nb6.1"/>
267 <param name="nb.cluster.nb" value="${nb.cluster.nb}"/>
268 <param name="comm.clusters.list" value="${comm.clusters.list}"/>
269 <param name="spec.version" value="${spec.version}"/>
270 <param name="netbeans.dest.dir.ml" value="${netbeans.dest.dir.ml}"/>
271 <param name="netbeans.build.dir.ml" value="${netbeans.build.dir.ml}"/>
272 <param name="buildnumber" value="${buildnumber}"/>
277 <target name="-create-cluster-ml-nbm-metadata" unless="is.kit">
278 <echo file="build/ml/nbms/tmp/manifest.mf">OpenIDE-Module: ${code.name}
279 OpenIDE-Module-Localizing-Bundle: ${code.name.base.slashes}/Bundle.properties
280 OpenIDE-Module-Specification-Version: ${spec.version}
282 <echo file="build/ml/nbms/classes/${code.name.base.slashes}/Bundle.properties">
283 OpenIDE-Module-Name=NetBeans 6.1 ${one.cluster.dir.ml} cluster localization (${locales})
284 OpenIDE-Module-Display-Category=Localization
285 OpenIDE-Module-Short-Description=NetBeans 6.1 ${one.cluster.dir.ml} cluster localization (${locales})
286 OpenIDE-Module-Long-Description=Delivers ${locales} localization for all modules in ${one.cluster.dir.ml} cluster of NetBeans 6.1
290 <target name="-prepare-localizing-bundles" if="one.kit.locale">
291 <echo file="build/ml/nbms/classes/${code.name.base.slashes}/Bundle_${one.kit.locale}.properties">
292 OpenIDE-Module-Name=NetBeans 6.1 ${one.kit.locale} localization plugin
293 OpenIDE-Module-Display-Category=Localization
294 OpenIDE-Module-Short-Description=NetBeans 6.1 ${one.kit.locale} localization plugin
295 OpenIDE-Module-Long-Description=Delivers ${one.kit.locale} localization of whole NetBeans 6.1
297 <!-- try to look for Bundle properties file provided by translation team -->
298 <copy file="l10n_uc_kits/${code.name.base.slashes}/../${one.kit.locale}/Bundle.properties"
299 tofile="build/ml/nbms/classes/${code.name.base.slashes}/Bundle_${one.kit.locale}.properties"
301 failonerror="false"/>
302 <!-- enforce display category to be "Localization", the same for all umbrella kit NBMs -->
303 <propertyfile file="build/ml/nbms/classes/${code.name.base.slashes}/Bundle_${one.kit.locale}.properties">
304 <entry key="OpenIDE-Module-Display-Category" value="Localization"/>
308 <target name="-create-kit-ml-nbm-metadata" if="is.kit">
309 <echo file="build/ml/nbms/tmp/manifest.mf">OpenIDE-Module: ${code.name}
310 OpenIDE-Module-Localizing-Bundle: ${code.name.base.slashes}/Bundle.properties
311 OpenIDE-Module-Specification-Version: ${spec.version}
312 OpenIDE-Module-Module-Dependencies: ${kit.deps}
314 <!-- prepare localization jarfiles - it's just for localized info.xml files inf NBMs -->
316 <repeat target="-prepare-localizing-bundles" name="one.kit.locale" values="${locales}"/>
317 <property name="locjar.locales" value="${locales}"/>
318 <locjar jarfile="${cluster}/${module.jar}"
319 basedir="build/ml/nbms/classes"
322 <fileset dir="build/ml/nbms/classes/${code.name.base.slashes}" includes="Bundle_*.properties"/>
326 <!-- create default Bundle properties -->
327 <echo file="build/ml/nbms/classes/${code.name.base.slashes}/Bundle.properties">
328 OpenIDE-Module-Name=NetBeans 6.1 ${locales} localization kit
329 OpenIDE-Module-Display-Category=Localization
330 OpenIDE-Module-Short-Description=NetBeans 6.1 ${locales} localization kit
331 OpenIDE-Module-Long-Description=Delivers ${locales} localization of whole NetBeans 6.1
333 <!-- try to look for Bundle properties file provided by translation team -->
334 <copy file="../translatedfiles/src/nbbuild/${code.name.base.slashes}/Bundle.properties"
335 tofile="build/ml/nbms/classes/${code.name.base.slashes}/Bundle.properties"
337 failonerror="false"/>
338 <!-- enforce display category to be "Localization", the same for all umbrella kit NBMs -->
339 <propertyfile file="build/ml/nbms/classes/${code.name.base.slashes}/Bundle.properties">
340 <entry key="OpenIDE-Module-Display-Category" value="Localization"/>
344 <target name="-check-ml-nbm-props">
345 <condition property="run.ml.nbm.build" value="true">
347 <isset property="locales"/>
348 <isset property="dlocales"/>
349 <isset property="one.cluster.dir.ml"/>
350 <isset property="comm.clusters.list"/>
351 <isset property="spec.version"/>
352 <isset property="netbeans.dest.dir.ml"/>
353 <isset property="netbeans.build.dir.ml"/>
358 <target name="build-one-nbm-ml" depends="init-tasks,-check-ml-nbm-props" if="run.ml.nbm.build">
359 <property file="build/ml/cluster-nbms-ml.properties"/>
361 <echo>Cluster dir: ${one.cluster.dir.ml}</echo>
363 <pathconvert property="cluster.package.dir" setonempty="false">
364 <path path="${one.cluster.dir.ml}"/>
367 <replacestring from="," to="_"/>
368 <replacestring from="-" to="_"/>
369 <replacestring from="." to="_"/>
374 <property name="cluster" location="${netbeans.build.dir.ml}/${one.cluster.dir.ml}"/>
376 <delete dir="build/ml/nbms"/>
377 <delete dir="${netbeans.build.dir.ml}"/>
378 <mkdir dir="${netbeans.build.dir.ml}/${one.cluster.dir.ml}"/>
379 <copy todir="${netbeans.build.dir.ml}/${one.cluster.dir.ml}">
380 <fileset dir="dist/${one.cluster.dir.ml}"/>
383 <condition property="code.name.base" value="org.netbeans.localization.${cluster.package.dir}.${dlocales}">
385 <isset property="is.kit"/>
388 <condition property="code.name.base" value="org.netbeans.localization.kit.${cluster.package.dir}.${dlocales}">
389 <isset property="is.kit"/>
392 <pathconvert property="code.name.base.slashes" setonempty="false">
393 <path path="${code.name.base}"/>
397 <replacestring from="." to="/"/>
401 <pathconvert property="code.name.base.dashes" setonempty="false">
402 <path path="${code.name.base}"/>
406 <replacestring from="." to="-"/>
410 <property name="public.packages" value="${code.name.base}.*"/>
411 <property name="code.name" value="${code.name.base}/1"/>
412 <mkdir dir="build/ml/nbms/classes/${code.name.base.slashes}"/>
413 <mkdir dir="build/ml/nbms/tmp"/>
414 <antcall target="-create-cluster-ml-nbm-metadata"/>
415 <antcall target="-create-kit-ml-nbm-metadata"/>
416 <property name="is.autoload" value="false"/>
417 <property name="is.eager" value="false"/>
418 <condition property="module.jar.dir" value="modules">
419 <!-- set module.jar.dir property only when building kit NBM - leads to AutoUpdate-Show-In-Client manifest attribute is set to true -->
420 <isset property="is.kit"/>
422 <property name="module.jar" value="modules/${code.name.base.dashes}.jar"/> <mkdir dir="${cluster}/modules"/>
423 <jarwithmoduleattributes jarfile="${cluster}/${module.jar}"
424 compress="${build.package.compress}"
425 index="${build.package.index}"
426 manifest="build/ml/nbms/tmp/manifest.mf">
427 <fileset dir="build/ml/nbms/classes"/>
428 </jarwithmoduleattributes>
429 <createmodulexml xmldir="${cluster}/config/Modules">
430 <enabled dir="${cluster}">
431 <include name="${module.jar}"/>
434 <patternset id="module.files">
435 <!-- include name="${module.jar}"/ -->
436 <include name="**/*.jar"/>
437 <include name="config/Modules/${code.name.base.dashes}.xml"/>
439 <property name="module.files.toString" refid="module.files"/>
440 <echo level="verbose">Basic matching module files (${code.name.base.dashes}): ${module.files.toString}</echo>
441 <genlist outputfiledir="${cluster}" module="${module.jar}">
442 <fileset dir="${cluster}">
443 <patternset refid="module.files"/>
446 <property name="license.file.override" location="build/ml/nbms/license"/>
447 <property name="extra.license.files" value=""/>
448 <taskdef name="releasefileslicense" classname="org.netbeans.nbbuild.extlibs.ReleaseFilesLicense" classpath="${nb_all}/nbbuild/nbantext.jar"/>
449 <releasefileslicense license="${license.file.override}" standardlicense="${nb_all}/nbbuild/standard-nbm-license.txt" extralicensefiles="${extra.license.files}"/>
450 <taskdef name="makenbm" classname="org.netbeans.nbbuild.MakeNBM" classpath="${nb_all}/nbbuild/nbantext.jar"/>
451 <property name="nbm_alias" value="nb_ide"/>
452 <makenbm file="build/ml/${code.name.base.dashes}.nbm"
453 productdir="${cluster}"
454 module="${module.jar}"
455 homepage="http://translatedfiles.netbeans.org/"
456 distribution="http://translatedfiles.netbeans.org/"
459 targetcluster="${one.cluster.dir.ml}"
462 <license file="${license.file.override}"/>
463 <signature keystore="${keystore}" storepass="${storepass}" alias="${nbm_alias}"/>
465 <move todir="${netbeans.dest.dir.ml}" file="build/ml/${code.name.base.dashes}.nbm"/>
466 <property file="build/ml/cluster-nbms-ml.properties"/>
467 <condition property="new.kit.deps" value="${code.name} > ${spec.version}">
470 <isset property="kit.deps"/>
473 <isset property="is.kit"/>
477 <condition property="new.kit.deps" value="${kit.deps},${code.name} > ${spec.version}">
479 <isset property="kit.deps"/>
481 <isset property="is.kit"/>
485 <condition property="new.kit.deps" value="${kit.deps}">
486 <isset property="is.kit"/>
488 <propertyfile file="build/ml/cluster-nbms-ml.properties">
489 <entry key="kit.deps" value="${new.kit.deps}"/>