-
Notifications
You must be signed in to change notification settings - Fork 13
/
build.xml
162 lines (127 loc) · 4.43 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
154
155
156
157
158
159
160
161
162
<?xml version="1.0" encoding="UTF-8"?>
<project default="clean" basedir="." name="redis-extension">
<description>Build Redis Extension</description>
<property name="fld" location="source/fld"/>
<property name="tld" location="source/tld"/>
<property name="lib" location="source/java/lib"/>
<property name="src" location="source/java/src"/>
<property name="temp" location="temp"/>
<property name="build" location="build"/>
<property name="dist" location="target"/>
<path id="classpath">
<fileset dir="${lib}">
<include name="**/*.jar" />
</fileset>
</path>
<target name="init">
<!-- Create the time stamp -->
<tstamp/>
<delete dir="${temp}"/>
<delete dir="${dist}"/>
<!-- Create the build directory structure used by compile -->
<mkdir dir="${temp}"/>
<mkdir dir="${temp}/classes"/>
<mkdir dir="${temp}/jars"/>
<mkdir dir="${dist}"/>
<tstamp>
<format property="NOW" pattern="yyyy-MM-dd HH:mm:ss" />
</tstamp>
</target>
<target name="compile" depends="init" description="compile the source " >
<javac srcdir="${src}" target="11" destdir="${temp}/classes" debug="true" debuglevel="lines,vars,source">
<classpath refid="classpath" />
</javac>
<jar jarfile="${temp}/jars/${bundlename}-${bundleversion}.jar" basedir="${temp}/classes" manifest="${src}/META-INF/MANIFEST.MF">
<manifest>
<attribute name="Bundle-Version" value="${bundleversion}"/>
<attribute name="Built-Date" value="${NOW}"/>
<attribute name="Bundle-SymbolicName" value="${bundlename}"/>
</manifest>
</jar>
<delete dir="${temp}/classes"/>
</target>
<target name="dist" depends="compile" description="copy source file to temp" >
<!-- Manifest of the extension -->
<echo file="${dist}/extension2/META-INF/MANIFEST.MF">Manifest-Version: 1.0
Built-Date: ${NOW}
version: "${bundleversion}"
id: "${id}"
name: "${label}"
description: "${description}"
start-bundles: false
release-type: ${releaseType}
cache: "[{'class':'${class}','bundleName':'${bundlename}','bundleVersion':'${bundleversion}'}]"
</echo>
<!-- copy the jars necessary -->
<copy todir="${dist}/extension2/jars">
<fileset dir="${lib}">
<include name="**/*.jar"/>
<exclude name="**/javax.servlet.jar"/>
<exclude name="**/lucee*.jar"/>
</fileset>
</copy>
<!-- copy the tlds necessary -->
<copy file="${tld}/tag.tldx" tofile="${dist}/extension2/tlds/lucee-redis.tldx" />
<replaceregexp
file="${dist}/extension2/tlds/lucee-redis.tldx"
match="\{bundle-name\}"
replace="${bundlename}"
byline="true"/>
<replaceregexp
file="${dist}/extension2/tlds/lucee-redis.tldx"
match="\{bundle-version\}"
replace="${bundleversion}"
byline="true"/>
<!-- copy the flds necessary -->
<copy file="${fld}/function.fld" tofile="${dist}/extension2/flds/lucee-redis.fld" />
<replaceregexp
file="${dist}/extension2/flds/lucee-redis.fld"
match="\{bundle-name\}"
replace="${bundlename}"
byline="true"/>
<replaceregexp
file="${dist}/extension2/flds/lucee-redis.fld"
match="\{bundle-version\}"
replace="${bundleversion}"
byline="true"/>
<!-- copy the jar just build -->
<copy todir="${dist}/extension2/jars">
<fileset dir="${temp}/jars/">
<include name="**/*.jar"/>
</fileset>
</copy>
<!-- Redis.cfc -->
<copy
file="${build}/context/admin/cdriver/${camelname}.cfc"
tofile="${dist}/extension2/context/admin/cdriver/${camelname}.cfc" />
<replaceregexp
file="${dist}/extension2/context/admin/cdriver/${camelname}.cfc"
match="\{class\}"
replace="${class}"
byline="true"/>
<replaceregexp
file="${dist}/extension2/context/admin/cdriver/${camelname}.cfc"
match="\{label\}"
replace="${label}"
byline="true"/>
<replaceregexp
file="${dist}/extension2/context/admin/cdriver/${camelname}.cfc"
match="\{desc\}"
replace="${description}"
byline="true"/>
<!-- copy the logos -->
<copy todir="${dist}/extension2/META-INF">
<fileset dir="${build}/images">
<include name="logo.png"/>
</fileset>
</copy>
<!-- Zip everything -->
<zip destfile="${dist}/${filename}-${bundleversion}.lex">
<zipfileset dir="${dist}/extension2"/>
</zip>
</target>
<target name="clean" depends="dist" description="clean up" >
<delete dir="${temp}"/>
<delete dir="${dist}/extension2"/>
</target>
</project>