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

Last change on this file since 1278 was 1278, checked in by Nicklas Nordborg, 12 years ago

Fixes #287: Change "source" and "target" compilation options to 1.6

Also added includeantruntime="false" option.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Date Id
File size: 2.9 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.Xpre" />
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.6" />
18  <property name="javac.target" value="1.6" />
19  <property name="javac.encoding" value="UTF-8" />
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      includeantruntime="false"
97      >
98      <compilerarg value="${javac.arg}" />
99    </javac>
100    <copy todir="${build}">
101      <fileset dir="." includes="META-INF/*" />
102    </copy>
103    <replace token="%%plugins.jar%%" value="${jar.name}" file="${build}/META-INF/base-plugins.xml" />
104    <jar 
105      jarfile="${jar.name}" 
106      basedir="${build}" 
107      >
108    </jar>
109  </target>
110</project>
Note: See TracBrowser for help on using the repository browser.