source: webservices/net.sf.basedb.examples/trunk/build.xml @ 1279

Last change on this file since 1279 was 1279, checked in by Nicklas Nordborg, 11 years ago

Fixes #288: 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: 3.6 KB
Line 
1<?xml version="1.0" encoding="UTF-8"?>
2<project 
3  name="ExampleWebServiceClient" 
4  default="build" 
5  basedir=".">
6 
7  <!-- settings for the BASE webservices server -->
8  <!-- modify the values as needed              -->
9  <property name="services.url" value="http://localhost:8080/base2/services" />
10  <property name="services.login" value="root" />
11  <property name="services.password" value="root" />
12  <!-- set this to a valid directory to enable download of raw data from raw bioassays -->
13  <property name="download.dir" value="" />
14
15  <!-- variables used -->
16  <property name="name" value="example-webservices" />
17  <property name="version" value="2.6" />
18  <property name="src" location="src" description="Location of source files" />
19  <property name="build" location="build" description="Location of compiled files" />
20  <property name="dist" location="dist" description="Directory where distribution should be created" />
21  <property name="jar.name" value="${name}.jar" description="Name of JAR file with the compiled code." />
22  <property name="tar.prefix" value="${name}-${version}" description="Prefix of .tar.gz file for download." />
23  <property name="tar.name" value="${tar.prefix}.tar.gz" description="Full name of .tar.gz file for download." />
24  <property name="javac.arg" value="-Xlint:unchecked" />
25  <property name="javac.source" value="1.6" />
26  <property name="javac.target" value="1.6" />
27  <property name="javac.encoding" value="UTF-8" />
28
29  <!-- set up classpath for compiling -->
30  <path id="classpath">
31    <fileset dir="lib">
32      <include name="**/*.jar" />
33    </fileset>
34  </path>
35
36  <target name="init">
37    <mkdir dir="${build}" />
38    <mkdir dir="${dist}" />
39  </target>
40   
41  <target name="clean">
42    <delete failonerror="false" includeemptydirs="true">
43      <fileset dir="${build}" defaultexcludes="no" />
44      <fileset dir="${dist}" defaultexcludes="no" />
45      <fileset file="${jar.name}" />
46      <fileset file="${tar.name}" />
47    </delete>
48  </target>
49 
50  <target 
51    name="dist" 
52    depends="clean,build"
53    >
54    <copy todir="${dist}">
55      <fileset dir="." includes="README,LICENSE,RELEASE,build.xml" />
56      <fileset dir="." includes="src/**" />
57      <fileset dir="." includes="lib/**" />
58      <fileset file="${jar.name}" />
59    </copy>
60  </target>
61 
62  <target
63    name="package"
64    depends="dist"
65    description="Create binary distribution package"
66    >
67    <tar
68      destfile="${tar.name}"
69      longfile="gnu"
70      compression="gzip"
71      >
72      <tarfileset
73        dir="${dist}"
74        mode="755"
75        prefix="${tar.prefix}"
76        preserveLeadingSlashes="true"
77        >
78        <include name="**/*.sh" />
79      </tarfileset>
80      <tarfileset
81        dir="${dist}"
82        prefix="${tar.prefix}"
83        preserveLeadingSlashes="true"
84        >
85        <exclude name="**/*.sh" />
86      </tarfileset>
87    </tar>
88  </target>
89 
90  <target 
91    name="test" 
92    description="Test the client by logging in to BASE and listing projects and experiments" 
93    depends="build"
94    >
95    <java
96      classname="net.sf.basedb.ws.example.Main"
97      >
98      <arg value="${services.url}" />
99      <arg value="${services.login}" />
100      <arg value="${services.password}" />
101      <arg value="${download.dir}" />
102      <classpath>
103        <path refid="classpath" />
104        <path location="${build}" />
105      </classpath>
106    </java>
107  </target>
108 
109  <target 
110    name="build"
111    depends="init"
112    description="Compiles the plugin and put in jar"
113    >
114    <mkdir dir="${build}" />
115    <javac 
116      encoding="${javac.encoding}" 
117      srcdir="${src}" 
118      destdir="${build}" 
119      debug="true" 
120      classpathref="classpath"
121      source="${javac.source}"
122      target="${javac.target}"
123      includeantruntime="false"
124      >
125      <compilerarg value="${javac.arg}" />
126    </javac>
127    <jar 
128      jarfile="${jar.name}" 
129      basedir="${build}" 
130      >
131    </jar>
132  </target>
133</project>
Note: See TracBrowser for help on using the repository browser.