-
Notifications
You must be signed in to change notification settings - Fork 1
/
assembly.xml
220 lines (205 loc) · 9.9 KB
/
assembly.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
<project name="drive-assembly" default="build" xmlns:nx="urn:nuxeo-build" xmlns:artifact="urn:nuxeo-artifact">
<taskdef resource="org/nuxeo/build/antlib.xml" uri="urn:nuxeo-build" />
<taskdef resource="org/nuxeo/build/artifact/antlib.xml" uri="urn:nuxeo-artifact" />
<taskdef resource="net/sf/antcontrib/antlib.xml" />
<target name="build" description="Build Nuxeo Drive Marketplace package">
<property name="outdir" value="${maven.project.build.directory}" />
<artifact:nuxeo-expand includeTestScope="true" groupPrefixes="org.nuxeo" />
<artifact:print output="${outdir}/artifacts-drive.properties" mode="sdk" />
<artifact:print output="${outdir}/test-artifacts-drive.properties" mode="sdk" scopes="test" />
<artifact:print output="${outdir}/dependency-tree.log" />
<tstamp />
<delete failonerror="false" dir="${outdir}/nxr" />
<mkdir dir="${outdir}/nxr" />
<delete failonerror="false" dir="${outdir}/marketplace" />
<mkdir dir="${outdir}/marketplace" />
<copy todir="${outdir}/marketplace">
<fileset dir="src/main/resources" />
<filterset>
<filter token="VERSION" value="${maven.project.version}" />
<filter token="DISTRIB_VERSION" value="${target.platform.version}" />
</filterset>
</copy>
<copy file="${outdir}/artifacts-drive.properties" todir="${outdir}/marketplace/install" />
<copy file="${outdir}/test-artifacts-drive.properties" todir="${outdir}/marketplace/install" />
<!-- Base distribution NXR -->
<copy todir="${outdir}">
<artifact:file key="org.nuxeo.ecm.distribution:nuxeo-nxr-server::zip" />
</copy>
<!-- JSF UI NXR -->
<copy todir="${outdir}">
<artifact:file key="org.nuxeo.ecm.distribution:nuxeo-nxr-jsf-ui::zip" />
</copy>
<!-- Drive Core -->
<!-- Nuxeo bundles -->
<copy todir="${outdir}/nxr/bundles" overwrite="true">
<artifact:dependencies key="org.nuxeo.ecm:nuxeo-drive-core-dependencies::pom">
<includes>
<artifact groupId="org.nuxeo*" />
</includes>
<excludes>
<artifact groupId="org.nuxeo.lib*" />
<artifact scope="test" />
<artifact scope="provided" />
<artifact type="pom" />
</excludes>
</artifact:dependencies>
</copy>
<!-- Third-party libraries -->
<copy todir="${outdir}/nxr/lib" overwrite="true">
<artifact:dependencies key="org.nuxeo.ecm:nuxeo-drive-core-dependencies::pom">
<includes>
<artifact groupId="!org.nuxeo*" />
<artifact groupId="org.nuxeo.lib*" />
</includes>
<excludes>
<artifact scope="test" />
</excludes>
</artifact:dependencies>
</copy>
<nx:rmdups dir="${outdir}/nxr/lib" />
<zip destfile="${outdir}/nxr-${maven.project.version}.zip" basedir="${outdir}/nxr" />
<!-- Diff against Nuxeo Server -->
<nx:zipdiff file1="${outdir}/nxr-${maven.project.version}.zip"
file2="${outdir}/nuxeo-nxr-server-${nuxeo.distribution.version}.zip"
includesfile="${outdir}/includes"
excludesfile="${outdir}/excludesfile"
patternsetid="drive.versus.server">
</nx:zipdiff>
<unzip src="${outdir}/nxr-${maven.project.version}.zip" dest="${outdir}/marketplace/install">
<patternset refid="drive.versus.server" />
</unzip>
<!-- Drive JSF -->
<!-- Nuxeo bundles -->
<copy todir="${outdir}/nxr/bundles" overwrite="true">
<artifact:dependencies key="org.nuxeo.ecm:nuxeo-drive-jsf:::">
<includes>
<artifact groupId="org.nuxeo*" />
</includes>
<excludes>
<artifact groupId="org.nuxeo.lib*" />
<artifact scope="test" />
<artifact scope="provided" />
<artifact type="pom" />
</excludes>
</artifact:dependencies>
</copy>
<!-- Third-party libraries -->
<copy todir="${outdir}/nxr/lib" overwrite="true">
<artifact:dependencies key="org.nuxeo.ecm:nuxeo-drive-jsf:::">
<includes>
<artifact groupId="!org.nuxeo*" />
<artifact groupId="org.nuxeo.lib*" />
</includes>
<excludes>
<artifact scope="test" />
</excludes>
</artifact:dependencies>
</copy>
<nx:rmdups dir="${outdir}/nxr/lib" />
<unzip src="${outdir}/nuxeo-nxr-server-${nuxeo.distribution.version}.zip"
dest="${outdir}/nuxeo-nxr-server-jsf-ui" />
<unzip src="${outdir}/nuxeo-nxr-jsf-ui-${nuxeo.distribution.version}.zip"
dest="${outdir}/nuxeo-nxr-server-jsf-ui" />
<unzip src="${outdir}/nxr-${maven.project.version}.zip" dest="${outdir}/nuxeo-nxr-server-jsf-ui" />
<zip destfile="${outdir}/nuxeo-nxr-server-jsf-ui-${nuxeo.distribution.version}.zip"
basedir="${outdir}/nuxeo-nxr-server-jsf-ui" />
<zip destfile="${outdir}/nxr-${maven.project.version}.zip" basedir="${outdir}/nxr" />
<!-- Diff against Nuxeo Server + JSF UI -->
<nx:zipdiff file1="${outdir}/nxr-${maven.project.version}.zip"
file2="${outdir}/nuxeo-nxr-server-jsf-ui-${nuxeo.distribution.version}.zip"
includesfile="${outdir}/includes"
excludesfile="${outdir}/excludesfile"
patternsetid="drive.versus.jsf"
ignoreContent="false"
ignoreContentPattern=".*\.jar$">
</nx:zipdiff>
<unzip src="${outdir}/nxr-${maven.project.version}.zip" dest="${outdir}/marketplace/install">
<patternset refid="drive.versus.jsf" />
<firstmatchmapper>
<globmapper from="bundles/*" to="bundles-jsf-ui/*" />
<globmapper from="lib/*" to="lib-jsf-ui/*" />
</firstmatchmapper>
</unzip>
<!-- Add Web UI bundles -->
<copy todir="${outdir}/marketplace/install/bundles-web-ui">
<artifact:resolveFile key="org.nuxeo.ecm:nuxeo-drive-web-ui" />
</copy>
<!-- Generate install.xml content -->
<var name="install.bundles" value="" />
<var name="install.bundles"
value="${line.separator}
<update file="${package.root}/install/bundles" todir="${env.bundles}" />" />
<var name="install.bundles"
value="${install.bundles}${line.separator}
<update file="${package.root}/install/bundles-jsf-ui" todir="${env.bundles}" if="Packages.contains('nuxeo-jsf-ui')" />" />
<var name="install.bundles"
value="${install.bundles}${line.separator}
<update file="${package.root}/install/bundles-web-ui" todir="${env.bundles}" if="Packages.contains('nuxeo-web-ui')" />" />
<var name="install.libs" value="" />
<if>
<available file="${outdir}/marketplace/install/lib" />
<then>
<var name="install.libs"
value="${line.separator}
<update file="${package.root}/install/lib" todir="${env.lib}" />" />
</then>
</if>
<if>
<available file="${outdir}/marketplace/install/lib-jsf-ui" />
<then>
<var name="install.libs"
value="${install.libs}${line.separator}
<update file="${package.root}/install/lib-jsf-ui" todir="${env.lib}" if="Packages.contains('nuxeo-jsf-ui')" />" />
</then>
</if>
<if>
<available file="${outdir}/marketplace/install/lib-web-ui" />
<then>
<var name="install.libs"
value="${install.libs}${line.separator}
<update file="${package.root}/install/lib-web-ui" todir="${env.lib}" if="Packages.contains('nuxeo-web-ui')" />" />
</then>
</if>
<var name="install.properties"
value="${line.separator}
<copy file="${package.root}/install/artifacts-drive.properties"${line.separator}
todir="${env.server.home}/sdk" overwrite="true" />${line.separator}
<copy file="${package.root}/install/test-artifacts-drive.properties"${line.separator}
todir="${env.server.home}/sdk" overwrite="true" />" />
<var name="install.templates" value="" />
<if>
<available file="${outdir}/marketplace/install/templates" />
<then>
<var name="install.templates"
value="${line.separator}
<copy dir="${package.root}/install/templates" todir="${env.templates}" overwrite="true" />${line.separator}
<config addtemplate="drive" />${line.separator}" />
</then>
</if>
<copy file="src/main/resources/install.xml" todir="${outdir}/marketplace" overwrite="true">
<filterset>
<filter token="BUNDLES" value="${install.bundles}" />
<filter token="LIBS" value="${install.libs}" />
<filter token="PROPERTIES" value="${install.properties}" />
<filter token="TEMPLATES" value="${install.templates}" />
</filterset>
</copy>
<nx:studioExtraction todir="${outdir}/marketplace">
<fileset dir="${outdir}/marketplace/install/bundles"/>
<fileset dir="${outdir}/marketplace/install/bundles-jsf-ui"/>
<fileset dir="${outdir}/marketplace/install/bundles-web-ui"/>
</nx:studioExtraction>
<zip destfile="${outdir}/${maven.project.artifactId}-${maven.project.version}.zip"
basedir="${outdir}/marketplace" />
<artifact:attach file="${outdir}/${maven.project.artifactId}-${maven.project.version}.zip" type="zip" />
<!-- cleanups -->
<delete dir="${outdir}/marketplace" failonerror="false" />
<delete dir="${outdir}/nxr" failonerror="false" />
<delete dir="${outdir}/nuxeo-nxr-server-jsf-ui" failonerror="false" />
<delete file="${outdir}/nuxeo-nxr-server-${nuxeo.distribution.version}.zip" failonerror="false" />
<delete file="${outdir}/nuxeo-nxr-jsf-ui-${nuxeo.distribution.version}.zip" failonerror="false" />
<delete file="${outdir}/nuxeo-nxr-server-jsf-ui-${nuxeo.distribution.version}.zip" failonerror="false" />
<delete file="${outdir}/nxr-${maven.project.version}.zip" failonerror="false" />
</target>
</project>