2 o -projecthelp is useful to find out what to do
4 o If you do not have asciidoc installed (and dont' want
5 to install it), set no.asciidoc on the command line or
8 <project name="vimdoclet" default="jar" basedir=".">
10 <property environment="env" />
12 <property name="src.dir" value="${basedir}/src"/>
13 <property name="java.src.dir" value="${src.dir}/java"/>
14 <property name="build.dir" value="${basedir}/build"/>
15 <property name="jar" value="${build.dir}/${ant.project.name}.jar"/>
16 <property name="doc.dir" value="${basedir}/doc" />
18 <loadfile property="release.number" srcFile="${src.dir}/release.txt">
24 <property name="release.name" value="vimdoclet-${release.number}" />
25 <property name="release.base.dir" value="${build.dir}/dist" />
26 <property name="release.dir.name" value="${release.name}" />
27 <property name="release.build.dir" value="${release.base.dir}/${release.dir.name}" />
28 <property name="samples.build.dir" value="${build.dir}/vimdoclet-${release.number}-samples" />
30 <path id="javadoc.classpath">
31 <fileset dir="${build.dir}"> <include name="*.jar"/> </fileset>
34 <target name="compile"
35 description="Compiles all code">
36 <mkdir dir="${build.dir}"/>
37 <mkdir dir="${build.dir}/classes"/>
38 <javac destdir="${build.dir}/classes"
40 <src path="${java.src.dir}"/>
45 description="Removes all build artifacts">
46 <delete dir="${build.dir}" />
47 <delete file="doc/index.html" />
50 <target name="jar" depends="compile"
51 description="Packages code in a jar file">
52 <jar destfile="${jar}"
53 basedir="${build.dir}/classes">
57 <target name="test.run" depends="jar"
58 description="Runs the doclet on the test classes"
60 <delete dir="${build.dir}/test-output" />
61 <mkdir dir="${build.dir}/test-output" />
62 <javadoc maxmemory="512M" classpathref="javadoc.classpath">
63 <packageset dir="${java.src.dir}" />
65 name="com.naildrivin5.applications.vimdoclet.Main"
66 pathref="javadoc.classpath">
67 <param name="-outputDir" value="${build.dir}/test-output" />
72 <target name="doc.push" depends="doc">
73 <scp verbose="true" sftp="true"
74 todir="davetron5000@shell.sourceforge.net:/home/groups/v/vi/vimdoclet/htdocs/" keyfile="/Users/davec/.ssh/id_dsa" passphrase="">
75 <fileset dir="${doc.dir}" excludes="README.txt"/>
79 <target name="doc" unless="no.asciidoc"
80 description="Generate HTML from asciidoc"
82 <exec executable="asciidoc" dir="${doc.dir}">
83 <arg line="-a toc -a numbered -o index.html README.txt" />
87 <target name="dist" depends="clean,jar,doc"
88 description="Creates a release tarball and zip in build/">
89 <mkdir dir="${release.build.dir}" />
90 <mkdir dir="${release.build.dir}/bin" />
92 <copy tofile="${release.build.dir}/bin/vimdoclet-${release.number}.jar" file="${jar}" />
93 <copy todir="${release.build.dir}/src">
94 <fileset dir="${src.dir}" excludes="release.txt" />
96 <copy todir="${release.build.dir}" file="build.xml" />
97 <copy todir="${release.build.dir}" file="run.xml" />
98 <mkdir dir="${release.build.dir}/doc" />
99 <copy todir="${release.build.dir}/doc">
100 <fileset dir="${doc.dir}" />
102 <tar destfile="${build.dir}/${release.name}.tar.gz" basedir="${release.base.dir}"
103 includes="${release.dir.name}/**"
104 compression="gzip" />
105 <zip destfile="${build.dir}/${release.name}.zip" basedir="${release.base.dir}"
106 includes="${release.dir.name}/**" />
109 <target name="dist-samples"
110 description="Creates the samples distribution">
111 <mkdir dir="${samples.build.dir}/vimdoclet-samples/samples" />
112 <copy todir="${samples.build.dir}/vimdoclet-samples/samples">
113 <fileset dir="${basedir}/sample" />
116 file="${samples.build.dir}/vimdoclet-samples/samples/README.txt"
117 tofile="${samples.build.dir}/vimdoclet-samples/README.txt" />
118 <zip destfile="${samples.build.dir}.zip" basedir="${samples.build.dir}" />