This repository was archived by the owner on Jan 14, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuild.xml
159 lines (128 loc) · 5.93 KB
/
build.xml
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
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
<?xml version="1.0"?>
<project name="textclassification" default="all" basedir="." xmlns:ivy="antlib:org.apache.ivy.ant">
<description>
</description>
<!-- *******************************************************************
**************** USER OPTIONS ************************************
*******************************************************************
Make changes to this section of the build file to customise your
test and build script -->
<!-- Allow overriding of properties via build.properties -->
<property file="build.properties" />
<property name="ivy.jar.dir" value="${user.home}/.ivy2/jars" />
<property name="ivy.jar.file" value="${ivy.jar.dir}/ivy.jar" />
<!-- =================================
target: load-ivy
this target is not necessary if you put ivy.jar in your ant lib directory
if you already have ivy 2.0 in your ant lib, you can simply remove this
target
================================= -->
<target name="load-ivy">
<!-- try to load ivy here from home ivy dir, in case the user has not already dropped
it into ant's lib dir (note that the latter copy will always take precedence).
We will not fail as long as ivy home lib dir exists (it may be empty) and
ivy is in at least one of ant's lib dir or the ivy home lib dir. -->
<mkdir dir="${ivy.jar.dir}" />
<path id="ivy.lib.path">
<fileset dir="${ivy.jar.dir}" includes="*.jar"/>
</path>
<taskdef resource="org/apache/ivy/ant/antlib.xml"
uri="antlib:org.apache.ivy.ant" classpathref="ivy.lib.path"/>
</target>
<!-- =================================
target: resolve
================================= -->
<target name="resolve" depends="clean-lib, load-ivy" description="--> resolve and retrieve dependencies with ivy">
<!-- the call to resolve is not mandatory, retrieve makes an implicit call if we don't -->
<ivy:resolve file="${ivy.file}"/>
<ivy:retrieve pattern="${compile.lib.dir}/[artifact].[ext]" />
</target>
<!-- Documentation directory -->
<property name="docDir" location="doc" />
<property name="jarFile" value="${plugin.name}-${version}.jar" />
<fileset id="lib" dir="lib">
<include name="*.jar" />
</fileset>
<fileset id="compile.lib.dir" dir="${compile.lib.dir}">
<include name="*.jar" />
</fileset>
<path id="compile.classpath">
<fileset refid="lib" />
<fileset refid="compile.lib.dir" />
</path>
<!-- RUNTIME MEMORY -->
<property name="run.memory" value="200M" />
<!-- *******************************************************************
**************** USER OPTIONS END HERE! **************************
******************************************************************* -->
<!-- set global properties for this build -->
<!-- Directories -->
<!-- Sources -->
<property name="srcDir" location="src" />
<!-- Use the new 1.3+ compiler -->
<property name="build.compiler" value="modern" />
<!-- create build directory structure -->
<target name="prepare" depends="resolve">
<mkdir dir="${build.dir}" />
<mkdir dir="${lib.dir}" />
</target>
<!-- Make documentation -->
<target name="javadoc">
<javadoc access="protected" destdir="${docDir}/javadoc" classpathref="compile.classpath" Encoding="UTF-8" Use="yes" Windowtitle="${plugin.name} JavaDoc" link="http://java.sun.com/j2se/1.5.0/docs/api/" docencoding="UTF-8" charset="UTF-8" source="1.5" useexternalfile="yes" breakiterator="true">
<fileset dir="${srcDir}" />
</javadoc>
</target>
<target name="copy.resources" depends="prepare" description="copy non-.java files from src to build">
<copy todir="${build.dir}" includeEmptyDirs="true">
<fileset dir="${srcDir}" excludes="**/*.java" />
</copy>
</target>
<!-- This target compiles all the classes including debug information
-->
<target name="compile" description="compile the source " depends="prepare">
<!-- Compile the java code from ${srcDir} into ${build.dir} -->
<javac classpathref="compile.classpath" srcdir="${srcDir}" destdir="${build.dir}" encoding="UTF-8" source="1.5" target="1.5" debug="true" />
</target>
<target name="jar" depends="compile,copy.resources">
<jar destfile="${jarFile}" update="false" index="true">
<fileset dir="${build.dir}/" />
</jar>
</target>
<!-- Generates a zip for the distribution -->
<target name="distrib" depends="jar">
<delete file="${plugin.name}-${version}.zip" />
<delete dir="${dist.dir}" />
<mkdir dir="${dist.dir}/${plugin.name}" />
<mkdir dir="${dist.dir}/${plugin.name}/lib" />
<copy todir="${dist.dir}/${plugin.name}/lib" includeEmptyDirs="false">
<fileset dir="lib" />
</copy>
<copy file="${jarFile}" todir="${dist.dir}/${plugin.name}" />
<copy file="creole.xml" todir="${dist.dir}/${plugin.name}" />
<zip compress="true" casesensitive="yes" destfile="${plugin.name}-${version}.zip">
<zipfileset dir="${dist.dir}" />
</zip>
</target>
<!-- Everything! -->
<target name="all" depends="clean,jar">
</target>
<!-- =================================
target: clean-lib
================================= -->
<target name="clean-lib" description="--> clean the project libraries directory (dependencies)">
<delete includeemptydirs="true" dir="${compile.lib.dir}"/>
</target>
<!-- =================================
target: clean-build
================================= -->
<target name="clean-build" description="--> clean the project built files">
<delete includeemptydirs="true" dir="${build.dir}"/>
</target>
<!-- =================================
target: clean
================================= -->
<target name="clean" depends="clean-build, clean-lib" description="--> clean the project" >
<delete dir="${dist.dir}" />
<delete file="${jarFile}" />
</target>
</project>