3987 |
17 Nov 10 |
gregory |
1 |
<?xml version="1.0"?> |
3987 |
17 Nov 10 |
gregory |
2 |
<!-- |
3987 |
17 Nov 10 |
gregory |
$Id$ |
3987 |
17 Nov 10 |
gregory |
4 |
--> |
3987 |
17 Nov 10 |
gregory |
5 |
<project name="MyExtension" default="dist"> |
3987 |
17 Nov 10 |
gregory |
6 |
<description> |
3987 |
17 Nov 10 |
gregory |
7 |
My extension for Proteios |
3987 |
17 Nov 10 |
gregory |
8 |
</description> |
3987 |
17 Nov 10 |
gregory |
9 |
<!-- ================================ |
3987 |
17 Nov 10 |
gregory |
Configuration |
3987 |
17 Nov 10 |
gregory |
See http://dev.thep.lu.se/proteios_plugins/wiki/NamingConventions |
3987 |
17 Nov 10 |
gregory |
12 |
================================ --> |
3987 |
17 Nov 10 |
gregory |
13 |
<property name="name" value="myExtension-0.1" /> |
3987 |
17 Nov 10 |
gregory |
14 |
<property environment="env" /> |
3987 |
17 Nov 10 |
gregory |
15 |
<property name="src" location="src" /> |
3987 |
17 Nov 10 |
gregory |
16 |
<property name="build" location="build" /> |
3987 |
17 Nov 10 |
gregory |
17 |
<property name="dist" location="dist" /> |
3987 |
17 Nov 10 |
gregory |
18 |
<property name="test" location="test" /> |
3987 |
17 Nov 10 |
gregory |
19 |
<property name="baseurl" value="http://www.proteios.org/trac/raw-attachment/wiki/Extensions/Manual"/> |
3987 |
17 Nov 10 |
gregory |
20 |
<path id="classpath"> |
4391 |
05 Dec 12 |
olle |
<!-- Point it to your tomcat installation should work nicely if you have set CATALINA_BASE --> |
4391 |
05 Dec 12 |
olle |
22 |
<fileset dir="${env.CATALINA_BASE}/webapps/proteios/WEB-INF/lib"> |
3987 |
17 Nov 10 |
gregory |
23 |
<include name="**/*.jar" /> |
3987 |
17 Nov 10 |
gregory |
24 |
</fileset> |
4391 |
05 Dec 12 |
olle |
25 |
<pathelement location="${env.CATALINA_BASE}/webapps/proteios/WEB-INF/classes"/> |
3987 |
17 Nov 10 |
gregory |
26 |
</path> |
3987 |
17 Nov 10 |
gregory |
27 |
|
3987 |
17 Nov 10 |
gregory |
28 |
<!-- ================================= |
3987 |
17 Nov 10 |
gregory |
target: init |
3987 |
17 Nov 10 |
gregory |
30 |
================================= --> |
3987 |
17 Nov 10 |
gregory |
31 |
<target name="init" description="Creates directory structure for your extension"> |
3987 |
17 Nov 10 |
gregory |
32 |
<mkdir dir="${src}"/> |
3987 |
17 Nov 10 |
gregory |
33 |
<mkdir dir="${src}/greg"/> |
3987 |
17 Nov 10 |
gregory |
34 |
<get src="${baseurl}/ImportXFileForm.java" dest="${src}/greg/ImportXFileForm.java" /> |
3987 |
17 Nov 10 |
gregory |
35 |
<get src="${baseurl}/CreateXFileImportJob.java?format=raw" dest="${src}/greg/CreateXFileImportJob.java" /> |
3987 |
17 Nov 10 |
gregory |
36 |
<get src="${baseurl}/ImportXFile.java?format=raw" dest="${src}/greg/ImportXFile.java" /> |
3987 |
17 Nov 10 |
gregory |
37 |
</target> |
3987 |
17 Nov 10 |
gregory |
38 |
|
3987 |
17 Nov 10 |
gregory |
39 |
<!-- ================================= |
3987 |
17 Nov 10 |
gregory |
target: dist |
3987 |
17 Nov 10 |
gregory |
41 |
================================= --> |
3987 |
17 Nov 10 |
gregory |
42 |
<target name="dist" depends="clean,compile,testVersion" description="--> Plugins"> |
3987 |
17 Nov 10 |
gregory |
43 |
<mkdir dir="${dist}" /> |
3987 |
17 Nov 10 |
gregory |
<!-- Build jar file --> |
3987 |
17 Nov 10 |
gregory |
45 |
<jar basedir="${build}" destfile="${dist}/${name}-${proteios-version}.ext.jar" includes="**/*.class" /> |
3987 |
17 Nov 10 |
gregory |
46 |
</target> |
3987 |
17 Nov 10 |
gregory |
47 |
|
3987 |
17 Nov 10 |
gregory |
48 |
<!-- - - - - - - - - - - - - - - - - - |
3987 |
17 Nov 10 |
gregory |
target: compile |
3987 |
17 Nov 10 |
gregory |
50 |
- - - - - - - - - - - - - - - - - --> |
3987 |
17 Nov 10 |
gregory |
51 |
<target name="compile"> |
3987 |
17 Nov 10 |
gregory |
52 |
<mkdir dir="${build}" /> |
3987 |
17 Nov 10 |
gregory |
53 |
<javac encoding="ISO-8859-1" srcdir="${src}" destdir="${build}" classpathref="classpath" debug="true" deprecation="true"> |
3987 |
17 Nov 10 |
gregory |
54 |
<compilerarg value="-Xlint:unchecked" /> |
3987 |
17 Nov 10 |
gregory |
55 |
</javac> |
3987 |
17 Nov 10 |
gregory |
56 |
</target> |
3987 |
17 Nov 10 |
gregory |
57 |
|
3987 |
17 Nov 10 |
gregory |
58 |
<!-- - - - - - - - - - - - - - - - - - |
3987 |
17 Nov 10 |
gregory |
target: clean |
3987 |
17 Nov 10 |
gregory |
60 |
- - - - - - - - - - - - - - - - - --> |
3987 |
17 Nov 10 |
gregory |
61 |
<target name="clean"> |
3987 |
17 Nov 10 |
gregory |
62 |
<delete dir="${dist}/${name}-${proteios-version}.ext.jar" /> |
3987 |
17 Nov 10 |
gregory |
63 |
<delete dir="${build}" /> |
3987 |
17 Nov 10 |
gregory |
64 |
<delete dir="${test}/build" /> |
3987 |
17 Nov 10 |
gregory |
65 |
</target> |
3987 |
17 Nov 10 |
gregory |
66 |
|
3987 |
17 Nov 10 |
gregory |
67 |
<!-- - - - - - - - - - - - - - - - - - |
3987 |
17 Nov 10 |
gregory |
target: test |
3987 |
17 Nov 10 |
gregory |
69 |
- - - - - - - - - - - - - - - - - --> |
3987 |
17 Nov 10 |
gregory |
70 |
<target name="test" description="Compiles and runs all tests"> |
3987 |
17 Nov 10 |
gregory |
71 |
<mkdir dir="${test}/build" /> |
3987 |
17 Nov 10 |
gregory |
72 |
<javac encoding="ISO-8859-1" srcdir="${test}/src" destdir="${test}/build" classpathref="classpath" debug="true" deprecation="true"> |
3987 |
17 Nov 10 |
gregory |
73 |
<compilerarg value="-Xlint:unchecked" /> |
3987 |
17 Nov 10 |
gregory |
74 |
</javac> |
3987 |
17 Nov 10 |
gregory |
<!-- Run tests |
3987 |
17 Nov 10 |
gregory |
All tests should run quietly unless something goes wrong. |
3987 |
17 Nov 10 |
gregory |
77 |
--> |
3987 |
17 Nov 10 |
gregory |
78 |
<junit printsummary="false" haltonfailure="true" forkmode="once" reloading="false"> |
3987 |
17 Nov 10 |
gregory |
79 |
<formatter type="brief" usefile="false" /> |
3987 |
17 Nov 10 |
gregory |
80 |
<classpath refid="classpath" /> |
3987 |
17 Nov 10 |
gregory |
81 |
<!-- |
3987 |
17 Nov 10 |
gregory |
Example |
3987 |
17 Nov 10 |
gregory |
<test name="org.proteios.plugin.TestSomePlugin" /> |
3987 |
17 Nov 10 |
gregory |
84 |
--> |
3987 |
17 Nov 10 |
gregory |
85 |
</junit> |
3987 |
17 Nov 10 |
gregory |
86 |
</target> |
3987 |
17 Nov 10 |
gregory |
87 |
|
3987 |
17 Nov 10 |
gregory |
88 |
<!-- |
3987 |
17 Nov 10 |
gregory |
Gets the version number from installed proteios |
3987 |
17 Nov 10 |
gregory |
90 |
--> |
3987 |
17 Nov 10 |
gregory |
91 |
<target name="testVersion"> |
3987 |
17 Nov 10 |
gregory |
92 |
<java classname="org.proteios.core.Application" classpathref="classpath" outputproperty="proteios-version" /> |
4391 |
05 Dec 12 |
olle |
93 |
<fail unless="proteios-version" message="Please set CATALINA_BASE and make sure proteios is installed" /> |
3987 |
17 Nov 10 |
gregory |
94 |
</target> |
3987 |
17 Nov 10 |
gregory |
95 |
|
3987 |
17 Nov 10 |
gregory |
96 |
<!-- - - - - - - - - - - - - - - - - - |
3987 |
17 Nov 10 |
gregory |
target: doc |
3987 |
17 Nov 10 |
gregory |
98 |
- - - - - - - - - - - - - - - - - --> |
3987 |
17 Nov 10 |
gregory |
99 |
<target name="doc"> |
3987 |
17 Nov 10 |
gregory |
100 |
<javadoc classpathref="classpath" destdir="${dist}/docs/api" author="true" version="true" use="true" windowtitle="${name}"> |
3987 |
17 Nov 10 |
gregory |
101 |
<packageset dir="src" /> |
3987 |
17 Nov 10 |
gregory |
102 |
</javadoc> |
3987 |
17 Nov 10 |
gregory |
103 |
</target> |
3987 |
17 Nov 10 |
gregory |
104 |
|
3987 |
17 Nov 10 |
gregory |
105 |
</project> |