GarrettS / ape-javascript-library

Minimal JavaScript library for writing and developing widgets.

This URL has Read+Write access

ape-javascript-library / build.xml
100644 105 lines (93 sloc) 4.09 kb
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
<project name="ape" basedir="." default="js.minify">
 
    <property name="src" location="src"/>
    <property name="test" location="test"/>
    <property name="example" location="example"/>
<property name="build" location="build"/>
    <property name="deploy" location="C:/Program Files/Apache/Tomcat/webapps/ROOT/ape/"/>
    
    <target name="js.rollups" depends="js.copy">
 
    <!-- concat all dom-f.js files, EXCEPT the first (style-f.js).
Remove the APE.namespace(APE.dom) from each file (except the first)
-->
        <property name='domFiles' value='constants.js, viewport-f.js, position-f.js, classname-f.js,
traversal-f.js, Event.js, Event-coords.js, style-f.js'/>
        <concat destfile="${build}/dom/dom.js">
            <filelist dir="${build}/dom" files="${domFiles}"/>
            <filterchain>
                <tokenfilter>
                    <replacestring from='APE.namespace("APE.dom");' to=""/>
                    <replacestring from="APE.namespace('APE.dom');" to=""/>
                </tokenfilter>
            </filterchain>
            <header>/**dom.js rollup: ${domFiles} */
APE.namespace("APE.dom"<!--necessary space for filterchain. --> );</header>
        </concat>
 
        <!-- build ape-ep-dom.js rollup -->
        <concat destfile="${build}/ape-ep-dom.js">
            <filelist dir="${build}"
                 files="APE.js, EventPublisher.js, dom/dom.js"/>
        </concat>
 
        <!-- build anim.js rollup -->
        <property name='animFiles' value='Animation.js, StyleTransition.js'/>
        <concat destfile="${build}/anim/anim.js">
            <filelist dir="${build}/anim" files="${animFiles}"/>
            <filterchain>
                <tokenfilter>
                    <replacestring from='APE.namespace("APE.anim");' to=""/>
                    <replacestring from="APE.namespace('APE.anim');" to=""/>
                </tokenfilter>
            </filterchain>
            <header>/**anim.js rollup: ${animFiles} */
APE.namespace("APE.anim"<!--necessary space, or filterchain will remove this! --> );
</header>
        </concat>
 
        <!-- build anim.js rollup -->
        <concat destfile="${build}/ajax/ajax-form.js">
            <filelist dir="${src}"
                 files="ajax/AsyncRequest.js, form/Form.js"/>
        </concat>
 
        <!-- build drag-slider.js rollup -->
        <concat destfile="${build}/drag/drag-slider.js">
            <filelist dir="${build}/drag"
                 files="Draggable.js, Slider.js"/>
            <filterchain>
                <tokenfilter>
                    <replacestring from='APE.namespace("APE.drag");' to=""/>
                    <replacestring from="APE.namespace('APE.drag');" to=""/>
                </tokenfilter>
            </filterchain>
            <header>/**drag-slider.js rollup: Draggable.js, Slider.js*/
APE.namespace("APE.drag"<!--necessary space --> );</header>
        </concat>
    </target>
 
    <target name="js.copy" depends="js.clean">
        <copy todir="${build}">
            <fileset dir="${src}"/>
        </copy>
    </target>
 
    <target name="js.minify" depends="js.rollups">
        <apply executable="java" parallel="false" dest="${build}" taskname="yui">
            <fileset dir="${build}" includes="**/*.js"/>
            <arg line="-jar"/>
            <arg path="yuicompressor-2.4\build\yuicompressor-2.4.jar"/>
            <arg line="-v"/>
            <srcfile/>
            <arg line="-o"/>
            <mapper type="glob" from="*.js" to="*-min.js"/>
            <targetfile/>
        </apply>
    </target>
 
    <target name="js.clean">
        <delete>
            <fileset dir="${build}" includes="**/*.js"/>
        </delete>
    </target>
    
    <target name="deploy" depends="js.minify, deploy.copy"
        description="copy test, build, example, to webserver directory">
    </target>
 
    <target name="deploy.copy" depends="js.rollups"
        description="copy test, build, example, to webserver directory">
        <copy todir="${deploy}">
            <fileset dir="."/>
        </copy>
    </target>
</project>