java/ant/build.xml
changeset 328 9e7c0ac38233
parent 268 fb9bf90251e3
child 329 918e6f7f8136
     1.1 --- a/java/ant/build.xml	Sun Jul 06 00:12:56 2008 +0200
     1.2 +++ b/java/ant/build.xml	Fri Apr 24 22:58:54 2009 +0200
     1.3 @@ -2,6 +2,11 @@
     1.4  <!-- You may freely edit this file. See commented blocks below for -->
     1.5  <!-- some examples of how to customize the build. -->
     1.6  <!-- (If you delete it and reopen the project it will be recreated.) -->
     1.7 +<!-- By default, only the Clean and Build commands use this build script. -->
     1.8 +<!-- Commands such as Run, Debug, and Test only use this build script if -->
     1.9 +<!-- the Compile on Save feature is turned off for the project. -->
    1.10 +<!-- You can turn off the Compile on Save (or Deploy on Save) setting -->
    1.11 +<!-- in the project's Project Properties dialog box.-->
    1.12  <project name="ant" default="default" basedir=".">
    1.13      <description>Builds, tests, and runs the project ant.</description>
    1.14      <import file="nbproject/build-impl.xml"/>
    1.15 @@ -66,4 +71,27 @@
    1.16      nbproject/build-impl.xml file. 
    1.17  
    1.18      -->
    1.19 +    <target name="-revision" unless="revision">
    1.20 +        <fail unless="snippets.code.dir"/>
    1.21 +        <exec dir="${snippets.code.dir}" outputproperty="revision" executable="/bin/sh">
    1.22 +            <arg file="${ant.file}/../tip.sh"/>
    1.23 +        </exec>
    1.24 +    </target>
    1.25 +
    1.26 +    <target name="snippets" depends="jar,-revision" description="Extracts code snippets">
    1.27 +        <fail unless="revision"/>
    1.28 +        <fail unless="snippets.dir"/>
    1.29 +        <fail unless="snippets.repo"/>
    1.30 +        <fail unless="snippets.path"/>
    1.31 +        <fail unless="snippets.code.dir"/>
    1.32 +
    1.33 +        <taskdef name="grepcopy" classname="org.apidesign.infra.ant.GrepCopy" classpath="dist/apidesign-ant-tasks.jar"/>
    1.34 +        <grepcopy target="${snippets.dir}" baseurl="${snippets.repo}/file/${revision}/${snippets.path}">
    1.35 +            <fileset dir="${snippets.code.dir}">
    1.36 +                <include name="**/*"/>
    1.37 +                <exclude name="**/build/**/*"/>
    1.38 +            </fileset>
    1.39 +        </grepcopy>
    1.40 +    </target>
    1.41 +
    1.42  </project>