Url of cloudbar fixed and made relative
[pithos-web-client] / build.xml
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>
4
5         <property file="build.properties"/>
6     <property name="deps.dir" value="dependencies"/>
7
8     <property name="gwt.workers" value="1"/>
9
10     <property name="gwt.version" value="2.4.0"/>
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}"/>
14
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}" />
19
20         <property name="src.dir" value="${basedir}/src"/>
21
22         <!-- Build dirs -->
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"/>
31
32         <!-- set classpath -->
33         <path id="project.class.path">
34         <pathelement location="${gwt.home}/gwt-user.jar"/>
35         </path>
36
37         <target name="check-dependencies" description="Checks if all dependencies are present">
38         <condition property="dependencies.present">
39             <and>
40                 <available file="${gwt.home}" type="dir"/>
41             </and>
42         </condition>
43         <echo message="dependencies.present=${dependencies.present}"/>
44     </target>
45
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}/.."/>
50     </target>
51
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}/**"/>
56             </srcfiles>
57                         <mergemapper to="${gwt.www.dir}/${gwt.module}/${gwt.module}.nocache.js"/>
58                 </uptodate>
59         </target>
60
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}" />
65                         <arg value="-war"/>
66                         <arg value="${gwt.www.dir}"/>
67                         <arg value="${gwt.module}"/>
68                         
69                     <classpath>
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}" />
74                     </classpath>
75                 </java>
76         <!--move file="${gwt.www.dir}/${gwt.module}/${gwt.module.class}.html" tofile="${gwt.www.dir}/${gwt.module}/index.html"/-->
77         </target>
78
79     <target name="uploadToVM" depends="gwt-compile">
80         <scp todir="chstath@pithos.dev.grnet.gr:/var/www/pithos_web_client" keyfile="${ssh.key}" passphrase="${passphrase}">
81             <fileset dir="${gwt.www.dir}/${gwt.module}"/>
82         </scp>
83     </target>
84
85     <target name="uploadCSSToVM">
86         <scp todir="chstath@pithos.dev.grnet.gr:/var/www/pithos_web_client" keyfile="${ssh.key}" passphrase="${passphrase}">
87             <fileset dir="${src.dir}/${gwt.root.path}/public" includes="pithos.css"/>
88         </scp>
89     </target>
90
91         <target name="clean" description="Delete all build artifacts">
92                 <delete dir="${build.dir}"/>
93         </target>
94
95     <target name="distclean" depends="clean" description="Delete all downloaded dependencies">
96         <delete dir="${deps.dir}"/>
97     </target>
98
99     <target name="run-web-dev-mode" description="Run web client in development mode">
100         <java fork="true" classname="com.google.gwt.dev.DevMode" spawn="true">
101             <classpath>
102                 <pathelement location="${src.dir}"/>
103                 <pathelement location="${build.classes.dir}"/>
104                 <pathelement path="${gwt.home}/gwt-dev.jar"/>
105                 <pathelement path="${gwt.home}/gwt-user.jar" />
106                 <path refid="project.class.path"/>
107             </classpath>
108             <jvmarg value="-Xmx256M"/>
109             <jvmarg value="-Xdebug"/>
110             <jvmarg value="-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=55555"/>
111             <arg value="-war"/>
112             <arg value="${gwt.www.dir}"/>
113             <arg value="-noserver"/>
114             <arg value="-startupUrl"/>
115             <arg value="http://127.0.0.1:8080/client"/>
116             <arg value="${gwt.module}"/>
117         </java>
118     </target>
119 </project>