-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
executable file
·168 lines (151 loc) · 5.76 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
<?xml version="1.0" encoding="UTF-8"?>
<project name="Redproductfinder" default="site" basedir=".">
<import file="./redCORE/build.xml"/>
<!-- Do initialization stuff -->
<target name="init" >
<if>
<not>
<available file="build.properties"/>
</not>
<then>
<fail message="The file build.properties does not exists." />
</then>
<else>
<property file="build.properties" override="true"/>
<echo message="build.properties File included successfully." />
</else>
</if>
<property name="src" value="./" />
</target>
<!-- Do initialization stuff -->
<target name="prepare" >
<property file="build.properties" override="true"/>
<if>
<equals arg1="${extension}" arg2="" />
<then>
<fail message="Extension not specified, use -Dextension=EXTENSION" />
</then>
<else>
<!--<property file="${extension}.properties" override="true"/>-->
</else>
</if>
</target>
<property name="src" value="./" />
<target name="sites" description="Copies files to a existing joomla site" depends="init, redCORE-submodule, prepare">
<echo message="---------------- || PLUGIN || ----------------"/>
<!-- Manifest & install script -->
<echo message="Copying manifest..."/>
<!-- Plugins -->
<copy todir="${www.dir}/plugins" overwrite="true">
<fileset dir="${src}/plugins">
<include name="**" />
</fileset>
</copy>
<!-- Coppy media to media folder of plugins -->
<copy todir="${www.dir}/media/plg_system_${extension.name}" overwrite="true">
<fileset dir="${src}/plugins/system/${extension.name}/media">
<include name="**" />
</fileset>
</copy>
<!-- Coppy language to language folder of plugins -->
<copy todir="${www.dir}/administrator/language" overwrite="true">
<fileset dir="${src}/plugins/system/${extension.name}/language">
<include name="**" />
</fileset>
</copy>
</target>
<target name="site" description="Copies files to a existing joomla site" depends="init, redCORE-submodule, prepare">
<echo message="Copying administrator component..." />
<!-- Manifest & install script -->
<echo message="Copying manifest..." />
<copy file="${src}/${comp.name}.xml"
tofile="${www.dir}/administrator/components/com_${comp.name}/${comp.name}.xml" overwrite="true">
<!-- trick to replace extension folders in the manifest-->
<filterchain>
<replacetokens begintoken="comp" endtoken="/admin">
<token key="onent" value="administrator/components/${comp.name}" />
</replacetokens>
<replacetokens begintoken="comp" endtoken="/site">
<token key="onent" value="components/${comp.name}" />
</replacetokens>
</filterchain>
</copy>
<!-- Backend component -->
<copy todir="${www.dir}/administrator/components/com_${comp.name}" overwrite="true">
<fileset dir="${src}/component/admin">
<include name="**" />
<exclude name="${comp.name}.xml" />
<exclude name="install.php" />
</fileset>
</copy>
<!-- Backend languages -->
<copy todir="${www.dir}/administrator/language" overwrite="true">
<fileset dir="${src}/component/admin/language">
<include name="**" />
</fileset>
</copy>
<!-- Frontend component -->
<echo message="Copying frontend component..." />
<copy todir="${www.dir}/components/com_${comp.name}" overwrite="true">
<fileset dir="${src}/component/site" />
</copy>
<!-- Frontend languages -->
<copy todir="${www.dir}/language" overwrite="true">
<fileset dir="${src}/component/site/language">
<include name="**" />
</fileset>
</copy>
<!-- Media -->
<copy todir="${www.dir}/media" overwrite="true">
<fileset dir="${src}/media">
<include name="**" />
</fileset>
</copy>
<!-- Modules - Site -->
<echo message="Copying frontend modules..." />
<copy todir="${www.dir}/modules" overwrite="true">
<fileset dir="${src}/modules/site">
<include name="**" />
</fileset>
</copy>
<!-- Modules - Languages -->
<copy todir="${www.dir}/language" overwrite="true">
<fileset dir="${src}/modules/site/mod_redproductforms/language">
<include name="**" />
</fileset>
</copy>
<!-- Plugins -->
<echo message="Copying redPRODUCTFINDER plugins..." />
<copy todir="${www.dir}/plugins" overwrite="true">
<fileset dir="${src}/plugins">
<include name="**" />
</fileset>
</copy>
<!-- Plugins - Languages -->
<!-- Copy redPRODUCTFINDER plugins language -->
<foreach param="group_name" target="red_plg_copy">
<fileset dir="${src}/plugins">
<type type="dir" />
<depth max="0" min="0" />
</fileset>
</foreach>
</target>
<target name="red_plg_copy" description="Loops through plugins folders inside groups">
<!-- Loop through plugins -->
<foreach param="plugin_name" target="red_plg_copy_files">
<fileset dir="${src}/plugins/${group_name}">
<type type="dir" />
<depth max="0" min="0" />
</fileset>
</foreach>
</target>
<target name="red_plg_copy_files" description="Packages the extension for delivery">
<!-- Copy plugin files & folder -->
<copy todir="${www.dir}/language" overwrite="true">
<fileset dir="${src}/plugins/${group_name}/${plugin_name}/language">
<include name="**"/>
<exclude name=".*"/>
</fileset>
</copy>
</target>
</project>