Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
197 lines (181 sloc) 8.95 KB
<project name="dam-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 DAM Marketplace package">
<property name="outdir" value="${maven.project.build.directory}" />
<artifact:nuxeo-expand includeTestScope="true" groupPrefixes="org.nuxeo" />
<artifact:print output="${outdir}/artifacts-dam.properties" mode="sdk" />
<artifact:print output="${outdir}/test-artifacts-dam.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="${nuxeo.distribution.version}" />
</filterset>
</copy>
<copy file="${outdir}/artifacts-dam.properties" todir="${outdir}/marketplace/install" />
<copy file="${outdir}/test-artifacts-dam.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>
<!-- DAM Core -->
<!-- Nuxeo bundles -->
<copy todir="${outdir}/nxr/bundles" overwrite="true">
<artifact:dependencies key="org.nuxeo.dam:nuxeo-dam:::">
<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.dam:nuxeo-dam:::">
<includes>
<artifact groupId="!org.nuxeo*" scope="!test" />
<artifact groupId="org.nuxeo.lib*" scope="!test" />
</includes>
</artifact:dependencies>
</copy>
<nx:rmdups dir="${outdir}/nxr/lib" />
<zip destfile="${outdir}/nxr-server-${maven.project.version}.zip" basedir="${outdir}/nxr" />
<artifact:attach file="${outdir}/nxr-server-${maven.project.version}.zip" classifier="nxr-server" type="zip" />
<!-- Diff against Nuxeo Server -->
<nx:zipdiff file1="${outdir}/nxr-server-${maven.project.version}.zip"
file2="${outdir}/nuxeo-nxr-server-${nuxeo.distribution.version}.zip"
includesfile="${outdir}/includes"
excludesfile="${outdir}/excludesfile"
patternsetid="dam.versus.server">
</nx:zipdiff>
<unzip src="${outdir}/nxr-server-${maven.project.version}.zip" dest="${outdir}/marketplace/install">
<patternset refid="dam.versus.server" />
</unzip>
<!-- DAM JSF -->
<!-- Nuxeo bundles -->
<copy todir="${outdir}/nxr/bundles" overwrite="true">
<artifact:dependencies key="org.nuxeo.dam:nuxeo-dam-jsf::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.dam:nuxeo-dam-jsf::pom">
<includes>
<artifact groupId="!org.nuxeo*" scope="!test" />
<artifact groupId="org.nuxeo.lib*" scope="!test" />
</includes>
</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-server-${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-jsf-${maven.project.version}.zip" basedir="${outdir}/nxr" />
<artifact:attach file="${outdir}/nxr-jsf-${maven.project.version}.zip" classifier="nxr-jsf" type="zip" />
<nx:zipdiff file1="${outdir}/nxr-jsf-${maven.project.version}.zip"
file2="${outdir}/nuxeo-nxr-server-jsf-ui-${nuxeo.distribution.version}.zip"
includesfile="${outdir}/includes"
excludesfile="${outdir}/excludesfile"
patternsetid="dam.versus.jsf">
</nx:zipdiff>
<unzip src="${outdir}/nxr-jsf-${maven.project.version}.zip" dest="${outdir}/marketplace/install">
<patternset refid="dam.versus.jsf" />
<firstmatchmapper>
<globmapper from="bundles/*" to="bundles-jsf-ui/*" />
<globmapper from="lib/*" to="lib-jsf-ui/*" />
</firstmatchmapper>
</unzip>
<!-- Generate install.xml content -->
<var name="install.bundles" value="" />
<var name="install.bundles"
value="${line.separator}
&lt;update file=&quot;${package.root}/install/bundles&quot; todir=&quot;${env.bundles}&quot; /&gt;" />
<var name="install.bundles"
value="${install.bundles}${line.separator}
&lt;update file=&quot;${package.root}/install/bundles-jsf-ui&quot; todir=&quot;${env.bundles}&quot; if=&quot;Packages.contains('nuxeo-jsf-ui')&quot; /&gt;" />
<var name="install.libs" value="" />
<if>
<available file="${outdir}/marketplace/install/lib" />
<then>
<var name="install.libs"
value="${line.separator}
&lt;update file=&quot;${package.root}/install/lib&quot; todir=&quot;${env.lib}&quot; /&gt;" />
</then>
</if>
<if>
<available file="${outdir}/marketplace/install/lib-jsf-ui" />
<then>
<var name="install.libs"
value="${install.libs}${line.separator}
&lt;update file=&quot;${package.root}/install/lib-jsf-ui&quot; todir=&quot;${env.lib}&quot; if=&quot;Packages.contains('nuxeo-jsf-ui')&quot; /&gt;" />
</then>
</if>
<var name="install.properties"
value="${line.separator}
&lt;copy file=&quot;${package.root}/install/artifacts-dam.properties&quot;${line.separator}
todir=&quot;${env.server.home}/sdk&quot; overwrite=&quot;true&quot; /&gt;${line.separator}
&lt;copy file=&quot;${package.root}/install/test-artifacts-dam.properties&quot;${line.separator}
todir=&quot;${env.server.home}/sdk&quot; overwrite=&quot;true&quot; /&gt;" />
<var name="install.templates" value="" />
<if>
<available file="${outdir}/marketplace/install/templates" />
<then>
<var name="install.templates"
value="${line.separator}
&lt;copy dir=&quot;${package.root}/install/templates&quot; todir=&quot;${env.templates}&quot; overwrite=&quot;true&quot; /&gt;${line.separator}
&lt;config addtemplate=&quot;dam&quot; /&gt;${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"/>
</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" />
</target>
</project>
You can’t perform that action at this time.