summaryrefslogtreecommitdiffstats
path: root/push/build.xml
blob: f18caf69b4d66e303851709b37ca7afbcb261507 (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
<?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" />

    <!-- Keep the version number in sync with ivy.xml and server/src/com/vaadin/server/Constants.java-->
    <property name="atmosphere.version" value="1.0.14-vaadin1" />
    <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" />
        </fileset>
    </union>

    <target name="vaadinPush.js">
        <mkdir dir="${result.dir}/js/VAADIN" />
        <property name="vaadinPush.js.output" location="${result.dir}/js/VAADIN/vaadinPush.js" />
        <property name="vaadinPush.js.combined.output" location="${result.dir}/js/VAADIN/push.combined.js" />

        <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>
        <echo file="${vaadinPush.js.combined.output}">${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.output}" />
            <arg file="${vaadinPush.js.combined.output}" />
        </java>
    </target>

    <target name="jar" depends="vaadinPush.js">
        <antcall target="common.jar">
            <param name="require-bundle" value="org.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>