-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.xml
173 lines (135 loc) · 5.65 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
163
164
165
166
167
168
169
170
171
172
173
<?xml version="1.0" encoding="UTF-8"?>
<project default="clean" basedir="." name="formtag-extension">
<description>
Build Sentry Extension
</description>
<!-- set global properties for this build -->
<property file="build.properties"/>
<property name="lib" location="source/java/libs"/>
<property name="src" location="source/java/src"/>
<property name="srcCFML" location="source/CFML/src"/>
<property name="srcImg" location="source/images"/>
<property name="temp" location="temp"/>
<property name="build" location="build"/>
<property name="dist" location="dist"/>
<buildnumber file="build.number"/>
<scriptdef name="replace" language="javascript">
<attribute name="haystack" />
<attribute name="needle" />
<attribute name="repl" />
<attribute name="property" />
<![CDATA[
var text = attributes.get("haystack");
var needle = attributes.get("needle");
var repl = attributes.get("repl");
text=text.trim();
var regex = new RegExp(needle,'g');
text=text.replace(regex,repl);
project.setProperty(attributes.get("property"), text);
]]>
</scriptdef>
<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="${build}"/>
<mkdir dir="${dist}/"/>
</target>
<target name="copy" depends="init" description="copy source file to temp" >
<!-- copy the source -->
<copy todir="${temp}">
<fileset dir="${src}">
<include name="**/*.java"/>
</fileset>
</copy>
<tstamp>
<format property="NOW" pattern="yyyy-MM-dd HH:mm:ss" />
</tstamp>
<echo file="${dist}/extension/META-INF/MANIFEST.MF">Manifest-Version: 1.0
Built-Date: ${NOW}
version: "${bundleversion}${build.number}${bundleversionappendix}"
id: "${id}"
name: "${label}"
description: "${description}"
lucee-core-version: "5.0.0.230"
start-bundles: false
release-type: server
</echo>
</target>
<target name="compile" depends="copy"
description="compile the source " >
<!-- Compile ACF-Infinspan source -->
<javac srcdir="${temp}" target="1.7" destdir="${build}" debug="true" debuglevel="lines,vars,source">
<classpath refid="classpath" />
</javac>
</target>
<target name="dist" depends="compile"
description="generate the distribution" >
<!-- Put everything in ${build} into .jar file -->
<jar
jarfile="${dist}/extension/jars/${filename}-${bundleversion}${build.number}${bundleversionappendix}.jar" basedir="${build}" manifest="${src}/META-INF/MANIFEST.MF">
<manifest>
<attribute name="Bundle-Version" value="${bundleversion}${build.number}${bundleversionappendix}"/>
<attribute name="Built-Date" value="${NOW}"/>
<attribute name="Bundle-SymbolicName" value="${bundlename}"/>
</manifest>
</jar>
<!-- copy the context necessary
<copy todir="${dist}/extension/context">
<fileset dir="${srcCFML}/context">
<include name="**/*.*"/>
</fileset>
</copy> -->
<!-- copy the driver for Log4j1 -->
<loadfile property="c1" srcFile="${srcCFML}/context/admin/logging/appender/SentryAppenderLog4j1.cfc" />
<replace haystack="${c1}" needle="{class}" repl="${classlog4j1}" property="c2"/>
<replace haystack="${c2}" needle="{label}" repl="${labellog4j1}" property="c3"/>
<replace haystack="${c3}" needle="{desc}" repl="${desclog4j1}" property="c4"/>
<replace haystack="${c4}" needle="{bundlename}" repl="${bundlename}" property="c5"/>
<replace haystack="${c5}" needle="{bundleversion}" repl="${bundleversion}${build.number}${bundleversionappendix}" property="c6"/>
<echo message="${c6}" file="${dist}/extension/context/admin/logging/appender/SentryAppenderLog4j1.cfc"/>
<!-- copy the driver for Log4j1 -->
<loadfile property="xc1" srcFile="${srcCFML}/context/admin/logging/appender/SentryAppenderLog4j2.cfc" />
<replace haystack="${xc1}" needle="{class}" repl="${classlog4j2}" property="xc2"/>
<replace haystack="${xc2}" needle="{label}" repl="${labellog4j2}" property="xc3"/>
<replace haystack="${xc3}" needle="{desc}" repl="${desclog4j2}" property="xc4"/>
<replace haystack="${xc4}" needle="{bundlename}" repl="${bundlename}" property="xc5"/>
<replace haystack="${xc5}" needle="{bundleversion}" repl="${bundleversion}${build.number}${bundleversionappendix}" property="xc6"/>
<echo message="${xc6}" file="${dist}/extension/context/admin/logging/appender/SentryAppenderLog4j2.cfc"/>
<!-- copy the jars necessary -->
<copy todir="${dist}/extension/jars">
<fileset dir="${lib}">
<include name="**/*.jar"/>
<exclude name="**/javax.*"/>
<exclude name="**/jsp-*"/>
<exclude name="**/lucee.jar"/>
<exclude name="**/org.apache.felix.framework-*"/>
<exclude name="**/slf4j*"/>
<exclude name="**/log4j*"/>
</fileset>
</copy>
<!-- copy the logo -->
<copy todir="${dist}/extension/META-INF">
<fileset dir="${srcImg}/">
<include name="logo.png"/>
</fileset>
</copy>
<!-- Zip everything -->
<zip destfile="${dist}/${filename}-${bundleversion}${build.number}${bundleversionappendix}.lex">
<zipfileset dir="${dist}/extension"/>
</zip>
</target>
<target name="clean" depends="dist" description="clean up" >
<!-- Delete the ${build} and ${dist} directory trees -->
<delete dir="${build}"/>
<delete dir="${temp}"/>
</target>
</project>