build.xml
author rnovak@netbeans.org
Tue, 05 Oct 2010 14:49:08 +0200
branchrelease65
changeset 1243 ee39ff46f5aa
parent 489 b9bf0d630546
permissions -rw-r--r--
marking as branch release65
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=".">
rnovak@417
    51
  <import file="../nbbuild/default.xml"/>
rnovak@417
    52
mzlamal@20
    53
  <target name="assure-ant">
mzlamal@20
    54
      <fail message="You need Ant version 1.7.0 or later to build NetBeans.">
mzlamal@20
    55
          <condition>
mzlamal@20
    56
              <not>
mzlamal@20
    57
                  <antversion atleast="1.7.0"/>
mzlamal@20
    58
              </not>
mzlamal@20
    59
          </condition>
mzlamal@20
    60
      </fail>
mzlamal@20
    61
  </target>
mzlamal@20
    62
mzlamal@20
    63
  <!-- Fallback for ant.core.lib - it is not set in some cases - 124554 -->
mzlamal@20
    64
  <available property="ant.core.lib" value="${ant.home}/lib/ant.jar" file="${ant.home}/lib/ant.jar"/>
mzlamal@20
    65
  <!-- if the previous location is not correct than find the ant.jar from the java.class.path value -->
mzlamal@20
    66
  <pathconvert property="ant.core.lib">
mzlamal@20
    67
    <mapper type="regexp" from="${path.separator}([^${path.separator}]*ant.jar)${path.separator}" to="\1"/>
mzlamal@20
    68
    <path location="${path.separator}${java.class.path}${path.separator}"/>
mzlamal@20
    69
  </pathconvert>
mzlamal@20
    70
mzlamal@20
    71
  <target name="bootstrap"
mzlamal@20
    72
          description="Bootstrap NetBeans-specific Ant extensions."
mzlamal@20
    73
          depends="assure-ant">
mzlamal@20
    74
    <property file="build.properties"/>
mzlamal@20
    75
    <property name="main.dir" location=".."/>
mzlamal@20
    76
    <property name="jh.jar" value="apisupport.harness/external/jsearch*.jar"/>
mzlamal@20
    77
    <property name="jsearch.jar" value="javahelp/external/jh*.jar"/>
mzlamal@20
    78
mzlamal@20
    79
    <mkdir dir="build/antclasses"/>
mzlamal@20
    80
    <echo message="Bootstrapping NetBeans-specific Ant extensions..."/>
mzlamal@20
    81
    <path id="bootstrap-cp">
mzlamal@20
    82
     <pathelement location="${ant.core.lib}"/>
mzlamal@20
    83
     <fileset dir="${main.dir}">
mzlamal@20
    84
        <!-- For JavaHelp indexing: -->
mzlamal@20
    85
        <include name="${jh.jar}"/>
mzlamal@20
    86
        <!-- For JavaHelp link checking: -->
mzlamal@20
    87
        <include name="${jsearch.jar}"/>
mzlamal@20
    88
        <include name="nbbuild/nbantext.jar"/>
mzlamal@20
    89
      </fileset>
mzlamal@20
    90
    </path>
mzlamal@20
    91
    <!-- Sanity check: -->
mzlamal@20
    92
    <pathconvert pathsep=":" property="class.files.in.antsrc">
mzlamal@20
    93
        <path>
mzlamal@20
    94
            <fileset dir="antsrc">
mzlamal@20
    95
                <include name="**/*.class"/>
mzlamal@20
    96
            </fileset>
mzlamal@20
    97
        </path>
mzlamal@20
    98
    </pathconvert>
mzlamal@20
    99
    <fail>
mzlamal@20
   100
        <condition>
mzlamal@20
   101
            <not>
mzlamal@20
   102
                <equals arg1="${class.files.in.antsrc}" arg2=""/>
mzlamal@20
   103
            </not>
mzlamal@20
   104
        </condition>
mzlamal@20
   105
        You have stray *.class files in ${basedir}/antsrc which you must remove.
mzlamal@20
   106
        Probably you failed to clean your sources before updating. Try: ant hg-clean
