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

Last change on this file since 1381 was 1381, checked in by Martin Svensson, 12 years ago

References #315. The license-text in the files are updated to GPL3.

File size: 5.2 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 the FTP Server extension 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 3
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 BASE. If not, see <http://www.gnu.org/licenses/>.
23-->
24<project 
25  name="FtpServerExtension" 
26  default="jar" 
27  basedir=".">
28
29  <!--create this file if you need to override values from properties below -->
30  <property file="build.properties" />
31 
32  <!-- variables used -->
33  <property name="name" value="base-ftpserver" />
34  <property name="version" value="1.2pre" />
35  <property name="src" location="src" description="Location of source files" />
36  <property name="build" location="build" description="Location of compiled files" />
37  <property name="jar.name" value="${name}.jar" 
38    description="Name of JAR file with the extensions." />
39  <property name="tar.prefix" value="${name}-${version}" 
40    description="Prefix of .tar.gz file for download." />
41  <property name="tar.name" value="${tar.prefix}.tar.gz" 
42    description="Full name of .tar.gz file for download." />
43  <property name="javac.arg" value="-Xlint:unchecked" />
44  <property name="javac.source" value="1.6" />
45  <property name="javac.target" value="1.6" />
46  <property name="javac.encoding" value="UTF-8" />
47  <property name="depend.jars" value="http://base2.thep.lu.se/base/jars/2.16.0" />
48
49  <!-- set up classpath for compiling -->
50  <path id="classpath">
51    <fileset dir="lib">
52      <include name="**/*.jar" />
53    </fileset>
54  </path>
55
56  <target name="init">
57    <mkdir dir="${build}" />
58  </target>
59   
60  <target name="clean">
61    <delete failonerror="false" includeemptydirs="true">
62      <fileset dir="${build}" defaultexcludes="no" />
63      <fileset file="${jar.name}" />
64      <fileset file="${tar.name}" />
65    </delete>
66  </target>
67 
68  <target
69    name="package"
70    depends="clean,jar"
71    description="Clean and create binary distribution package"
72    >
73    <tar
74      destfile="${tar.name}"
75      longfile="gnu"
76      compression="gzip"
77      >
78      <tarfileset
79        dir="."
80        prefix="${tar.prefix}"
81        preserveLeadingSlashes="true"
82        includes="${jar.name},README,LICENSE*,ftp-config.xml,lib/ftpserver/*"
83      />
84    </tar>
85  </target>
86 
87  <target 
88    name="jar"
89    depends="build"
90    description="Creates the extension JAR file"
91    >
92    <jar 
93      jarfile="${jar.name}"
94      manifest="META-INF/MANIFEST.MF"
95      >
96      <fileset dir="${build}" />
97      <fileset dir="." includes="META-INF/**" />
98      <fileset dir="." includes="resources/**" />
99    </jar>
100  </target>
101 
102  <target 
103    name="build"
104    depends="init,checkjar"
105    description="Compiles the plugin and put in jar"
106    >
107    <mkdir dir="${build}" />
108    <javac 
109      encoding="${javac.encoding}" 
110      srcdir="${src}" 
111      destdir="${build}" 
112      debug="true" 
113      classpathref="classpath"
114      source="${javac.source}"
115      target="${javac.target}"
116      includeantruntime="false"
117      >
118      <compilerarg value="${javac.arg}" />
119    </javac>
120  </target>
121 
122  <target name="update-version">
123    <echo>Setting version to: ${version}</echo>
124    <echo>extensions.xml</echo>
125    <replaceregexp 
126      file="META-INF/extensions.xml"
127      match="&lt;version&gt;.*&lt;/version&gt;"
128      replace="&lt;version&gt;${version}&lt;/version&gt;"
129      encoding="UTF-8"
130    />
131    <echo>Don't forget to commit the changes to the subversion repository!</echo>
132  </target>
133 
134  <target 
135    name="checkjar"
136    description="Checks that the BASE2Core.jar and BASE2CorePlugins.jar exists."
137    >
138    <available classname="net.sf.basedb.core.Application" 
139      classpathref="classpath" property="base2core" />
140    <available classname="net.sf.basedb.clients.web.extensions.menu.FixedMenuItemFactory" 
141      classpathref="classpath" property="base2web" />
142    <fail unless="base2core" message="Can't find BASE2Core.jar in ./lib/compile. Try 'ant download-lib' to download the missing file." />
143    <fail unless="base2web" message="Can't find BASE2Webclient.jar in ./lib/compile. Try 'ant download-lib' to download the missing file." />
144    <echo>Found BASE2Core.jar and BASE2Webclient.jar.</echo>
145  </target>
146 
147  <target 
148    name="download-lib"
149    description="Download BASE2Core.jar and BASE2Webclient.jar."
150    >
151    <echo>
152-------------------------------------------------------   
153NOTE! You may specifiy a different download location by
154creating the file './build.properties' and
155setting 'depend.jars' to the URL to download from.
156-------------------------------------------------------
157    </echo>
158    <download-lib file="BASE2Core.jar" />
159    <download-lib file="BASE2Webclient.jar" />
160  </target>
161 
162  <macrodef name="download-lib" description="Download BASE core JAR files">
163    <attribute name="file" />
164    <sequential>
165      <get 
166        dest="lib/compile/@{file}" 
167        src="${depend.jars}/@{file}" 
168        usetimestamp="true" 
169        verbose="true"
170        ignoreerrors="true"
171      />
172    </sequential>
173  </macrodef>
174</project>
Note: See TracBrowser for help on using the repository browser.