<?xml version="1.0" encoding="UTF-8"?>
<!--
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="apisupport/harness" default="netbeans" basedir=".">

    <import file="../../nbbuild/templates/projectized.xml"/>

    <target name="nbantext" depends="init">
        <jar jarfile="${cluster}/tasks.jar" compress="${build.package.compress}" index="${build.package.index}">
            <!-- XXX would be more maintainable to use depfind.sf.net / genjar.sf.net / sadun-util.sf.net/pack.html -->
            <zipfileset src="${nb_all}/nbbuild/nbantext.jar" includes="${bundled.tasks}"/>
            <zipfileset file="taskdefs.properties" fullpath="org/netbeans/nbbuild/taskdefs.properties"/>
        </jar>
    </target>

    <target name="netbeans-extra" depends="init,nbantext,jar-jnlp-launcher">
        <copy file="${nb_all}/nbbuild/templates/common.xml" tofile="${cluster}/common.xml"/>
        <copy file="${nb_all}/nbbuild/jdk.xml" tofile="${cluster}/jdk.xml"/>
        <copy file="../external/jsearch-2.0_03.jar" todir="${cluster}"/>
    </target>
 
    <target name="compile-jnlp-launcher" depends="init,compile">
        <mkdir dir="build/jnlp-launcher-classes"/>
        <javac srcdir="jnlp-src" destdir="build/jnlp-launcher-classes" deprecation="${build.compiler.deprecation}" debug="${build.compiler.debug}" source="1.4" includeantruntime="false">
            <classpath>
                <path path="${jnlp.cp}"/>
            </classpath>
        </javac>
        <copy todir="build/jnlp-launcher-classes">
            <fileset dir="jnlp-src" excludesfile="${nb_all}/nbbuild/standard-jar-excludes.txt"/>
        </copy>
    </target>
   
    <target name="jar-jnlp-launcher" depends="compile-jnlp-launcher">
        <mkdir dir="${cluster}/jnlp/"/>
        <jar jarfile="${cluster}/jnlp/jnlp-launcher.jar" compress="false" manifest="jnlp-manifest.mf" >
            <fileset dir="build/jnlp-launcher-classes"/>
        </jar>
    </target>

    <target name="nbm" depends="init,netbeans,-nbm-prompt-for-storepass" description="Build NBM archive.">
        <mkdir dir="build"/>
        <makenbm file="build/${nbm}"
                 productdir="${cluster}"
                 module="${module.jar}"
                 homepage="${nbm.homepage}"
                 distribution="${nbm.distribution}"
                 needsrestart="${nbm.needs.restart}"
                 global="${nbm.is.global}"
                 releasedate="${nbm.release.date}"
		 moduleauthor="${nbm.module.author}"> 
            <license name="apisupport-harness-license.txt">
                <text>For the main build harness:</text>
                <file location="${license.file}"/>
                <text>For the bundled JavaHelp search indexer library:</text>
                <file location="../external/jsearch-2.0_03-license.txt"/>
            </license>
            <signature keystore="${keystore}" storepass="${storepass}" alias="${nbm_alias}"/>
        </makenbm>
    </target>

</project>
