Add two new tags for working with the license file

git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@112869 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
dion
2003-02-10 02:29:27 +00:00
parent d40f87ea68
commit 2a19207b62

View File

@@ -11,6 +11,38 @@
<define:jellybean name="license"
className="org.apache.maven.license.LicenseTask"
method="doExecute" />
<define:tag name="fileName">
<j:set var="licenseX" value='${maven.license.licenseFile}X'/>
<j:choose>
<j:when test="${licenseX != 'X'}">
<j:set var="licenseFile" value='${maven.license.licenseFile}'/>
</j:when>
<j:otherwise>
<j:set var="licenseFile" value='${basedir}/LICENSE.txt'/>
</j:otherwise>
</j:choose>
<j:whitespace trim="yes">${licenseFile}</j:whitespace>
</define:tag>
<define:tag name="relativeFileName" trim="yes">
<!-- get the license file and replace backslashes with forwards -->
<util:replace var="forwardSlashFile" oldChar="\" newChar="/" trim="yes">
<license:fileName />
</util:replace>
<!-- change bsaedir to have forward slashes too -->
<util:replace var="forwardSlashBaseDir" value="${basedir}"
oldChar="\" newChar="/" />
<j:if test="${!forwardSlashBaseDir.endsWith('/')}">
<j:set var="base" value="${forwardSlashBaseDir}/" />
</j:if>
<j:set var="relativePath">${forwardSlashFile.substring(base.length())}</j:set>
<j:whitespace trim="yes">${relativePath}</j:whitespace>
</define:tag>
</define:taglib>
<!-- ================================================================== -->