source: plugins/base2/net.sf.basedb.examples/trunk/build.xml @ 647

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

References #105: Complete the move of the example code from BASE.

First checkin of plug-in examples.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Date Id
File size: 2.8 KB
Line 
1<?xml version="1.0" encoding="UTF-8"?>
2<project 
3  name="ExamplePlugin" 
4  default="build" 
5  basedir=".">
6
7  <!-- variables used -->
8  <property name="name" value="example-plugins" />
9  <property name="version" value="2.6" />
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="jar.name" value="${name}.jar" description="Name of JAR file with the extensions." />
14  <property name="tar.prefix" value="${name}-${version}" description="Prefix of .tar.gz file for download." />
15  <property name="tar.name" value="${tar.prefix}.tar.gz" description="Full name of .tar.gz file for download." />
16  <property name="javac.arg" value="-Xlint:unchecked" />
17  <property name="javac.source" value="1.5" />
18  <property name="javac.target" value="1.5" />
19  <property name="javac.encoding" value="ISO-8859-1" />
20
21  <!-- set up classpath for compiling -->
22  <path id="classpath">
23    <fileset dir="lib">
24      <include name="**/*.jar" />
25    </fileset>
26  </path>
27
28  <target name="init">
29    <mkdir dir="${build}" />
30    <mkdir dir="${dist}" />
31  </target>
32   
33  <target name="clean">
34    <delete failonerror="false" includeemptydirs="true">
35      <fileset dir="${build}" defaultexcludes="no" />
36      <fileset dir="${dist}" defaultexcludes="no" />
37      <fileset file="${jar.name}" />
38      <fileset file="${tar.name}" />
39    </delete>
40  </target>
41 
42  <target 
43    name="dist" 
44    depends="clean,build"
45    >
46    <copy todir="${dist}">
47      <fileset dir="." includes="README,LICENSE,RELEASE,build.xml" />
48      <fileset dir="." includes="src/**,META-INF/**" />
49      <fileset dir="." includes="lib/**" />
50      <fileset file="${jar.name}" />
51    </copy>
52  </target>
53 
54  <target
55    name="package"
56    depends="dist"
57    description="Create binary distribution package"
58    >
59    <tar
60      destfile="${tar.name}"
61      longfile="gnu"
62      compression="gzip"
63      >
64      <tarfileset
65        dir="${dist}"
66        mode="755"
67        prefix="${tar.prefix}"
68        preserveLeadingSlashes="true"
69        >
70        <include name="**/*.sh" />
71      </tarfileset>
72      <tarfileset
73        dir="${dist}"
74        prefix="${tar.prefix}"
75        preserveLeadingSlashes="true"
76        >
77        <exclude name="**/*.sh" />
78      </tarfileset>
79    </tar>
80  </target>
81 
82  <target 
83    name="build"
84    depends="init"
85    description="Compiles the plugin and put in jar"
86    >
87    <mkdir dir="${build}" />
88    <javac 
89      encoding="${javac.encoding}" 
90      srcdir="${src}" 
91      destdir="${build}" 
92      debug="true" 
93      classpathref="classpath"
94      source="${javac.source}"
95      target="${javac.target}"
96      >
97      <compilerarg value="${javac.arg}" />
98    </javac>
99    <copy todir="${build}">
100      <fileset dir="." includes="META-INF/*" />
101      <fileset dir="." includes="resources/**" />
102    </copy>
103    <jar 
104      jarfile="${jar.name}" 
105      basedir="${build}" 
106      >
107    </jar>
108  </target>
109</project>
Note: See TracBrowser for help on using the repository browser.