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 <target name="assure-ant">
52 <fail message="You need Ant version 1.7.0 or later to build NetBeans.">
55 <antversion atleast="1.7.0"/>
61 <!-- Fallback for ant.core.lib - it is not set in some cases - 124554 -->
62 <available property="ant.core.lib" value="${ant.home}/lib/ant.jar" file="${ant.home}/lib/ant.jar"/>
63 <!-- if the previous location is not correct than find the ant.jar from the java.class.path value -->
64 <pathconvert property="ant.core.lib">
65 <mapper type="regexp" from="${path.separator}([^${path.separator}]*ant.jar)${path.separator}" to="\1"/>
66 <path location="${path.separator}${java.class.path}${path.separator}"/>
69 <target name="bootstrap"
70 description="Bootstrap NetBeans-specific Ant extensions."
72 <property file="build.properties"/>
73 <property name="main.dir" location=".."/>
74 <property name="jh.jar" value="apisupport.harness/external/jsearch*.jar"/>
75 <property name="jsearch.jar" value="javahelp/external/jh*.jar"/>
77 <mkdir dir="build/antclasses"/>
78 <echo message="Bootstrapping NetBeans-specific Ant extensions..."/>
79 <path id="bootstrap-cp">
80 <pathelement location="${ant.core.lib}"/>
81 <fileset dir="${main.dir}">
82 <!-- For JavaHelp indexing: -->
83 <include name="${jh.jar}"/>
84 <!-- For JavaHelp link checking: -->
85 <include name="${jsearch.jar}"/>
86 <include name="nbbuild/nbantext.jar"/>
89 <!-- Sanity check: -->
90 <pathconvert pathsep=":" property="class.files.in.antsrc">
92 <fileset dir="antsrc">
93 <include name="**/*.class"/>
100 <equals arg1="${class.files.in.antsrc}" arg2=""/>
103 You have stray *.class files in ${basedir}/antsrc which you must remove.
104 Probably you failed to clean your sources before updating. Try: ant hg-clean
106 <!-- OK, continue: -->
107 <javac srcdir="antsrc" destdir="build/antclasses" deprecation="true" debug="true" source="1.5" target="1.5">
108 <classpath refid="bootstrap-cp"/>
109 <compilerarg line="-Xlint -Xlint:-serial"/>
111 <jar jarfile="l10nantext.jar">
112 <fileset dir="build/antclasses"/>
113 <fileset dir="antsrc">
114 <exclude name="**/*.java"/>
115 <exclude name="**/package.html"/>
116 <exclude name="package-list"/>
121 <target name="-hg-check-can-clean">
122 <available property="can.hg.clean" type="dir" file="../.hg"/>
124 <target name="-hg-clean-alternative" depends="-hg-check-can-clean" unless="can.hg.clean">
125 <antcall target="-real-clean"/>
127 <target name="hg-clean" depends="-hg-clean-alternative" if="can.hg.clean"
128 description="Clean everything possible.">
129 <antcall target="-do-hg-clean">
130 <!-- <include name="."/> does not seem to work in a dirset -->
131 <param name="basedir" location="."/>
134 <target name="-do-hg-clean">
135 <echo>Cleaning untracked files in ${basedir}...</echo>
136 <exec executable="hg" failonerror="yes" outputproperty="hg.unknown.files">
139 <arg value="status"/>
140 <arg value="--unknown"/>
141 <arg value="--no-status"/>
143 <fail message="Will not run clean; checkout contains unknown and not ignored files (did you forget to hg add?): ${hg.unknown.files}">
146 <equals arg1="${hg.unknown.files}" arg2=""/>
150 <exec executable="hg" failonerror="yes">
153 <arg value="--config"/>
154 <arg value="extensions.purge="/>
155 <arg value="--verbose"/>
158 <arg value="--exclude"/>
159 <!-- Do not use **/nbproject/private/ as this will match some test/{results,work} dirs: -->
160 <arg value="glob:{*/nbproject/private/**,*/*/nbproject/private/**,**/user.build.properties,nbbuild/misc/build-site-local.sh}"/>
164 <target name="build" depends="bootstrap">
165 <taskdef name="jhindexer"
166 classname="org.netbeans.nbbuild.JHIndexer"
167 classpath="${main.dir}/nbbuild/nbantext.jar"/>
168 <taskdef name="locjhindexer"
169 classname="org.netbeans.nbbuild.LocJHIndexer"
170 classpath="${main.dir}/nbbuild/nbantext.jar"/>
172 <property name="locjhindexer.jhall" value="${main.dir}/${jh.jar}"/>
173 <property name="locales" value="ja,zh_CN,pt_BR"/>
174 <property name="dist.dir" location="dist"/>
175 <property name="nbms.dist.dir" location="nbms"/>
176 <property name="nbms.dir" location="../nbbuild/nbms"/>
177 <property name="keystore" location=""/>
178 <property name="storepass" value=""/>
179 <property name="nbm_alias" value="nb_ide"/>
181 <taskdef name="package-build" classname="org.netbeans.l10n.Package">
183 <pathelement path="l10nantext.jar"/>
184 <pathelement path="${main.dir}/nbbuild/nbantext.jar"/>
187 <package-build src="src" locales="${locales}" dist="${dist.dir}" nbms="${nbms.dir}" nbmsDist="${nbms.dist.dir}"
188 keystore="${keystore}" storepass="${storepass}" alias="${nbm_alias}"/>
189 <copy todir="${dist.dir}" flatten="true">
191 <include name="*/other/ide.branding/release/*.html"/>
194 <copy todir="${dist.dir}/nb6.1" flatten="true">
196 <include name="*/other/ide.branding/release/*.pdf"/>