git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@270237 13f79535-47bb-0310-9956-ffa450edef68master
| @@ -11,11 +11,11 @@ import org.apache.myrmidon.api.AbstractTask; | |||||
| import org.apache.myrmidon.api.TaskException; | import org.apache.myrmidon.api.TaskException; | ||||
| /** | /** | ||||
| * This is the echo task to display a message. | |||||
| * This is a task used to log messages in the build file. | |||||
| * | * | ||||
| * @author <a href="mailto:peter@apache.org">Peter Donald</a> | * @author <a href="mailto:peter@apache.org">Peter Donald</a> | ||||
| */ | */ | ||||
| public class Echo | |||||
| public class Log | |||||
| extends AbstractTask | extends AbstractTask | ||||
| { | { | ||||
| private String m_message; | private String m_message; | ||||
| @@ -6,7 +6,7 @@ | |||||
| Basic tests build file | Basic tests build file | ||||
| Authors: | Authors: | ||||
| Peter Donald <donaldp@apache.org> | |||||
| Peter Donald <peter@apache.org> | |||||
| Legal: | Legal: | ||||
| Copyright (c) 2000 The Apache Software Foundation. All Rights Reserved. | Copyright (c) 2000 The Apache Software Foundation. All Rights Reserved. | ||||
| @@ -26,24 +26,24 @@ Legal: | |||||
| <!-- | <!-- | ||||
| <file-manip-test base-directory="."> | <file-manip-test base-directory="."> | ||||
| <source> | <source> | ||||
| <include value="**/*.java" /> | |||||
| <include value="**/*.java" /> | |||||
| </source> | </source> | ||||
| </file-manip-test> | </file-manip-test> | ||||
| --> | --> | ||||
| </target> | </target> | ||||
| <target name="undefined-task"> | <target name="undefined-task"> | ||||
| <echo message="About to execute task that hasn't been defined"/> | |||||
| <echo2 message="This should have failed"/> | |||||
| <log message="About to execute task that hasn't been defined"/> | |||||
| <log2 message="This should have failed"/> | |||||
| </target> | </target> | ||||
| <target name="no-test-target" if="no-do-tests"> | <target name="no-test-target" if="no-do-tests"> | ||||
| <echo message="No tests done here"/> | |||||
| <log message="No tests done here"/> | |||||
| </target> | </target> | ||||
| <target name="test-target" depends="no-test-target,extensions-test" unless="no-do-tests"> | <target name="test-target" depends="no-test-target,extensions-test" unless="no-do-tests"> | ||||
| <echo message="Tests away"/> | |||||
| <log message="Tests away"/> | |||||
| <prim-test | <prim-test | ||||
| integer="1" | integer="1" | ||||
| @@ -67,9 +67,9 @@ Legal: | |||||
| </sub-elements-test> | </sub-elements-test> | ||||
| <conf-test message="..." /> | <conf-test message="..." /> | ||||
| <content-test>123</content-test> | <content-test>123</content-test> | ||||
| </target> | </target> | ||||
| <target name="extensions-test"> | <target name="extensions-test"> | ||||
| @@ -26,7 +26,7 @@ Legal: | |||||
| <target name="all" depends="property-test, typedef-test, converterdef-test, ant-call-test, datatype-test, namespace-test, ant1-tasklib-test, prim->main" /> | <target name="all" depends="property-test, typedef-test, converterdef-test, ant-call-test, datatype-test, namespace-test, ant1-tasklib-test, prim->main" /> | ||||
| <!-- | |||||
| <!-- | |||||
| <register-tasklib lib="../../dist/lib/core.atl" /> | <register-tasklib lib="../../dist/lib/core.atl" /> | ||||
| --> | --> | ||||
| @@ -34,16 +34,16 @@ Legal: | |||||
| <property name="blah" value="fred" /> | <property name="blah" value="fred" /> | ||||
| <property name="${blah}" value="barney" /> | <property name="${blah}" value="barney" /> | ||||
| <echo message="Doing the funky Echo with ${blah} ${fred} Year=${year}!"/> | |||||
| <log message="Doing the funky Echo with ${blah} ${fred} Year=${year}!"/> | |||||
| </target> | </target> | ||||
| <target name="typedef-test"> | <target name="typedef-test"> | ||||
| <typedef name="echo2" | |||||
| type="task" | |||||
| classname="org.apache.myrmidon.libs.core.Echo" | |||||
| <typedef name="log2" | |||||
| type="task" | |||||
| classname="org.apache.myrmidon.libs.core.Log" | |||||
| lib="../../dist/lib/core.atl" /> | lib="../../dist/lib/core.atl" /> | ||||
| <echo2 message="Luke to Echo base. Can you hear me?"/> | |||||
| <log2 message="Luke to Echo base. Can you hear me?"/> | |||||
| </target> | </target> | ||||
| <target name="converterdef-test"> | <target name="converterdef-test"> | ||||
| @@ -51,11 +51,11 @@ Legal: | |||||
| source-type="java.lang.String" | source-type="java.lang.String" | ||||
| destination-type="java.lang.Class" | destination-type="java.lang.Class" | ||||
| lib="../../dist/lib/core.atl" /> | lib="../../dist/lib/core.atl" /> | ||||
| </target> | |||||
| </target> | |||||
| <target name="ant-call-test"> | <target name="ant-call-test"> | ||||
| <!-- test elided until we decide scope and necessity of ant-call --> | <!-- test elided until we decide scope and necessity of ant-call --> | ||||
| <echo message="AntCall test elided until we decide scope and necessity of ant-call"/> | |||||
| <log message="AntCall test elided until we decide scope and necessity of ant-call"/> | |||||
| <!-- | <!-- | ||||
| <ant-call target="ant-call-test-target"> | <ant-call target="ant-call-test-target"> | ||||
| <param name="blah" value="blah-value" /> | <param name="blah" value="blah-value" /> | ||||
| @@ -64,9 +64,9 @@ Legal: | |||||
| </target> | </target> | ||||
| <target name="ant-call-test-target"> | <target name="ant-call-test-target"> | ||||
| <echo message="This should fail ...."/> | |||||
| <echo message="${blah}"/> | |||||
| <echo message="Whoa - it no fail. You used ant-call to call me and set param blah!"/> | |||||
| <log message="This should fail ...."/> | |||||
| <log message="${blah}"/> | |||||
| <log message="Whoa - it no fail. You used ant-call to call me and set param blah!"/> | |||||
| </target> | </target> | ||||
| <target name="datatype-test"> | <target name="datatype-test"> | ||||
| @@ -76,26 +76,26 @@ Legal: | |||||
| <pattern id="foo2" value="*.java" if="..." /> | <pattern id="foo2" value="*.java" if="..." /> | ||||
| <echo message="foo=${foo}" /> | |||||
| <echo message="foo2=${foo2}" /> | |||||
| <log message="foo=${foo}" /> | |||||
| <log message="foo2=${foo2}" /> | |||||
| </target> | </target> | ||||
| <target name="namespace-test"> | <target name="namespace-test"> | ||||
| <!-- ant and doc are built in namespaces --> | <!-- ant and doc are built in namespaces --> | ||||
| <echo ant:fail-on-error="true" message="Some random message"> | |||||
| <log ant:fail-on-error="true" message="Some random message"> | |||||
| <doc:description> | <doc:description> | ||||
| Test case for aspects | Test case for aspects | ||||
| </doc:description> | </doc:description> | ||||
| <ant:some-element some-attribute="blah"/> | <ant:some-element some-attribute="blah"/> | ||||
| </echo> | |||||
| </log> | |||||
| <!-- load facility for blee: namespace --> | <!-- load facility for blee: namespace --> | ||||
| <facility namespace="blee"> | <facility namespace="blee"> | ||||
| <noop/> | <noop/> | ||||
| </facility> | </facility> | ||||
| <echo blee:some-param="blah" message="Blee namespace test successful!"/> | |||||
| <log blee:some-param="blah" message="Blee namespace test successful!"/> | |||||
| </target> | </target> | ||||
| @@ -104,7 +104,7 @@ Legal: | |||||
| <!-- | <!-- | ||||
| <ant1-tasklib prefix="a1-" lib="../../dist/lib/ant1-compat.jar"/> | <ant1-tasklib prefix="a1-" lib="../../dist/lib/ant1-compat.jar"/> | ||||
| <a1-echo message="Boo!" /> | |||||
| <a1-log message="Boo!" /> | |||||
| <a1-mkdir dir="../../dist/test"/> | <a1-mkdir dir="../../dist/test"/> | ||||
| <a1-copy file="../../tools/lib/ant.jar" tofile="../../dist/test/ant1-compat.jar" /> | <a1-copy file="../../tools/lib/ant.jar" tofile="../../dist/test/ant1-compat.jar" /> | ||||
| --> | --> | ||||
| @@ -9,11 +9,11 @@ | |||||
| <target name="main"> | <target name="main"> | ||||
| <property name="year" value="2000"/> | <property name="year" value="2000"/> | ||||
| <echo message="Before template"/> | |||||
| <echo-template msg="Template echo 1!" /> | |||||
| <echo-template msg="Template echo 2!" /> | |||||
| <echo-template msg="Template echo 3!" /> | |||||
| <echo message="After template"/> | |||||
| <log message="Before template"/> | |||||
| <log-template msg="Template log 1!" /> | |||||
| <log-template msg="Template log 2!" /> | |||||
| <log-template msg="Template log 3!" /> | |||||
| <log message="After template"/> | |||||
| </target> | </target> | ||||
| </project> | </project> | ||||
| @@ -2,11 +2,11 @@ | |||||
| <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> | <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> | ||||
| <xsl:template match="echo-template"> | |||||
| <echo message="This is an example of how to use a template to expand" /> | |||||
| <echo message="a single element into a list of tasks to do. In this" /> | |||||
| <echo message="example it is largely a case of echoing an attribute" /> | |||||
| <echo message="ie. msg='{@msg}' and embeddding an ant variable ${{year}}" /> | |||||
| <xsl:template match="log-template"> | |||||
| <log message="This is an example of how to use a template to expand" /> | |||||
| <log message="a single element into a list of tasks to do. In this" /> | |||||
| <log message="example it is largely a case of echoing an attribute" /> | |||||
| <log message="ie. msg='{@msg}' and embeddding an ant variable ${{year}}" /> | |||||
| </xsl:template> | </xsl:template> | ||||
| <xsl:template match="@*|node()"> | <xsl:template match="@*|node()"> | ||||
| @@ -3,7 +3,7 @@ | |||||
| <types> | <types> | ||||
| <!-- basic tasks/datatypes/coverters required in most environments --> | <!-- basic tasks/datatypes/coverters required in most environments --> | ||||
| <task name="echo" classname="org.apache.myrmidon.libs.core.Echo" /> | |||||
| <task name="log" classname="org.apache.myrmidon.libs.core.Log" /> | |||||
| <task name="property" classname="org.apache.myrmidon.libs.core.Property" /> | <task name="property" classname="org.apache.myrmidon.libs.core.Property" /> | ||||
| </types> | </types> | ||||