samples/extensionpoint/build.xml
author Jaroslav Tulach <jtulach@netbeans.org>
Sat, 14 Jun 2008 09:53:48 +0200
changeset 86 adf4440db888
child 119 8147cafd007a
permissions -rw-r--r--
How to write extension point
     1 <?xml version="1.0" encoding="UTF-8"?>
     2 <project name="extensionpoint" default="run" basedir=".">
     3     <target name="clean">
     4         <delete dir="build"/>
     5     </target>
     6     
     7     <target name="build">
     8         <antcall target="-build-one">
     9             <param name="version" value="api"/>
    10         </antcall>
    11         <antcall target="-build-one">
    12             <param name="version" value="helloworld"/>
    13             <param name="cp" location="build/api/classes"/>
    14         </antcall>
    15         <antcall target="-build-one">
    16             <param name="version" value="hellodesign"/>
    17             <param name="cp" location="build/api/classes"/>
    18         </antcall>
    19     </target>
    20     
    21     <target name="run" depends="build">
    22         <echo level="info" message="Running without any extension points."/>
    23         <antcall target="-run-one">
    24         </antcall>
    25         <echo level="info" message="Running with 'Hello World!' extension."/>
    26         <antcall target="-run-one">
    27             <param name="version1" value="helloworld"/>
    28         </antcall>
    29         <echo level="info" message="Running with 'Hello Design!' extension."/>
    30         <antcall target="-run-one">
    31             <param name="version1" value="hellodesign"/>
    32         </antcall>
    33         <echo level="info" message="Running with both extension."/>
    34         <antcall target="-run-one">
    35             <param name="version1" value="helloworld"/>
    36             <param name="version2" value="hellodesign"/>
    37         </antcall>
    38     </target>
    39 
    40     
    41     <!-- support methods -->
    42     
    43     <target name="-run-one">
    44         <java 
    45             classpath="build/${version1}/classes:build/${version2}/classes:build/api/classes:../libs/dist/org-openide-util.jar" 
    46             classname="org.apidesign.extensionpoint.Main"
    47             failonerror="true" 
    48         >
    49             <jvmarg value="-ea"/>
    50         </java>
    51     </target>
    52     
    53     <target name="-build-one">
    54         <fail message="You need to specify version number" unless="version"/>
    55         
    56         <mkdir dir="build/${version}/classes"/>
    57         <property name="cp" value=""/>
    58         <javac 
    59             srcdir="src-${version}" 
    60             destdir="build/${version}/classes" 
    61             source="1.5" target="1.5"
    62             classpath="${cp}"
    63         />
    64         <copy todir="build/${version}/classes">
    65             <fileset dir="src-${version}">
    66                 <exclude name="**/*.java"/>
    67             </fileset>
    68         </copy>
    69     </target>
    70 </project>