forked from liferay/liferay-nativity
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
283 lines (234 loc) · 9.34 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
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
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
<?xml version="1.0"?>
<project name="liferay-nativity-java" basedir="." default="compile">
<property name="project.dir" value="." />
<property name="project.tmp.dir" value="${project.dir}/tmp" />
<property name="java.dir" value="${project.dir}/java" />
<property environment="env" />
<property file="${project.dir}/build.${user.name}.properties" />
<property file="${project.dir}/build.${env.COMPUTERNAME}.properties" />
<property file="${project.dir}/build.${env.HOST}.properties" />
<property file="${project.dir}/build.${env.HOSTNAME}.properties" />
<property file="${project.dir}/build.properties" />
<path id="portal.classpath">
<pathelement location="${portal.dir}/portal-impl/classes" />
<pathelement location="${portal.dir}/portal-service/classes" />
<pathelement location="${portal.dir}/portal-web/docroot/WEB-INF/classes" />
<pathelement location="${portal.dir}/util-java/classes" />
<fileset dir="${portal.dir}/lib/development" includes="*.jar" />
<fileset dir="${portal.dir}/lib/global" includes="*.jar" />
<fileset dir="${portal.dir}/lib/portal" includes="*.jar" />
</path>
<path id="lib.classpath">
<fileset dir="${java.dir}/lib" includes="*.jar" />
</path>
<target name="build-jar" depends="compile">
<delete dir="${java.dir}/dist" />
<jar destfile="${project.dir}/dist/liferay-nativity-${package.version}.jar" filesetmanifest="mergewithoutmain">
<fileset dir="${java.dir}/classes" />
<zipgroupfileset dir="${java.dir}/lib" excludes="META-INF/*.SF" includes="*.jar" />
</jar>
</target>
<target name="build-jni-headers" depends="compile">
<javah destdir="${project.dir}/windows/LiferayNativityShellExtensions/LiferayNativityWindowsUtil" classpath="${java.dir}/classes" class="com.liferay.nativity.control.win.WindowsNativityUtil"/>
</target>
<target name="build-windows-util" depends="compile">
<if>
<not>
<equals arg1="${target.os}" arg2="windows" />
</not>
<then>
<fail>
Ant target must be run in Windows
</fail>
</then>
</if>
<mkdir dir="${project.dir}/dist/" />
<exec
executable="${nativity.dir}/build-windows.cmd"
failonerror="true"
>
<arg value="LiferayNativityUtil" />
<arg value="${nativity.dir}/windows" />
<arg value="${ms.sdk.7.1.dir}" />
<arg value="${framework.dir}" />
</exec>
<copy
file="${nativity.dir}/windows/LiferayNativityShellExtensions/Release/x64/LiferayNativityUtil_x64.dll"
toFile="${project.dir}/dist/LiferayNativityUtil_x64.dll"
/>
<copy
file="${nativity.dir}/windows/LiferayNativityShellExtensions/Release/Win32/LiferayNativityUtil_x86.dll"
toFile="${project.dir}/dist/LiferayNativityUtil_x86.dll"
/>
</target>
<target name="build-windows-native-util" depends="compile">
<if>
<not>
<equals arg1="${target.os}" arg2="windows" />
</not>
<then>
<fail>
Ant target must be run in Windows
</fail>
</then>
</if>
<mkdir dir="${project.dir}/dist/" />
<antcall target="build-jni-headers" />
<exec
executable="${nativity.dir}/build-windows.cmd"
failonerror="true"
>
<arg value="LiferayNativityWindowsUtil" />
<arg value="${nativity.dir}/windows" />
<arg value="${ms.sdk.7.1.dir}" />
<arg value="${framework.dir}" />
</exec>
<copy
file="${nativity.dir}/windows/LiferayNativityShellExtensions/Release/x64/LiferayNativityWindowsUtil_x64.dll"
toFile="${project.dir}/dist/LiferayNativityWindowsUtil_x64.dll"
/>
<copy
file="${nativity.dir}/windows/LiferayNativityShellExtensions/Release/Win32/LiferayNativityWindowsUtil_x86.dll"
toFile="${project.dir}/dist/LiferayNativityWindowsUtil_x86.dll"
/>
<copy
file="${nativity.dir}/windows/LiferayNativityShellExtensions/Release/x64/LiferayNativityWindowsUtil_x64.dll"
toFile="${java.dir}/lib/native/LiferayNativityWindowsUtil_x64.dll"
/>
<copy
file="${nativity.dir}/windows/LiferayNativityShellExtensions/Release/Win32/LiferayNativityWindowsUtil_x86.dll"
toFile="${java.dir}/lib/native/LiferayNativityWindowsUtil_x86.dll"
/>
</target>
<target name="build-windows-menus" depends="compile">
<if>
<not>
<equals arg1="${target.os}" arg2="windows" />
</not>
<then>
<fail>
Ant target must be run in Windows
</fail>
</then>
</if>
<mkdir dir="${project.dir}/dist/" />
<copy
file="${nativity.dir}/windows/LiferayNativityShellExtensions/LiferayNativityContextMenus/ContextMenuContants.h.original"
toFile="${nativity.dir}/windows/LiferayNativityShellExtensions/LiferayNativityContextMenus/ContextMenuContants.h"
overwrite="true"
force="true"
failonerror="true"
/>
<replace file="${nativity.dir}/windows/LiferayNativityShellExtensions/LiferayNativityContextMenus/ContextMenuContants.h">
<replacefilter token="[$context.menu.guid$]" value="${context.menu.guid}" />
</replace>
<exec
executable="${nativity.dir}/build-windows.cmd"
failonerror="true"
>
<arg value="LiferayNativityContextMenus" />
<arg value="${nativity.dir}/windows" />
<arg value="${ms.sdk.7.1.dir}" />
<arg value="${framework.dir}" />
</exec>
<copy
file="${nativity.dir}/windows/LiferayNativityShellExtensions/Release/x64/LiferayNativityContextMenus_x64.dll"
toFile="${project.dir}/dist/LiferayNativityContextMenus_x64.dll"
/>
<copy
file="${nativity.dir}/windows/LiferayNativityShellExtensions/Release/Win32/LiferayNativityContextMenus_x86.dll"
toFile="${project.dir}/dist/LiferayNativityContextMenus_x86.dll"
/>
</target>
<target name="build-windows-overlays" depends="compile">
<if>
<not>
<equals arg1="${target.os}" arg2="windows" />
</not>
<then>
<fail>
Ant target must be run in Windows
</fail>
</then>
</if>
<mkdir dir="${project.dir}/dist/" />
<copy
file="${overlay.path}"
toFile="${nativity.dir}/windows/LiferayNativityShellExtensions/LiferayNativityOverlays/overlay.ico"
overwrite="true"
force="true"
failonerror="true"
/>
<copy
file="${nativity.dir}/windows/LiferayNativityShellExtensions/LiferayNativityOverlays/OverlayConstants.h.original"
toFile="${nativity.dir}/windows/LiferayNativityShellExtensions/LiferayNativityOverlays/OverlayConstants.h"
overwrite="true"
force="true"
failonerror="true"
/>
<replace file="${nativity.dir}/windows/LiferayNativityShellExtensions/LiferayNativityOverlays/OverlayConstants.h">
<replacefilter token="[$overlay.guid$]" value="${overlay.guid}" />
<replacefilter token="[$overlay.id$]" value="${overlay.id}" />
<replacefilter token="[$overlay.name$]" value="${overlay.name}" />
</replace>
<exec
executable="${nativity.dir}/build-windows.cmd"
failonerror="true"
>
<arg value="LiferayNativityOverlays" />
<arg value="${nativity.dir}/windows" />
<arg value="${ms.sdk.7.1.dir}" />
<arg value="${framework.dir}" />
</exec>
<copy
file="${nativity.dir}/windows/LiferayNativityShellExtensions/Release/x64/LiferayNativityOverlays_x64.dll"
toFile="${project.dir}/dist/${overlay.name}_x64.dll"
/>
<copy
file="${nativity.dir}/windows/LiferayNativityShellExtensions/Release/Win32/LiferayNativityOverlays_x86.dll"
toFile="${project.dir}/dist/${overlay.name}_x86.dll"
/>
</target>
<target name="clean">
<delete dir="${java.dir}/classes" />
<delete dir="dist" />
<delete dir="${project.tmp.dir}" />
</target>
<target name="compile">
<antcall target="compile-java">
<param name="javac.classpathref" value="lib.classpath" />
<param name="javac.destdir" value="${java.dir}/classes" />
<param name="javac.srcdir" value="${java.dir}/src" />
</antcall>
</target>
<target name="compile-java">
<mkdir dir="${java.dir}/classes" />
<copy todir="${javac.destdir}">
<fileset dir="${javac.srcdir}" excludes="**/*.java" />
</copy>
<javac
classpathref="${javac.classpathref}"
compiler="${javac.compiler}"
debug="${javac.debug}"
deprecation="${javac.deprecation}"
destdir="${javac.destdir}"
encoding="${javac.encoding}"
includeAntRuntime="false"
nowarn="${javac.nowarn}"
srcdir="${javac.srcdir}"
/>
<echo file="${javac.destdir}/.touch"></echo>
</target>
<target name="format-source">
<java
classname="com.liferay.portal.tools.sourceformatter.SourceFormatter"
classpathref="portal.classpath"
dir="${java.dir}"
fork="true"
newenvironment="true"
>
<jvmarg value="-Xmx128m" />
</java>
<delete file="ServiceBuilder.temp" />
</target>
</project>