Merge branch 'issue_3575' into develop
[pithos-web-client] / build.xml
index 14b3129..88d36d0 100644 (file)
--- a/build.xml
+++ b/build.xml
@@ -1,43 +1,19 @@
 <?xml version="1.0" encoding="utf-8" ?>
-<project name="gss" default="package-war" basedir=".">
-       <description>The GSS project build file</description>
+<project name="pithos" default="main" basedir=".">
+       <description>The Pithos web client project build file</description>
 
        <property file="build.properties"/>
+       <property file="runtime.properties"/>
     <property name="deps.dir" value="dependencies"/>
 
-    <property name="gwt.workers" value="1"/>
-    <property name="jboss.args" value="-b 0.0.0.0" />
-
-    <property name="jboss.version" value="5.1.0"/>
-    <property name="jboss.home" value="${deps.dir}/jboss-${jboss.version}.GA" />
-    <property name="jboss.bin.dir" value="${jboss.home}/bin" />
-    <property name="jboss.conf.dir" value="${jboss.home}/server/default/conf" />
-    <property name="jboss.deploy.dir" value="${jboss.home}/server/default/deploy" />
-    <property name="jboss.lib.dir" value="${jboss.home}/server/default/lib" />
-    <property name="jboss.root.lib.dir" value="${jboss.home}/lib" />
-    <property name="jboss.common.lib.dir" value="${jboss.home}/common/lib" />
-    <property name="jboss.filename" value="jboss-${jboss.version}.GA-jdk6.zip"/>
-       <property name="jboss.download.url" value="http://switch.dl.sourceforge.net/project/jboss/JBoss/JBoss-${jboss.version}.GA/${jboss.filename}"/>
-
-    <property name="gwt.version" value="2.1.1"/>
+    <property name="gwt.workers" value="2"/>
+
+    <property name="gwt.version" value="2.4.0"/>
        <property name="gwt.home" value="${deps.dir}/gwt-${gwt.version}"/>
     <property name="gwt.filename" value="gwt-${gwt.version}.zip"/>
     <property name="gwt.download.url" value="http://google-web-toolkit.googlecode.com/files/${gwt.filename}"/>
 
-    <property name="gwt-gears.version" value="1.3.0"/>
-    <property name="gwt-gears.home" value="${deps.dir}/gwt-gears-${gwt-gears.version}" />
-    <property name="gwt-gears.filename" value="gwt-gears-${gwt-gears.version}.zip"/>
-    <property name="gwt-gears.download.url" value="http://gwt-google-apis.googlecode.com/files/${gwt-gears.filename}"/>
-
-    <property name="gwtquery.filename" value="gwtquery-1.0.0-20110116.074055-7.jar"/>
-    <property name="gwtquery.download.url" value="http://gss.googlecode.com/hg/lib/${gwtquery.filename}?r=0473a2c1bc32c9426423f8ca3b688a29ce30216b"/>
-    <property name="gwtquery-draggable-plugin.filename" value="draggable-plugin-1.0.2.jar"/>
-    <property name="gwtquery-draggable-plugin.download.url" value="http://gss.googlecode.com/hg/lib/${gwtquery-draggable-plugin.filename}?r=0634eeeeaaad1b9bfb7a8e809bfc9e9545d208e2"/>
-    <property name="gwtquery-droppable-plugin.filename" value="droppable-plugin-1.0.2.jar"/>
-    <property name="gwtquery-droppable-plugin.download.url" value="http://gss.googlecode.com/hg/lib/${gwtquery-droppable-plugin.filename}?r=c8bca56a1c4ab780ac0d0cc72a2b40b60d7ca4f7"/>
-
-    <property name="root.context" value="gss" />
-    <property name="gwt.module.class" value="GSS" />
+    <property name="gwt.module.class" value="Pithos" />
     <property name="gwt.root.package" value="gr.grnet.pithos.web" />
     <property name="gwt.root.path" value="gr/grnet/pithos/web" />
     <property name="gwt.module" value="${gwt.root.package}.${gwt.module.class}" />
        <!-- set classpath -->
        <path id="project.class.path">
         <pathelement location="${gwt.home}/gwt-user.jar"/>
