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

Last change on this file since 714 was 714, checked in by Nicklas Nordborg, 15 years ago

References #114: Implement FTP Server

Initial checkin.

File size: 4.0 KB
Line 
1<?xml version="1.0" encoding="UTF-8"?>
2<project 
3  name="MevLauncher" 
4  default="jar" 
5  basedir=".">
6
7  <!--create this file if you need to override values from properties below -->
8  <property file="build.properties" />
9 
10  <!-- variables used -->
11  <property name="name" value="base-ftpserver" />
12  <property name="version" value="1.0beta" />
13  <property name="src" location="src" description="Location of source files" />
14  <property name="build" location="build" description="Location of compiled files" />
15  <property name="jar.name" value="${name}.jar" 
16    description="Name of JAR file with the extensions." />
17  <property name="tar.prefix" value="${name}-${version}" 
18    description="Prefix of .tar.gz file for download." />
19  <property name="tar.name" value="${tar.prefix}.tar.gz" 
20    description="Full name of .tar.gz file for download." />
21  <property name="javac.arg" value="-Xlint:unchecked" />
22  <property name="javac.source" value="1.5" />
23  <property name="javac.target" value="1.5" />
24  <property name="javac.encoding" value="ISO-8859-1" />
25  <property name="depend.jars" value="http://base2.thep.lu.se/base/jars/2.8.0" />
26
27  <!-- set up classpath for compiling -->
28  <path id="classpath">
29    <fileset dir="lib">
30      <include name="**/*.jar" />
31    </fileset>
32  </path>
33
34  <target name="init">
35    <mkdir dir="${build}" />
36  </target>
37   
38  <target name="clean">
39    <delete failonerror="false" includeemptydirs="true">
40      <fileset dir="${build}" defaultexcludes="no" />
41      <fileset file="${jar.name}" />
42      <fileset file="${tar.name}" />
43    </delete>
44  </target>
45 
46  <target
47    name="package"
48    depends="clean,jar"
49    description="Clean and create binary distribution package"
50    >
51    <tar
52      destfile="${tar.name}"
53      longfile="gnu"
54      compression="gzip"
55      >
56      <tarfileset
57        dir="."
58        prefix="${tar.prefix}"
59        preserveLeadingSlashes="true"
60        includes="${jar.name},README,LICENSE,ftp.config,lib/ftpserver/*"
61      />
62    </tar>
63  </target>
64 
65  <target 
66    name="jar"
67    depends="build"
68    description="Creates the extension JAR file"
69    >
70    <jar 
71      jarfile="${jar.name}"
72      manifest="META-INF/MANIFEST.MF"
73      >
74      <fileset dir="${build}" />
75      <fileset dir="." includes="META-INF/**" />
76      <fileset dir="." includes="resources/**" />
77    </jar>
78  </target>
79 
80  <target 
81    name="build"
82    depends="init,checkjar"
83    description="Compiles the plugin and put in jar"
84    >
85    <mkdir dir="${build}" />
86    <javac 
87      encoding="${javac.encoding}" 
88      srcdir="${src}" 
89      destdir="${build}" 
90      debug="true" 
91      classpathref="classpath"
92      source="${javac.source}"
93      target="${javac.target}"
94      >
95      <compilerarg value="${javac.arg}" />
96    </javac>
97  </target>
98 
99  <target 
100    name="checkjar"
101    description="Checks that the BASE2Core.jar and BASE2CorePlugins.jar exists."
102    >
103    <available classname="net.sf.basedb.core.Application" 
104      classpathref="classpath" property="base2core" />
105    <available classname="net.sf.basedb.clients.web.extensions.menu.FixedMenuItemFactory" 
106      classpathref="classpath" property="base2web" />
107    <fail unless="base2core" message="Can't find BASE2Core.jar in ./lib/compile. Try 'ant download-lib' to download the missing file." />
108    <fail unless="base2web" message="Can't find BASE2Webclient.jar in ./lib/compile. Try 'ant download-lib' to download the missing file." />
109    <echo>Found BASE2Core.jar and BASE2Webclient.jar.</echo>
110  </target>
111 
112  <target 
113    name="download-lib"
114    description="Download BASE2Core.jar and BASE2Webclient.jar."
115    >
116    <echo>
117-------------------------------------------------------   
118NOTE! You may specifiy a different download location by
119creating the file './build.properties' and
120setting 'depend.jars' to the URL to download from.
121-------------------------------------------------------
122    </echo>
123    <download-lib file="BASE2Core.jar" />
124    <download-lib file="BASE2Webclient.jar" />
125  </target>
126 
127  <macrodef name="download-lib" description="Download BASE core JAR files">
128    <attribute name="file" />
129    <sequential>
130      <get 
131        dest="lib/compile/@{file}" 
132        src="${depend.jars}/@{file}" 
133        usetimestamp="true" 
134        verbose="true"
135        ignoreerrors="true"
136      />
137    </sequential>
138  </macrodef>
139</project>
Note: See TracBrowser for help on using the repository browser.