Statistics
| Branch: | Tag: | Revision:

root / web_client / build.xml @ f55cf326

History | View | Annotate | Download (7.5 kB)

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.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}"/>
14

    
15
    <property name="gwt-gears.version" value="1.3.0"/>
16
    <property name="gwt-gears.home" value="${deps.dir}/gwt-gears-${gwt-gears.version}" />
17
    <property name="gwt-gears.filename" value="gwt-gears-${gwt-gears.version}.zip"/>
18
    <property name="gwt-gears.download.url" value="http://gwt-google-apis.googlecode.com/files/${gwt-gears.filename}"/>
19

    
20
    <property name="gwtquery.filename" value="gwtquery-1.0.0-20110116.074055-7.jar"/>
21
    <property name="gwtquery.download.url" value="http://gss.googlecode.com/hg/lib/${gwtquery.filename}?r=0473a2c1bc32c9426423f8ca3b688a29ce30216b"/>
22
    <property name="gwtquery-draggable-plugin.filename" value="draggable-plugin-1.0.2.jar"/>
23
    <property name="gwtquery-draggable-plugin.download.url" value="http://gss.googlecode.com/hg/lib/${gwtquery-draggable-plugin.filename}?r=0634eeeeaaad1b9bfb7a8e809bfc9e9545d208e2"/>
24
    <property name="gwtquery-droppable-plugin.filename" value="droppable-plugin-1.0.2.jar"/>
25
    <property name="gwtquery-droppable-plugin.download.url" value="http://gss.googlecode.com/hg/lib/${gwtquery-droppable-plugin.filename}?r=c8bca56a1c4ab780ac0d0cc72a2b40b60d7ca4f7"/>
26

    
27
    <property name="gwt.module.class" value="Pithos" />
28
    <property name="gwt.root.package" value="gr.grnet.pithos.web" />
29
    <property name="gwt.root.path" value="gr/grnet/pithos/web" />
30
    <property name="gwt.module" value="${gwt.root.package}.${gwt.module.class}" />
31

    
32
        <property name="src.dir" value="${basedir}/src"/>
33

    
34
        <!-- Build dirs -->
35
        <property name="build.dir" value="${basedir}/bin" />
36
        <property name="build.classes.dir" value="${build.dir}/classes" />
37
        <property name="gwt.www.dir" value="${build.dir}/www" />
38
        <property name="gwt.www.admin.dir" value="${build.dir}/wwwadmin" />
39
        <property name="dist.war" value="${ant.project.name}.war"/>
40
        <property name="war.dir" value="${basedir}/war" />
41
        <property name="war.web-inf.dir" value="${war.dir}/WEB-INF"/>
42
        <property name="war.lib.dir" value="${war.web-inf.dir}/lib"/>
43

    
44
        <!-- set classpath -->
45
        <path id="project.class.path">
46
        <pathelement location="${gwt.home}/gwt-user.jar"/>
47
        </path>
48

    
49
        <target name="check-dependencies" description="Checks if all dependencies are present">
50
        <condition property="dependencies.present">
51
            <and>
52
                <available file="${gwt.home}" type="dir"/>
53
                <available file="${gwt-gears.home}" type="dir"/>
54
                <available file="${deps.dir}/${gwtquery.filename}"/>
55
                <available file="${deps.dir}/${gwtquery-draggable-plugin.filename}"/>
56
                <available file="${deps.dir}/${gwtquery-droppable-plugin.filename}"/>
57
            </and>
58
        </condition>
59
        <echo message="dependencies.present=${dependencies.present}"/>
60
    </target>
61

    
62
    <target name="fetch-dependencies" unless="dependencies.present" description="Fetch the dpendencies if not present" depends="check-dependencies">
63
            <mkdir dir="${deps.dir}"/>
64
        <get src="${gwt.download.url}" dest="${deps.dir}/${gwt.filename}" usetimestamp="true"/>
65
        <get src="${gwt-gears.download.url}" dest="${deps.dir}/${gwt-gears.filename}" usetimestamp="true"/>
66
        <get src="${gwtquery.download.url}" dest="${deps.dir}/${gwtquery.filename}" usetimestamp="true"/>
67
        <get src="${gwtquery-draggable-plugin.download.url}" dest="${deps.dir}/${gwtquery-draggable-plugin.filename}" usetimestamp="true"/>