mzlamal@20
   107
    </fail>
mzlamal@20
   108
    <!-- OK, continue: -->
mzlamal@20
   109
    <javac srcdir="antsrc" destdir="build/antclasses" deprecation="true" debug="true" source="1.5" target="1.5">
mzlamal@20
   110
      <classpath refid="bootstrap-cp"/>
mzlamal@20
   111
      <compilerarg line="-Xlint -Xlint:-serial"/>
mzlamal@20
   112
    </javac>
mzlamal@20
   113
    <jar jarfile="l10nantext.jar">
mzlamal@20
   114
      <fileset dir="build/antclasses"/>
mzlamal@20
   115
      <fileset dir="antsrc">
mzlamal@20
   116
        <exclude name="**/*.java"/>
mzlamal@20
   117
        <exclude name="**/package.html"/>
mzlamal@20
   118
        <exclude name="package-list"/>
mzlamal@20
   119
      </fileset>
mzlamal@20
   120
    </jar>
mzlamal@20
   121
  </target>
mzlamal@20
   122
mzlamal@20
   123
  <target name="-hg-check-can-clean">
mzlamal@20
   124
    <available property="can.hg.clean" type="dir" file="../.hg"/>
mzlamal@20
   125
  </target>
mzlamal@20
   126
  <target name="-hg-clean-alternative" depends="-hg-check-can-clean" unless="can.hg.clean">
mzlamal@20
   127
    <antcall target="-real-clean"/>
mzlamal@20
   128
  </target>
mzlamal@20
   129
  <target name="hg-clean" depends="-hg-clean-alternative" if="can.hg.clean"
mzlamal@20
   130
          description="Clean everything possible.">
mzlamal@20
   131
    <antcall target="-do-hg-clean">
mzlamal@20
   132
      <!-- <include name="."/> does not seem to work in a dirset -->
mzlamal@22
   133
      <param name="basedir" location="."/>
mzlamal@20
   134
    </antcall>
mzlamal@20
   135
  </target>
mzlamal@20
   136
  <target name="-do-hg-clean">
mzlamal@20
   137
    <echo>Cleaning untracked files in ${basedir}...</echo>
mzlamal@20
   138
    <exec executable="hg" failonerror="yes" outputproperty="hg.unknown.files">
mzlamal@20
   139
      <arg value="--cwd"/>
mzlamal@20
   140
      <arg file="."/>
mzlamal@20
   141
      <arg value="status"/>
mzlamal@20
   142
      <arg value="--unknown"/>
mzlamal@20
   143
      <arg value="--no-status"/>
mzlamal@20
   144
    </exec>
mzlamal@20
   145
    <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
   146
        <condition>
mzlamal@20
   147
            <not>
mzlamal@20
   148
                <equals arg1="${hg.unknown.files}" arg2=""/>
mzlamal@20
   149
            </not>
mzlamal@20
   150
        </condition>
mzlamal@20
   151
    </fail>
mzlamal@20
   152
    <exec executable="hg" failonerror="yes">
mzlamal@20
   153
      <arg value="--cwd"/>
mzlamal@20
   154
      <arg file="."/>
mzlamal@20
   155
      <arg value="--config"/>
mzlamal@20
   156
      <arg value="extensions.purge="/>
mzlamal@20
   157
      <arg value="--verbose"/>
mzlamal@20
   158
      <arg value="clean"/>
mzlamal@20
   159
      <arg value="--all"/>
mzlamal@20
   160
      <arg value="--exclude"/>
mzlamal@20
   161
      <!-- Do not use **/nbproject/private/ as this will match some test/{results,work} dirs: -->
mzlamal@20
   162
      <arg value="glob:{*/nbproject/private/**,*/*/nbproject/private/**,**/user.build.properties,nbbuild/misc/build-site-local.sh}"/>
mzlamal@20
   163
    </exec>
mzlamal@20
   164
  </target>
mzlamal@20
   165
mzlamal@20
   166
 <target name="build" depends="bootstrap">
mzlamal@20
   167
    <taskdef name="jhindexer"
