source: extensions/net.sf.basedb.ftp/trunk/build.xml @ 1025

Last change on this file since 1025 was 1025, checked in by Nicklas Nordborg, 13 years ago

Fixes #201: Change source files to UTF-8

File size: 4.8 KB
Line 
1<?xml version="1.0" encoding="UTF-8"?>
2<!--
3  $Id $
4
5  Copyright (C) 2008 Nicklas Nordborg
6
7  This file is part of FTP extension for BASE.
8  Available at http://baseplugins.thep.lu.se/
9
10  BASE is free software; you can redistribute it and/or
11  modify it under the terms of the GNU General Public License
12  as published by the Free Software Foundation; either version 2
13  of the License, or (at your option) any later version.
14
15  BASE is distributed in the hope that it will be useful,
16  but WITHOUT ANY WARRANTY; without even the implied warranty of
17  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  GNU General Public License for more details.
19
20  You should have received a copy of the GNU General Public License
21  along with this program; if not, write to the Free Software
22  Foundation, Inc., 59 Temple Place - Suite 330,
23  Boston, MA  02111-1307, USA.
24-->
25<project 
26  name="FtpServerExtension" 
27  default="jar" 
28  basedir=".">
29
30  <!--create this file if you need to override values from properties below -->
31  <property file="build.properties" />
32 
33  <!-- variables used -->
34  <property name="name" value="base-ftpserver" />
35  <property name="version" value="1.1pre" />
36  <property name="src" location="src" description="Location of source files" />
37  <property name="build" location="build" description="Location of compiled files" />
38  <property name="jar.name" value="${name}.jar" 
39    description="Name of JAR file with the extensions." />
40  <property name="tar.prefix" value="${name}-${version}" 
41    description="Prefix of .tar.gz file for download." />
42  <property name="tar.name" value="${tar.prefix}.tar.gz" 
43    description="Full name of .tar.gz file for download." />
44  <property name="javac.arg" value="-Xlint:unchecked" />
45  <property name="javac.source" value="1.5" />
46  <property name="javac.target" value="1.5" />
47  <property name="javac.encoding" value="UTF-8" />
48  <property name="depend.jars" value="http://base2.thep.lu.se/base/jars/2.10.0" />
49
50  <!-- set up classpath for compiling -->
51  <path id="classpath">
52    <fileset dir="lib">
53      <include name="**/*.jar" />
54    </fileset>
55  </path>
56
57  <target name="init">
58    <mkdir dir="${build}" />
59  </target>
60   
61  <target name="clean">
62    <delete failonerror="false" includeemptydirs="true">
63      <fileset dir="${build}" defaultexcludes="no" />
64      <fileset file="${jar.name}" />
65      <fileset file="${tar.name}" />
66    </delete>
67  </target>
68 
69  <target
70    name="package"
71    depends="clean,jar"
72    description="Clean and create binary distribution package"
73    >
74    <tar
75      destfile="${tar.name}"
76      longfile="gnu"
77      compression="gzip"
78      >
79      <tarfileset
80        dir="."
81        prefix="${tar.prefix}"
82        preserveLeadingSlashes="true"
83        includes="${jar.name},README,LICENSE*,ftp-config.xml,lib/ftpserver/*"
84      />
85    </tar>
86  </target>
87 
88  <target 
89    name="jar"
90    depends="build"
91    description="Creates the extension JAR file"
92    >
93    <jar 
94      jarfile="${jar.name}"
95      manifest="META-INF/MANIFEST.MF"
96      >
97      <fileset dir="${build}" />
98      <fileset dir="." includes="META-INF/**" />
99      <fileset dir="." includes="resources/**" />
100    </jar>
101  </target>
102 
103  <target 
104    name="build"
105    depends="init,checkjar"
106    description="Compiles the plugin and put in jar"
107    >
108    <mkdir dir="${build}" />
109    <javac 
110      encoding="${javac.encoding}" 
111      srcdir="${src}" 
112      destdir="${build}" 
113      debug="true" 
114      classpathref="classpath"
115      source="${javac.source}"
116      target="${javac.target}"
117      >
118      <compilerarg value="${javac.arg}" />
119    </javac>
120  </target>
121 
122  <target 
123    name="checkjar"
124    description="Checks that the BASE2Core.jar and BASE2CorePlugins.jar exists."
125    >
126    <available classname="net.sf.basedb.core.Application" 
127      classpathref="classpath" property="base2core" />
128    <available classname="net.sf.basedb.clients.web.extensions.menu.FixedMenuItemFactory" 
129      classpathref="classpath" property="base2web" />
130    <fail unless="base2core" message="Can't find BASE2Core.jar in ./lib/compile. Try 'ant download-lib' to download the missing file." />
131    <fail unless="base2web" message="Can't find BASE2Webclient.jar in ./lib/compile. Try 'ant download-lib' to download the missing file." />
132    <echo>Found BASE2Core.jar and BASE2Webclient.jar.</echo>
133  </target>
134 
135  <target 
136    name="download-lib"
137    description="Download BASE2Core.jar and BASE2Webclient.jar."
138    >
139    <echo>
140-------------------------------------------------------   
141NOTE! You may specifiy a different download location by
142creating the file './build.properties' and
143setting 'depend.jars' to the URL to download from.
144-------------------------------------------------------
145    </echo>
146    <download-lib file="BASE2Core.jar" />
147    <download-lib file="BASE2Webclient.jar" />
148  </target>
149 
150  <macrodef name="download-lib" description="Download BASE core JAR files">
151    <attribute name="file" />
152    <sequential>
153      <get 
154        dest="lib/compile/@{file}" 
155        src="${depend.jars}/@{file}" 
156        usetimestamp="true" 
157        verbose="true"
158        ignoreerrors="true"
159      />
160    </sequential>
161  </macrodef>
162</project>
Note: See TracBrowser for help on using the repository browser.