<?xml version="1.0" encoding="UTF-8"?> <!-- -*- sgml-indent-step: 2 -*- -->
<!--
  The contents of this file are subject to the terms of the Common Development
  and Distribution License (the License). You may not use this file except in
  compliance with the License.

  You can obtain a copy of the License at http://www.netbeans.org/cddl.html
  or http://www.netbeans.org/cddl.txt.

  When distributing Covered Code, include this CDDL Header Notice in each file
  and include the License file at http://www.netbeans.org/cddl.txt.
  If applicable, add the following below the CDDL Header, with the fields
  enclosed by brackets [] replaced by your own identifying information:
  "Portions Copyrighted [year] [name of copyright owner]"

  The Original Software is NetBeans. The Initial Developer of the Original
  Software is Sun Microsystems, Inc. Portions Copyright 1997-2006 Sun
  Microsystems, Inc. All Rights Reserved.
-->
<project name="suite-impl" basedir=".">

    <target name="nbms" depends="-init" description="build all nbms in the suite.">
      <subant target="nbm" buildpath="${modules.sorted}" inheritrefs="false" inheritall="false"/>
      <echo>******** nbm-target-dir=${nbm.target.dir} </echo>
      <mkdir dir="${nbm.target.dir}"/>
      <subant target="move-nbm" buildpath="${modules.sorted}" genericantfile="${ant.file}" inheritrefs="false" inheritall="true"/>
    </target>

    <target name="move-nbm">
      <move todir="${nbm.target.dir}">
        <fileset dir="build/updates" includes="*.nbm"/>
      </move>
    </target>

    <target name="zip-cluster">
      <zip destfile="${dist.dir}/ent_pack-${branchname}-${buildnumber}${file.ext}.zip" update="true"
           basedir="${nbplatform.EntPack.netbeans.dest.dir}" includes="${cluster.dir.name}/*/**"/>
    </target>

    <target name="process-cluster" depends="check-cluster" if="cluster.not.in.list">
        <!-- add cluster name to etc/netbeans.clusters -->
        <echo
            file="${nbplatform.EntPack.netbeans.dest.dir}/etc/netbeans.clusters"
            message="${cluster.dir.name}${line.separator}"
            append="true"/>

        <!-- copy Enterprise Pack legal files -->
        <copy todir="${nbplatform.EntPack.netbeans.dest.dir}/${cluster.dir.name}">
            <fileset dir="${nbplatform.EntPack.netbeans.dest.dir}/../entpack/legal/entpack">
                <include name="*.txt"/>
                <include name="*.html"/>
            </fileset>
        </copy>

        <!-- copy Java Tools Bundle legal files -->
        <copy todir="${nbplatform.EntPack.netbeans.dest.dir}" overwrite="true">
            <fileset dir="${nbplatform.EntPack.netbeans.dest.dir}/../entpack/legal/bundle">
                <include name="*.txt"/>
            </fileset>
        </copy>

        <!-- Set Enterprise Pack build number-->
        <tstamp>
            <format property="pack.build.number" pattern="yyyy.MM.dd HH:mm" locale="en"/>
        </tstamp>
        <echo file="${nbplatform.EntPack.netbeans.dest.dir}/${cluster.dir.name}/build_info">Enterprise Pack: ${pack.build.number}${line.separator}</echo>
    </target>

    <target name="check-cluster">
        <loadfile srcFile="${nbplatform.EntPack.netbeans.dest.dir}/etc/netbeans.clusters" property="clusters.list"/>
        <condition property="cluster.not.in.list">
            <not>
                <contains string="${clusters.list}" substring="${cluster.dir.name}"/>
            </not>
        </condition>
    </target>
</project>