mzlamal@20
   168
         classname="org.netbeans.nbbuild.JHIndexer"
mzlamal@20
   169
         classpath="${main.dir}/nbbuild/nbantext.jar"/>
mzlamal@20
   170
    <taskdef name="locjhindexer"
mzlamal@20
   171
         classname="org.netbeans.nbbuild.LocJHIndexer"
mzlamal@20
   172
         classpath="${main.dir}/nbbuild/nbantext.jar"/>
rnovak@489
   173
    <taskdef name="repeat"
rnovak@489
   174
         classname="org.netbeans.nbbuild.Repeat"
rnovak@489
   175
         classpath="${main.dir}/nbbuild/nbantext.jar"/> 
mzlamal@20
   176
mzlamal@20
   177
     <property name="locjhindexer.jhall" value="${main.dir}/${jh.jar}"/>
mzlamal@47
   178
     <property name="locales" value="ja,zh_CN,pt_BR"/>
mzlamal@24
   179
     <property name="dist.dir" location="dist"/>
mzlamal@85
   180
     <property name="nbms.dist.dir" location="nbms"/>
mzlamal@85
   181
     <property name="nbms.dir" location="../nbbuild/nbms"/>
mzlamal@85
   182
     <property name="keystore" location=""/>
mzlamal@85
   183
     <property name="storepass" value=""/>
mzlamal@85
   184
     <property name="nbm_alias" value="nb_ide"/>
mzlamal@24
   185
     
mzlamal@20
   186
     <taskdef name="package-build" classname="org.netbeans.l10n.Package">
mzlamal@20
   187
        <classpath>
mzlamal@20
   188
            <pathelement path="l10nantext.jar"/>
mzlamal@20
   189
            <pathelement path="${main.dir}/nbbuild/nbantext.jar"/>
mzlamal@20
   190
        </classpath>
mzlamal@20
   191
     </taskdef>
mzlamal@85
   192
     <package-build src="src" locales="${locales}" dist="${dist.dir}" nbms="${nbms.dir}" nbmsDist="${nbms.dist.dir}" 
mzlamal@85
   193
                    keystore="${keystore}" storepass="${storepass}" alias="${nbm_alias}"/>
rnovak@489
   194
     <repeat target="copy-docs-for-locale" name="one.locale" values="${locales}"/>
rnovak@489
   195
 </target>
rnovak@489
   196
rnovak@489
   197
 <target name="copy-docs-for-locale" if="one.locale"> 
mzlamal@89
   198
     <copy todir="${dist.dir}" flatten="true">
mzlamal@47
   199
         <fileset dir="src">
rnovak@489
   200
            <include name="*/other/ide.branding/release-toplevel/*_${one.locale}.html"/>
mzlamal@47
   201
         </fileset>
mzlamal@47
   202
     </copy>
mzlamal@187
   203
     <copy todir="${dist.dir}/nb6.5" flatten="true">
mzlamal@47
   204
         <fileset dir="src">
rnovak@489
   205
            <include name="*/other/ide.branding/release/*_${one.locale}.pdf"/>
mzlamal@47
   206
         </fileset>
mzlamal@47
   207
     </copy>
mzlamal@20
   208
 </target>
mzlamal@20
   209
rnovak@417
   210
 <target name="build-community-nbms" depends="bootstrap,init-tasks">
rnovak@417
   211
      <taskdef name="repeat" classname="org.netbeans.nbbuild.Repeat"
rnovak@417
   212
               classpath="${main.dir}/nbbuild/nbantext.jar"/>
rnovak@417
   213
rnovak@417
   214
      <pathconvert property="dlocales" setonempty="false">
rnovak@417
   215
          <path path="${locales}"/>
rnovak@417
   216
          <chainedmapper>
rnovak@417
   217
          <filtermapper>
rnovak@417
   218
              <replacestring from="," to="_"/>
rnovak@417
   219
              <replacestring from="-" to="_"/>
rnovak@417
   220
          </filtermapper>
rnovak@417
   221
          <flattenmapper/>
rnovak@417
   222
          </chainedmapper>
rnovak@417
   223
      </pathconvert>
rnovak@417
   224
