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
mzlamal@20
     1
<?xml version="1.0" encoding="UTF-8"?>
mzlamal@20
     2
<!--
mzlamal@20
     3
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
mzlamal@20
     4
mzlamal@20
     5
Copyright 1997-2008 Sun Microsystems, Inc. All rights reserved.
mzlamal@20
     6
mzlamal@20
     7
mzlamal@20
     8
The contents of this file are subject to the terms of either the GNU
mzlamal@20
     9
General Public License Version 2 only ("GPL") or the Common
mzlamal@20
    10
Development and Distribution License("CDDL") (collectively, the
mzlamal@20
    11
"License"). You may not use this file except in compliance with the
mzlamal@20
    12
License. You can obtain a copy of the License at
mzlamal@20
    13
http://www.netbeans.org/cddl-gplv2.html
mzlamal@20
    14
or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
mzlamal@20
    15
specific language governing permissions and limitations under the
mzlamal@20
    16
License.  When distributing the software, include this License Header
mzlamal@20
    17
Notice in each file and include the License file at
mzlamal@20
    18
nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
mzlamal@20
    19
particular file as subject to the "Classpath" exception as provided
mzlamal@20
    20
by Sun in the GPL Version 2 section of the License file that
mzlamal@20
    21
accompanied this code. If applicable, add the following below the
mzlamal@20
    22
License Header, with the fields enclosed by brackets [] replaced by
mzlamal@20
    23
your own identifying information:
mzlamal@20
    24
"Portions Copyrighted [year] [name of copyright owner]"
mzlamal@20
    25
mzlamal@20
    26
Contributor(s):
mzlamal@20
    27
mzlamal@20
    28
The Original Software is NetBeans. The Initial Developer of the Original
mzlamal@20
    29
Software is Sun Microsystems, Inc. Portions Copyright 1997-2008 Sun
mzlamal@20
    30
Microsystems, Inc. All Rights Reserved.
mzlamal@20
    31
mzlamal@20
    32
If you wish your version of this file to be governed by only the CDDL
mzlamal@20
    33
or only the GPL Version 2, indicate your decision by adding
mzlamal@20
    34
"[Contributor] elects to include this software in this distribution
mzlamal@20
    35
under the [CDDL or GPL Version 2] license." If you do not indicate a
mzlamal@20
    36
single choice of license, a recipient has the option to distribute
mzlamal@20
    37
your version of this file under either the CDDL, the GPL Version 2 or
mzlamal@20
    38
to extend the choice of license to its licensees as provided above.
mzlamal@20
    39
However, if you add GPL Version 2 code and therefore, elected the GPL
mzlamal@20
    40
Version 2 license, then the option applies only if the new code is
mzlamal@20
    41
made subject to such option by the copyright holder.
mzlamal@20
    42
-->
mzlamal@20
    43
<!DOCTYPE someant  [
mzlamal@20
    44
  <!ENTITY links SYSTEM "javadoctools/links.xml">
mzlamal@20
    45
  <!ENTITY properties SYSTEM "javadoctools/properties.xml">
mzlamal@20
    46
  <!ENTITY replaces SYSTEM "javadoctools/replaces.xml">
mzlamal@20
    47
  <!ENTITY disallowed-links SYSTEM "javadoctools/disallowed-links.xml">
mzlamal@20
    48
]>
mzlamal@20
    49
mzlamal@20
    50
<project name="ml-build" default="build" basedir=".">
mzlamal@20
    51
  <target name="assure-ant">
mzlamal@20
    52
      <fail message="You need Ant version 1.7.0 or later to build NetBeans.">
mzlamal@20
    53
          <condition>
mzlamal@20
    54
              <not>
mzlamal@20
    55
                  <antversion atleast="1.7.0"/>
mzlamal@20
    56
              </not>
mzlamal@20
    57
          </condition>
mzlamal@20
    58
      </fail>
mzlamal@20
    59
  </target>
mzlamal@20
    60
mzlamal@20
    61
  <!-- Fallback for ant.core.lib - it is not set in some cases - 124554 -->
mzlamal@20
    62
  <available property="ant.core.lib" value="${ant.home}/lib/ant.jar" file="${ant.home}/lib/ant.jar"/>
mzlamal@20
    63
  <!-- if the previous location is not correct than find the ant.jar from the java.class.path value -->
mzlamal@20
    64
  <pathconvert property="ant.core.lib">
mzlamal@20
    65
    <mapper type="regexp" from="${path.separator}([^${path.separator}]*ant.jar)${path.separator}" to="\1"/>
mzlamal@20
    66
    <path location="${path.separator}${java.class.path}${path.separator}"/>
mzlamal@20
    67
  </pathconvert>
