Apply lf filter before crlf in zip distributions. git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@496512 13f79535-47bb-0310-9956-ffa450edef68
669 lines
23 KiB
XML
669 lines
23 KiB
XML
<?xml version="1.0"?>
|
|
<!--
|
|
/*
|
|
* Copyright 2001-2005 The Apache Software Foundation.
|
|
*
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
* you may not use this file except in compliance with the License.
|
|
* You may obtain a copy of the License at
|
|
*
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
|
*
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
* See the License for the specific language governing permissions and
|
|
* limitations under the License.
|
|
*/
|
|
-->
|
|
|
|
|
|
<project
|
|
xmlns:j="jelly:core"
|
|
xmlns:ant="jelly:ant"
|
|
xmlns:maven="jelly:maven"
|
|
xmlns:artifact="artifact"
|
|
xmlns:assert="assert"
|
|
xmlns:util="jelly:util">
|
|
|
|
|
|
<j:new var="distTypeHandler" className="org.apache.maven.dist.DistributionArtifactTypeHandler" />
|
|
|
|
<!-- ================================================================== -->
|
|
<!-- D I S T R I B U T I O N S -->
|
|
<!-- ================================================================== -->
|
|
|
|
<goal
|
|
name="dist:prepare-bin-filesystem"
|
|
description="Builds the binary distribution file system.">
|
|
|
|
<!--
|
|
|
|
This is the directory where everything is copied to so that it can
|
|
be archived.
|
|
|
|
-->
|
|
|
|
<ant:delete dir="${maven.dist.bin.assembly.dir}"/>
|
|
<ant:mkdir dir="${maven.dist.bin.assembly.dir}"/>
|
|
|
|
<ant:echo>
|
|
+-------------------------------------------------------+
|
|
| C R E A T I N G B I N A R Y D I S T R I B U T I O N |
|
|
+-------------------------------------------------------+
|
|
</ant:echo>
|
|
|
|
<ant:copy todir="${maven.dist.bin.assembly.dir}">
|
|
<ant:fileset dir="." includes="${maven.dist.bin.includes}"/>
|
|
</ant:copy>
|
|
|
|
<j:set var="binArtifactType" value="${maven.dist.bin.artifact.type}"/>
|
|
<j:choose>
|
|
<j:when test="${binArtifactType == 'rar'}">
|
|
<attainGoal name="rar:rar"/>
|
|
<j:set var="maven.dist.bin.artifact" value="${maven.rar.final.name}"/>
|
|
</j:when>
|
|
<j:when test="${binArtifactType == 'ear'}">
|
|
<attainGoal name="ear:ear"/>
|
|
<j:set var="maven.dist.bin.artifact" value="${maven.ear.final.name}"/>
|
|
</j:when>
|
|
<j:when test="${binArtifactType == 'war'}">
|
|
<attainGoal name="war:war"/>
|
|
<j:set var="maven.dist.bin.artifact" value="${maven.war.final.name}"/>
|
|
</j:when>
|
|
<j:when test="${binArtifactType == 'ejb'}">
|
|
<attainGoal name="ejb:ejb"/>
|
|
<j:set var="maven.dist.bin.artifact" value="${maven.ejb.final.name}"/>
|
|
</j:when>
|
|
<j:otherwise>
|
|
<attainGoal name="jar:jar"/>
|
|
<j:set var="maven.dist.bin.artifact" value="${maven.jar.final.name}"/>
|
|
</j:otherwise>
|
|
</j:choose>
|
|
|
|
<!-- Copy artifact -->
|
|
<ant:copy todir="${maven.dist.bin.assembly.dir}">
|
|
<ant:fileset dir="${maven.build.dir}">
|
|
<ant:include name="${maven.dist.bin.artifact}"/>
|
|
</ant:fileset>
|
|
</ant:copy>
|
|
|
|
<!-- Delete any previously generated documentation -->
|
|
<ant:delete dir="${maven.docs.dest}"/>
|
|
<j:set var="includeSite" value="${maven.dist.bin.include.site}"/>
|
|
<j:choose>
|
|
<j:when test="${includeSite}">
|
|
<attainGoal name="site"/>
|
|
</j:when>
|
|
<j:otherwise>
|
|
<attainGoal name="javadoc"/>
|
|
</j:otherwise>
|
|
</j:choose>
|
|
<!-- Copy documentation -->
|
|
<j:set var="docsDest" value="${maven.docs.dest}"/>
|
|
<ant:copy todir="${maven.dist.bin.assembly.dir}/docs">
|
|
<ant:fileset dir="${docsDest}">
|
|
<ant:include name="**"/>
|
|
</ant:fileset>
|
|
</ant:copy>
|
|
|
|
<!-- Copy additional directories. -->
|
|
<util:tokenize var="includedirs" delim=",">${maven.dist.include.dirs}</util:tokenize>
|
|
<j:forEach items="${includedirs}" var="includedir">
|
|
<util:available file="${includedir}">
|
|
<ant:copy todir="${maven.dist.bin.assembly.dir}/${includedir}">
|
|
<ant:fileset dir="${includedir}" />
|
|
</ant:copy>
|
|
</util:available>
|
|
</j:forEach>
|
|
|
|
</goal>
|
|
|
|
<goal
|
|
name="dist:prepare-src-filesystem"
|
|
description="Builds the source distribution file system.">
|
|
|
|
<!-- S O U R C E D I S T R I B U T I O N -->
|
|
|
|
<ant:delete dir="${maven.dist.src.assembly.dir}" />
|
|
<ant:mkdir dir="${maven.dist.src.assembly.dir}" />
|
|
|
|
<ant:echo>
|
|
+-------------------------------------------------------+
|
|
| C R E A T I N G S O U R C E D I S T R I B U T I O N |
|
|
+-------------------------------------------------------+
|
|
</ant:echo>
|
|
|
|
<util:tokenize var="includelist" delim=",">${maven.dist.src.include}</util:tokenize>
|
|
|
|
<ant:copy todir="${maven.dist.src.assembly.dir}">
|
|
<ant:fileset dir="." includes="${maven.dist.src.includes}"/>
|
|
</ant:copy>
|
|
|
|
<!-- We can't use it in the bootstrap phase because classes aren't yet build in the artifact plugin. -->
|
|
<j:if test="${bootstrapping == null}">
|
|
<assert:assertPluginAvailable groupId="maven" artifactId="maven-artifact-plugin" minRelease="1.7" neededBy="${plugin.artifactId}"/>
|
|
<artifact:rewritePOM path="${maven.dist.src.assembly.dir}/project.xml"/>
|
|
</j:if>
|
|
|
|
<!-- ant plugin < 1.10 -->
|
|
<maven:get var="antScript" plugin="maven-ant-plugin" property="maven.ant.generatebuild.file"/>
|
|
|
|
<!-- ant plugin >= 1.10 -->
|
|
<j:if test="${context.getVariable('antScript') == null or context.getVariable('antScript').equals('')}">
|
|
<maven:get var="dir" plugin="maven-ant-plugin" property="maven.ant.generate.dir"/>
|
|
<maven:get var="script" plugin="maven-ant-plugin" property="maven.ant.generate.script"/>
|
|
<j:set var="antScript" value="${dir}/${script}"/>
|
|
</j:if>
|
|
|
|
<ant:available property="maven.dist.build.xml.avail" file="${antScript}"/>
|
|
<j:if test="${maven.dist.build.xml.avail}">
|
|
<ant:copy todir="${maven.dist.src.assembly.dir}" file="${antScript}"/>
|
|
</j:if>
|
|
|
|
<!-- Copy Source -->
|
|
<util:available file="${maven.src.dir}">
|
|
<ant:copy todir="${maven.dist.src.assembly.dir}/src">
|
|
<ant:fileset dir="${maven.src.dir}" />
|
|
</ant:copy>
|
|
</util:available>
|
|
|
|
<!-- Copy additional directories. -->
|
|
<util:tokenize var="includedirs" delim=",">${maven.dist.include.dirs}</util:tokenize>
|
|
<j:forEach items="${includedirs}" var="includedir">
|
|
<util:available file="${includedir}">
|
|
<ant:copy todir="${maven.dist.src.assembly.dir}/${includedir}">
|
|
<ant:fileset dir="${includedir}" />
|
|
</ant:copy>
|
|
</util:available>
|
|
</j:forEach>
|
|
|
|
</goal>
|
|
|
|
<goal name="dist"
|
|
prereqs="dist:build"
|
|
description="Build a complete distribution.">
|
|
</goal>
|
|
|
|
<goal
|
|
name="dist:build"
|
|
prereqs="dist:build-bin,dist:build-src"
|
|
description="Build a complete distribution.">
|
|
</goal>
|
|
|
|
<goal
|
|
name="dist:build-setup"
|
|
description="Set up directories for a distribution build">
|
|
<ant:delete dir="${maven.dist.dir}"/>
|
|
<ant:mkdir dir="${maven.dist.dir}"/>
|
|
<j:set var="lfFilter" value="${maven.dist.lf.filter}"/>
|
|
<j:set var="crlfFilter" value="${maven.dist.crlf.filter}"/>
|
|
</goal>
|
|
|
|
<goal
|
|
name="dist:build-bin"
|
|
prereqs="dist:build-setup,dist:prepare-bin-filesystem"
|
|
description="Build the binary distribution.">
|
|
|
|
<util:tokenize var="distFormats" delim="," trim="true">${maven.dist.formats}</util:tokenize>
|
|
|
|
<j:forEach var="distFormat" items="${distFormats}">
|
|
|
|
<j:if test="${distFormat == 'tgz'}">
|
|
<!-- Use LF line endings for specified files if lf filter
|
|
is set -->
|
|
<j:if test="${lfFilter.length() > 0}">
|
|
<ant:fixcrlf srcdir="${maven.dist.bin.archive.dir}"
|
|
eol="lf" includes="${lfFilter}"/>
|
|
</j:if>
|
|
|
|
<!-- Create a tar.gz file -->
|
|
<ant:tar longfile="gnu" tarfile="${maven.dist.dir}/${maven.final.name}.tar">
|
|
<ant:tarfileset dir="${maven.dist.bin.archive.dir}"/>
|
|
</ant:tar>
|
|
|
|
<ant:gzip
|
|
zipfile="${maven.dist.dir}/${maven.final.name}.tar.gz"
|
|
src="${maven.dist.dir}/${maven.final.name}.tar"
|
|
/>
|
|
|
|
<ant:delete file="${maven.dist.dir}/${maven.final.name}.tar"/>
|
|
</j:if>
|
|
|
|
<j:if test="${distFormat == 'zip'}">
|
|
<!-- Use LF line endings for specified files if lf filter
|
|
is set, apply before crlf so crlf takes precedence -->
|
|
<j:if test="${lfFilter.length() > 0}">
|
|
<ant:fixcrlf srcdir="${maven.dist.bin.archive.dir}"
|
|
eol="lf" includes="${lfFilter}"/>
|
|
</j:if>
|
|
<!-- Use CRLF line endings for specified files in zip if crlf filter
|
|
is set -->
|
|
<j:if test="${crlfFilter.length() > 0}">
|
|
<ant:fixcrlf srcdir="${maven.dist.bin.archive.dir}"
|
|
eol="crlf" includes="${crlfFilter}"/>
|
|
</j:if>
|
|
|
|
<!-- Create a zip file -->
|
|
<ant:zip zipfile="${maven.dist.dir}/${maven.final.name}.zip">
|
|
<ant:zipfileset dir="${maven.dist.bin.archive.dir}"/>
|
|
</ant:zip>
|
|
</j:if>
|
|
|
|
</j:forEach>
|
|
|
|
</goal>
|
|
|
|
<goal
|
|
name="dist:build-src"
|
|
prereqs="dist:build-setup,dist:prepare-src-filesystem"
|
|
description="Build the source distribution.">
|
|
|
|
<util:tokenize var="distFormats" delim="," trim="true">${maven.dist.formats}</util:tokenize>
|
|
|
|
<j:forEach var="distFormat" items="${distFormats}">
|
|
|
|
<j:if test="${distFormat == 'tgz'}">
|
|
<!-- Use LF line endings for specified files in unix distros if lf filter
|
|
is set -->
|
|
<j:if test="${lfFilter.length() > 0}">
|
|
<ant:fixcrlf srcdir="${maven.dist.src.archive.dir}"
|
|
eol="lf" includes="${lfFilter}"/>
|
|
</j:if>
|
|
|
|
<!-- Create a tar.gz file -->
|
|
<ant:tar longfile="gnu" tarfile="${maven.dist.dir}/${maven.final.name}-src.tar">
|
|
<ant:tarfileset dir="${maven.dist.src.archive.dir}"/>
|
|
</ant:tar>
|
|
|
|
<ant:gzip
|
|
zipfile="${maven.dist.dir}/${maven.final.name}-src.tar.gz"
|
|
src="${maven.dist.dir}/${maven.final.name}-src.tar"
|
|
/>
|
|
|
|
<ant:delete file="${maven.dist.dir}/${maven.final.name}-src.tar"/>
|
|
</j:if>
|
|
|
|
<j:if test="${distFormat == 'zip'}">
|
|
<!-- Use LF line endings for specified files in unix distros if lf filter
|
|
is set, apply before crlf so crlf takes precedence -->
|
|
<j:if test="${lfFilter.length() > 0}">
|
|
<ant:fixcrlf srcdir="${maven.dist.src.archive.dir}"
|
|
eol="lf" includes="${lfFilter}"/>
|
|
</j:if>
|
|
<!-- Use CRLF line endings for text files in zip archive if crlf filter
|
|
is set -->
|
|
<j:if test="${crlfFilter.length() > 0}">
|
|
<ant:fixcrlf srcdir="${maven.dist.src.archive.dir}"
|
|
eol="crlf" includes="${crlfFilter}"/>
|
|
</j:if>
|
|
|
|
<!-- Create a zip file -->
|
|
<ant:zip zipfile="${maven.dist.dir}/${maven.final.name}-src.zip">
|
|
<ant:zipfileset dir="${maven.dist.src.archive.dir}"/>
|
|
</ant:zip>
|
|
</j:if>
|
|
</j:forEach>
|
|
|
|
</goal>
|
|
|
|
<!-- ================================================================== -->
|
|
<!-- D E P L O Y D I S T R I B U T I O N -->
|
|
<!-- ================================================================== -->
|
|
|
|
<goal name="dist:multiproject-deploy" description="Deploy a multiproject distribution"
|
|
prereqs="dist:multiproject-deploy-bin,dist:multiproject-deploy-src" />
|
|
|
|
<goal name="dist:deploy" description="Deploy a distribution"
|
|
prereqs="dist:deploy-bin,dist:deploy-src" />
|
|
|
|
<goal name="dist:deploy-bin" description="Deploy a binary distribution" prereqs="dist:build-bin">
|
|
|
|
<artifact:deploy
|
|
artifact="${maven.dist.dir}/${maven.final.name}.tar.gz"
|
|
type="distribution-targz"
|
|
project="${pom}"
|
|
typeHandler="${distTypeHandler}"
|
|
/>
|
|
<artifact:deploy
|
|
artifact="${maven.dist.dir}/${maven.final.name}.zip"
|
|
type="distribution-zip"
|
|
project="${pom}"
|
|
typeHandler="${distTypeHandler}"
|
|
/>
|
|
|
|
</goal>
|
|
|
|
<goal name="dist:multiproject-deploy-bin" description="Deploy a binary multiproject distribution" prereqs="dist:multiproject-bin">
|
|
|
|
<artifact:deploy
|
|
artifact="${maven.dist.dir}/${maven.final.name}.tar.gz"
|
|
type="distribution-targz"
|
|
project="${pom}"
|
|
typeHandler="${distTypeHandler}"
|
|
/>
|
|
<artifact:deploy
|
|
artifact="${maven.dist.dir}/${maven.final.name}.zip"
|
|
type="distribution-zip"
|
|
project="${pom}"
|
|
typeHandler="${distTypeHandler}"
|
|
/>
|
|
|
|
</goal>
|
|
|
|
|
|
<goal name="dist:deploy-src" description="Deploy a source distribution" prereqs="dist:build-src">
|
|
|
|
<artifact:deploy
|
|
artifact="${maven.dist.dir}/${maven.final.name}-src.tar.gz"
|
|
type="distribution-src-targz"
|
|
project="${pom}"
|
|
typeHandler="${distTypeHandler}"
|
|
/>
|
|
<artifact:deploy
|
|
artifact="${maven.dist.dir}/${maven.final.name}-src.zip"
|
|
type="distribution-src-zip"
|
|
project="${pom}"
|
|
typeHandler="${distTypeHandler}"
|
|
/>
|
|
|
|
</goal>
|
|
|
|
<goal name="dist:multiproject-deploy-src" description="Deploy a source multiproject distribution" prereqs="dist:multiproject-src">
|
|
|
|
<artifact:deploy
|
|
artifact="${maven.dist.dir}/${maven.final.name}-src.tar.gz"
|
|
type="distribution-src-targz"
|
|
project="${pom}"
|
|
typeHandler="${distTypeHandler}"
|
|
/>
|
|
<artifact:deploy
|
|
artifact="${maven.dist.dir}/${maven.final.name}-src.zip"
|
|
type="distribution-src-zip"
|
|
project="${pom}"
|
|
typeHandler="${distTypeHandler}"
|
|
/>
|
|
|
|
</goal>
|
|
|
|
|
|
<!-- ================================================================== -->
|
|
<!-- D E P L O Y S N A P S H O T D I S T R I B U T I O N -->
|
|
<!-- ================================================================== -->
|
|
|
|
<goal name="dist:deploy-snapshot" description="Deploy a snapshot distribution"
|
|
prereqs="dist:deploy-bin-snapshot,dist:deploy-src-snapshot" />
|
|
|
|
<goal name="dist:deploy-bin-snapshot" description="Deploy a binary distribution" prereqs="dist:build-bin">
|
|
|
|
<artifact:deploy-snapshot
|
|
artifact="${maven.dist.dir}/${maven.final.name}.tar.gz"
|
|
type="distribution-targz"
|
|
project="${pom}"
|
|
typeHandler="${distTypeHandler}"
|
|
/>
|
|
<artifact:deploy-snapshot
|
|
artifact="${maven.dist.dir}/${maven.final.name}.zip"
|
|
type="distribution-zip"
|
|
project="${pom}"
|
|
typeHandler="${distTypeHandler}"
|
|
/>
|
|
|
|
</goal>
|
|
|
|
<goal name="dist:deploy-src-snapshot" description="Deploy a source distribution" prereqs="dist:build-src">
|
|
|
|
<artifact:deploy-snapshot
|
|
artifact="${maven.dist.dir}/${maven.final.name}-src.tar.gz"
|
|
type="distribution-src-targz"
|
|
project="${pom}"
|
|
typeHandler="${distTypeHandler}"
|
|
/>
|
|
<artifact:deploy-snapshot
|
|
artifact="${maven.dist.dir}/${maven.final.name}-src.zip"
|
|
type="distribution-src-zip"
|
|
project="${pom}"
|
|
typeHandler="${distTypeHandler}"
|
|
/>
|
|
|
|
</goal>
|
|
|
|
|
|
<!-- ================================================================== -->
|
|
<!-- B I N A R Y M U L T I P R O J E C T D I S T R I B U T I O N -->
|
|
<!-- ================================================================== -->
|
|
|
|
|
|
<goal
|
|
name="dist:multiproject-bin"
|
|
prereqs="dist:build-setup"
|
|
description="Builds the binary multiproject distributions as tarball and zip">
|
|
|
|
<!-- we use plugin's own settings in first order. -->
|
|
<!-- if they are not provided we will try use use multiproject settings -->
|
|
|
|
<j:set var="multiprojectIncludes" value="${maven.dist.multiproject.includes}"/>
|
|
<j:if test="${multiprojectIncludes == null or multiprojectIncludes.length() eq 0}">
|
|
<maven:get var="multiprojectIncludes" plugin="maven-multiproject-plugin"
|
|
property="maven.multiproject.includes"/>
|
|
</j:if>
|
|
|
|
<j:set var="multiprojectExcludes" value="${maven.dist.multiproject.excludes}"/>
|
|
<j:if test="${multiprojectExcludes == null or multiprojectExcludes.length() eq 0}">
|
|
<maven:get var="multiprojectExcludes" plugin="maven-multiproject-plugin"
|
|
property="maven.multiproject.excludes"/>
|
|
</j:if>
|
|
|
|
<j:set var="multiprojectBasedir" value="${maven.idea.project.multiproject.basedir}"/>
|
|
<j:if test="${multiprojectBasedir == null or multiprojectBasedir.length() eq 0}">
|
|
<maven:get var="multiprojectBasedir" plugin="maven-multiproject-plugin"
|
|
property="maven.multiproject.basedir"/>
|
|
</j:if>
|
|
|
|
<maven:reactor
|
|
basedir="${multiprojectBasedir}"
|
|
banner="Generating dist materials for:"
|
|
includes="${multiprojectIncludes}"
|
|
excludes="${multiprojectExcludes}"
|
|
postProcessing="true"
|
|
goals="xdoc:init, jar:jar"
|
|
ignoreFailures="true"/>
|
|
|
|
<ant:echo>
|
|
+----------------------------------------------------------------+
|
|
| C R E A T I N G B I N A R Y M U L T I P R O J E C T D I S T |
|
|
+----------------------------------------------------------------+
|
|
</ant:echo>
|
|
|
|
<ant:delete dir="${maven.dist.bin.assembly.dir}"/>
|
|
<ant:mkdir dir="${maven.dist.bin.assembly.dir}"/>
|
|
|
|
<ant:echo>
|
|
+--------------------------------------------------------------+
|
|
| C O P Y I N G L I C E N S E S A N D D I S C L A I M E R S |
|
|
+--------------------------------------------------------------+
|
|
</ant:echo>
|
|
|
|
<ant:copy todir="${maven.dist.bin.assembly.dir}">
|
|
<ant:fileset dir="." includes="${maven.dist.bin.includes}"/>
|
|
</ant:copy>
|
|
|
|
<ant:echo>
|
|
+--------------------------------------------------------------+
|
|
| C O P Y I N G C H I L D P R O J E C T A R T I F A C T S |
|
|
+--------------------------------------------------------------+
|
|
</ant:echo>
|
|
|
|
<!-- Copy artifacts from all reactor project target directories -->
|
|
<ant:copy todir="${maven.dist.bin.assembly.dir}">
|
|
<j:forEach var="project" items="${reactorProjects}">
|
|
<ant:fileset dir="${project.mavenXml.parent}/target">
|
|
<ant:include name="*${project.artifactId}*.jar"/>
|
|
</ant:fileset>
|
|
</j:forEach>
|
|
</ant:copy>
|
|
|
|
<ant:echo>
|
|
+-----------------------------------------------------+
|
|
| C R E A T I N G S I T E D O C U M E N T A T I O N |
|
|
+-----------------------------------------------------+
|
|
</ant:echo>
|
|
|
|
<attainGoal name="multiproject:site"/>
|
|
|
|
<!-- Copy generated non-javadoc documentation -->
|
|
<j:set var="docsDest" value="${maven.docs.dest}"/>
|
|
<ant:copy todir="${maven.dist.bin.assembly.dir}/docs">
|
|
<ant:fileset dir="${docsDest}">
|
|
<ant:include name="**"/>
|
|
</ant:fileset>
|
|
</ant:copy>
|
|
|
|
<ant:echo>
|
|
+-----------------------------------------------------------+
|
|
| C R E A T I N G C O N S O L I D A T E D J A V A D O C S |
|
|
+-----------------------------------------------------------+
|
|
</ant:echo>
|
|
|
|
<javadoc destdir="${maven.dist.bin.assembly.dir}/docs/apidocs">
|
|
<j:forEach var="project" items="${reactorProjects}">
|
|
<util:file var="_javasources" name="${project.build.sourceDirectory}"/>
|
|
<j:if test="${_javasources.exists()}">
|
|
<packageset dir="${project.build.sourceDirectory}"/>
|
|
</j:if>
|
|
</j:forEach>
|
|
<j:useBean var="classPathBuilder" class="org.apache.maven.DependencyClasspathBuilder"/>
|
|
<classpath>
|
|
<path location="${maven.build.dest}"/>
|
|
<j:forEach var="project" items="${reactorProjects}">
|
|
<pathelement path="${classPathBuilder.build(project)}"/>
|
|
</j:forEach>
|
|
</classpath>
|
|
</javadoc>
|
|
|
|
<util:tokenize var="distFormats" delim="," trim="true">${maven.dist.formats}</util:tokenize>
|
|
|
|
<j:forEach var="distFormat" items="${distFormats}">
|
|
|
|
<j:if test="${distFormat == 'tgz'}">
|
|
<ant:echo>
|
|
+---------------------------------------------+
|
|
| C R E A T I N G B I N A R Y T A R B A L L |
|
|
+---------------------------------------------+
|
|
</ant:echo>
|
|
|
|
<!-- Create a tar.gz file -->
|
|
<ant:tar longfile="gnu" tarfile="${maven.dist.dir}/${maven.final.name}.tar">
|
|
<ant:tarfileset dir="${maven.dist.bin.archive.dir}"/>
|
|
</ant:tar>
|
|
<ant:gzip
|
|
zipfile="${maven.dist.dir}/${maven.final.name}.tar.gz"
|
|
src="${maven.dist.dir}/${maven.final.name}.tar"
|
|
/>
|
|
|
|
<ant:delete file="${maven.dist.dir}/${maven.final.name}.tar"/>
|
|
</j:if>
|
|
|
|
<j:if test="${distFormat == 'zip'}">
|
|
<ant:echo>
|
|
+----------------------------------------------+
|
|
| C R E A T I N G B I N A R Y Z I P F I L E |
|
|
+----------------------------------------------+
|
|
</ant:echo>
|
|
|
|
<!-- Create a zip file -->
|
|
<ant:zip zipfile="${maven.dist.dir}/${maven.final.name}.zip">
|
|
<ant:zipfileset dir="${maven.dist.bin.archive.dir}"/>
|
|
</ant:zip>
|
|
</j:if>
|
|
|
|
</j:forEach>
|
|
|
|
</goal>
|
|
|
|
|
|
<!-- ================================================================== -->
|
|
<!-- S O U R C E M U L T I P R O J E C T D I S T R I B U T I O N -->
|
|
<!-- ================================================================== -->
|
|
|
|
|
|
<goal
|
|
name="dist:multiproject-src"
|
|
prereqs="dist:build-setup"
|
|
description="Builds the source distributions as tarball and zip">
|
|
|
|
<ant:echo>
|
|
+----------------------------------------------------------------+
|
|
| C R E A T I N G S O U R C E M U L T I P R O J E C T D I S T |
|
|
+----------------------------------------------------------------+
|
|
</ant:echo>
|
|
|
|
<ant:delete dir="${maven.dist.src.assembly.dir}"/>
|
|
<ant:mkdir dir="${maven.dist.src.assembly.dir}"/>
|
|
|
|
<ant:echo>
|
|
+----------------------------------------------+
|
|
| C O P Y I N G A L L S O U R C E F I L E S |
|
|
+----------------------------------------------+
|
|
</ant:echo>
|
|
|
|
<ant:copy todir="${maven.dist.src.assembly.dir}">
|
|
<ant:fileset dir="${user.dir}">
|
|
<ant:include name="**/*"/>
|
|
<ant:exclude name="**/target/**"/>
|
|
<ant:exclude name="**/*.log*"/>
|
|
<ant:exclude name="**/*.ipr*"/>
|
|
<ant:exclude name="**/*.iml*"/>
|
|
<ant:exclude name="**/*.iws*"/>
|
|
<ant:exclude name="**/*.md5*"/>
|
|
<ant:exclude name="**/.???*"/>
|
|
</ant:fileset>
|
|
</ant:copy>
|
|
|
|
<util:tokenize var="distFormats" delim="," trim="true">${maven.dist.formats}</util:tokenize>
|
|
|
|
<j:forEach var="distFormat" items="${distFormats}">
|
|
|
|
<j:if test="${distFormat == 'tgz'}">
|
|
<ant:echo>
|
|
+---------------------------------------------+
|
|
| C R E A T I N G S O U R C E T A R B A L L |
|
|
+---------------------------------------------+
|
|
</ant:echo>
|
|
|
|
<!-- Create a tar.gz file -->
|
|
<ant:tar longfile="gnu" tarfile="${maven.dist.dir}/${maven.final.name}-src.tar">
|
|
<ant:tarfileset dir="${maven.dist.src.archive.dir}"/>
|
|
</ant:tar>
|
|
<ant:gzip
|
|
zipfile="${maven.dist.dir}/${maven.final.name}-src.tar.gz"
|
|
src="${maven.dist.dir}/${maven.final.name}-src.tar"
|
|
/>
|
|
<ant:delete file="${maven.dist.dir}/${maven.final.name}-src.tar"/>
|
|
</j:if>
|
|
|
|
<j:if test="${distFormat == 'zip'}">
|
|
<ant:echo>
|
|
+----------------------------------------------+
|
|
| C R E A T I N G S O U R C E Z I P F I L E |
|
|
+----------------------------------------------+
|
|
</ant:echo>
|
|
|
|
<!-- Create a zip file -->
|
|
<ant:zip zipfile="${maven.dist.dir}/${maven.final.name}-src.zip">
|
|
<ant:zipfileset dir="${maven.dist.src.archive.dir}"/>
|
|
</ant:zip>
|
|
</j:if>
|
|
|
|
</j:forEach>
|
|
</goal>
|
|
|
|
<goal
|
|
name="dist:multiproject"
|
|
prereqs="dist:multiproject-bin,dist:multiproject-src"
|
|
description="Build a complete distribution for a multiproject configuration.">
|
|
</goal>
|
|
|
|
</project>
|
|
|