rnovak@417
   225
      <property name="netbeans.dest.dir.ml" location="nbms/community/${dlocales}"/>
rnovak@417
   226
      <mkdir dir="${netbeans.dest.dir.ml}"/>
rnovak@417
   227
rnovak@417
   228
      <property name="netbeans.build.dir.ml" location="build/community"/>
rnovak@417
   229
      <delete dir="${netbeans.build.dir.ml}"/>
rnovak@417
   230
      <mkdir dir="${netbeans.build.dir.ml}"/>
rnovak@417
   231
rnovak@417
   232
      <tstamp>
rnovak@417
   233
          <format property="spec.version" pattern="yyyy.M.d.kmm" locale="en" />
rnovak@417
   234
      </tstamp>
rnovak@417
   235
      <delete file="build/ml/cluster-nbms-ml.properties"/>
rnovak@417
   236
rnovak@417
   237
      <pathconvert property="base.dir" pathsep=",">
rnovak@417
   238
          <path>
rnovak@417
   239
              <pathelement location="dist"/>
rnovak@417
   240
          </path>
rnovak@417
   241
      </pathconvert>
rnovak@417
   242
rnovak@417
   243
      <echo>Base dir: ${base.dir}</echo>
rnovak@417
   244
rnovak@417
   245
      <pathconvert property="comm.clusters.list" pathsep=",">
rnovak@417
   246
          <path>
rnovak@417
   247
              <dirset dir="dist" id="cluster.dirs">
rnovak@417
   248
                  <include name="*"/>
rnovak@417
   249
                  <exclude name="nb*.*"/>
rnovak@417
   250
              </dirset>
rnovak@417
   251
          </path>
rnovak@417
   252
          <map from="${base.dir}/" to=""/>
rnovak@417
   253
      </pathconvert>
rnovak@417
   254
rnovak@417
   255
      <echo>Cluster dirs: ${comm.clusters.list}</echo>
rnovak@417
   256
      <condition property="is.localized" value="true">
rnovak@417
   257
          <not>
rnovak@417
   258
             <equals arg1="${comm.clusters.list}" arg2="" trim="true"/>
rnovak@417
   259
          </not>
rnovak@417
   260
      </condition>
rnovak@417
   261
      <echo>IS localized: ${is.localized}</echo>
rnovak@417
   262
rnovak@1078
   263
      <mkdir dir="dist/nb6.5"/>
rnovak@417
   264
      <antcall target="build-all-nbm-ml"/>
rnovak@417
   265
  </target>
rnovak@417
   266
rnovak@417
   267
  <target name="build-all-nbm-ml" if="is.localized">
rnovak@417
   268
      <repeat target="build-one-nbm-ml" name="one.cluster.dir.ml" values="${comm.clusters.list}"/>
rnovak@417
   269
      <antcall target="build-one-nbm-ml" inheritall="false">
rnovak@417
   270
          <param name="is.kit" value="true"/>
rnovak@417
   271
          <param name="locales" value="${locales}"/>
rnovak@417
   272
          <param name="dlocales" value="${dlocales}"/>
rnovak@418
   273
          <param name="one.cluster.dir.ml" value="nb6.5"/>
rnovak@417
   274
          <param name="nb.cluster.nb" value="${nb.cluster.nb}"/>
rnovak@417
   275
          <param name="comm.clusters.list" value="${comm.clusters.list}"/>
rnovak@417
   276
          <param name="spec.version" value="${spec.version}"/>
rnovak@417
   277
          <param name="netbeans.dest.dir.ml" value="${netbeans.dest.dir.ml}"/>
rnovak@417
   278
          <param name="netbeans.build.dir.ml" value="${netbeans.build.dir.ml}"/>
rnovak@417
   279
          <param name="buildnumber" value="${buildnumber}"/>
rnovak@417
   280
      </antcall>
rnovak@417
   281
  </target>
rnovak@417
   282
rnovak@417
   283
rnovak@417
   284
  <target name="-create-cluster-ml-nbm-metadata" unless="is.kit">
