public
Description: Javadoc doclet that generates VIM helpfiles
Homepage: http://vimdoclet.sf.net
Clone URL: git://github.com/davetron5000/vimdoclet.git
vimdoclet / build.xml
100644 122 lines (105 sloc) 4.716 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
<!--
o -projecthelp is useful to find out what to do
 
o If you do not have asciidoc installed (and dont' want
to install it), set no.asciidoc on the command line or
in here.
-->
<project name="vimdoclet" default="jar" basedir=".">
 
    <property environment="env" />
 
    <property name="src.dir" value="${basedir}/src"/>
    <property name="java.src.dir" value="${src.dir}/java"/>
    <property name="build.dir" value="${basedir}/build"/>
    <property name="jar" value="${build.dir}/${ant.project.name}.jar"/>
    <property name="doc.dir" value="${basedir}/doc" />
 
    <loadfile property="release.number" srcFile="${src.dir}/release.txt">
        <filterchain>
            <striplinebreaks />
        </filterchain>
    </loadfile>
 
    <property name="release.name" value="vimdoclet-${release.number}" />
    <property name="release.base.dir" value="${build.dir}/dist" />
    <property name="release.dir.name" value="${release.name}" />
    <property name="release.build.dir" value="${release.base.dir}/${release.dir.name}" />
    <property name="samples.build.dir" value="${build.dir}/vimdoclet-${release.number}-samples" />
 
    <path id="javadoc.classpath">
        <fileset dir="${build.dir}"> <include name="*.jar"/> </fileset>
    </path>
 
    <target name="compile"
        description="Compiles all code">
        <mkdir dir="${build.dir}"/>
        <mkdir dir="${build.dir}/classes"/>
        <javac destdir="${build.dir}/classes"
            debug="on">
            <src path="${java.src.dir}"/>
        </javac>
    </target>
 
    <target name="clean"
        description="Removes all build artifacts">
        <delete dir="${build.dir}" />
        <delete file="doc/index.html" />
    </target>
 
    <target name="jar" depends="compile"
        description="Packages code in a jar file">
        <jar destfile="${jar}"
            basedir="${build.dir}/classes">
        </jar>
    </target>
 
    <target name="test.run" depends="jar"
        description="Runs the doclet on the test classes"
        >
        <delete dir="${build.dir}/test-output" />
        <mkdir dir="${build.dir}/test-output" />
        <javadoc maxmemory="512M" classpathref="javadoc.classpath">
            <packageset dir="${java.src.dir}" />
            <doclet
                name="com.naildrivin5.applications.vimdoclet.Main"
                pathref="javadoc.classpath">
                <param name="-outputDir" value="${build.dir}/test-output" />
            </doclet>
        </javadoc>
    </target>
 
    <target name="doc.push" depends="doc">
        <scp verbose="true" sftp="true"
            todir="davetron5000@shell.sourceforge.net:/home/groups/v/vi/vimdoclet/htdocs/" keyfile="/Users/davec/.ssh/id_dsa" passphrase="">
            <fileset dir="${doc.dir}" excludes="README.txt"/>
        </scp>
    </target>
 
    <target name="doc" unless="no.asciidoc"
        description="Generate HTML from asciidoc"
        >
        <exec executable="asciidoc" dir="${doc.dir}">
            <arg line="-a toc -a numbered -o index.html README.txt" />
        </exec>
    </target>
 
    <target name="dist" depends="clean,jar,doc"
        description="Creates a release tarball and zip in build/">
        <mkdir dir="${release.build.dir}" />
        <mkdir dir="${release.build.dir}/bin" />
 
        <copy tofile="${release.build.dir}/bin/vimdoclet-${release.number}.jar" file="${jar}" />
        <copy todir="${release.build.dir}/src">
            <fileset dir="${src.dir}" excludes="release.txt" />
        </copy>
        <copy todir="${release.build.dir}" file="build.xml" />
        <copy todir="${release.build.dir}" file="run.xml" />
        <mkdir dir="${release.build.dir}/doc" />
        <copy todir="${release.build.dir}/doc">
            <fileset dir="${doc.dir}" />
        </copy>
        <tar destfile="${build.dir}/${release.name}.tar.gz" basedir="${release.base.dir}"
            includes="${release.dir.name}/**"
            compression="gzip" />
        <zip destfile="${build.dir}/${release.name}.zip" basedir="${release.base.dir}"
            includes="${release.dir.name}/**" />
    </target>
 
    <target name="dist-samples"
        description="Creates the samples distribution">
        <mkdir dir="${samples.build.dir}/vimdoclet-samples/samples" />
        <copy todir="${samples.build.dir}/vimdoclet-samples/samples">
            <fileset dir="${basedir}/sample" />
        </copy>
        <move
            file="${samples.build.dir}/vimdoclet-samples/samples/README.txt"
            tofile="${samples.build.dir}/vimdoclet-samples/README.txt" />
        <zip destfile="${samples.build.dir}.zip" basedir="${samples.build.dir}" />
    </target>
 
</project>