647 |
11 Apr 08 |
nicklas |
1 |
<?xml version="1.0" encoding="UTF-8"?> |
647 |
11 Apr 08 |
nicklas |
2 |
<project |
647 |
11 Apr 08 |
nicklas |
3 |
name="ExamplePlugin" |
647 |
11 Apr 08 |
nicklas |
4 |
default="build" |
647 |
11 Apr 08 |
nicklas |
5 |
basedir="."> |
647 |
11 Apr 08 |
nicklas |
6 |
|
1291 |
24 Feb 11 |
nicklas |
<!--create this file if you need to override values from properties below --> |
1291 |
24 Feb 11 |
nicklas |
8 |
<property file="build.properties" /> |
1291 |
24 Feb 11 |
nicklas |
9 |
|
647 |
11 Apr 08 |
nicklas |
<!-- variables used --> |
647 |
11 Apr 08 |
nicklas |
11 |
<property name="name" value="example-plugins" /> |
650 |
11 Apr 08 |
nicklas |
12 |
<property name="version" value="2.Xpre" /> |
647 |
11 Apr 08 |
nicklas |
13 |
<property name="src" location="src" description="Location of source files" /> |
647 |
11 Apr 08 |
nicklas |
14 |
<property name="build" location="build" description="Location of compiled files" /> |
647 |
11 Apr 08 |
nicklas |
15 |
<property name="dist" location="dist" description="Directory where distribution should be created" /> |
647 |
11 Apr 08 |
nicklas |
16 |
<property name="jar.name" value="${name}.jar" description="Name of JAR file with the extensions." /> |
647 |
11 Apr 08 |
nicklas |
17 |
<property name="tar.prefix" value="${name}-${version}" description="Prefix of .tar.gz file for download." /> |
647 |
11 Apr 08 |
nicklas |
18 |
<property name="tar.name" value="${tar.prefix}.tar.gz" description="Full name of .tar.gz file for download." /> |
647 |
11 Apr 08 |
nicklas |
19 |
<property name="javac.arg" value="-Xlint:unchecked" /> |
1278 |
24 Nov 10 |
nicklas |
20 |
<property name="javac.source" value="1.6" /> |
1278 |
24 Nov 10 |
nicklas |
21 |
<property name="javac.target" value="1.6" /> |
1030 |
07 Apr 09 |
nicklas |
22 |
<property name="javac.encoding" value="UTF-8" /> |
1292 |
24 Feb 11 |
nicklas |
23 |
<property name="depend.jars" value="http://base2.thep.lu.se/base/jars/2.17.0" /> |
647 |
11 Apr 08 |
nicklas |
24 |
|
647 |
11 Apr 08 |
nicklas |
<!-- set up classpath for compiling --> |
647 |
11 Apr 08 |
nicklas |
26 |
<path id="classpath"> |
647 |
11 Apr 08 |
nicklas |
27 |
<fileset dir="lib"> |
647 |
11 Apr 08 |
nicklas |
28 |
<include name="**/*.jar" /> |
647 |
11 Apr 08 |
nicklas |
29 |
</fileset> |
647 |
11 Apr 08 |
nicklas |
30 |
</path> |
647 |
11 Apr 08 |
nicklas |
31 |
|
647 |
11 Apr 08 |
nicklas |
32 |
<target name="init"> |
647 |
11 Apr 08 |
nicklas |
33 |
<mkdir dir="${build}" /> |
647 |
11 Apr 08 |
nicklas |
34 |
<mkdir dir="${dist}" /> |
647 |
11 Apr 08 |
nicklas |
35 |
</target> |
647 |
11 Apr 08 |
nicklas |
36 |
|
647 |
11 Apr 08 |
nicklas |
37 |
<target name="clean"> |
647 |
11 Apr 08 |
nicklas |
38 |
<delete failonerror="false" includeemptydirs="true"> |
647 |
11 Apr 08 |
nicklas |
39 |
<fileset dir="${build}" defaultexcludes="no" /> |
647 |
11 Apr 08 |
nicklas |
40 |
<fileset dir="${dist}" defaultexcludes="no" /> |
647 |
11 Apr 08 |
nicklas |
41 |
<fileset file="${jar.name}" /> |
647 |
11 Apr 08 |
nicklas |
42 |
<fileset file="${tar.name}" /> |
647 |
11 Apr 08 |
nicklas |
43 |
</delete> |
647 |
11 Apr 08 |
nicklas |
44 |
</target> |
647 |
11 Apr 08 |
nicklas |
45 |
|
647 |
11 Apr 08 |
nicklas |
46 |
<target |
647 |
11 Apr 08 |
nicklas |
47 |
name="dist" |
647 |
11 Apr 08 |
nicklas |
48 |
depends="clean,build" |
647 |
11 Apr 08 |
nicklas |
49 |
> |
647 |
11 Apr 08 |
nicklas |
50 |
<copy todir="${dist}"> |
647 |
11 Apr 08 |
nicklas |
51 |
<fileset dir="." includes="README,LICENSE,RELEASE,build.xml" /> |
647 |
11 Apr 08 |
nicklas |
52 |
<fileset dir="." includes="src/**,META-INF/**" /> |
647 |
11 Apr 08 |
nicklas |
53 |
<fileset dir="." includes="lib/**" /> |
647 |
11 Apr 08 |
nicklas |
54 |
<fileset file="${jar.name}" /> |
647 |
11 Apr 08 |
nicklas |
55 |
</copy> |
647 |
11 Apr 08 |
nicklas |
56 |
</target> |
647 |
11 Apr 08 |
nicklas |
57 |
|
647 |
11 Apr 08 |
nicklas |
58 |
<target |
647 |
11 Apr 08 |
nicklas |
59 |
name="package" |
647 |
11 Apr 08 |
nicklas |
60 |
depends="dist" |
647 |
11 Apr 08 |
nicklas |
61 |
description="Create binary distribution package" |
647 |
11 Apr 08 |
nicklas |
62 |
> |
647 |
11 Apr 08 |
nicklas |
63 |
<tar |
647 |
11 Apr 08 |
nicklas |
64 |
destfile="${tar.name}" |
647 |
11 Apr 08 |
nicklas |
65 |
longfile="gnu" |
647 |
11 Apr 08 |
nicklas |
66 |
compression="gzip" |
647 |
11 Apr 08 |
nicklas |
67 |
> |
647 |
11 Apr 08 |
nicklas |
68 |
<tarfileset |
647 |
11 Apr 08 |
nicklas |
69 |
dir="${dist}" |
647 |
11 Apr 08 |
nicklas |
70 |
mode="755" |
647 |
11 Apr 08 |
nicklas |
71 |
prefix="${tar.prefix}" |
647 |
11 Apr 08 |
nicklas |
72 |
preserveLeadingSlashes="true" |
647 |
11 Apr 08 |
nicklas |
73 |
> |
647 |
11 Apr 08 |
nicklas |
74 |
<include name="**/*.sh" /> |
647 |
11 Apr 08 |
nicklas |
75 |
</tarfileset> |
647 |
11 Apr 08 |
nicklas |
76 |
<tarfileset |
647 |
11 Apr 08 |
nicklas |
77 |
dir="${dist}" |
647 |
11 Apr 08 |
nicklas |
78 |
prefix="${tar.prefix}" |
647 |
11 Apr 08 |
nicklas |
79 |
preserveLeadingSlashes="true" |
647 |
11 Apr 08 |
nicklas |
80 |
> |
647 |
11 Apr 08 |
nicklas |
81 |
<exclude name="**/*.sh" /> |
647 |
11 Apr 08 |
nicklas |
82 |
</tarfileset> |
647 |
11 Apr 08 |
nicklas |
83 |
</tar> |
647 |
11 Apr 08 |
nicklas |
84 |
</target> |
647 |
11 Apr 08 |
nicklas |
85 |
|
647 |
11 Apr 08 |
nicklas |
86 |
<target |
647 |
11 Apr 08 |
nicklas |
87 |
name="build" |
647 |
11 Apr 08 |
nicklas |
88 |
depends="init" |
647 |
11 Apr 08 |
nicklas |
89 |
description="Compiles the plugin and put in jar" |
647 |
11 Apr 08 |
nicklas |
90 |
> |
647 |
11 Apr 08 |
nicklas |
91 |
<mkdir dir="${build}" /> |
647 |
11 Apr 08 |
nicklas |
92 |
<javac |
647 |
11 Apr 08 |
nicklas |
93 |
encoding="${javac.encoding}" |
647 |
11 Apr 08 |
nicklas |
94 |
srcdir="${src}" |
647 |
11 Apr 08 |
nicklas |
95 |
destdir="${build}" |
647 |
11 Apr 08 |
nicklas |
96 |
debug="true" |
647 |
11 Apr 08 |
nicklas |
97 |
classpathref="classpath" |
647 |
11 Apr 08 |
nicklas |
98 |
source="${javac.source}" |
647 |
11 Apr 08 |
nicklas |
99 |
target="${javac.target}" |
1278 |
24 Nov 10 |
nicklas |
100 |
includeantruntime="false" |
647 |
11 Apr 08 |
nicklas |
101 |
> |
647 |
11 Apr 08 |
nicklas |
102 |
<compilerarg value="${javac.arg}" /> |
647 |
11 Apr 08 |
nicklas |
103 |
</javac> |
647 |
11 Apr 08 |
nicklas |
104 |
<copy todir="${build}"> |
647 |
11 Apr 08 |
nicklas |
105 |
<fileset dir="." includes="META-INF/*" /> |
647 |
11 Apr 08 |
nicklas |
106 |
</copy> |
648 |
11 Apr 08 |
nicklas |
107 |
<replace token="%%plugins.jar%%" value="${jar.name}" file="${build}/META-INF/base-plugins.xml" /> |
647 |
11 Apr 08 |
nicklas |
108 |
<jar |
647 |
11 Apr 08 |
nicklas |
109 |
jarfile="${jar.name}" |
647 |
11 Apr 08 |
nicklas |
110 |
basedir="${build}" |
647 |
11 Apr 08 |
nicklas |
111 |
> |
647 |
11 Apr 08 |
nicklas |
112 |
</jar> |
647 |
11 Apr 08 |
nicklas |
113 |
</target> |
1291 |
24 Feb 11 |
nicklas |
114 |
|
1291 |
24 Feb 11 |
nicklas |
115 |
<target |
1291 |
24 Feb 11 |
nicklas |
116 |
name="checkjar" |
1291 |
24 Feb 11 |
nicklas |
117 |
description="Checks that the BASE2Core.jar exists." |
1291 |
24 Feb 11 |
nicklas |
118 |
> |
1291 |
24 Feb 11 |
nicklas |
119 |
<available classname="net.sf.basedb.core.plugin.Plugin" |
1291 |
24 Feb 11 |
nicklas |
120 |
classpathref="classpath" property="base2core" /> |
1291 |
24 Feb 11 |
nicklas |
121 |
<fail unless="base2core" message="Can't find BASE2Core.jar in ./lib/compile. Try 'ant download-lib' to download the missing file." /> |
1291 |
24 Feb 11 |
nicklas |
122 |
<echo>Found BASE2Core.jar.</echo> |
1291 |
24 Feb 11 |
nicklas |
123 |
</target> |
1291 |
24 Feb 11 |
nicklas |
124 |
|
1291 |
24 Feb 11 |
nicklas |
125 |
|
1291 |
24 Feb 11 |
nicklas |
126 |
<target |
1291 |
24 Feb 11 |
nicklas |
127 |
name="download-lib" |
1291 |
24 Feb 11 |
nicklas |
128 |
description="Download BASE2Core.jar" |
1291 |
24 Feb 11 |
nicklas |
129 |
> |
1291 |
24 Feb 11 |
nicklas |
130 |
<echo> |
1291 |
24 Feb 11 |
nicklas |
131 |
------------------------------------------------------- |
1291 |
24 Feb 11 |
nicklas |
132 |
NOTE! You may specifiy a different download location by |
1291 |
24 Feb 11 |
nicklas |
133 |
creating the file './build.properties' and |
1291 |
24 Feb 11 |
nicklas |
134 |
setting 'depend.jars' to the URL to download from. |
1291 |
24 Feb 11 |
nicklas |
135 |
------------------------------------------------------- |
1291 |
24 Feb 11 |
nicklas |
136 |
</echo> |
1291 |
24 Feb 11 |
nicklas |
137 |
<download-lib file="BASE2Core.jar" /> |
1291 |
24 Feb 11 |
nicklas |
138 |
</target> |
1291 |
24 Feb 11 |
nicklas |
139 |
|
1291 |
24 Feb 11 |
nicklas |
140 |
<macrodef name="download-lib" description="Download BASE core JAR files"> |
1291 |
24 Feb 11 |
nicklas |
141 |
<attribute name="file" /> |
1291 |
24 Feb 11 |
nicklas |
142 |
<sequential> |
1291 |
24 Feb 11 |
nicklas |
143 |
<get |
1291 |
24 Feb 11 |
nicklas |
144 |
dest="lib/compile/@{file}" |
1291 |
24 Feb 11 |
nicklas |
145 |
src="${depend.jars}/@{file}" |
1291 |
24 Feb 11 |
nicklas |
146 |
usetimestamp="true" |
1291 |
24 Feb 11 |
nicklas |
147 |
verbose="true" |
1291 |
24 Feb 11 |
nicklas |
148 |
ignoreerrors="true" |
1291 |
24 Feb 11 |
nicklas |
149 |
/> |
1291 |
24 Feb 11 |
nicklas |
150 |
</sequential> |
1291 |
24 Feb 11 |
nicklas |
151 |
</macrodef> |
647 |
11 Apr 08 |
nicklas |
152 |
</project> |