build.xml
author rnovak@netbeans.org
Tue, 05 Oct 2010 13:42:47 +0200
branchrelease61_fixes
changeset 1048 e54c0a8734fa
parent 85 97185a634f19
child 187 c7f767b90f9e
child 995 bdad3d834df2
permissions -rw-r--r--
marking as branch release61_fixes
     1 <?xml version="1.0" encoding="UTF-8"?>
     2 <!--
     3 DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
     4 
     5 Copyright 1997-2008 Sun Microsystems, Inc. All rights reserved.
     6 
     7 
     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]"
    25 
    26 Contributor(s):
    27 
    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.
    31 
    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.
    42 -->
    43 <!DOCTYPE someant  [
    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">
    48 ]>
    49 
    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.">
    53           <condition>
    54               <not>
    55                   <antversion atleast="1.7.0"/>
    56               </not>
    57           </condition>
    58       </fail>
    59   </target>
    60 
    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}"/>
    67   </pathconvert>
    68 
    69   <target name="bootstrap"
    70           description="Bootstrap NetBeans-specific Ant extensions."
    71           depends="assure-ant">
    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"/>
    76 
    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"/>
    87       </fileset>
    88     </path>
    89     <!-- Sanity check: -->
    90     <pathconvert pathsep=":" property="class.files.in.antsrc">
    91         <path>
    92             <fileset dir="antsrc">
    93                 <include name="**/*.class"/>
    94             </fileset>
    95         </path>
    96     </pathconvert>
    97     <fail>
    98         <condition>
    99             <not>
   100                 <equals arg1="${class.files.in.antsrc}" arg2=""/>
   101             </not>
   102         </condition>
   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
   105     </fail>
   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"/>
   110     </javac>
   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"/>
   117       </fileset>
   118     </jar>
   119   </target>
   120 
   121   <target name="-hg-check-can-clean">
   122     <available property="can.hg.clean" type="dir" file="../.hg"/>
   123   </target>
   124   <target name="-hg-clean-alternative" depends="-hg-check-can-clean" unless="can.hg.clean">
   125     <antcall target="-real-clean"/>
   126   </target>
   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="."/>
   132     </antcall>
   133   </target>
   134   <target name="-do-hg-clean">
   135     <echo>Cleaning untracked files in ${basedir}...</echo>
   136     <exec executable="hg" failonerror="yes" outputproperty="hg.unknown.files">
   137       <arg value="--cwd"/>
   138       <arg file="."/>
   139       <arg value="status"/>
   140       <arg value="--unknown"/>
   141       <arg value="--no-status"/>
   142     </exec>
   143     <fail message="Will not run clean; checkout contains unknown and not ignored files (did you forget to hg add?):&#10;${hg.unknown.files}">
   144         <condition>
   145             <not>
   146                 <equals arg1="${hg.unknown.files}" arg2=""/>
   147             </not>
   148         </condition>
   149     </fail>
   150     <exec executable="hg" failonerror="yes">
   151       <arg value="--cwd"/>
   152       <arg file="."/>
   153       <arg value="--config"/>
   154       <arg value="extensions.purge="/>
   155       <arg value="--verbose"/>
   156       <arg value="clean"/>
   157       <arg value="--all"/>
   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}"/>
   161     </exec>
   162   </target>
   163 
   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"/>
   171 
   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"/>
   180      
   181      <taskdef name="package-build" classname="org.netbeans.l10n.Package">
   182         <classpath>
   183             <pathelement path="l10nantext.jar"/>
   184             <pathelement path="${main.dir}/nbbuild/nbantext.jar"/>
   185         </classpath>
   186      </taskdef>
   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">
   190          <fileset dir="src">
   191             <include name="*/other/ide.branding/release/*.html"/>
   192          </fileset>
   193      </copy>
   194      <copy todir="${dist.dir}/nb6.1" flatten="true">
   195          <fileset dir="src">
   196             <include name="*/other/ide.branding/release/*.pdf"/>
   197          </fileset>
   198      </copy>
   199  </target>
   200 
   201 </project>