<?xml version="1.0"?>
<!--
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="libs/xhtml" default="netbeans" basedir=".">

    <property name="libs_root" location=".."/>

    <property name="nbroot" location="${libs_root}/.."/>
    <property name="nbext_root" location="${nbroot}/nbbuild"/>

    <property name="license.file" location="${nbroot}/nbbuild/standard-nbm-license.txt"/>
    <property name="homepage.base" value="libs.netbeans.org"/>
    <property name="dist.base" value="www.netbeans.org/download/nbms/40"/>
    <property name="nbm_alias" value="nb_ide"/>

    <taskdef name="makenbm" classname="org.netbeans.nbbuild.MakeNBM" classpath="${nbext_root}/nbantext.jar"/>
    <taskdef name="genlist" classname="org.netbeans.nbbuild.MakeListOfNBM" classpath="${nbext_root}/nbantext.jar"/>
    <taskdef name="locjar" classname="org.netbeans.nbbuild.LocalizedJar" classpath="${nbext_root}/nbantext.jar"/>


    <target name="init">
        <property file="${libs_root}/public.properties"/>
        <filter token="xhtml_SPEC_VERS_SUBST" value="${libs.xhtml.specification.version}"/>
        <filter token="xhtml_IMPL_VERS_SUBST" value="${libs.xhtml.implementation.version}"/>
        <filter token="BUILD_NUMBER_SUBST" value="${buildnumber}"/>
    </target>

    <target name="jars" depends="init" description="Package NetBeans XHTML wrapper module.">
        <mkdir dir="netbeans/modules"/>

        <copy file="manifest.mf" tofile="manifest-subst.mf" filtering="on"/>
        <locjar jarfile="netbeans/modules/autoload/xhtml.jar"
                manifest="manifest-subst.mf"
                compress="false">
            <fileset dir="src" excludesfile="${nbroot}/nbbuild/standard-jar-excludes.txt"/>
            <locale name="ja"/>
        </locjar>    
    </target>

    <target name="release" depends="init">
        <mkdir dir="netbeans/modules/autoload/ext"/>
        <copy todir="netbeans/modules/autoload/ext">
            <fileset dir="${libs_root}/external">
                <include name="xhtml*.zip"/>
            </fileset>
        </copy>
    </target>

    <target name="netbeans" depends="jars, release">
        <genlist targetname="nbm" outputfiledir="netbeans"/>
    </target>

    <target name="nbm" depends="netbeans">
        <delete dir="Info"/>
        <makenbm file="${libs_root}/xhtml.nbm"
                 topdir="."
                 module="netbeans/modules/autoload/xhtml.jar"
                 homepage="http://${homepage.base}/#xhtml"
                 distribution="http://${dist.base}/xhtml.nbm">
            <license name="xhtml-license.txt">
                <text>For the integration module:</text>
                <file location="${license.file}"/>
                <text>For the xhtml library:</text>
                <file location="${libs_root}/external/xhtml11-license.txt"/>
            </license>
            <signature keystore="${keystore}" storepass="${storepass}" alias="${nbm_alias}"/>
        </makenbm>
    </target>

    <target name="clean">
        <delete file="manifest-subst.mf"/>
        <delete file="${libs_root}/xhtml.nbm"/>
        <delete dir="netbeans"/>
        <delete dir="Info"/>
    </target>

    <target name="all" depends="clean, nbm"/>

</project>