rnovak@417
   285
      <echo file="build/ml/nbms/tmp/manifest.mf">OpenIDE-Module: ${code.name}
rnovak@417
   286
OpenIDE-Module-Localizing-Bundle: ${code.name.base.slashes}/Bundle.properties
rnovak@417
   287
OpenIDE-Module-Specification-Version: ${spec.version}
rnovak@417
   288
</echo>
rnovak@417
   289
      <echo file="build/ml/nbms/classes/${code.name.base.slashes}/Bundle.properties">
rnovak@418
   290
OpenIDE-Module-Name=NetBeans 6.5 ${one.cluster.dir.ml} cluster localization (${locales})
rnovak@417
   291
OpenIDE-Module-Display-Category=Localization
rnovak@418
   292
OpenIDE-Module-Short-Description=NetBeans 6.5 ${one.cluster.dir.ml} cluster localization (${locales})
rnovak@418
   293
OpenIDE-Module-Long-Description=Delivers ${locales} localization for all modules in ${one.cluster.dir.ml} cluster of NetBeans 6.5
rnovak@417
   294
</echo>
rnovak@417
   295
  </target>
rnovak@417
   296
 
rnovak@417
   297
    <target name="-prepare-localizing-bundles" if="one.kit.locale">
rnovak@417
   298
       <echo file="build/ml/nbms/classes/${code.name.base.slashes}/Bundle_${one.kit.locale}.properties">
rnovak@418
   299
OpenIDE-Module-Name=NetBeans 6.5 ${one.kit.locale} localization plugin
rnovak@417
   300
OpenIDE-Module-Display-Category=Localization
rnovak@418
   301
OpenIDE-Module-Short-Description=NetBeans 6.5 ${one.kit.locale} localization plugin
rnovak@418
   302
OpenIDE-Module-Long-Description=Delivers ${one.kit.locale} localization of whole NetBeans 6.5
rnovak@417
   303
</echo>
rnovak@417
   304
       <!-- try to look for Bundle properties file provided by translation team -->
rnovak@417
   305
       <copy file="l10n_uc_kits/${code.name.base.slashes}/../${one.kit.locale}/Bundle.properties"
rnovak@417
   306
             tofile="build/ml/nbms/classes/${code.name.base.slashes}/Bundle_${one.kit.locale}.properties"
rnovak@417
   307
             overwrite="true"
rnovak@417
   308
             failonerror="false"/>
rnovak@417
   309
       <!-- enforce display category to be "Localization", the same for all umbrella kit NBMs -->
rnovak@417
   310
       <propertyfile file="build/ml/nbms/classes/${code.name.base.slashes}/Bundle_${one.kit.locale}.properties">
rnovak@417
   311
         <entry key="OpenIDE-Module-Display-Category" value="Localization"/>
rnovak@417
   312
       </propertyfile>
rnovak@417
   313
    </target>
rnovak@417
   314
rnovak@417
   315
    <target name="-create-kit-ml-nbm-metadata" if="is.kit">
rnovak@417
   316
      <echo file="build/ml/nbms/tmp/manifest.mf">OpenIDE-Module: ${code.name}
rnovak@417
   317
OpenIDE-Module-Localizing-Bundle: ${code.name.base.slashes}/Bundle.properties
rnovak@417
   318
OpenIDE-Module-Specification-Version: ${spec.version}
rnovak@417
   319
OpenIDE-Module-Module-Dependencies: ${kit.deps}
rnovak@417
   320
</echo>
rnovak@417
   321
       <!-- prepare localization jarfiles - it's just for localized info.xml files inf NBMs -->
rnovak@417
   322
<!--
rnovak@417
   323
       <repeat target="-prepare-localizing-bundles" name="one.kit.locale" values="${locales}"/>
rnovak@417
   324
       <property name="locjar.locales" value="${locales}"/>
rnovak@417
   325
       <locjar jarfile="${cluster}/${module.jar}"
rnovak@417
   326
               basedir="build/ml/nbms/classes"
rnovak@417
   327
               compress="false"/>
rnovak@417
   328
       <delete>
rnovak@417
   329
           <fileset dir="build/ml/nbms/classes/${code.name.base.slashes}" includes="Bundle_*.properties"/>
