improve naming consistency : rename plugin:available by assert:assertPluginAvailable
git-svn-id: https://svn.apache.org/repos/asf/maven/maven-1/plugins/trunk@290197 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
677c0c6d33
commit
c587f48e09
@ -28,15 +28,15 @@
|
||||
xmlns:ant="jelly:ant"
|
||||
xmlns:util="jelly:util"
|
||||
xmlns:doc="doc"
|
||||
xmlns:plugin="plugin"
|
||||
xmlns:assert="assert"
|
||||
xmlns:maven="jelly:maven"
|
||||
xmlns:define="jelly:define"
|
||||
xmlns:checkstyle="checkstyle">
|
||||
|
||||
<j:if test="${bootstrapping == null}">
|
||||
<!-- fake test because the plugin:available tag is avalaible in the maven-plugin-plugin 1.7 and newer. Thus maven will break if it's not present. -->
|
||||
<plugin:available groupId="maven" artifactId="maven-plugin-plugin" minRelease="1.7" neededBy="maven-faq-plugin"/>
|
||||
<plugin:available groupId="maven" artifactId="maven-xdoc-plugin" minRelease="1.10" neededBy="maven-faq-plugin"/>
|
||||
<!-- fake test because the assert:assertPluginAvailable tag is avalaible in the maven-plugin-plugin 1.7 and newer. Thus maven will break if it's not present. -->
|
||||
<assert:assertPluginAvailable groupId="maven" artifactId="maven-plugin-plugin" minRelease="1.7" neededBy="${plugin.artifactId}"/>
|
||||
<assert:assertPluginAvailable groupId="maven" artifactId="maven-xdoc-plugin" minRelease="1.10" neededBy="${plugin.artifactId}"/>
|
||||
</j:if>
|
||||
|
||||
<!--
|
||||
|
||||
6
dist/plugin.jelly
vendored
6
dist/plugin.jelly
vendored
@ -23,11 +23,13 @@
|
||||
xmlns:ant="jelly:ant"
|
||||
xmlns:maven="jelly:maven"
|
||||
xmlns:artifact="artifact"
|
||||
xmlns:plugin="plugin"
|
||||
xmlns:assert="assert"
|
||||
xmlns:util="jelly:util">
|
||||
|
||||
<j:if test="${bootstrapping == null}">
|
||||
<plugin:available groupId="maven" artifactId="maven-artifact-plugin" minRelease="1.3" neededBy="maven-dist-plugin"/>
|
||||
<!-- fake test because the assert:assertPluginAvailable tag is avalaible in the maven-plugin-plugin 1.7 and newer. Thus maven will break if it's not present. -->
|
||||
<assert:assertPluginAvailable groupId="maven" artifactId="maven-plugin-plugin" minRelease="1.7" neededBy="${plugin.artifactId}"/>
|
||||
<assert:assertPluginAvailable groupId="maven" artifactId="maven-artifact-plugin" minRelease="1.3" neededBy="${plugin.artifactId}"/>
|
||||
</j:if>
|
||||
|
||||
<j:new var="distTypeHandler" className="org.apache.maven.dist.DistributionArtifactTypeHandler" />
|
||||
|
||||
@ -26,13 +26,13 @@
|
||||
xmlns:ant="jelly:ant"
|
||||
xmlns:define="jelly:define"
|
||||
xmlns:doc="doc"
|
||||
xmlns:plugin="plugin"
|
||||
xmlns:assert="assert"
|
||||
xmlns:faq="faq">
|
||||
|
||||
<j:if test="${bootstrapping == null}">
|
||||
<!-- fake test because the plugin:available tag is avalaible in the maven-plugin-plugin 1.7 and newer. Thus maven will break if it's not present. -->
|
||||
<plugin:available groupId="maven" artifactId="maven-plugin-plugin" minRelease="1.7" neededBy="maven-faq-plugin"/>
|
||||
<plugin:available groupId="maven" artifactId="maven-xdoc-plugin" minRelease="1.9.2" neededBy="maven-faq-plugin"/>
|
||||
<!-- fake test because the assert:assertPluginAvailable tag is avalaible in the maven-plugin-plugin 1.7 and newer. Thus maven will break if it's not present. -->
|
||||
<assert:assertPluginAvailable groupId="maven" artifactId="maven-plugin-plugin" minRelease="1.7" neededBy="${plugin.artifactId}"/>
|
||||
<assert:assertPluginAvailable groupId="maven" artifactId="maven-xdoc-plugin" minRelease="1.9.2" neededBy="${plugin.artifactId}"/>
|
||||
</j:if>
|
||||
|
||||
<define:taglib uri="faq">
|
||||
|
||||
@ -24,12 +24,14 @@
|
||||
xmlns:license="license"
|
||||
xmlns:maven="jelly:maven"
|
||||
xmlns:artifact="artifact"
|
||||
xmlns:plugin="plugin"
|
||||
xmlns:assert="assert"
|
||||
xmlns:util="jelly:util"
|
||||
xmlns:doc="doc">
|
||||
|
||||
<j:if test="${bootstrapping == null}">
|
||||
<plugin:available groupId="maven" artifactId="maven-artifact-plugin" minRelease="1.3" neededBy="maven-jar-plugin"/>
|
||||
<!-- fake test because the assert:assertPluginAvailable tag is avalaible in the maven-plugin-plugin 1.7 and newer. Thus maven will break if it's not present. -->
|
||||
<assert:assertPluginAvailable groupId="maven" artifactId="maven-plugin-plugin" minRelease="1.7" neededBy="${plugin.artifactId}"/>
|
||||
<assert:assertPluginAvailable groupId="maven" artifactId="maven-artifact-plugin" minRelease="1.3" neededBy="${plugin.artifactId}"/>
|
||||
</j:if>
|
||||
|
||||
<!-- ================================================================== -->
|
||||
|
||||
@ -23,11 +23,13 @@
|
||||
xmlns:maven="jelly:maven"
|
||||
xmlns:doc="doc"
|
||||
xmlns:scm="scm"
|
||||
xmlns:plugin="plugin"
|
||||
xmlns:assert="assert"
|
||||
xmlns:ant="jelly:ant">
|
||||
|
||||
<j:if test="${bootstrapping == null}">
|
||||
<plugin:available groupId="maven" artifactId="maven-scm-plugin" minRelease="1.5" neededBy="maven-jdiff-plugin"/>
|
||||
<!-- fake test because the assert:assertPluginAvailable tag is avalaible in the maven-plugin-plugin 1.7 and newer. Thus maven will break if it's not present. -->
|
||||
<assert:assertPluginAvailable groupId="maven" artifactId="maven-plugin-plugin" minRelease="1.7" neededBy="${plugin.artifactId}"/>
|
||||
<assert:assertPluginAvailable groupId="maven" artifactId="maven-scm-plugin" minRelease="1.5" neededBy="${plugin.artifactId}"/>
|
||||
</j:if>
|
||||
|
||||
<goal name="maven-jdiff-plugin:register">
|
||||
|
||||
@ -57,7 +57,45 @@
|
||||
</ant:delete>
|
||||
</define:tag>
|
||||
|
||||
<define:tag name="available">
|
||||
</define:taglib>
|
||||
|
||||
<define:taglib uri="assert">
|
||||
<define:tag name="assertFileExists">
|
||||
<!-- @file : Full file path -->
|
||||
<!-- @msg : optional message to be displayed -->
|
||||
<u:file var="fileAsFile" name="${file}"/>
|
||||
<j:if test="${!(fileAsFile.exists())}">
|
||||
<ant:fail>${file} does not exist.${msg}</ant:fail>
|
||||
</j:if>
|
||||
</define:tag>
|
||||
<define:tag name="assertFileContains">
|
||||
<!-- @file : Full file path -->
|
||||
<!-- @match: the matching value expected -->
|
||||
<!-- @msg : optional message to be displayed -->
|
||||
<assert:assertFileExists file="${file}" msg="${msg}"/>
|
||||
<u:loadText var="fileContent" file="${file}"/>
|
||||
<j:if test="${fileContent.indexOf(match) lt 0}">
|
||||
<ant:fail>${file} does not contain string [${match}].${msg}</ant:fail>
|
||||
</j:if>
|
||||
</define:tag>
|
||||
<define:tag name="assertFileNotFound">
|
||||
<!-- @file : Full file path -->
|
||||
<!-- @msg : optional message to be displayed -->
|
||||
<u:file var="fileAsFile" name="${file}"/>
|
||||
<j:if test="${fileAsFile.exists()}">
|
||||
<ant:fail>${file} found and not expected.${msg}</ant:fail>
|
||||
</j:if>
|
||||
</define:tag>
|
||||
<define:tag name="assertEquals">
|
||||
<!-- @expected : the expected value -->
|
||||
<!-- @value : the actual value -->
|
||||
<!-- @msg : optional message to be displayed -->
|
||||
<j:if test="${not(expected.equals(value))}">
|
||||
<ant:fail>Expected [${expected}] but got [${value}].${msg}</ant:fail>
|
||||
</j:if>
|
||||
</define:tag>
|
||||
|
||||
<define:tag name="assertPluginAvailable">
|
||||
<!-- Check parameters -->
|
||||
<maven:param-check value="${groupId}" fail="true" message="'groupId' must be specified"/>
|
||||
<maven:param-check value="${artifactId}" fail="true" message="'artifactId' must be specified"/>
|
||||
@ -161,45 +199,8 @@ Try: maven plugin:download -DgroupId=maven -DartifactId=${pluginToTest} -Dversio
|
||||
|
||||
</define:taglib>
|
||||
|
||||
<define:taglib uri="assert">
|
||||
<define:tag name="assertFileExists">
|
||||
<!-- @file : Full file path -->
|
||||
<!-- @msg : optional message to be displayed -->
|
||||
<u:file var="fileAsFile" name="${file}"/>
|
||||
<j:if test="${!(fileAsFile.exists())}">
|
||||
<ant:fail>${file} does not exist.${msg}</ant:fail>
|
||||
</j:if>
|
||||
</define:tag>
|
||||
<define:tag name="assertFileContains">
|
||||
<!-- @file : Full file path -->
|
||||
<!-- @match: the matching value expected -->
|
||||
<!-- @msg : optional message to be displayed -->
|
||||
<assert:assertFileExists file="${file}" msg="${msg}"/>
|
||||
<u:loadText var="fileContent" file="${file}"/>
|
||||
<j:if test="${fileContent.indexOf(match) lt 0}">
|
||||
<ant:fail>${file} does not contain string [${match}].${msg}</ant:fail>
|
||||
</j:if>
|
||||
</define:tag>
|
||||
<define:tag name="assertFileNotFound">
|
||||
<!-- @file : Full file path -->
|
||||
<!-- @msg : optional message to be displayed -->
|
||||
<u:file var="fileAsFile" name="${file}"/>
|
||||
<j:if test="${fileAsFile.exists()}">
|
||||
<ant:fail>${file} found and not expected.${msg}</ant:fail>
|
||||
</j:if>
|
||||
</define:tag>
|
||||
<define:tag name="assertEquals">
|
||||
<!-- @expected : the expected value -->
|
||||
<!-- @value : the actual value -->
|
||||
<!-- @msg : optional message to be displayed -->
|
||||
<j:if test="${not(expected.equals(value))}">
|
||||
<ant:fail>Expected [${expected}] but got [${value}].${msg}</ant:fail>
|
||||
</j:if>
|
||||
</define:tag>
|
||||
</define:taglib>
|
||||
|
||||
<j:if test="${bootstrapping == null}">
|
||||
<plugin:available groupId="maven" artifactId="maven-artifact-plugin" minRelease="1.3" neededBy="maven-plugin-plugin"/>
|
||||
<assert:assertPluginAvailable groupId="maven" artifactId="maven-artifact-plugin" minRelease="1.3" neededBy="${plugin.artifactId}"/>
|
||||
</j:if>
|
||||
|
||||
<goal name="plugin" prereqs="plugin:plugin" description="Build a plugin jar" />
|
||||
|
||||
@ -24,7 +24,7 @@
|
||||
</properties>
|
||||
<body>
|
||||
<release version="1.7-SNAPSHOT" date="In SVN">
|
||||
<action dev="aheritier" type="add">new plugin:available tag to check if a minimal release of a plugin is present.</action>
|
||||
<action dev="aheritier" type="add">new assert:assertPluginAvailable tag to check if a minimal release of a plugin is present.</action>
|
||||
</release>
|
||||
<release version="1.6" date="2005-06-03">
|
||||
<action dev="vmassol" type="add">Added new
|
||||
|
||||
@ -31,7 +31,6 @@
|
||||
<ol>
|
||||
<li><a href='#uninstall_Tag'>uninstall</a></li>
|
||||
<li><a href='#clearCache_Tag'>clearCache</a></li>
|
||||
<li><a href='#available_Tag'>available</a></li>
|
||||
</ol>
|
||||
</li>
|
||||
<li><a href='#assert_Tag_Library'>assert</a>
|
||||
@ -40,6 +39,7 @@
|
||||
<li><a href='#assertFileContains_Tag'>assertFileContains</a></li>
|
||||
<li><a href='#assertFileNotFound_Tag'>assertFileNotFound</a></li>
|
||||
<li><a href='#assertEquals_Tag'>assertEquals</a></li>
|
||||
<li><a href='#assertPluginAvailable_Tag'>available</a></li>
|
||||
</ol>
|
||||
</li>
|
||||
</ol>
|
||||
@ -71,32 +71,6 @@
|
||||
</p>
|
||||
<p>There are no attributes for this tag</p>
|
||||
</subsection>
|
||||
<subsection name='available Tag'>
|
||||
<p>Fails the build if the given plugin does not exist or hasn't the minimal release number. Otherwise no effect.</p>
|
||||
<table>
|
||||
<tr><th>Attribute</th><th>Optional?</th><th>Description</th></tr>
|
||||
<tr>
|
||||
<td>groupId</td>
|
||||
<td>No</td>
|
||||
<td>The plugin's groupId</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>artifactId</td>
|
||||
<td>No</td>
|
||||
<td>The plugin's artifactId</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>minRelease</td>
|
||||
<td>No</td>
|
||||
<td>The minimum plugin's release</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>neededBy</td>
|
||||
<td>No</td>
|
||||
<td>The name of the plugin or project using this tag. It is used when the tag displays the error for the user.</td>
|
||||
</tr>
|
||||
</table>
|
||||
</subsection>
|
||||
</section>
|
||||
<section name='assert Tag Library'>
|
||||
<p>
|
||||
@ -177,6 +151,32 @@
|
||||
</tr>
|
||||
</table>
|
||||
</subsection>
|
||||
<subsection name='assertPluginAvailable Tag'>
|
||||
<p>Fails the build if the given plugin does not exist or hasn't the minimal release number. Otherwise no effect.</p>
|
||||
<table>
|
||||
<tr><th>Attribute</th><th>Optional?</th><th>Description</th></tr>
|
||||
<tr>
|
||||
<td>groupId</td>
|
||||
<td>No</td>
|
||||
<td>The plugin's groupId</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>artifactId</td>
|
||||
<td>No</td>
|
||||
<td>The plugin's artifactId</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>minRelease</td>
|
||||
<td>No</td>
|
||||
<td>The minimum plugin's release</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>neededBy</td>
|
||||
<td>No</td>
|
||||
<td>The name of the plugin or project using this tag. It is used when the tag displays the error for the user.</td>
|
||||
</tr>
|
||||
</table>
|
||||
</subsection>
|
||||
</section>
|
||||
</body>
|
||||
</document>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user