forked from liferay/liferay-plugins
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild-common-theme.xml
229 lines (207 loc) · 5.69 KB
/
build-common-theme.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
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
<?xml version="1.0"?>
<!DOCTYPE project>
<project name="build-common-theme">
<import file="../build-common-plugin.xml" />
<target name="build-css">
<java
classname="com.liferay.portal.tools.SassToCssBuilder"
classpathref="portal.classpath"
fork="true"
newenvironment="true"
>
<jvmarg value="-Dliferay.lib.portal.dir=${app.server.lib.portal.dir}" />
<arg value="sass.dir=/" />
<arg value="sass.docroot.dir=${basedir}/docroot" />
<arg value="sass.portal.common.dir=${app.server.portal.dir}/html/css/common" />
</java>
</target>
<target name="clean">
<if>
<available file="docroot/_diffs" />
<then>
<delete includeemptydirs="true" quiet="true" failonerror="false">
<fileset
dir="docroot"
excludes=".gitignore,_diffs.*,_diffs/**,WEB-INF/**"
/>
</delete>
</then>
</if>
<antcall target="build-common-plugin.clean" />
</target>
<target name="compile">
<if>
<available file="docroot/_diffs/images" />
<then>
<for param="file">
<path>
<fileset
dir="docroot/_diffs/images"
includes="**/screenshot.png"
/>
</path>
<sequential>
<propertyregex input="@{file}" override="yes" property="thumbnail.file" regexp="screenshot\.png" replace="thumbnail\.png" />
<java
classname="com.liferay.portal.tools.ThumbnailBuilder"
classpathref="portal.classpath"
>
<arg value="thumbnail.original.file=@{file}" />
<arg value="thumbnail.thumbnail.file=${thumbnail.file}" />
<arg value="thumbnail.height=120" />
<arg value="thumbnail.width=160" />
<arg value="thumbnail.overwrite=false" />
</java>
</sequential>
</for>
</then>
</if>
<if>
<not>
<isset property="theme.type" />
</not>
<then>
<property name="theme.type" value="vm" />
</then>
</if>
<if>
<equals arg1="${theme.parent}" arg2="_unstyled" />
<then>
<copy todir="docroot" overwrite="true" preservelastmodified="true">
<fileset
dir="${app.server.portal.dir}/html/themes/_unstyled"
excludes="templates/**"
/>
</copy>
<copy todir="docroot/templates" overwrite="true" preservelastmodified="true">
<fileset
dir="${app.server.portal.dir}/html/themes/_unstyled/templates"
excludes="init.${theme.type}"
includes="*.${theme.type}"
/>
</copy>
</then>
<elseif>
<equals arg1="${theme.parent}" arg2="_styled" />
<then>
<copy todir="docroot" overwrite="true" preservelastmodified="true">
<fileset
dir="${app.server.portal.dir}/html/themes/_unstyled"
excludes="templates/**"
/>
</copy>
<copy todir="docroot/templates" overwrite="true" preservelastmodified="true">
<fileset
dir="${app.server.portal.dir}/html/themes/_unstyled/templates"
excludes="init.${theme.type}"
includes="*.${theme.type}"
/>
</copy>
<copy todir="docroot" overwrite="true" preservelastmodified="true">
<fileset
dir="${app.server.portal.dir}/html/themes/_styled"
/>
</copy>
</then>
</elseif>
<elseif>
<equals arg1="${theme.parent}" arg2="classic" />
<then>
<copy todir="docroot" overwrite="true" preservelastmodified="true">
<fileset
dir="${app.server.portal.dir}/html/themes/classic"
excludes="**/.sass-cache/**,_diffs/**,templates/**"
/>
</copy>
<copy todir="docroot/templates" overwrite="true" preservelastmodified="true">
<fileset
dir="${app.server.portal.dir}/html/themes/classic/templates"
includes="*.${theme.type}"
/>
</copy>
</then>
</elseif>
<elseif>
<equals arg1="${theme.parent}" arg2="control_panel" />
<then>
<copy todir="docroot" overwrite="true" preservelastmodified="true">
<fileset
dir="${app.server.portal.dir}/html/themes/control_panel"
excludes="**/.sass-cache/**,_diffs/**,templates/**"
/>
</copy>
<copy todir="docroot/templates" overwrite="true" preservelastmodified="true">
<fileset
dir="${app.server.portal.dir}/html/themes/control_panel/templates"
includes="*.${theme.type}"
/>
</copy>
</then>
</elseif>
<elseif>
<isset property="theme.parent" />
<then>
<ant dir="${theme.parent}" target="compile" inheritAll="false" />
<copy todir="docroot" overwrite="true" preservelastmodified="true">
<fileset
dir="${theme.parent}/docroot"
excludes="**/.sass-cache/**,_diffs/**,WEB-INF/*.properties,WEB-INF/*.xml"
/>
</copy>
</then>
</elseif>
</if>
<if>
<available file="docroot/_diffs" />
<then>
<copy todir="docroot" overwrite="true" preservelastmodified="true">
<fileset
dir="docroot/_diffs"
/>
</copy>
</then>
</if>
<if>
<available file="docroot/WEB-INF/src" />
<then>
<antcall target="build-common-plugin.compile" />
</then>
<else>
<if>
<available file="overwrite" />
<then>
<copy overwrite="true" preservelastmodified="true" todir="docroot">
<fileset dir="overwrite" />
</copy>
</then>
</if>
</else>
</if>
</target>
<target name="war" depends="compile">
<antcall target="build-css" />
<if>
<not>
<available file="docroot/images/screenshot.png" />
</not>
<then>
<echo>screenshot.png does not exist.</echo>
</then>
</if>
<if>
<not>
<available file="docroot/images/thumbnail.png" />
</not>
<then>
<echo>thumbnail.png does not exist.</echo>
</then>
</if>
<mkdir dir="${sdk.dir}/dist" />
<delete file="${plugin.file}" />
<zip
basedir="docroot"
destfile="${plugin.file}"
excludes="_diffs.*,_diffs/**,${plugins.war.excludes}"
/>
</target>
</project>