<?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 basedir="." default="convert">
    <import file="../../nbbuild/default.xml"/>
    <property name="ant.jar" location="${ant.home}/lib/ant.jar"/>
    <target name="init" depends="default.init">
        <ant dir="${nb_all}/openide/util"/>
        <ant dir="${nb_all}/openide/modules"/>
    </target>
    <target name="convert-compile" depends="init">
        <mkdir dir="build/antclasses"/>
        <javac srcdir="antsrc" destdir="build/antclasses" includes="ConvertToNbmProjectTask.java" source="1.4" debug="true">
            <classpath>
                <pathelement location="${ant.jar}"/>
                <pathelement location="${openide/util.dir}/lib/org-openide-util.jar"/>
                <pathelement location="${openide/modules.dir}/lib/org-openide-modules.jar"/>
            </classpath>
        </javac>
    </target>
    <target name="convert" depends="convert-compile">
        <property name="foobar" location="${nb_all}/foo/bar"/>
        <input addproperty="path">Choose module to projectize (e.g. foo/bar for ${foobar}):</input>
        <path id="task.cp">
            <pathelement location="build/antclasses"/>
            <fileset dir="${nb_all}/libs/external">
                <include name="xerces*.jar"/>
                <include name="xml-commons-dom-ranges*.jar"/>
            </fileset>
            <pathelement location="${openide/util.dir}/lib/org-openide-util.jar"/>
            <pathelement location="${openide/modules.dir}/lib/org-openide-modules.jar"/>
        </path>
        <property name="task.cp.tostring" refid="task.cp"/>
        <!--<echo>task.cp=${task.cp.tostring}</echo>-->
        <taskdef name="convert-to-nbm-project" classname="ConvertToNbmProjectTask">
            <classpath refid="task.cp"/>
        </taskdef>
        <convert-to-nbm-project nbroot="${nb_all}" path="${path}"/>
    </target>
</project>
