Statistics
| Branch: | Tag: | Revision:

root / build.xml @ 91b28598

History | View | Annotate | Download (5.1 kB)

1 ab3fae7b Christos Stathis
<?xml version="1.0" encoding="utf-8" ?>
2 749068ba Christos Stathis
<project name="pithos" default="gwt-compile" 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 ab3fae7b Christos Stathis
    <property name="deps.dir" value="dependencies"/>
7 ab3fae7b Christos Stathis
8 ab3fae7b Christos Stathis
    <property name="gwt.workers" value="1"/>
9 ab3fae7b Christos Stathis
10 91b28598 Christos Stathis
    <property name="gwt.version" value="2.4.0"/>
11 ab3fae7b Christos Stathis
        <property name="gwt.home" value="${deps.dir}/gwt-${gwt.version}"/>
12 ab3fae7b Christos Stathis
    <property name="gwt.filename" value="gwt-${gwt.version}.zip"/>
13 ab3fae7b Christos Stathis
    <property name="gwt.download.url" value="http://google-web-toolkit.googlecode.com/files/${gwt.filename}"/>
14 ab3fae7b Christos Stathis
15 749068ba Christos Stathis
    <property name="gwt.module.class" value="Pithos" />
16 a57faaf0 Christos Stathis
    <property name="gwt.root.package" value="gr.grnet.pithos.web" />
17 a57faaf0 Christos Stathis
    <property name="gwt.root.path" value="gr/grnet/pithos/web" />
18 ab3fae7b Christos Stathis
    <property name="gwt.module" value="${gwt.root.package}.${gwt.module.class}" />
19 ab3fae7b Christos Stathis
20 ab3fae7b Christos Stathis
        <property name="src.dir" value="${basedir}/src"/>
21 ab3fae7b Christos Stathis
22 ab3fae7b Christos Stathis
        <!-- Build dirs -->
23 ab3fae7b Christos Stathis
        <property name="build.dir" value="${basedir}/bin" />
24 ab3fae7b Christos Stathis
        <property name="build.classes.dir" value="${build.dir}/classes" />
25 ab3fae7b Christos Stathis
        <property name="gwt.www.dir" value="${build.dir}/www" />
26 ab3fae7b Christos Stathis
        <property name="gwt.www.admin.dir" value="${build.dir}/wwwadmin" />
27 ab3fae7b Christos Stathis
        <property name="dist.war" value="${ant.project.name}.war"/>
28 ab3fae7b Christos Stathis
        <property name="war.dir" value="${basedir}/war" />
29 ab3fae7b Christos Stathis
        <property name="war.web-inf.dir" value="${war.dir}/WEB-INF"/>
30 ab3fae7b Christos Stathis
        <property name="war.lib.dir" value="${war.web-inf.dir}/lib"/>
31 ab3fae7b Christos Stathis
32 ab3fae7b Christos Stathis
        <!-- set classpath -->
33 ab3fae7b Christos Stathis
        <path id="project.class.path">
34 ab3fae7b Christos Stathis
        <pathelement location="${gwt.home}/gwt-user.jar"/>
35 ab3fae7b Christos Stathis
        </path>
36 ab3fae7b Christos Stathis
37 ab3fae7b Christos Stathis
        <target name="check-dependencies" description="Checks if all dependencies are present">
38 ab3fae7b Christos Stathis
        <condition property="dependencies.present">
39 ab3fae7b Christos Stathis
            <and>
40 ab3fae7b Christos Stathis
                <available file="${gwt.home}" type="dir"/>
41 ab3fae7b Christos Stathis
            </and>
42 ab3fae7b Christos Stathis
        </condition>
43 ab3fae7b Christos Stathis
        <echo message="dependencies.present=${dependencies.present}"/>
44 ab3fae7b Christos Stathis
    </target>
45 ab3fae7b Christos Stathis
46 ab3fae7b Christos Stathis
    <target name="fetch-dependencies" unless="dependencies.present" description="Fetch the dpendencies if not present" depends="check-dependencies">
47 ab3fae7b Christos Stathis
            <mkdir dir="${deps.dir}"/>
48 ab3fae7b Christos Stathis
        <get src="${gwt.download.url}" dest="${deps.dir}/${gwt.filename}" usetimestamp="true"/>
49 ab3fae7b Christos Stathis
            <unzip src="${deps.dir}/${gwt.filename}" dest="${gwt.home}/.."/>
50 ab3fae7b Christos Stathis
    </target>
51 ab3fae7b Christos Stathis
52 ab3fae7b Christos Stathis
        <target name="check-gwt-compile" description="Checks is the web gwt client sources are up-to-date with the compiled artifacts">
53 ab3fae7b Christos Stathis
                <uptodate property="compilation-not-needed">
54 ab3fae7b Christos Stathis
                        <srcfiles dir="${src.dir}">
55 ab3fae7b Christos Stathis
                <include name="${gwt.root.path}/**"/>
56 ab3fae7b Christos Stathis
            </srcfiles>
57 ab3fae7b Christos Stathis
                        <mergemapper to="${gwt.www.dir}/${gwt.module}/${gwt.module}.nocache.js"/>