-        <pathelement location="${war.lib.dir}/commons-fileupload-1.2.jar"/>
        </path>
 
        <target name="check-dependencies" description="Checks if all dependencies are present">
         <condition property="dependencies.present">
             <and>
-                <available file="${jboss.home}" type="dir"/>
                 <available file="${gwt.home}" type="dir"/>
-                <available file="${gwt-gears.home}" type="dir"/>
-                <available file="${deps.dir}/${gwtquery.filename}"/>
-                <available file="${deps.dir}/${gwtquery-draggable-plugin.filename}"/>
-                <available file="${deps.dir}/${gwtquery-droppable-plugin.filename}"/>
             </and>
         </condition>
         <echo message="dependencies.present=${dependencies.present}"/>
     <target name="fetch-dependencies" unless="dependencies.present" description="Fetch the dpendencies if not present" depends="check-dependencies">
        <mkdir dir="${deps.dir}"/>
         <get src="${gwt.download.url}" dest="${deps.dir}/${gwt.filename}" usetimestamp="true"/>
-        <get src="${gwt-gears.download.url}" dest="${deps.dir}/${gwt-gears.filename}" usetimestamp="true"/>
-        <get src="${gwtquery.download.url}" dest="${deps.dir}/${gwtquery.filename}" usetimestamp="true"/>
-        <get src="${gwtquery-draggable-plugin.download.url}" dest="${deps.dir}/${gwtquery-draggable-plugin.filename}" usetimestamp="true"/>
-        <get src="${gwtquery-droppable-plugin.download.url}" dest="${deps.dir}/${gwtquery-droppable-plugin.filename}" usetimestamp="true"/>
        <unzip src="${deps.dir}/${gwt.filename}" dest="${gwt.home}/.."/>
-        <unzip src="${deps.dir}/${gwt-gears.filename}" dest="${gwt-gears.home}/.."/>
     </target>
 
        <target name="check-gwt-compile" description="Checks is the web gwt client sources are up-to-date with the compiled artifacts">
                        
                    <classpath>
                 <pathelement path="${gwt.home}/gwt-dev.jar"/>
-                <pathelement location="${deps.dir}/${gwtquery.filename}"/>
-                <pathelement location="${deps.dir}/${gwtquery-droppable-plugin.filename}"/>
-                <pathelement location="${deps.dir}/${gwtquery-draggable-plugin.filename}"/>
-                <pathelement location="${gwt-gears.home}/gwt-gears.jar"/>
                 <pathelement path="${gwt.home}/gwt-user.jar" />
                                <path refid="project.class.path"/>
                                <pathelement path="${src.dir}" />
                    </classpath>
                </java>
-        <!--move file="${gwt.www.dir}/${gwt.module}/${gwt.module.class}.html" tofile="${gwt.www.dir}/${gwt.module}/index.html"/-->
        </target>
