summaryrefslogtreecommitdiffstats
path: root/push/build.xml
blob: 1cbe23d75b18bf350b3a146ebc6e636b5aa69fbb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
<?xml version="1.0"?>

<project name="vaadin-push" basedir="." default="publish-local" xmlns:ivy="antlib:org.apache.ivy.ant">
    <description>
        Meta package which defines dependencies needed for push
    </description>
    <include file="../build.xml" as="vaadin" />
    <include file="../common.xml" as="common" />

    <property name="module.name" value="vaadin-push" />
    <property name="module.symbolic" value="com.vaadin.push" />
    <property name="result.dir" location="result" />
    <property name="vaadinPush.js" location="${result.dir}/js/VAADIN/vaadinPush.js" />
    <property name="vaadinPush.debug.js" location="${result.dir}/js/VAADIN/vaadinPush.debug.js" />

    <!-- Keep the version number in sync with ivy.xml, server/src/com/vaadin/server/Constants.java and jquery.atmosphere.js -->
    <property name="atmosphere.version" value="1.0.14.vaadin4" />
    <property name="jquery.version" value="1.7.2" />

    <path id="classpath.compile.custom" />

    <union id="jar.includes">
        <fileset dir="${result.dir}/js">
            <include name="VAADIN/vaadinPush.js" />
            <include name="VAADIN/vaadinPush.debug.js" />
        </fileset>
    </union>

    <target name="vaadinPush.js">
        <mkdir dir="${result.dir}/js/VAADIN" />

        <loadfile srcfile="${vaadin.basedir}/WebContent/VAADIN/jquery-${jquery.version}.js" property="jquery.js.contents" />
        <loadfile srcfile="${vaadin.basedir}/WebContent/VAADIN/jquery.atmosphere.js" property="jquery.atmosphere.js.contents" />
        <loadfile srcfile="${vaadin.basedir}/WebContent/VAADIN/vaadinPush.js.tpl" property="vaadinPush.js.contents">
            <filterchain>
                <replacetokens begintoken="@" endtoken="@">
                    <token key="jquery.js" value="${jquery.js.contents}" />
                    <token key="jquery.atmosphere.js" value="${jquery.atmosphere.js.contents}" />
                </replacetokens>
            </filterchain>
        </loadfile>

        <!-- Non-obfuscated version for debugging -->
        <echo file="${vaadinPush.debug.js}">${vaadinPush.js.contents}</echo>

        <!-- Minify -->
        <ivy:retrieve organisation="com.yahoo.platform.yui" module="yuicompressor" revision="2.4.7" inline="true" type="jar" pattern="${result.dir}/compressor.jar" />
        <java jar="${result.dir}/compressor.jar" fork="true">
            <arg value="-v" />
            <arg value="-o" />
            <arg file="${vaadinPush.js}" />
            <arg file="${vaadinPush.debug.js}" />
        </java>
    </target>

    <target name="jar" depends="vaadinPush.js">
        <antcall target="common.jar">
            <param name="require-bundle" value="com.vaadin.external.atmosphere.atmosphere-runtime;bundle-version=&quot;${atmosphere.version}&quot;;visibility:=reexport" />
            <reference torefid="extra.jar.includes" refid="jar.includes" />
        </antcall>
    </target>

    <target name="publish-local" depends="jar">
        <antcall target="common.publish-local" />
    </target>

    <target name="clean">
        <antcall target="common.clean" />
    </target>
    <target name="checkstyle">
    </target>

    <target name="test" depends="checkstyle">
    </target>
</project>