rnovak@417
   330
       </delete>
rnovak@417
   331
-->
rnovak@417
   332
rnovak@417
   333
       <!-- create default Bundle properties -->
rnovak@417
   334
       <echo file="build/ml/nbms/classes/${code.name.base.slashes}/Bundle.properties">
rnovak@418
   335
OpenIDE-Module-Name=NetBeans 6.5 ${locales} localization kit
rnovak@417
   336
OpenIDE-Module-Display-Category=Localization
rnovak@418
   337
OpenIDE-Module-Short-Description=NetBeans 6.5 ${locales} localization kit
rnovak@418
   338
OpenIDE-Module-Long-Description=Delivers ${locales} localization of whole NetBeans 6.5
rnovak@417
   339
</echo>
rnovak@417
   340
       <!-- try to look for Bundle properties file provided by translation team -->
rnovak@417
   341
       <copy file="../translatedfiles/src/nbbuild/${code.name.base.slashes}/Bundle.properties"
rnovak@417
   342
             tofile="build/ml/nbms/classes/${code.name.base.slashes}/Bundle.properties"
rnovak@417
   343
             overwrite="true"
rnovak@417
   344
             failonerror="false"/>
rnovak@417
   345
       <!-- enforce display category to be "Localization", the same for all umbrella kit NBMs -->
rnovak@417
   346
       <propertyfile file="build/ml/nbms/classes/${code.name.base.slashes}/Bundle.properties">
rnovak@417
   347
         <entry key="OpenIDE-Module-Display-Category" value="Localization"/>
rnovak@417
   348
       </propertyfile>
rnovak@417
   349
  </target>
rnovak@417
   350
rnovak@417
   351
  <target name="-check-ml-nbm-props">
rnovak@417
   352
      <condition property="run.ml.nbm.build" value="true">
rnovak@417
   353
          <and>
rnovak@417
   354
              <isset property="locales"/>
rnovak@417
   355
              <isset property="dlocales"/>
rnovak@417
   356
              <isset property="one.cluster.dir.ml"/>
rnovak@417
   357
              <isset property="comm.clusters.list"/>
rnovak@417
   358
              <isset property="spec.version"/>
rnovak@417
   359
              <isset property="netbeans.dest.dir.ml"/>
rnovak@417
   360
              <isset property="netbeans.build.dir.ml"/>
rnovak@417
   361
          </and>
rnovak@417
   362
      </condition>
rnovak@417
   363
  </target>
rnovak@417
   364
rnovak@417
   365
  <target name="build-one-nbm-ml" depends="init-tasks,-check-ml-nbm-props" if="run.ml.nbm.build">
rnovak@417
   366
      <property file="build/ml/cluster-nbms-ml.properties"/>
rnovak@417
   367
rnovak@417
   368
      <echo>Cluster dir: ${one.cluster.dir.ml}</echo>
rnovak@417
   369
rnovak@417
   370
      <pathconvert property="cluster.package.dir" setonempty="false">
rnovak@417
   371
          <path path="${one.cluster.dir.ml}"/>
rnovak@417
   372
          <chainedmapper>
rnovak@417
   373
          <filtermapper>
rnovak@417
   374
              <replacestring from="," to="_"/>
rnovak@417
   375
              <replacestring from="-" to="_"/>
rnovak@417
   376
              <replacestring from="." to="_"/>
rnovak@417
   377
          </filtermapper>
rnovak@417
   378
          <flattenmapper/>
rnovak@417
   379
          </chainedmapper>
rnovak@417
   380
      </pathconvert>
rnovak@417
   381
      <property name="cluster" location="${netbeans.build.dir.ml}/${one.cluster.dir.ml}"/>
rnovak@417
   382
rnovak@417
   383
      <delete dir="build/ml/nbms"/>
rnovak@417
   384
      <delete dir="${netbeans.build.dir.ml}"/>
rnovak@417
   385
      <mkdir dir="${netbeans.build.dir.ml}/${one.cluster.dir.ml}"/>
