1 | <?xml version="1.0" encoding="UTF-8"?> |
---|
2 | <!-- |
---|
3 | $Id: build.xml 747 2008-08-27 06:17:29Z martin $ |
---|
4 | |
---|
5 | Copyright (C) 2008 Martin Svensson |
---|
6 | |
---|
7 | This file is part of Normalizers plug-in package for BASE. |
---|
8 | Available at http://baseplugins.thep.lu.se/ |
---|
9 | BASE main site: http://base.thep.lu.se/ |
---|
10 | |
---|
11 | This is free software; you can redistribute it and/or |
---|
12 | modify it under the terms of the GNU General Public License |
---|
13 | as published by the Free Software Foundation; either version 2 |
---|
14 | of the License, or (at your option) any later version. |
---|
15 | |
---|
16 | The software is distributed in the hope that it will be useful, |
---|
17 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
18 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
19 | GNU General Public License for more details. |
---|
20 | |
---|
21 | You should have received a copy of the GNU General Public License |
---|
22 | along with this program; if not, write to the Free Software |
---|
23 | Foundation, Inc., 59 Temple Place - Suite 330, |
---|
24 | Boston, MA 02111-1307, USA. |
---|
25 | --> |
---|
26 | |
---|
27 | <project |
---|
28 | name="NormalizationPlugins" |
---|
29 | default="dist" |
---|
30 | basedir="." |
---|
31 | > |
---|
32 | |
---|
33 | <!-- variables used --> |
---|
34 | <property name="name" value="normalization-plugins" /> |
---|
35 | <property name="src" value="src" /> |
---|
36 | <property name="version" value="pre1.0" description="Version number of the package" /> |
---|
37 | <property name="build" value="build" description="Location of build class files"/> |
---|
38 | <property name="dist" value="dist" description="Location where jar-file are created"/> |
---|
39 | <property name="jar" value="${name}.jar" description="Name of the jar file"/> |
---|
40 | <property name="package" location="package" description="Directory where packaged distribution files are created"/> |
---|
41 | <property name="javac.arg" value="-Xlint:unchecked" /> |
---|
42 | <property name="javac.source" value="1.5" /> |
---|
43 | <property name="javac.target" value="1.5" /> |
---|
44 | <property name="javac.encoding" value="ISO-8859-1" /> |
---|
45 | |
---|
46 | <!-- set up classpath for compiling --> |
---|
47 | <path id="classpath"> |
---|
48 | <fileset dir="lib"> |
---|
49 | <include name="**/*.jar"/> |
---|
50 | </fileset> |
---|
51 | </path> |
---|
52 | |
---|
53 | <target name="init"> |
---|
54 | <mkdir dir="${build}" /> |
---|
55 | <mkdir dir="${dist}" /> |
---|
56 | </target> |
---|
57 | |
---|
58 | <target name="clean"> |
---|
59 | <delete failonerror="false" includeemptydirs="true"> |
---|
60 | <fileset dir="${build}" defaultexcludes="no" /> |
---|
61 | <fileset dir="${dist}" defaultexcludes="no" /> |
---|
62 | <fileset dir="${package}" defaultexcludes="no" /> |
---|
63 | </delete> |
---|
64 | </target> |
---|
65 | |
---|
66 | <!-- main target --> |
---|
67 | <target |
---|
68 | name="dist" |
---|
69 | depends="clean,build" |
---|
70 | > |
---|
71 | <copy todir="${dist}"> |
---|
72 | <fileset dir="." includes="README*,LICENSE,INSTALL" /> |
---|
73 | </copy> |
---|
74 | </target> |
---|
75 | |
---|
76 | <target |
---|
77 | name="package" |
---|
78 | depends="dist" |
---|
79 | description="Create binary distribution package" |
---|
80 | > |
---|
81 | <property name="tar.prefix" value="${name}-${version}" /> |
---|
82 | <mkdir dir="${package}" /> |
---|
83 | <tar |
---|
84 | destfile="${package}/${tar.prefix}.tar.gz" |
---|
85 | longfile="gnu" |
---|
86 | compression="gzip" |
---|
87 | > |
---|
88 | <tarfileset |
---|
89 | dir="${dist}" |
---|
90 | mode="755" |
---|
91 | prefix="${tar.prefix}" |
---|
92 | preserveLeadingSlashes="true" |
---|
93 | > |
---|
94 | <include name="**/*.sh" /> |
---|
95 | </tarfileset> |
---|
96 | <tarfileset |
---|
97 | dir="${dist}" |
---|
98 | prefix="${tar.prefix}" |
---|
99 | preserveLeadingSlashes="true" |
---|
100 | > |
---|
101 | <exclude name="**/*.sh" /> |
---|
102 | </tarfileset> |
---|
103 | </tar> |
---|
104 | </target> |
---|
105 | |
---|
106 | <target |
---|
107 | name="build" |
---|
108 | depends="init" |
---|
109 | description="Compiles the plugin and put in jar" |
---|
110 | > |
---|
111 | <property name="jar" value="${name}.jar" /> |
---|
112 | <mkdir dir="${build}" /> |
---|
113 | <javac |
---|
114 | encoding="${javac.encoding}" |
---|
115 | srcdir="${src}" |
---|
116 | destdir="${build}" |
---|
117 | debug="true" |
---|
118 | classpathref="classpath" |
---|
119 | source="${javac.source}" |
---|
120 | target="${javac.target}" |
---|
121 | > |
---|
122 | <compilerarg value="${javac.arg}" /> |
---|
123 | </javac> |
---|
124 | <copy todir="${build}"> |
---|
125 | <fileset dir="." includes="META-INF/*" /> |
---|
126 | </copy> |
---|
127 | <replace token="%%plugins.jar%%" value="${jar}" file="${build}/META-INF/base-plugins.xml" /> |
---|
128 | <jar |
---|
129 | jarfile="${dist}/${jar}" |
---|
130 | basedir="${build}" |
---|
131 | > |
---|
132 | </jar> |
---|
133 | </target> |
---|
134 | |
---|
135 | </project> |
---|