<?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="entpack-default" default="init" basedir=".">
  <import file="default-properties.xml"/>
  <property name="harness.dir" value="${nb_all}/nbbuild/netbeans/harness"/>

  <target name="init-tasks" unless="entpack-tasks-already-set">
    <taskdef name="repeat"
         classname="org.netbeans.nbbuild.Repeat"
         classpath="${nb_all}/nbbuild/nbantext.jar"/>
    <taskdef name="for-each"
         classname="org.netbeans.nbbuild.ForEach"
         classpath="${nb_all}/nbbuild/nbantext.jar"/>
    <taskdef name="ep-for-each"
         classname="org.netbeans.nbbuild.EPForEach"
         classpath="${nb_all}/nbbuild/nbantext.jar"/>
    <property name="entpack-tasks-already-set" value="true"/>
    <taskdef name="jhindexer"
         classname="org.netbeans.nbbuild.JHIndexer"
         classpath="${nb_all}/nbbuild/nbantext.jar"/>
    <taskdef name="makenbm"
         classname="org.netbeans.nbbuild.MakeNBM"
         classpath="${nb_all}/nbbuild/nbantext.jar"/>
    <taskdef name="makejnlp"
         classname="org.netbeans.nbbuild.MakeJNLP"
         classpath="${nb_all}/nbbuild/nbantext.jar"/>
    <taskdef name="makemasterjnlp"
         classname="org.netbeans.nbbuild.MakeMasterJNLP"
         classpath="${nb_all}/nbbuild/nbantext.jar"/>
    <taskdef name="genlist"
         classname="org.netbeans.nbbuild.MakeListOfNBM"
         classpath="${nb_all}/nbbuild/nbantext.jar"/>
    <taskdef name="setcluster"
         classname="org.netbeans.nbbuild.SetCluster"
         classpath="${nb_all}/nbbuild/nbantext.jar"/>
    <taskdef name="getmodulename"
         classname="org.netbeans.nbbuild.GetModuleName"
         classpath="${nb_all}/nbbuild/nbantext.jar"/>
    <taskdef name="createmodulexml"
         classname="org.netbeans.nbbuild.CreateModuleXML"
         classpath="${nb_all}/nbbuild/nbantext.jar"/>
    <taskdef name="locjar"
         classname="org.netbeans.nbbuild.LocalizedJar"
         classpath="${nb_all}/nbbuild/nbantext.jar"/>
    <taskdef name="locjhindexer"
         classname="org.netbeans.nbbuild.LocJHIndexer"
         classpath="${nb_all}/nbbuild/nbantext.jar"/>
    <taskdef name="locmakenbm"
         classname="org.netbeans.nbbuild.LocMakeNBM"
         classpath="${nb_all}/nbbuild/nbantext.jar"/>
    <taskdef name="parseprojectxml"
         classname="org.netbeans.nbbuild.ParseProjectXml"
         classpath="${nb_all}/nbbuild/nbantext.jar"/>
    <taskdef name="jarwithmoduleattributes"
         classname="org.netbeans.nbbuild.JarWithModuleAttributes"
         classpath="${nb_all}/nbbuild/nbantext.jar"/>
    <taskdef name="arch"
         classname="org.netbeans.nbbuild.Arch"
         classpath="${nb_all}/nbbuild/nbantext.jar"/>
    <taskdef name="fixdependencies"
         classname="org.netbeans.nbbuild.FixDependencies"
         classpath="${nb_all}/nbbuild/nbantext.jar"/>
    <taskdef name="sortsuitemodules"
         classname="org.netbeans.nbbuild.SortSuiteModules"
         classpath="${nb_all}/nbbuild/nbantext.jar"/>
    <taskdef name="verifyclasslinkage"
         classname="org.netbeans.nbbuild.VerifyClassLinkage"
         classpath="${nb_all}/nbbuild/nbantext.jar"/>
    <property name="tasks-already-set" value="true"/>
  </target>
 
 <target name="init" depends="init-tasks,setup-jdkhome">
     <propertyfile file="run.properties">
         <entry key="keystore" value="${keystore}"/>
         <entry key="nbm_alias" value="${nbm_alias}"/>
         <entry key="storepass" value="${storepass}"/>
         <entry key="nbplatform.active" value="EntPack"/>
     </propertyfile>
 </target>

  <target name="setup-jdkhome-1">
    <!-- Note: user-configured -Djavahome=... will always override this: -->
    <property name="javahome" location="${java.home}"/>
    <condition property="jdkhome" value="${javahome}">
        <or>
            <available file="${javahome}/lib/tools.jar"/>
            <!-- on Mac -->
            <available file="${javahome}/../Classes/classes.jar"/>
        </or>
    </condition>
  </target>
  
  <target name="setup-jdkhome-2" unless="jdkhome">
    <property name="javahomeParent" location="${java.home}/.."/>
    <condition property="jdkhome" value="${javahomeParent}">
        <or>
            <available file="${javahomeParent}/lib/tools.jar"/>
            <!-- on Mac -->
            <available file="${javahomeParent}/../Classes/classes.jar"/>
        </or>
    </condition>
  </target>

  <target name="setup-jdkhome" depends="setup-jdkhome-1,setup-jdkhome-2" unless="jdkhome">
    <fail message="No tools.jar or classes.jar found in ${javahome}! Set -Djavahome=... as needed."/>
  </target>
</project>
