source: extensions/net.sf.basedb.examples/trunk/build.xml @ 636

Last change on this file since 636 was 636, checked in by Nicklas Nordborg, 14 years ago

References #103: Create example extensions

First checkin of example extensions.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Date Id
File size: 3.2 KB
Line 
1<?xml version="1.0" encoding="UTF-8"?>
2<project 
3  name="ExtensionExamples" 
4  default="dist" 
5  basedir=".">
6
7  <!-- variables used -->
8  <property name="name" value="extension-examples" />
9  <property name="version" value="1.0" />
10  <property name="src" location="src" description="Location of source files" />
11  <property name="build" location="build" description="Location of compiled files" />
12  <property name="dist" location="dist" description="Directory where distribution should be created" />
13  <property name="package" location="package" description="Directory where packaged distribution files are created"/>
14  <property name="javac.arg" value="-Xlint:unchecked" />
15  <property name="javac.source" value="1.5" />
16  <property name="javac.target" value="1.5" />
17  <property name="javac.encoding" value="ISO-8859-1" />
18
19  <!-- set up classpath for compiling -->
20  <path id="classpath">
21    <fileset dir="lib">
22      <include name="**/*.jar" />
23    </fileset>
24  </path>
25
26  <target name="init">
27    <mkdir dir="${build}" />
28    <mkdir dir="${dist}" />
29  </target>
30   
31  <target name="clean">
32    <delete failonerror="false" includeemptydirs="true">
33      <fileset dir="${build}" defaultexcludes="no" />
34      <fileset dir="${dist}" defaultexcludes="no" />
35      <fileset dir="${package}" defaultexcludes="no" />
36    </delete>
37  </target>
38 
39  <target 
40    name="dist" 
41    depends="clean,build"
42    >
43    <copy todir="${dist}">
44      <fileset dir="." includes="README*,LICENSE,INSTALL" />
45    </copy>
46  </target>
47 
48  <target
49    name="package"
50    depends="dist"
51    description="Create binary distribution package"
52    >
53    <property name="tar.prefix" value="${name}-${version}" />
54    <mkdir dir="${package}" />
55    <tar
56      destfile="${package}/${tar.prefix}.tar.gz"
57      longfile="gnu"
58      compression="gzip"
59      >
60      <tarfileset
61        dir="${dist}"
62        mode="755"
63        prefix="${tar.prefix}"
64        preserveLeadingSlashes="true"
65        >
66        <include name="**/*.sh" />
67      </tarfileset>
68      <tarfileset
69        dir="${dist}"
70        prefix="${tar.prefix}"
71        preserveLeadingSlashes="true"
72        >
73        <exclude name="**/*.sh" />
74      </tarfileset>
75    </tar>
76  </target>
77 
78  <target 
79    name="build"
80    depends="init,checkjar"
81    description="Compiles the plugin and put in jar"
82    >
83    <property name="jar" value="${name}.jar" />
84    <mkdir dir="${build}" />
85    <javac 
86      encoding="${javac.encoding}" 
87      srcdir="${src}" 
88      destdir="${build}" 
89      debug="true" 
90      classpathref="classpath"
91      source="${javac.source}"
92      target="${javac.target}"
93      >
94      <compilerarg value="${javac.arg}" />
95    </javac>
96    <copy todir="${build}">
97      <fileset dir="." includes="META-INF/*" />
98      <fileset dir="." includes="resources/**" />
99    </copy>
100    <jar 
101      jarfile="${dist}/${jar}" 
102      basedir="${build}" 
103      >
104    </jar>
105  </target>
106 
107  <target 
108    name="checkjar"
109    description="Checks that the BASE2Core.jar and BASE2Webclient.jar exists."
110    >
111    <available classname="net.sf.basedb.core.Application" 
112      classpathref="classpath" property="base2core" />
113    <available classname="net.sf.basedb.clients.web.Base" 
114      classpathref="classpath" property="base2web" />
115    <fail unless="base2core" message="Can't find BASE2Core.jar in ./lib/compile" />
116    <fail unless="base2web" message="Can't find BASE2Webclient.jar in ./lib/compile" />
117    <echo>Found BASE2Core.jar and BASE2Webclient.jar.</echo>
118  </target>
119</project>
Note: See TracBrowser for help on using the repository browser.