dion 2003/07/08 19:53:30
Modified: src/conf driver.jelly
Log:
Add a param-check tag to the maven taglib.
This allows jelly plugins to better check their required values.
Revision Changes Path
1.16 +28 -3 maven/src/conf/driver.jelly
Index: driver.jelly
===================================================================
RCS file: /home/cvs/maven/src/conf/driver.jelly,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- driver.jelly 16 Jun 2003 07:50:37 -0000 1.15
+++ driver.jelly 9 Jul 2003 02:53:30 -0000 1.16
@@ -1,11 +1,12 @@
<?xml version="1.0"?>
<project
- xmlns:j="jelly:core"
+ xmlns:ant="jelly:ant"
xmlns:define="jelly:define"
- xmlns:util="jelly:util"
+ xmlns:j="jelly:core"
+ xmlns:m="maven"
xmlns:resources="resources"
- xmlns:m="maven">
+ xmlns:util="jelly:util">
<!-- ================================================================== -->
<!-- M A V E N T A G L I B R A R Y -->
@@ -38,6 +39,30 @@
| maven -Dmaven.username=${user.name} [goal]
+------------------------------------------------------------------
</fail>
+ </j:if>
+ </define:tag>
+
+ <!--
+ | Check a provided parameter has a value, and if not dump a message out
+ | and optionally fail while doing it.
+ |
+ | @param value the param value to check
+ | @param message the message to display, if not specified, the body of
+ | the tag is used
+ | @param fail whether to fail or not if the param has no value (true/false)
+ |
+ -->
+ <define:tag name="param-check">
+ <j:if test="${empty(value)}">
+ <j:if test="${empty(message)}">
+ <j:set var="message" trim="yes"><define:invokeBody/></j:set>
+ </j:if>
+ <j:if test="${fail}">
+ <ant:fail>${message}</ant:fail>
+ </j:if>
+ <j:if test="${!fail}">
+ <ant:echo>${message}</ant:echo>
+ </j:if>
</j:if>
</define:tag>
</define:taglib>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]