1 <?xml version="1.0" encoding="utf-8" ?>
2 <project name="pithos" default="gwt-compile" basedir=".">
3 <description>The Pithos web client project build file</description>
5 <property file="build.properties"/>
6 <property name="deps.dir" value="dependencies"/>
8 <property name="gwt.workers" value="1"/>
10 <property name="gwt.version" value="2.1.1"/>
11 <property name="gwt.home" value="${deps.dir}/gwt-${gwt.version}"/>
12 <property name="gwt.filename" value="gwt-${gwt.version}.zip"/>
13 <property name="gwt.download.url" value="http://google-web-toolkit.googlecode.com/files/${gwt.filename}"/>
15 <property name="gwt.module.class" value="Pithos" />
16 <property name="gwt.root.package" value="gr.grnet.pithos.web" />
17 <property name="gwt.root.path" value="gr/grnet/pithos/web" />
18 <property name="gwt.module" value="${gwt.root.package}.${gwt.module.class}" />
20 <property name="src.dir" value="${basedir}/src"/>
23 <property name="build.dir" value="${basedir}/bin" />
24 <property name="build.classes.dir" value="${build.dir}/classes" />
25 <property name="gwt.www.dir" value="${build.dir}/www" />
26 <property name="gwt.www.admin.dir" value="${build.dir}/wwwadmin" />
27 <property name="dist.war" value="${ant.project.name}.war"/>
28 <property name="war.dir" value="${basedir}/war" />
29 <property name="war.web-inf.dir" value="${war.dir}/WEB-INF"/>
30 <property name="war.lib.dir" value="${war.web-inf.dir}/lib"/>
32 <!-- set classpath -->
33 <path id="project.class.path">
34 <pathelement location="${gwt.home}/gwt-user.jar"/>
37 <target name="check-dependencies" description="Checks if all dependencies are present">
38 <condition property="dependencies.present">
40 <available file="${gwt.home}" type="dir"/>
43 <echo message="dependencies.present=${dependencies.present}"/>
46 <target name="fetch-dependencies" unless="dependencies.present" description="Fetch the dpendencies if not present" depends="check-dependencies">
47 <mkdir dir="${deps.dir}"/>
48 <get src="${gwt.download.url}" dest="${deps.dir}/${gwt.filename}" usetimestamp="true"/>
49 <unzip src="${deps.dir}/${gwt.filename}" dest="${gwt.home}/.."/>
52 <target name="check-gwt-compile" description="Checks is the web gwt client sources are up-to-date with the compiled artifacts">
53 <uptodate property="compilation-not-needed">
54 <srcfiles dir="${src.dir}">
55 <include name="${gwt.root.path}/**"/>
57 <mergemapper to="${gwt.www.dir}/${gwt.module}/${gwt.module}.nocache.js"/>
61 <target name="gwt-compile" depends="check-gwt-compile, fetch-dependencies" unless="compilation-not-needed" description="Compile the gwt web client code to JavaScript">
62 <java classname="com.google.gwt.dev.Compiler" failonerror="true" fork="true">
63 <arg value="-localWorkers" />
64 <arg value="${gwt.workers}" />
66 <arg value="${gwt.www.dir}"/>
67 <arg value="${gwt.module}"/>
70 <pathelement path="${gwt.home}/gwt-dev.jar"/>
71 <pathelement path="${gwt.home}/gwt-user.jar" />
72 <path refid="project.class.path"/>
73 <pathelement path="${src.dir}" />
76 <!--move file="${gwt.www.dir}/${gwt.module}/${gwt.module.class}.html" tofile="${gwt.www.dir}/${gwt.module}/index.html"/-->
79 <target name="uploadToVM" depends="gwt-compile">
80 <scp todir="chstath@pithos.dev.grnet.gr:/var/www/pithos_web_client" keyfile="/home/chstath/.ssh/id_rsa" passphrase="r0bax45">
81 <fileset dir="${gwt.www.dir}/${gwt.module}"/>
85 <target name="clean" description="Delete all build artifacts">
86 <delete dir="${build.dir}"/>
89 <target name="distclean" depends="clean" description="Delete all downloaded dependencies">
90 <delete dir="${deps.dir}"/>
93 <target name="run-web-dev-mode" description="Run web client in development mode">
94 <java fork="true" classname="com.google.gwt.dev.DevMode" spawn="true">
96 <pathelement location="${src.dir}"/>
97 <pathelement location="${build.classes.dir}"/>
98 <pathelement path="${gwt.home}/gwt-dev.jar"/>
99 <pathelement path="${gwt.home}/gwt-user.jar" />
100 <path refid="project.class.path"/>
102 <jvmarg value="-Xmx256M"/>
103 <jvmarg value="-Xdebug"/>
104 <jvmarg value="-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=55555"/>
106 <arg value="${gwt.www.dir}"/>
107 <arg value="-noserver"/>
108 <arg value="-startupUrl"/>
109 <arg value="http://127.0.0.1:8080/client/pithos.html"/>
110 <arg value="${gwt.module}"/>