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

Last change on this file since 1230 was 1230, checked in by Nicklas Nordborg, 11 years ago

Fixes #269: Update ftp server library version

Updated to 1.0.4.

File size: 4.9 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.16.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      includeantruntime="false"
118      >
119      <compilerarg value="${javac.arg}" />
120    </javac>
121  </target>
122 
123  <target 
124    name="checkjar"
125    description="Checks that the BASE2Core.jar and BASE2CorePlugins.jar exists."
126    >
127    <available classname="net.sf.basedb.core.Application" 
128      classpathref="classpath" property="base2core" />
129    <available classname="net.sf.basedb.clients.web.extensions.menu.FixedMenuItemFactory" 
130      classpathref="classpath" property="base2web" />
131    <fail unless="base2core" message="Can't find BASE2Core.jar in ./lib/compile. Try 'ant download-lib' to download the missing file." />
132    <fail unless="base2web" message="Can't find BASE2Webclient.jar in ./lib/compile. Try 'ant download-lib' to download the missing file." />
133    <echo>Found BASE2Core.jar and BASE2Webclient.jar.</echo>
134  </target>
135 
136  <target 
137    name="download-lib"
138    description="Download BASE2Core.jar and BASE2Webclient.jar."
139    >
140    <echo>
141-------------------------------------------------------   
142NOTE! You may specifiy a different download location by
143creating the file './build.properties' and
144setting 'depend.jars' to the URL to download from.
145-------------------------------------------------------
146    </echo>
147    <download-lib file="BASE2Core.jar" />
148    <download-lib file="BASE2Webclient.jar" />
149  </target>
150 
151  <macrodef name="download-lib" description="Download BASE core JAR files">
152    <attribute name="file" />
153    <sequential>
154      <get 
155        dest="lib/compile/@{file}" 
156        src="${depend.jars}/@{file}" 
157        usetimestamp="true" 
158        verbose="true"
159        ignoreerrors="true"
160      />
161    </sequential>
162  </macrodef>
163</project>
Note: See TracBrowser for help on using the repository browser.