-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
builder.xml
99 lines (95 loc) · 3.69 KB
/
builder.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
<?xml version="1.0" encoding="UTF-8"?>
<!--
Override variables:
- Version number -Dbuild.version=0.0.0
All paths starts at the build folder
- Build dir -Dbuilddir=./../../packages/swsetgroup
- Sourcefiles -Dsrc=./..
-->
<project name="joomlatextools" default="build">
<property name="extension_name" value="JoomTexApps" />
<!-- Version number of build -->
<property name="build.version" value="0.0.0" override="true" />
<!-- get the date for build -->
<tstamp prefix="build.date">
<format property = "XMLDATE" pattern = "%Y-%m-%d" />
</tstamp>
<!-- Set the directory where the packages should be saved. Relative to the build dir -->
<property name="builddir" value="./../packages/${extension_name}" override="true" />
<!-- Declare Project src files -->
<property name="src" value="./src" override="true" />
<property name="plugins" value="${src}/plugins" />
<property name="media" value="${src}/media" />
<!-- plugins -->
<fileset dir="${plugins}/kunenatex" id="katex">
<include name="**" />
</fileset>
<fileset dir="${media}" id="katexMedia">
<include name="plg_kunenatex/**" />
</fileset>
<fileset dir="${plugins}/jatex" id="jatex">
<include name="**" />
</fileset>
<fileset dir="${media}" id="jatexMedia">
<include name="plg_jatex/**" />
</fileset>
<target name="build" depends="prepare, copy">
<zip destfile="${builddir}/kunenatex_${build.version}_${build.date.DSTAMP}.zip">
<fileset dir="${builddir}/tmp/katex">
<include name="**" />
</fileset>
</zip>
<zip destfile="${builddir}/jatex_${build.version}_${build.date.DSTAMP}.zip">
<fileset dir="${builddir}/tmp/jatex">
<include name="**" />
</fileset>
</zip>
<delete dir="${builddir}/tmp" />
<echo msg="Zip ALL OK!" />
</target>
<target name="prepare">
<mkdir dir="${builddir}/tmp/katex/media" />
<mkdir dir="${builddir}/tmp/jatex/media" />
<echo msg="Create temp folder OK!" />
</target>
<target name="copy">
<!-- copy the plugins -->
<copy todir="${builddir}/tmp/katex">
<fileset refid="katex" />
</copy>
<copy todir="${builddir}/tmp/katex/media">
<fileset refid="katexMedia" />
</copy>
<copy todir="${builddir}/tmp/jatex">
<fileset refid="jatex" />
</copy>
<copy todir="${builddir}/tmp/jatex/media">
<fileset refid="jatexMedia" />
</copy>
<delete file="${builddir}/tmp/jatex/media/plg_jatex/js/mathjax" />
<delete file="${builddir}/tmp/katex/media/plg_kunenatex/js/mathjax" />
<copy todir="${builddir}/tmp/jatex/media/plg_jatex/js/mathjax" >
<fileset dir="${media}/mathjax">
<include name="**"/>
</fileset>
</copy>
<copy todir="${builddir}/tmp/katex/media/plg_kunenatex/js/mathjax" >
<fileset dir="${media}/mathjax">
<include name="**"/>
</fileset>
</copy>
<echo msg="Copy was successfull" />
<!-- insert version, build number and date into the xml files -->
<reflexive>
<fileset dir="${builddir}/tmp/">
<include name="**" />
</fileset>
<filterchain>
<replaceregexp>
<regexp pattern="sw\.build\.version" replace="${build.version}" />
<regexp pattern="sw\.build\.date" replace="${build.date.XMLDATE}" />
</replaceregexp>
</filterchain>
</reflexive>
</target>
</project>