mzlamal@20
    68
mzlamal@20
    69
  <target name="bootstrap"
mzlamal@20
    70
          description="Bootstrap NetBeans-specific Ant extensions."
mzlamal@20
    71
          depends="assure-ant">
mzlamal@20
    72
    <property file="build.properties"/>
mzlamal@20
    73
    <property name="main.dir" location=".."/>
mzlamal@20
    74
    <property name="jh.jar" value="apisupport.harness/external/jsearch*.jar"/>
mzlamal@20
    75
    <property name="jsearch.jar" value="javahelp/external/jh*.jar"/>
mzlamal@20
    76
mzlamal@20
    77
    <mkdir dir="build/antclasses"/>
mzlamal@20
    78
    <echo message="Bootstrapping NetBeans-specific Ant extensions..."/>
mzlamal@20
    79
    <path id="bootstrap-cp">
mzlamal@20
    80
     <pathelement location="${ant.core.lib}"/>
mzlamal@20
    81
     <fileset dir="${main.dir}">
mzlamal@20
    82
        <!-- For JavaHelp indexing: -->
mzlamal@20
    83
        <include name="${jh.jar}"/>
mzlamal@20
    84
        <!-- For JavaHelp link checking: -->
mzlamal@20
    85
        <include name="${jsearch.jar}"/>
mzlamal@20
    86
        <include name="nbbuild/nbantext.jar"/>
mzlamal@20
    87
      </fileset>
mzlamal@20
    88
    </path>
mzlamal@20
    89
    <!-- Sanity check: -->
mzlamal@20
    90
    <pathconvert pathsep=":" property="class.files.in.antsrc">
mzlamal@20
    91
        <path>
mzlamal@20
    92
            <fileset dir="antsrc">
mzlamal@20
    93
                <include name="**/*.class"/>
mzlamal@20
    94
            </fileset>
mzlamal@20
    95
        </path>
mzlamal@20
    96
    </pathconvert>
mzlamal@20
    97
    <fail>
mzlamal@20
    98
        <condition>
mzlamal@20
    99
            <not>
mzlamal@20
   100
                <equals arg1="${class.files.in.antsrc}" arg2=""/>
mzlamal@20
   101
            </not>
mzlamal@20
   102
        </condition>
mzlamal@20
   103
        You have stray *.class files in ${basedir}/antsrc which you must remove.
mzlamal@20
   104
        Probably you failed to clean your sources before updating. Try: ant hg-clean
mzlamal@20
   105
    </fail>
mzlamal@20
   106
    <!-- OK, continue: -->
mzlamal@20
   107
    <javac srcdir="antsrc" destdir="build/antclasses" deprecation="true" debug="true" source="1.5" target="1.5">
mzlamal@20
   108
      <classpath refid="bootstrap-cp"/>
mzlamal@20
   109
      <compilerarg line="-Xlint -Xlint:-serial"/>
mzlamal@20
   110
    </javac>
mzlamal@20
   111
    <jar jarfile="l10nantext.jar">
mzlamal@20
   112
      <fileset dir="build/antclasses"/>
mzlamal@20
   113
      <fileset dir="antsrc">
mzlamal@20
   114
        <exclude name="**/*.java"/>
mzlamal@20
   115
        <exclude name="**/package.html"/>
mzlamal@20
   116
        <exclude name="package-list"/>
mzlamal@20
   117
      </fileset>
mzlamal@20
   118
    </jar>
mzlamal@20
   119
  </target>
mzlamal@20
   120
mzlamal@20
   121
  <target name="-hg-check-can-clean">
mzlamal@20
   122
    <available property="can.hg.clean" type="dir" file="../.hg"/>
mzlamal@20
   123
  </target>
mzlamal@20
   124
  <target name="-hg-clean-alternative" depends="-hg-check-can-clean" unless="can.hg.clean">
mzlamal@20
   125
    <antcall target="-real-clean"/>
mzlamal@20
   126
  </target>
mzlamal@20
   127
  <target name="hg-clean" depends="-hg-clean-alternative" if="can.hg.clean"
mzlamal@20
   128
          description="Clean everything possible.">
mzlamal@20
   129
    <antcall target="-do-hg-clean">
mzlamal@20
   130
      <!-- <include name="."/> does not seem to work in a dirset -->
mzlamal@22
   131
      <param name="basedir" location="."/>
mzlamal@20
   132
    </antcall>
mzlamal@20
   133
  </target>
mzlamal@20
   134
  <target name="-do-hg-clean">
mzlamal@20
   135
    <echo>Cleaning untracked files in ${basedir}...</echo>
mzlamal@20
   136
    <exec executable="hg" failonerror="yes" outputproperty="hg.unknown.files">
