forked from markussackmann/extension-redis-single
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build-modern.xml
83 lines (68 loc) · 2.74 KB
/
build-modern.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
<?xml version="1.0" encoding="UTF-8"?>
<project default="clean" basedir="." name="formtag-extension">
<description>Build Redis Extension Modern</description>
<import file="build-compile.xml"/>
<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();
text=text.replace(needle,repl);
project.setProperty(attributes.get("property"), text);
]]>
</scriptdef>
<target name="distModern" 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}${build.number}${bundleversion_appendix}"
id: "${id}"
name: "${label}"
description: "${description}"
start-bundles: false
release-type: ${releaseType}
cache: "[{'class':'${class}','bundleName':'${bundlename}','bundleVersion':'${bundleversion}${build.number}${bundleversion_appendix}'}]"
</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 jar just build -->
<copy todir="${dist}/extension2/jars">
<fileset dir="${temp}/jars/">
<include name="**/*.jar"/>
</fileset>
</copy>
<move
file="${dist}/extension2/jars/lucee.extension.${codename}.jar"
tofile="${dist}/extension2/jars/lucee.extension.${codename}-${bundleversion}${build.number}${bundleversion_appendix}.jar"/>
<!-- copy the context necessary -->
<loadfile property="content1" srcFile="${build}/context/admin/cdriver/${camelname}.cfc" />
<replace haystack="${content1}" needle="{class}" repl="${class}" property="content2"/>
<replace haystack="${content2}" needle="{label}" repl="${label}" property="content3"/>
<replace haystack="${content3}" needle="{desc}" repl="${description}" property="content4"/>
<echo message="${content4}" file="${dist}/extension2/context/admin/cdriver/${camelname}.cfc"/>
<!-- copy the logo -->
<copy todir="${dist}/extension2/META-INF">
<fileset dir="${build}/images">
<include name="logo.png"/>
</fileset>
</copy>
<!-- Zip everything -->
<zip destfile="${dist}/modern/extension-${codename}-${bundleversion}${build.number}${bundleversion_appendix}.lex">
<zipfileset dir="${dist}/extension2"/>
</zip>
</target>
<target name="buildModern" depends="distModern" description="clean up" >
<!-- <delete dir="${dist}/extension2"/> -->
</target>
</project>