58 ab3fae7b Christos Stathis
                </uptodate>
59 ab3fae7b Christos Stathis
        </target>
60 ab3fae7b Christos Stathis
61 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">
62 ab3fae7b Christos Stathis
                <java classname="com.google.gwt.dev.Compiler" failonerror="true" fork="true">
63 ab3fae7b Christos Stathis
                        <arg value="-localWorkers" />
64 ab3fae7b Christos Stathis
                        <arg value="${gwt.workers}" />
65 ab3fae7b Christos Stathis
                        <arg value="-war"/>
66 ab3fae7b Christos Stathis
                        <arg value="${gwt.www.dir}"/>
67 ab3fae7b Christos Stathis
                        <arg value="${gwt.module}"/>
68 ab3fae7b Christos Stathis
                        
69 ab3fae7b Christos Stathis
                    <classpath>
70 ab3fae7b Christos Stathis
                <pathelement path="${gwt.home}/gwt-dev.jar"/>
71 ab3fae7b Christos Stathis
                <pathelement path="${gwt.home}/gwt-user.jar" />
72 ab3fae7b Christos Stathis
                                <path refid="project.class.path"/>
73 ab3fae7b Christos Stathis
                                <pathelement path="${src.dir}" />
74 ab3fae7b Christos Stathis
                    </classpath>
75 ab3fae7b Christos Stathis
                </java>
76 ab3fae7b Christos Stathis
        <!--move file="${gwt.www.dir}/${gwt.module}/${gwt.module.class}.html" tofile="${gwt.www.dir}/${gwt.module}/index.html"/-->
77 ab3fae7b Christos Stathis
        </target>
78 ab3fae7b Christos Stathis
79 6084aa02 Christos Stathis
    <target name="uploadToVM" depends="gwt-compile">
80 2aa9d5ce Christos Stathis
        <scp todir="chstath@pithos.dev.grnet.gr:/var/www/pithos_web_client" keyfile="${ssh.key}" passphrase="${passphrase}">
81 6084aa02 Christos Stathis
            <fileset dir="${gwt.www.dir}/${gwt.module}"/>
82 6084aa02 Christos Stathis
        </scp>
83 6084aa02 Christos Stathis
    </target>
84 6084aa02 Christos Stathis
85 152ee68f Christos Stathis
    <target name="uploadCSSToVM">
86 152ee68f Christos Stathis
        <scp todir="chstath@pithos.dev.grnet.gr:/var/www/pithos_web_client" keyfile="${ssh.key}" passphrase="${passphrase}">
87 1a0db4f4 Christos Stathis
            <fileset dir="${src.dir}/${gwt.root.path}/public" includes="pithos.css"/>
88 152ee68f Christos Stathis
        </scp>
89 152ee68f Christos Stathis
    </target>
90 152ee68f Christos Stathis
91 ab3fae7b Christos Stathis
        <target name="clean" description="Delete all build artifacts">
92 ab3fae7b Christos Stathis
                <delete dir="${build.dir}"/>
93 ab3fae7b Christos Stathis
        </target>
94 ab3fae7b Christos Stathis
95 ab3fae7b Christos Stathis
    <target name="distclean" depends="clean" description="Delete all downloaded dependencies">
96 ab3fae7b Christos Stathis
        <delete dir="${deps.dir}"/>
97 ab3fae7b Christos Stathis
    </target>
98 ab3fae7b Christos Stathis
99 ab3fae7b Christos Stathis
    <target name="run-web-dev-mode" description="Run web client in development mode">
100 ab3fae7b Christos Stathis
        <java fork="true" classname="com.google.gwt.dev.DevMode" spawn="true">
101 ab3fae7b Christos Stathis
            <classpath>
102 ab3fae7b Christos Stathis
                <pathelement location="${src.dir}"/>
103 ab3fae7b Christos Stathis
                <pathelement location="${build.classes.dir}"/>
104 ab3fae7b Christos Stathis
                <pathelement path="${gwt.home}/gwt-dev.jar"/>
105 ab3fae7b Christos Stathis
                <pathelement path="${gwt.home}/gwt-user.jar" />
106 ab3fae7b Christos Stathis
                <path refid="project.class.path"/>
107 ab3fae7b Christos Stathis
            </classpath>
108 ab3fae7b Christos Stathis
            <jvmarg value="-Xmx256M"/>
109 ab3fae7b Christos Stathis
            <jvmarg value="-Xdebug"/>
110 ab3fae7b Christos Stathis
            <jvmarg value="-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=55555"/>
111 ab3fae7b Christos Stathis
            <arg value="-war"/>
112 d0596237 Christos Stathis
            <arg value="${gwt.www.dir}"/>
113 6084aa02 Christos Stathis
            <arg value="-noserver"/>
114 ab3fae7b Christos Stathis
            <arg value="-startupUrl"/>
115 969a4d94 Christos Stathis
            <arg value="http://127.0.0.1:8080/client"/>
116 ab3fae7b Christos Stathis
            <arg value="${gwt.module}"/>
117 ab3fae7b Christos Stathis
        </java>
118 ab3fae7b Christos Stathis
    </target>
119 ab3fae7b Christos Stathis
</project>