Statistics
| Branch: | Tag: | Revision:

root / build.xml @ d4ace10a

History | View | Annotate | Download (7.1 kB)

1 ab3fae7b Christos Stathis
<?xml version="1.0" encoding="utf-8" ?>
2 f0105e9f Christos Stathis
<project name="pithos" default="main" basedir=".">
3 749068ba Christos Stathis
        <description>The Pithos web client project build file</description>
4 ab3fae7b Christos Stathis
5 ab3fae7b Christos Stathis
        <property file="build.properties"/>
6 f0105e9f Christos Stathis
        <property file="runtime.properties"/>
7 ab3fae7b Christos Stathis
    <property name="deps.dir" value="dependencies"/>
8 ab3fae7b Christos Stathis
9 64d3b76b Christos KK Loverdos
    <property name="gwt.workers" value="2"/>
10 ab3fae7b Christos Stathis
11 91b28598 Christos Stathis
    <property name="gwt.version" value="2.4.0"/>
12 ab3fae7b Christos Stathis
        <property name="gwt.home" value="${deps.dir}/gwt-${gwt.version}"/>
13 ab3fae7b Christos Stathis
    <property name="gwt.filename" value="gwt-${gwt.version}.zip"/>
14 ab3fae7b Christos Stathis
    <property name="gwt.download.url" value="http://google-web-toolkit.googlecode.com/files/${gwt.filename}"/>
15 ab3fae7b Christos Stathis
16 749068ba Christos Stathis
    <property name="gwt.module.class" value="Pithos" />
17 a57faaf0 Christos Stathis
    <property name="gwt.root.package" value="gr.grnet.pithos.web" />
18 a57faaf0 Christos Stathis
    <property name="gwt.root.path" value="gr/grnet/pithos/web" />
19 ab3fae7b Christos Stathis
    <property name="gwt.module" value="${gwt.root.package}.${gwt.module.class}" />
20 ab3fae7b Christos Stathis
21 ab3fae7b Christos Stathis
        <property name="src.dir" value="${basedir}/src"/>
22 ab3fae7b Christos Stathis
23 ab3fae7b Christos Stathis
        <!-- Build dirs -->
24 ab3fae7b Christos Stathis
        <property name="build.dir" value="${basedir}/bin" />
25 ab3fae7b Christos Stathis
        <property name="build.classes.dir" value="${build.dir}/classes" />
26 ab3fae7b Christos Stathis
        <property name="gwt.www.dir" value="${build.dir}/www" />
27 ab3fae7b Christos Stathis
        <property name="gwt.www.admin.dir" value="${build.dir}/wwwadmin" />
28 ab3fae7b Christos Stathis
        <property name="dist.war" value="${ant.project.name}.war"/>
29 ab3fae7b Christos Stathis
        <property name="war.dir" value="${basedir}/war" />
30 ab3fae7b Christos Stathis
        <property name="war.web-inf.dir" value="${war.dir}/WEB-INF"/>
31 ab3fae7b Christos Stathis
        <property name="war.lib.dir" value="${war.web-inf.dir}/lib"/>
32 ab3fae7b Christos Stathis
33 ab3fae7b Christos Stathis
        <!-- set classpath -->
34 ab3fae7b Christos Stathis
        <path id="project.class.path">
35 ab3fae7b Christos Stathis
        <pathelement location="${gwt.home}/gwt-user.jar"/>
36 ab3fae7b Christos Stathis
        </path>
37 ab3fae7b Christos Stathis
38 ab3fae7b Christos Stathis
        <target name="check-dependencies" description="Checks if all dependencies are present">
39 ab3fae7b Christos Stathis
        <condition property="dependencies.present">
40 ab3fae7b Christos Stathis
            <and>
41 ab3fae7b Christos Stathis
                <available file="${gwt.home}" type="dir"/>
42 ab3fae7b Christos Stathis
            </and>
43 ab3fae7b Christos Stathis
        </condition>
44 ab3fae7b Christos Stathis
        <echo message="dependencies.present=${dependencies.present}"/>
45 ab3fae7b Christos Stathis
    </target>
46 ab3fae7b Christos Stathis
47 ab3fae7b Christos Stathis
    <target name="fetch-dependencies" unless="dependencies.present" description="Fetch the dpendencies if not present" depends="check-dependencies">
48 ab3fae7b Christos Stathis
            <mkdir dir="${deps.dir}"/>
49 ab3fae7b Christos Stathis
        <get src="${gwt.download.url}" dest="${deps.dir}/${gwt.filename}" usetimestamp="true"/>
50 ab3fae7b Christos Stathis
            <unzip src="${deps.dir}/${gwt.filename}" dest="${gwt.home}/.."/>
51 ab3fae7b Christos Stathis
    </target>
52 ab3fae7b Christos Stathis
53 ab3fae7b Christos Stathis
        <target name="check-gwt-compile" description="Checks is the web gwt client sources are up-to-date with the compiled artifacts">
