-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.xml
117 lines (100 loc) · 4.7 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
<?xml version="1.0" encoding="UTF-8"?>
<project name="Siwecos" default="dist">
<!-- ============================================ -->
<!-- Target: prepare -->
<!-- ============================================ -->
<target name="prepare">
<echo msg="Making directory ./build" />
<mkdir dir="./build" />
<mkdir dir="./build/mod" />
<mkdir dir="./build/plg" />
<echo msg="Making current timestamp" />
<tstamp>
<format property="zipstamp" pattern="%d%m%y%H%M%S" locale="de-DE" />
</tstamp>
<tstamp>
<format property="xmlstamp" pattern="%d.%m.%y" locale="de-DE" />
</tstamp>
<echo msg="fetching current versions" />
<xmlproperty file="./src/administrator/modules/mod_siwecos/mod_siwecos.xml" prefix="mod"/>
<xmlproperty file="./src/plugins/system/siwecos/siwecos.xml" prefix="plg"/>
<xmlproperty file="./src/administrator/manifests/packages/pkg_siwecos.xml" prefix="pkg"/>
</target>
<!-- ============================================ -->
<!-- Target: build -->
<!-- ============================================ -->
<target name="build" depends="prepare">
<echo msg="Deleting files from build directory" />
<delete dir="./build/mod" />
<delete dir="./build/plg" />
<delete file="./build/pkg_siwecos.xml" />
<echo msg="Copying files to build directory..." />
<echo msg="Copying module folder" />
<copy todir="./build/mod">
<fileset dir="./src/administrator/modules/mod_siwecos">
</fileset>
<filterchain>
<replacetokens begintoken="%%" endtoken="%%">
<token key="MODULEVERSION" value="${mod.extension.version}" />
<token key="CURRENTDATE" value="${xmlstamp}" />
</replacetokens>
</filterchain>
</copy>
<echo msg="Copying module media folder" />
<copy todir="./build/mod/media">
<fileset dir="./src/media/mod_siwecos">
</fileset>
</copy>
<echo msg="Copying plugin folder" />
<copy todir="./build/plg">
<fileset dir="./src/plugins/system/siwecos">
</fileset>
<filterchain>
<replacetokens begintoken="%%" endtoken="%%">
<token key="PLUGINVERSION" value="${plg.extension.version}" />
<token key="CURRENTDATE" value="${xmlstamp}" />
</replacetokens>
</filterchain>
</copy>
<echo msg="Copying package manifest" />
<copy tofile="./build/pkg_siwecos.xml" file="./src/administrator/manifests/packages/pkg_siwecos.xml">
<filterchain>
<replacetokens begintoken="%%" endtoken="%%">
<token key="MOD_ZIPNAME" value="mod_siwecos_${mod.extension.version}_${zipstamp}.zip" />
<token key="PLG_ZIPNAME" value="plg_siwecos_${plg.extension.version}_${zipstamp}.zip" />
<token key="CURRENTDATE" value="${xmlstamp}" />
</replacetokens>
</filterchain>
</copy>
<copy tofile="./build/script.siwecos.php" file="./src/administrator/manifests/packages/script.siwecos.php" />
</target>
<!-- ============================================ -->
<!-- (DEFAULT) Target: dist -->
<!-- ============================================ -->
<target name="dist" depends="build">
<echo msg="Creating module archive..." />
<zip destfile="./build/mod_siwecos_${mod.extension.version}_${zipstamp}.zip">
<fileset dir="./build/mod">
<include name="*" />
<include name="**/*" />
</fileset>
</zip>
<echo msg="Creating plugin archive..." />
<zip destfile="./build/plg_siwecos_${plg.extension.version}_${zipstamp}.zip">
<fileset dir="./build/plg">
<include name="*" />
<include name="**/*" />
</fileset>
</zip>
<echo msg="Creating package archive..." />
<zip destfile="./build/pkg_siwecos_${pkg.extension.version}_${zipstamp}.zip">
<fileset dir="./build">
<include name="mod_siwecos_${mod.extension.version}_${zipstamp}.zip" />
<include name="plg_siwecos_${plg.extension.version}_${zipstamp}.zip" />
<include name="pkg_siwecos.xml" />
<include name="script.siwecos.php" />
</fileset>
</zip>
<echo msg="Files copied and compressed in build directory OK!" />
</target>
</project>