sventon subversion web client - http://www.sventon.org
[show recent changes]
 
  Help
HEAD
Rev: 32865 - http://anonsvn.icesoft.org/repo / icefaces3 / branches / icefaces-3.0.x-maintenance / icefaces / compat / core / build.javascript.xml
Show File - build.javascript.xml  [show properties]
spinner
<?xml version="1.0"?>
<!--
  ~ Copyright 2004-2012 ICEsoft Technologies Canada Corp.
  ~
  ~ Licensed under the Apache License, Version 2.0 (the "License");
  ~ you may not use this file except in compliance with the
  ~ License. You may obtain a copy of the License at
  ~
10    ~ http://www.apache.org/licenses/LICENSE-2.0
11    ~
12    ~ Unless required by applicable law or agreed to in writing,
13    ~ software distributed under the License is distributed on an "AS
14    ~ IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
15    ~ express or implied. See the License for the specific language
16    ~ governing permissions and limitations under the License.
17    -->
18 
19  <project name="bridge" default="build">
20      <property file="build.properties"/>
21      <property name="src.dir" location="${basedir}/src/main/javascript"/>
22      <property name="extras.dir" location="${src.dir}/extras"/>
23      <property name="prototype.dir" location="${src.dir}/prototype"/>
24      <property name="scriptaculous.dir" location="${src.dir}/scriptaculous"/>
25      <property name="lib.dir" location="${basedir}/src/main/javascript/lib"/>
26      <property name="build.dir" location="${basedir}/build/resources/META-INF/resources"/>
27      <property name="icefaces-compat.js" location="${build.dir}/icefaces-compat.js"/>
28      <property name="script" location="${build.dir}/compat.js"/>
29      <property name="script.extra" location="${icefaces-compat.js}"/>
30      <property name="tmp" value="${build.dir}/tmp.js"/>
31      <property name="tmp.extra" value="${build.dir}/tmp.extra.js"/>
32 
33      <target name="prepare" depends="build.icefaces.compat" description="Collate bridge code">
34          <tstamp/>
35          <echoproperties/>
36          <mkdir dir="${build.dir}"/>
37          <loadfile property="functional.js" srcFile="${lib.dir}/functional.js"/>
38          <loadfile property="oo.js" srcFile="${lib.dir}/oo.js"/>
39          <loadfile property="collection.js" srcFile="${lib.dir}/collection.js"/>
40          <loadfile property="string.js" srcFile="${lib.dir}/string.js"/>
41          <loadfile property="window.js" srcFile="${lib.dir}/window.js"/>
42          <loadfile property="delay.js" srcFile="${lib.dir}/delay.js"/>
43          <loadfile property="http.js" srcFile="${lib.dir}/http.js"/>
44          <loadfile property="event.js" srcFile="${lib.dir}/event.js"/>
45          <loadfile property="status.js" srcFile="${src.dir}/status.js"/>
46          <loadfile property="submit.js" srcFile="${src.dir}/submit.js"/>
47          <copy file="${src.dir}/compat.js" tofile="${tmp}" overwrite="yes">
48              <filterset begintoken="//include " endtoken=".js">
49                  <filter token="functional" value="${functional.js}"/>
50                  <filter token="oo" value="${oo.js}"/>
51                  <filter token="collection" value="${collection.js}"/>
52                  <filter token="string" value="${string.js}"/>
53                  <filter token="window" value="${window.js}"/>
54                  <filter token="delay" value="${delay.js}"/>
55                  <filter token="http" value="${http.js}"/>
56                  <filter token="event" value="${event.js}"/>
57                  <filter token="status" value="${status.js}"/>
58                  <filter token="submit" value="${submit.js}"/>
59              </filterset>
60          </copy>
61      </target>
62 
63 
64      <target name="build.icefaces.compat" description="Collate compat components code">
65          <tstamp/>
66          <echoproperties/>
67          <mkdir dir="${build.dir}"/>
68          <concat destfile="${icefaces-compat.js}" append="yes" fixlastline="yes">
69              <header file="src/main/javascript/compat.header.js"/>
70              <footer file="src/main/javascript/compat.footer.js"/>
71              <filelist dir="${prototype.dir}">
72                  <file name="prototype.js"/>
73              </filelist>
74              <filelist dir="${scriptaculous.dir}">
75                  <!--<file name="builder.js"/>-->
76                  <file name="effects.js"/>
77                  <file name="dragdrop.js"/>
78                  <!--<file name="controls.js"/>-->
79                  <!--<file name="slider.js"/>-->
80                  <!--<file name="sound.js"/>-->
81              </filelist>
82              <filelist dir="${extras.dir}">
83                  <file name="extras.js"/>
84              </filelist>
85          </concat>
86          <copy file="${icefaces-compat.js}" tofile="${tmp.extra}" overwrite="yes"/>
87      </target>
88 
89      <target name="build.bridge.compressed" depends="prepare" unless="no-compress">
90          <echo message="Compressing Javascript code..."/>
91          <java jar="../../lib/yui-compressor.jar" fork="yes">
92              <arg line="--preserve-semi"/>
93              <arg value="-o"/>
94              <arg value="${script}"/>
95              <arg value="${tmp}"/>
96          </java>
97          <java jar="../../lib/yui-compressor.jar" fork="yes">
98              <arg line="--preserve-semi"/>
99              <arg value="-o"/>
100              <arg value="${script.extra}"/>
101              <arg value="${tmp.extra}"/>
102          </java>
103      </target>
104 
105      <target name="build.bridge.uncompressed" depends="prepare" if="no-compress">
106          <touch file="${script}"/>
107          <move file="${tmp}" tofile="${script}" overwrite="yes">
108              <filterchain>
109                  <stripjavacomments/>
110                  <ignoreblank/>
111              </filterchain>
112          </move>
113          <touch file="${script.extra}"/>
114          <move file="${tmp.extra}" tofile="${script.extra}" overwrite="yes">
115              <filterchain>
116                  <!-- using built in 'stripjavacomments' for removing comments breaks Prototype code, one of
117                  the regular expressions contains '/*' characters which are mistakenly interpreted as JS comments -->
118                  <!--stripjavacomments/-->
119                  <ignoreblank/>
120              </filterchain>
121          </move>
122      </target>
123 
124      <target name="build.cleanup">
125          <delete file="${script}"/>
126          <delete file="${script.extra}"/>
127          <delete file="${tmp}"/>
128          <delete file="${tmp.extra}"/>
129      </target>
130 
131      <target name="build" depends="build.cleanup, build.bridge.uncompressed, build.bridge.compressed"
132              description="Build bridge"/>
133 
134      <target name="clean">
135          <delete dir="${build.dir}"/>
136      </target>
137  </project>


feed icon

sventon 2.5.1