-       
-    <target name="package-war" depends="gwt-compile" description="Package up the web client as a war">
-        <jar destfile="${build.dir}/${dist.war}">
-            <zipfileset dir="${war.dir}"/>
-            <zipfileset dir="${gwt.www.dir}/${gwt.module}"/>
-        </jar>
+    
+    <target name="main" depends="gwt-compile">
+        <!--Fix the index html file variables -->
+           <replaceregexp file="${gwt.www.dir}/${gwt.module}/index.html"
+                          match="CLOUDBAR_ACTIVE_SERVICE = (.*)"
+                          replace="CLOUDBAR_ACTIVE_SERVICE = '${CLOUDBAR_ACTIVE_SERVICE}';"
+                          byline="true"
+           />
+           <replaceregexp file="${gwt.www.dir}/${gwt.module}/index.html"
+                          match="CLOUDBAR_LOCATION = (.*)"
+                          replace="CLOUDBAR_LOCATION = &quot;${CLOUDBAR_LOCATION}&quot;;"
+                          byline="true"
+           />
+           <replaceregexp file="${gwt.www.dir}/${gwt.module}/index.html"
+                          match="CLOUDBAR_SERVICES = (.*)"
+                          replace="CLOUDBAR_SERVICES = &quot;${CLOUDBAR_SERVICES}&quot;;"
+                          byline="true"
+           />
+           <replaceregexp file="${gwt.www.dir}/${gwt.module}/index.html"
+                          match="CLOUDBAR_MENU = (.*)"
+                          replace="CLOUDBAR_MENU = &quot;${CLOUDBAR_MENU}&quot;;"
+                          byline="true"
+           />
+           <replaceregexp file="${gwt.www.dir}/${gwt.module}/index.html"
+                          match="loginUrl: (.*)"
+                          replace="loginUrl: &quot;${loginUrl}&quot;,"
+                          byline="true"
+           />
+           <replaceregexp file="${gwt.www.dir}/${gwt.module}/index.html"
+                          match="feedbackUrl: (.*)"
+                          replace="feedbackUrl: &quot;${feedbackUrl}&quot;,"
+                          byline="true"
+           />
+           <replaceregexp file="${gwt.www.dir}/${gwt.module}/index.html"
+                          match="authCookie: (.*)"
+                          replace="authCookie: &quot;${authCookie}&quot;,"
+                          byline="true"
+           />
+           <replaceregexp file="${gwt.www.dir}/${gwt.module}/index.html"
+                          match="version: (.*)"
+                          replace="version: &quot;${version}&quot;"
+                          byline="true"
+           />
+    </target>
+
+    <target name="uploadToVM" depends="main">
+        <scp todir="chstath@pithos.dev.grnet.gr:/var/www/pithos_web_client" keyfile="${ssh.key}" passphrase="${passphrase}">
+            <fileset dir="${gwt.www.dir}/${gwt.module}"/>
+        </scp>
+    </target>
+
+    <target name="uploadCSSToVM">
+        <scp todir="chstath@pithos.dev.grnet.gr:/var/www/pithos_web_client" keyfile="${ssh.key}" passphrase="${passphrase}">
+            <fileset dir="${src.dir}/${gwt.root.path}/public" includes="pithos.css"/>
+        </scp>
     </target>
 
+  <target name="rsyncToDev84">
+    <exec executable="${basedir}/rsync-to-dev84.sh"></exec>
+  </target>
+
        <target name="clean" description="Delete all build artifacts">
                <delete dir="${build.dir}"/>
        </target>
                 <pathelement location="${src.dir}"/>
                 <pathelement location="${build.classes.dir}"/>
                 <pathelement path="${gwt.home}/gwt-dev.jar"/>
-                <pathelement location="${deps.dir}/${gwtquery.filename}"/>
-                <pathelement location="${deps.dir}/${gwtquery-draggable-plugin.filename}"/>
-                <pathelement location="${deps.dir}/${gwtquery-droppable-plugin.filename}"/>
-                <pathelement location="${gwt-gears.home}/gwt-gears.jar"/>
                 <pathelement path="${gwt.home}/gwt-user.jar" />
                 <path refid="project.class.path"/>
             </classpath>
             <jvmarg value="-Xdebug"/>
             <jvmarg value="-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=55555"/>
             <arg value="-war"/>
-            <arg value="${gwt.www.dir}/${gwt.module}"/>
+            <arg value="${gwt.www.dir}"/>
+            <arg value="-noserver"/>
             <arg value="-startupUrl"/>
-            <arg value="GSS.html"/>
+            <arg value="http://127.0.0.1:8080/client"/>
             <arg value="${gwt.module}"/>
         </java>
     </target>