rnovak@417
   386
      <copy todir="${netbeans.build.dir.ml}/${one.cluster.dir.ml}">
rnovak@417
   387
          <fileset dir="dist/${one.cluster.dir.ml}"/>
rnovak@417
   388
      </copy>
rnovak@417
   389
rnovak@417
   390
      <condition property="code.name.base" value="org.netbeans.localization.${cluster.package.dir}.${dlocales}">
rnovak@417
   391
          <not>
rnovak@417
   392
              <isset property="is.kit"/>
rnovak@417
   393
          </not>
rnovak@417
   394
      </condition>
rnovak@417
   395
      <condition property="code.name.base" value="org.netbeans.localization.kit.${cluster.package.dir}.${dlocales}">
rnovak@417
   396
          <isset property="is.kit"/>
rnovak@417
   397
      </condition>
rnovak@417
   398
rnovak@417
   399
      <pathconvert property="code.name.base.slashes" setonempty="false">
rnovak@417
   400
          <path path="${code.name.base}"/>
rnovak@417
   401
          <chainedmapper>
rnovak@417
   402
              <flattenmapper/>
rnovak@417
   403
              <filtermapper>
rnovak@417
   404
                  <replacestring from="." to="/"/>
rnovak@417
   405
              </filtermapper>
rnovak@417
   406
          </chainedmapper>
rnovak@417
   407
      </pathconvert>
rnovak@417
   408
      <pathconvert property="code.name.base.dashes" setonempty="false">
rnovak@417
   409
          <path path="${code.name.base}"/>
rnovak@417
   410
          <chainedmapper>
rnovak@417
   411
              <flattenmapper/>
rnovak@417
   412
              <filtermapper>
rnovak@417
   413
                  <replacestring from="." to="-"/>
rnovak@417
   414
              </filtermapper>
rnovak@417
   415
          </chainedmapper>
rnovak@417
   416
      </pathconvert>
rnovak@417
   417
      <property name="public.packages" value="${code.name.base}.*"/>
rnovak@417
   418
      <property name="code.name" value="${code.name.base}/1"/>
rnovak@417
   419
      <mkdir dir="build/ml/nbms/classes/${code.name.base.slashes}"/>
rnovak@417
   420
      <mkdir dir="build/ml/nbms/tmp"/>
rnovak@417
   421
      <antcall target="-create-cluster-ml-nbm-metadata"/>
rnovak@417
   422
      <antcall target="-create-kit-ml-nbm-metadata"/>
rnovak@417
   423
      <property name="is.autoload" value="false"/>
rnovak@417
   424
      <property name="is.eager" value="false"/>
rnovak@417
   425
      <condition property="module.jar.dir" value="modules">
rnovak@417
   426
          <!-- set module.jar.dir property only when building kit NBM - leads to               AutoUpdate-Show-In-Client manifest attribute is set to true -->
rnovak@417
   427
          <isset property="is.kit"/>
rnovak@417
   428
      </condition>
rnovak@417
   429
      <property name="module.jar" value="modules/${code.name.base.dashes}.jar"/>      <mkdir dir="${cluster}/modules"/>
rnovak@417
   430
      <jarwithmoduleattributes jarfile="${cluster}/${module.jar}"
rnovak@417
   431
          compress="${build.package.compress}"
rnovak@417
   432
          index="${build.package.index}"
rnovak@417
   433
          manifest="build/ml/nbms/tmp/manifest.mf">
rnovak@417
   434
          <fileset dir="build/ml/nbms/classes"/>
rnovak@417
   435
      </jarwithmoduleattributes>
rnovak@417
   436
      <createmodulexml xmldir="${cluster}/config/Modules">
rnovak@417
   437
          <enabled dir="${cluster}">
rnovak@417
   438
              <include name="${module.jar}"/>
rnovak@417
   439
          </enabled>
rnovak@417
   440
      </createmodulexml>
rnovak@417
   441
      <patternset id="module.files">
rnovak@417
   442
          <!-- include name="${module.jar}"/ -->
rnovak@417
   443
          <include name="**/*.jar"/>
rnovak@417
   444
          <include name="config/Modules/${code.name.base.dashes}.xml"/>