54 ab3fae7b Christos Stathis
                <uptodate property="compilation-not-needed">
55 ab3fae7b Christos Stathis
                        <srcfiles dir="${src.dir}">
56 ab3fae7b Christos Stathis
                <include name="${gwt.root.path}/**"/>
57 ab3fae7b Christos Stathis
            </srcfiles>
58 ab3fae7b Christos Stathis
                        <mergemapper to="${gwt.www.dir}/${gwt.module}/${gwt.module}.nocache.js"/>
59 ab3fae7b Christos Stathis
                </uptodate>
60 ab3fae7b Christos Stathis
        </target>
61 ab3fae7b Christos Stathis
62 ab3fae7b Christos Stathis
        <target name="gwt-compile" depends="check-gwt-compile, fetch-dependencies" unless="compilation-not-needed" description="Compile the gwt web client code to JavaScript">
63 ab3fae7b Christos Stathis
                <java classname="com.google.gwt.dev.Compiler" failonerror="true" fork="true">
64 ab3fae7b Christos Stathis
                        <arg value="-localWorkers" />
65 ab3fae7b Christos Stathis
                        <arg value="${gwt.workers}" />
66 ab3fae7b Christos Stathis
                        <arg value="-war"/>
67 ab3fae7b Christos Stathis
                        <arg value="${gwt.www.dir}"/>
68 ab3fae7b Christos Stathis
                        <arg value="${gwt.module}"/>
69 ab3fae7b Christos Stathis
                        
70 ab3fae7b Christos Stathis
                    <classpath>
71 ab3fae7b Christos Stathis
                <pathelement path="${gwt.home}/gwt-dev.jar"/>
72 ab3fae7b Christos Stathis
                <pathelement path="${gwt.home}/gwt-user.jar" />
73 ab3fae7b Christos Stathis
                                <path refid="project.class.path"/>
74 ab3fae7b Christos Stathis
                                <pathelement path="${src.dir}" />
75 ab3fae7b Christos Stathis
                    </classpath>
76 ab3fae7b Christos Stathis
                </java>
77 ab3fae7b Christos Stathis
        </target>
78 f0105e9f Christos Stathis
    
79 f0105e9f Christos Stathis
    <target name="main" depends="gwt-compile">
80 f0105e9f Christos Stathis
        <!--Fix the index html file variables -->
81 f0105e9f Christos Stathis
            <replaceregexp file="${gwt.www.dir}/${gwt.module}/index.html"
82 f0105e9f Christos Stathis
                           match="CLOUDBAR_ACTIVE_SERVICE = (.*)"
83 f0105e9f Christos Stathis
                           replace="CLOUDBAR_ACTIVE_SERVICE = '${CLOUDBAR_ACTIVE_SERVICE}';"
84 f0105e9f Christos Stathis
                           byline="true"
85 f0105e9f Christos Stathis
            />
86 f0105e9f Christos Stathis
            <replaceregexp file="${gwt.www.dir}/${gwt.module}/index.html"
87 f0105e9f Christos Stathis
                           match="CLOUDBAR_LOCATION = (.*)"
88 f0105e9f Christos Stathis
                           replace="CLOUDBAR_LOCATION = &quot;${CLOUDBAR_LOCATION}&quot;;"
89 f0105e9f Christos Stathis
                           byline="true"
90 f0105e9f Christos Stathis
            />
91 f0105e9f Christos Stathis
               <replaceregexp file="${gwt.www.dir}/${gwt.module}/index.html"
92 f0105e9f Christos Stathis
                              match="CLOUDBAR_SERVICES = (.*)"
93 f0105e9f Christos Stathis
                              replace="CLOUDBAR_SERVICES = &quot;${CLOUDBAR_SERVICES}&quot;;"
94 f0105e9f Christos Stathis
                              byline="true"
95 f0105e9f Christos Stathis
               />
96 f0105e9f Christos Stathis
               <replaceregexp file="${gwt.www.dir}/${gwt.module}/index.html"
97 f0105e9f Christos Stathis
                              match="CLOUDBAR_MENU = (.*)"
98 f0105e9f Christos Stathis
                              replace="CLOUDBAR_MENU = &quot;${CLOUDBAR_MENU}&quot;;"
99 f0105e9f Christos Stathis
                              byline="true"
100 f0105e9f Christos Stathis
               />
101 f0105e9f Christos Stathis
               <replaceregexp file="${gwt.www.dir}/${gwt.module}/index.html"
102 f0105e9f Christos Stathis
                              match="loginUrl: (.*)"
103 ff057ec1 Christos Stathis
                              replace="loginUrl: &quot;${loginUrl}&quot;,"
104 ff057ec1 Christos Stathis
                              byline="true"
105 a0a08c19 Christos Stathis
               />
106 a0a08c19 Christos Stathis
               <replaceregexp file="${gwt.www.dir}/${gwt.module}/index.html"
107 a0a08c19 Christos Stathis
                              match="feedbackUrl: (.*)"