68
        <get src="${gwtquery-droppable-plugin.download.url}" dest="${deps.dir}/${gwtquery-droppable-plugin.filename}" usetimestamp="true"/>
69
            <unzip src="${deps.dir}/${gwt.filename}" dest="${gwt.home}/.."/>
70
        <unzip src="${deps.dir}/${gwt-gears.filename}" dest="${gwt-gears.home}/.."/>
71
    </target>
72

    
73
        <target name="check-gwt-compile" description="Checks is the web gwt client sources are up-to-date with the compiled artifacts">
74
                <uptodate property="compilation-not-needed">
75
                        <srcfiles dir="${src.dir}">
76
                <include name="${gwt.root.path}/**"/>
77
            </srcfiles>
78
                        <mergemapper to="${gwt.www.dir}/${gwt.module}/${gwt.module}.nocache.js"/>
79
                </uptodate>
80
        </target>
81

    
82
        <target name="gwt-compile" depends="check-gwt-compile, fetch-dependencies" unless="compilation-not-needed" description="Compile the gwt web client code to JavaScript">
83
                <java classname="com.google.gwt.dev.Compiler" failonerror="true" fork="true">
84
                        <arg value="-localWorkers" />
85
                        <arg value="${gwt.workers}" />
86
                        <arg value="-war"/>
87
                        <arg value="${gwt.www.dir}"/>
88
                        <arg value="${gwt.module}"/>
89
                        
90
                    <classpath>
91
                <pathelement path="${gwt.home}/gwt-dev.jar"/>
92
                <pathelement location="${deps.dir}/${gwtquery.filename}"/>
93
                <pathelement location="${deps.dir}/${gwtquery-droppable-plugin.filename}"/>
94
                <pathelement location="${deps.dir}/${gwtquery-draggable-plugin.filename}"/>
95
                <pathelement location="${gwt-gears.home}/gwt-gears.jar"/>
96
                <pathelement path="${gwt.home}/gwt-user.jar" />
97
                                <path refid="project.class.path"/>
98
                                <pathelement path="${src.dir}" />
99
                    </classpath>
100
                </java>
101
        <!--move file="${gwt.www.dir}/${gwt.module}/${gwt.module.class}.html" tofile="${gwt.www.dir}/${gwt.module}/index.html"/-->
102
        </target>
103

    
104
    <target name="uploadToVM" depends="gwt-compile">
105
        <scp todir="chstath@pithos.dev.grnet.gr:/var/www/pithos_web_client" keyfile="/home/chstath/.ssh/id_rsa" passphrase="r0bax45">
106
            <fileset dir="${gwt.www.dir}/${gwt.module}"/>
107
        </scp>
108
    </target>
109

    
110
        <target name="clean" description="Delete all build artifacts">
111
                <delete dir="${build.dir}"/>
112
        </target>
113

    
114
    <target name="distclean" depends="clean" description="Delete all downloaded dependencies">
115
        <delete dir="${deps.dir}"/>
116
    </target>
117

    
118
    <target name="run-web-dev-mode" description="Run web client in development mode">
119
        <java fork="true" classname="com.google.gwt.dev.DevMode" spawn="true">
120
            <classpath>
121
                <pathelement location="${src.dir}"/>
122
                <pathelement location="${build.classes.dir}"/>
123
                <pathelement path="${gwt.home}/gwt-dev.jar"/>
124
                <pathelement location="${deps.dir}/${gwtquery.filename}"/>
125
                <pathelement location="${deps.dir}/${gwtquery-draggable-plugin.filename}"/>
126
                <pathelement location="${deps.dir}/${gwtquery-droppable-plugin.filename}"/>
127
                <pathelement location="${gwt-gears.home}/gwt-gears.jar"/>
128
                <pathelement path="${gwt.home}/gwt-user.jar" />
129
                <path refid="project.class.path"/>
130
            </classpath>
131
            <jvmarg value="-Xmx256M"/>
132
            <jvmarg value="-Xdebug"/>
133
            <jvmarg value="-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=55555"/>
134
            <arg value="-war"/>
135
            <arg value="${gwt.www.dir}/${gwt.module}"/>
136
            <arg value="-noserver"/>
137
            <arg value="-startupUrl"/>
138
            <arg value="http://127.0.0.1:8080/client/pithos.html"/>
139
            <arg value="${gwt.module}"/>
140
        </java>
141
    </target>
142
</project>