rnovak@417
   445
      </patternset>
rnovak@417
   446
      <property name="module.files.toString" refid="module.files"/>
rnovak@417
   447
      <echo level="verbose">Basic matching module files (${code.name.base.dashes}): ${module.files.toString}</echo>
rnovak@417
   448
      <genlist outputfiledir="${cluster}" module="${module.jar}">
rnovak@417
   449
          <fileset dir="${cluster}">
rnovak@417
   450
              <patternset refid="module.files"/>
rnovak@417
   451
          </fileset>
rnovak@417
   452
      </genlist>
rnovak@417
   453
      <property name="license.file.override" location="build/ml/nbms/license"/>
rnovak@417
   454
      <property name="extra.license.files" value=""/>
rnovak@417
   455
      <taskdef name="releasefileslicense" classname="org.netbeans.nbbuild.extlibs.ReleaseFilesLicense" classpath="${nb_all}/nbbuild/nbantext.jar"/>
rnovak@417
   456
      <releasefileslicense license="${license.file.override}" standardlicense="${nb_all}/nbbuild/standard-nbm-license.txt" extralicensefiles="${extra.license.files}"/>
rnovak@417
   457
      <taskdef name="makenbm" classname="org.netbeans.nbbuild.MakeNBM" classpath="${nb_all}/nbbuild/nbantext.jar"/>
rnovak@417
   458
      <property name="nbm_alias" value="nb_ide"/>
rnovak@417
   459
      <makenbm file="build/ml/${code.name.base.dashes}.nbm"
rnovak@417
   460
               productdir="${cluster}"
rnovak@417
   461
               module="${module.jar}"
rnovak@417
   462
               homepage="http://translatedfiles.netbeans.org/"
rnovak@417
   463
               distribution="http://translatedfiles.netbeans.org/"
rnovak@417
   464
               needsrestart="true"
rnovak@417
   465
               global="true"
rnovak@417
   466
               targetcluster="${one.cluster.dir.ml}"
rnovak@417
   467
               releasedate=""
rnovak@417
   468
               moduleauthor="">
rnovak@417
   469
          <license file="${license.file.override}"/>
rnovak@417
   470
          <signature keystore="${keystore}" storepass="${storepass}" alias="${nbm_alias}"/>
rnovak@417
   471
      </makenbm>
rnovak@417
   472
      <move todir="${netbeans.dest.dir.ml}" file="build/ml/${code.name.base.dashes}.nbm"/>
rnovak@417
   473
      <property file="build/ml/cluster-nbms-ml.properties"/>
rnovak@417
   474
      <condition property="new.kit.deps" value="${code.name} &gt; ${spec.version}">
rnovak@417
   475
          <and>
rnovak@417
   476
              <not>
rnovak@417
   477
                  <isset property="kit.deps"/>
rnovak@417
   478
              </not>
rnovak@417
   479
              <not>
rnovak@417
   480
                  <isset property="is.kit"/>
rnovak@417
   481
              </not>
rnovak@417
   482
          </and>
rnovak@417
   483
      </condition>
rnovak@417
   484
      <condition property="new.kit.deps" value="${kit.deps},${code.name} &gt; ${spec.version}">
rnovak@417
   485
          <and>
rnovak@417
   486
              <isset property="kit.deps"/>
rnovak@417
   487
              <not>
rnovak@417
   488
                  <isset property="is.kit"/>
rnovak@417
   489
              </not>
rnovak@417
   490
          </and>
rnovak@417
   491
      </condition>
rnovak@417
   492
      <condition property="new.kit.deps" value="${kit.deps}">
rnovak@417
   493
          <isset property="is.kit"/>
rnovak@417
   494
      </condition>
rnovak@417
   495
      <propertyfile file="build/ml/cluster-nbms-ml.properties">
rnovak@417
   496
          <entry key="kit.deps" value="${new.kit.deps}"/>
rnovak@417
   497
      </propertyfile>
rnovak@417
   498
rnovak@417
   499
 </target>
rnovak@417
   500
mzlamal@24
   501
</project>