-
Notifications
You must be signed in to change notification settings - Fork 9
/
build.xml
executable file
·154 lines (114 loc) · 4.89 KB
/
build.xml
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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
<?xml version="1.0" encoding="UTF-8"?>
<project name="RailoAjax" default="build">
<!-- update build properties -->
<propertyfile file="build.properties">
<entry key="build.number" type="int" operation="+" value="1" pattern="00"/>
<entry key="build.date" type="date" pattern="EEEE MMM dd, yyyy" value="now"/>
<entry key="build.time" type="date" pattern="kk:mm:ss" value="now"/>
<entry key="build.timestamp" type="date" pattern="yyyy-MM-dd'T'HH:mm:ss" value="now"/>
<entry key="build.year" type="date" pattern="yyyy" value="now"/>
</propertyfile>
<!-- project properties -->
<property file="project.properties"/>
<!-- build properties -->
<property file="build.properties"/>
<!-- yui compressor -->
<property name="yui-compressor.jar" location="libs/yuicompressor-2.4.2.jar" />
<property name="yui-compressor-ant-task.jar" location="libs/yui-compressor-ant-task-0.4.jar" />
<path id="yuiTask.classpath">
<pathelement location="${yui-compressor.jar}" />
<pathelement location="${yui-compressor-ant-task.jar}" />
</path>
<!-- setup -->
<target name="setup">
<delete dir="${basedir}/temp" failonerror="false"/>
<mkdir dir="${basedir}/temp" />
<mkdir dir="${basedir}/temp/uncompressed" />
<mkdir dir="${basedir}/temp/compressed"/>
<mkdir dir="${basedir}/temp/tag"/>
<mkdir dir="${basedir}/temp/function"/>
<mkdir dir="${basedir}/temp/output"/>
</target>
<!-- deploy -->
<target name="deploy" depends="setup">
<echo message="Copying to temp tags location"/>
<copy todir="${basedir}/temp/tag" overwrite="true">
<fileset dir="src/tag"/>
</copy>
<echo message="Copying to temp function location"/>
<copy todir="${basedir}/temp/function" overwrite="true">
<fileset dir="src/function"/>
</copy>
<echo message="Deploying to local railo install before compress."/>
<delete dir="WEB-INF/railo/library/tag" failonerror="false"/>
<copy todir="WEB-INF/railo/library/tag" overwrite="true">
<fileset dir="${basedir}/temp/tag/"/>
</copy>
<delete dir="WEB-INF/railo/library/function" failonerror="false"/>
<copy todir="WEB-INF/railo/library/function" overwrite="true">
<fileset dir="${basedir}/temp/function/"/>
</copy>
</target>
<target name="compress" depends="deploy">
<taskdef name="yui-compressor" classname="net.noha.tools.ant.yuicompressor.tasks.YuiCompressorTask">
<classpath refid="yuiTask.classpath" />
</taskdef>
<echo message="Compressing js files."/>
<copy todir="${basedir}/temp/uncompressed">
<fileset dir="${basedir}/temp/tag/railo/core/ajax/js/">
<include name="*.js"/>
</fileset>
<fileset dir="${basedir}/temp/tag/railo/core/ajax/js/google">
<include name="*.js"/>
</fileset>
<fileset dir="${basedir}/temp/tag/railo/core/ajax/js/jquery">
<include name="jquery.layout.js"/>
</fileset>
<fileset dir="${basedir}/temp/tag/railo/core/ajax/js/jquery">
<include name="jquery.window.js"/>
</fileset>
</copy>
<yui-compressor
warn="false"
munge="true"
jsSuffix=".js"
preserveallsemicolons="false"
fromdir="${basedir}/temp/uncompressed"
todir="${basedir}/temp/compressed"/>
<echo message="Copy compressed files"/>
<copy todir="${basedir}/temp/tag/railo/core/ajax/js" overwrite="true">
<fileset dir="${basedir}/temp/compressed" includes="RailoAjax.js"/>
</copy>
<copy todir="${basedir}/temp/tag/railo/core/ajax/js" overwrite="true">
<fileset dir="${basedir}/temp/compressed" includes="RailoMap.js"/>
</copy>
<copy todir="${basedir}/temp/tag/railo/core/ajax/js" overwrite="true">
<fileset dir="${basedir}/temp/compressed" includes="RailoLayout.js"/>
</copy>
<copy todir="${basedir}/temp/tag/railo/core/ajax/js" overwrite="true">
<fileset dir="${basedir}/temp/compressed" includes="RailoWindow.js"/>
</copy>
<copy todir="${basedir}/temp/tag/railo/core/ajax/js/google" overwrite="true">
<fileset dir="${basedir}/temp/compressed" includes="google-map.js"/>
</copy>
<copy todir="${basedir}/temp/tag/railo/core/ajax/js/jquery" overwrite="true">
<fileset dir="${basedir}/temp/compressed" includes="jquery.layout.js"/>
</copy>
<copy todir="${basedir}/temp/tag/railo/core/ajax/js/jquery" overwrite="true">
<fileset dir="${basedir}/temp/compressed" includes="jquery.window.js"/>
</copy>
<echo message="Deploying to build path"/>
<copy todir="build/tag" overwrite="true">
<fileset dir="${basedir}/temp/tag/"/>
</copy>
<copy todir="build/function" overwrite="true">
<fileset dir="${basedir}/temp/function/"/>
</copy>
</target>
<target name="build" depends="compress">
<delete dir="${basedir}/temp"/>
</target>
<target name="restartRailo" description="Restarts the Railo server.">
<get src="http://${server.name}:${server.port}/reload.cfm" dest="temp/output/output.txt" ignoreerrors="true" />
</target>
</project>