source: extensions/net.sf.basedb.reggie/trunk/build.xml @ 1283

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

References #291: Personal information registration

Implemented first step with input fields for Case name and Personal number. The personal number is validated and when everything seems ok the second step with patient information is displayed. Existing patient information should be verified and for new patients some information needs to be entered. Functions for validating and going to the next step are not yet implemented.

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