mzlamal@20
   137
      <arg value="--cwd"/>
mzlamal@20
   138
      <arg file="."/>
mzlamal@20
   139
      <arg value="status"/>
mzlamal@20
   140
      <arg value="--unknown"/>
mzlamal@20
   141
      <arg value="--no-status"/>
mzlamal@20
   142
    </exec>
mzlamal@20
   143
    <fail message="Will not run clean; checkout contains unknown and not ignored files (did you forget to hg add?):&#10;${hg.unknown.files}">
mzlamal@20
   144
        <condition>
mzlamal@20
   145
            <not>
mzlamal@20
   146
                <equals arg1="${hg.unknown.files}" arg2=""/>
mzlamal@20
   147
            </not>
mzlamal@20
   148
        </condition>
mzlamal@20
   149
    </fail>
mzlamal@20
   150
    <exec executable="hg" failonerror="yes">
mzlamal@20
   151
      <arg value="--cwd"/>
mzlamal@20
   152
      <arg file="."/>
mzlamal@20
   153
      <arg value="--config"/>
mzlamal@20
   154
      <arg value="extensions.purge="/>
mzlamal@20
   155
      <arg value="--verbose"/>
mzlamal@20
   156
      <arg value="clean"/>
mzlamal@20
   157
      <arg value="--all"/>
mzlamal@20
   158
      <arg value="--exclude"/>
mzlamal@20
   159
      <!-- Do not use **/nbproject/private/ as this will match some test/{results,work} dirs: -->
mzlamal@20
   160
      <arg value="glob:{*/nbproject/private/**,*/*/nbproject/private/**,**/user.build.properties,nbbuild/misc/build-site-local.sh}"/>
mzlamal@20
   161
    </exec>
mzlamal@20
   162
  </target>
mzlamal@20
   163
mzlamal@20
   164
 <target name="build" depends="bootstrap">
mzlamal@20
   165
    <taskdef name="jhindexer"
mzlamal@20
   166
         classname="org.netbeans.nbbuild.JHIndexer"
mzlamal@20
   167
         classpath="${main.dir}/nbbuild/nbantext.jar"/>
mzlamal@20
   168
    <taskdef name="locjhindexer"
mzlamal@20
   169
         classname="org.netbeans.nbbuild.LocJHIndexer"
mzlamal@20
   170
         classpath="${main.dir}/nbbuild/nbantext.jar"/>
mzlamal@20
   171
mzlamal@20
   172
     <property name="locjhindexer.jhall" value="${main.dir}/${jh.jar}"/>
mzlamal@47
   173
     <property name="locales" value="ja,zh_CN,pt_BR"/>
mzlamal@24
   174
     <property name="dist.dir" location="dist"/>
mzlamal@85
   175
     <property name="nbms.dist.dir" location="nbms"/>
mzlamal@85
   176
     <property name="nbms.dir" location="../nbbuild/nbms"/>
mzlamal@85
   177
     <property name="keystore" location=""/>
mzlamal@85
   178
     <property name="storepass" value=""/>
mzlamal@85
   179
     <property name="nbm_alias" value="nb_ide"/>
mzlamal@24
   180
     
mzlamal@20
   181
     <taskdef name="package-build" classname="org.netbeans.l10n.Package">
mzlamal@20
   182
        <classpath>
mzlamal@20
   183
            <pathelement path="l10nantext.jar"/>
mzlamal@20
   184
            <pathelement path="${main.dir}/nbbuild/nbantext.jar"/>
mzlamal@20
   185
        </classpath>
mzlamal@20
   186
     </taskdef>
mzlamal@85
   187
     <package-build src="src" locales="${locales}" dist="${dist.dir}" nbms="${nbms.dir}" nbmsDist="${nbms.dist.dir}" 
mzlamal@85
   188
                    keystore="${keystore}" storepass="${storepass}" alias="${nbm_alias}"/>
mzlamal@89
   189
     <copy todir="${dist.dir}" flatten="true">
mzlamal@47
   190
         <fileset dir="src">
mzlamal@47
   191
            <include name="*/other/ide.branding/release/*.html"/>
mzlamal@47
   192
         </fileset>
mzlamal@47
   193
     </copy>
mzlamal@89
   194
     <copy todir="${dist.dir}/nb6.1" flatten="true">
mzlamal@47
   195
         <fileset dir="src">
mzlamal@47
   196
            <include name="*/other/ide.branding/release/*.pdf"/>
mzlamal@47
   197
         </fileset>
mzlamal@47
   198
     </copy>
mzlamal@20
   199
 </target>
mzlamal@20
   200
mzlamal@24
   201
</project>