108 a0a08c19 Christos Stathis
                              replace="feedbackUrl: &quot;${feedbackUrl}&quot;,"
109 a0a08c19 Christos Stathis
                              byline="true"
110 ff057ec1 Christos Stathis
               />
111 ff057ec1 Christos Stathis
               <replaceregexp file="${gwt.www.dir}/${gwt.module}/index.html"
112 ff057ec1 Christos Stathis
                              match="authCookie: (.*)"
113 4253d74b Christos Stathis
                              replace="authCookie: &quot;${authCookie}&quot;,"
114 f0105e9f Christos Stathis
                              byline="true"
115 f0105e9f Christos Stathis
               />
116 cdc11586 Christos Stathis
               <replaceregexp file="${gwt.www.dir}/${gwt.module}/index.html"
117 cdc11586 Christos Stathis
                              match="version: (.*)"
118 cdc11586 Christos Stathis
                              replace="version: &quot;${version}&quot;"
119 cdc11586 Christos Stathis
                              byline="true"
120 cdc11586 Christos Stathis
               />
121 f0105e9f Christos Stathis
    </target>
122 ab3fae7b Christos Stathis
123 f0105e9f Christos Stathis
    <target name="uploadToVM" depends="main">
124 2aa9d5ce Christos Stathis
        <scp todir="chstath@pithos.dev.grnet.gr:/var/www/pithos_web_client" keyfile="${ssh.key}" passphrase="${passphrase}">
125 6084aa02 Christos Stathis
            <fileset dir="${gwt.www.dir}/${gwt.module}"/>
126 6084aa02 Christos Stathis
        </scp>
127 6084aa02 Christos Stathis
    </target>
128 6084aa02 Christos Stathis
129 152ee68f Christos Stathis
    <target name="uploadCSSToVM">
130 152ee68f Christos Stathis
        <scp todir="chstath@pithos.dev.grnet.gr:/var/www/pithos_web_client" keyfile="${ssh.key}" passphrase="${passphrase}">
131 1a0db4f4 Christos Stathis
            <fileset dir="${src.dir}/${gwt.root.path}/public" includes="pithos.css"/>
132 152ee68f Christos Stathis
        </scp>
133 152ee68f Christos Stathis
    </target>
134 152ee68f Christos Stathis
135 0aa7f3c9 Christos KK Loverdos
  <target name="rsyncToDev84">
136 0aa7f3c9 Christos KK Loverdos
    <exec executable="${basedir}/rsync-to-dev84.sh"></exec>
137 0aa7f3c9 Christos KK Loverdos
  </target>
138 0aa7f3c9 Christos KK Loverdos
139 ab3fae7b Christos Stathis
        <target name="clean" description="Delete all build artifacts">
140 ab3fae7b Christos Stathis
                <delete dir="${build.dir}"/>
141 ab3fae7b Christos Stathis
        </target>
142 ab3fae7b Christos Stathis
143 ab3fae7b Christos Stathis
    <target name="distclean" depends="clean" description="Delete all downloaded dependencies">
144 ab3fae7b Christos Stathis
        <delete dir="${deps.dir}"/>
145 ab3fae7b Christos Stathis
    </target>
146 ab3fae7b Christos Stathis
147 ab3fae7b Christos Stathis
    <target name="run-web-dev-mode" description="Run web client in development mode">
148 ab3fae7b Christos Stathis
        <java fork="true" classname="com.google.gwt.dev.DevMode" spawn="true">
149 ab3fae7b Christos Stathis
            <classpath>
150 ab3fae7b Christos Stathis
                <pathelement location="${src.dir}"/>
151 ab3fae7b Christos Stathis
                <pathelement location="${build.classes.dir}"/>
152 ab3fae7b Christos Stathis
                <pathelement path="${gwt.home}/gwt-dev.jar"/>
153 ab3fae7b Christos Stathis
                <pathelement path="${gwt.home}/gwt-user.jar" />
154 ab3fae7b Christos Stathis
                <path refid="project.class.path"/>
155 ab3fae7b Christos Stathis
            </classpath>
156 ab3fae7b Christos Stathis
            <jvmarg value="-Xmx256M"/>
157 ab3fae7b Christos Stathis
            <jvmarg value="-Xdebug"/>
158 ab3fae7b Christos Stathis
            <jvmarg value="-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=55555"/>
159 ab3fae7b Christos Stathis
            <arg value="-war"/>
160 d0596237 Christos Stathis
            <arg value="${gwt.www.dir}"/>
161 6084aa02 Christos Stathis
            <arg value="-noserver"/>
162 ab3fae7b Christos Stathis
            <arg value="-startupUrl"/>
163 969a4d94 Christos Stathis
            <arg value="http://127.0.0.1:8080/client"/>
164 ab3fae7b Christos Stathis
            <arg value="${gwt.module}"/>
165 ab3fae7b Christos Stathis
        </java>
166 ab3fae7b Christos Stathis
    </target>
167 ab3fae7b Christos Stathis
</project>