Source

main-silver / xml.tools / build.xml

<?xml version="1.0"?>
<!--
                Sun Public License Notice

The contents of this file are subject to the Sun Public License
Version 1.0 (the "License"). You may not use this file except in
compliance with the License. A copy of the License is available at
http://www.sun.com/

The Original Code is NetBeans. The Initial Developer of the Original
Code is Sun Microsystems, Inc. Portions Copyright 1997-2004 Sun
Microsystems, Inc. All Rights Reserved.
-->

<project name="xml/tools" default="netbeans" basedir=".">
    <import file="../../nbbuild/default.xml"/> 

    <property name="xml_root" location=".."/>
    <property name="api_root" location="${xml_root}/api"/>
    <property name="tax_root" location="${xml_root}/tax"/>
    <property name="tax_lib_root" location="${tax_root}/lib"/>
    <property name="core_root" location="${xml_root}/core"/>

    <target name="init" depends="default.init">
        <patternset id="xml/tools.files">
          <include name="${nb.modules.dir}/xml-tools.jar"/>
          <include name="${nb.docs.dir}/xml-apis.zip"/>
          <include name="${nb.system.dir}/ParserDB/xml-apis.jc*"/>
        </patternset>
        <path id="cp">
          <pathelement location="${nb_all}/openide/openide-13javac-workaround.jar"/>
          <pathelement location="${openide.dir}/${nb.lib.dir}/openide.jar"/>
          <pathelement location="${openide/loaders.dir}/${nb.lib.dir}/openide-loaders.jar"/>
          <pathelement location="${java/srcmodel.dir}/${nb.modules/autoload.dir}/java-src-model.jar"/>
          <pathelement location="${xml/api.dir}/${nb.modules/autoload.dir}/xml-api.jar"/>
          <pathelement location="${xml/tax.dir}/${nb.modules/autoload.dir}/xml-tax.jar"/>
          <pathelement location="${xml/tax.dir}/${nb.modules/autoload.dir}/ext/tax.jar"/>
          <pathelement location="${xml/core.dir}/${nb.modules/autoload.dir}/xml-core.jar"/>
          <pathelement location="${java/api.dir}/${nb.modules/autoload.dir}/java-api.jar"/>
        </path>
    </target>

    <target name="compile" depends="init">
        <echo message="Compiling XML tools module classes..."/>
        <javac srcdir="src" destdir="src" deprecation="${build.compiler.deprecation}" debug="${build.compiler.debug}" source="1.4">
            <classpath refID="cp"/>
        </javac>
    </target>

    <target name="jars" depends="compile">
        <mkdir dir="${netbeans.dest.dir}/${cluster.dir}/${nb.modules.dir}"/>
        <property file="${xml_root}/spec-vers.properties"/>
        <copy file="manifest.mf" tofile="manifest-subst.mf">
            <filterchain>
                <expandproperties/>
            </filterchain>
        </copy>
        <jar jarfile="${netbeans.dest.dir}/${cluster.dir}/${nb.modules.dir}/xml-tools.jar"
                manifest="manifest-subst.mf"
                compress="false">
            <fileset dir="src" excludesfile="${nb_all}/nbbuild/standard-jar-excludes.txt"/>
            <fileset dir="compat/src" excludesfile="${nb_all}/nbbuild/standard-jar-excludes.txt"/>
        </jar>    
    </target>

    <target name="release">
        <copy todir="${netbeans.dest.dir}/${cluster.dir}/${nb.docs.dir}" includeEmptyDirs="false">
            <fileset dir="release/docs" excludesfile="${nb_all}/nbbuild/standard-jar-excludes.txt"/>
        </copy>
        <copy todir="${netbeans.dest.dir}/${cluster.dir}/${nb.system.dir}" includeEmptyDirs="false">
            <fileset dir="release/system" excludesfile="${nb_all}/nbbuild/standard-jar-excludes.txt"/>
        </copy>
    </target>

    <target name="netbeans" depends="jars,release">
       <genlist outputfiledir="${netbeans.dest.dir}/${cluster.dir}" module="${nb.modules.dir}/xml-tools.jar">
          <fileset dir="${netbeans.dest.dir}/${cluster.dir}">
             <patternset refID="xml/tools.files"/>
          </fileset>
       </genlist>
    </target>

    <target name="reload" depends="compile" description="Test module inside running IDE (API Support with Ant required).">
        <mkdir dir="test"/>

        <copy file="manifest.mf" tofile="manifest-subst.mf" filtering="on"/>
        <jar jarfile="test/xml-tools-test.jar" manifest="manifest-subst.mf" compress="false">
            <fileset dir="src" excludesfile="../../nbbuild/standard-jar-excludes.txt"/>
        </jar>
        <nbinstaller module="test/xml-tools-test.jar" action="reinstall"/>
    </target>
    
    
    <target name="nbm" depends="netbeans">
        <makenbm file="xml-tools.nbm"
                 productdir="${netbeans.dest.dir}/${cluster.dir}"
                 needsrestart="false"
                 module="${nb.modules.dir}/xml-tools.jar"
                 homepage="http://xml.${homepage.base}/tools/"
                 distribution="http://${dist.base}/xml-tools.nbm">
            <license file="${license.file}"/>
            <signature keystore="${keystore}" storepass="${storepass}" alias="${nbm_alias}"/>
        </makenbm>
    </target>

    <target name="clean" depends="init" description="Clean build products.">
        <delete>
            <fileset dir="src">
                <include name="**/*.class"/>
            </fileset>
            <fileset dir="${netbeans.dest.dir}/${cluster.dir}">
                <patternset refID="xml/tools.files"/>
            </fileset>
        </delete>
        <delete file="manifest-subst.mf"/>
        <delete file="xml-tools.nbm"/>
    </target>

    <target name="real-clean" depends="clean">
        <delete dir="javadoc"/>

        <ant dir="test" target="realclean"/>
    </target>

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

    <target name="javadoc">
    </target>


    <!-- This target compile all XML sub-modules. -->
    <target name="all-xml">
        <echo message="Compile all XML sub-modules ..."/>
        <ant dir=".." target="clean"/>
        <ant dir=".." target="compile"/>
    </target>

    <target name="test">
        <ant dir="test"/>
    </target>

</project>