diff --git a/proposal/myrmidon/src/main/org/apache/tools/ant/Task.java b/proposal/myrmidon/src/main/org/apache/tools/ant/Task.java index 1ba3a1a9d..49304d5c6 100644 --- a/proposal/myrmidon/src/main/org/apache/tools/ant/Task.java +++ b/proposal/myrmidon/src/main/org/apache/tools/ant/Task.java @@ -26,16 +26,6 @@ public abstract class Task { } - /** - * Called by the project to let the task initialize properly. - * - * @throws TaskException if someting goes wrong with the build - */ - public void initialize() - throws TaskException - { - } - /** * Log a mesage with the give priority. * diff --git a/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/ANTLR.java b/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/ANTLR.java index cd3adc916..b050223f6 100644 --- a/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/ANTLR.java +++ b/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/ANTLR.java @@ -112,6 +112,10 @@ public class ANTLR extends Task public void execute() throws TaskException { + //Adds the jars or directories containing Antlr this should make the forked + //JVM work without having to specify it directly. + addClasspathEntry( "/antlr/Tool.class" ); + validateAttributes(); //TODO: use ANTLR to parse the grammer file to do this. @@ -140,18 +144,6 @@ public class ANTLR extends Task } } - /** - * Adds the jars or directories containing Antlr this should make the forked - * JVM work without having to specify it directly. - * - * @exception TaskException Description of Exception - */ - public void initialize() - throws TaskException - { - addClasspathEntry( "/antlr/Tool.class" ); - } - /** * Search for the given resource and add the directory or archive that * contains it to the classpath.

diff --git a/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java b/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java index 7d1c6901e..3c26e4211 100644 --- a/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java +++ b/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java @@ -379,6 +379,15 @@ public class JUnitTask extends Task public void execute() throws TaskException { + /* + * Adds the jars or directories containing Ant, this task and JUnit to the + * classpath - this should make the forked JVM work without having to + * specify them directly. + */ + addClasspathEntry( "/junit/framework/TestCase.class" ); + addClasspathEntry( "/org/apache/tools/ant/Task.class" ); + addClasspathEntry( "/org/apache/tools/ant/taskdefs/optional/junit/JUnitTestRunner.class" ); + Enumeration list = getIndividualTests(); while( list.hasMoreElements() ) { @@ -390,18 +399,6 @@ public class JUnitTask extends Task } } - /** - * Adds the jars or directories containing Ant, this task and JUnit to the - * classpath - this should make the forked JVM work without having to - * specify them directly. - */ - public void initialize() - { - addClasspathEntry( "/junit/framework/TestCase.class" ); - addClasspathEntry( "/org/apache/tools/ant/Task.class" ); - addClasspathEntry( "/org/apache/tools/ant/taskdefs/optional/junit/JUnitTestRunner.class" ); - } - /** * Get the default output for a formatter. * diff --git a/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/perforce/P4Base.java b/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/perforce/P4Base.java index 509c7bc65..e9bb2ac32 100644 --- a/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/perforce/P4Base.java +++ b/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/perforce/P4Base.java @@ -93,9 +93,8 @@ public abstract class P4Base extends org.apache.tools.ant.Task this.P4View = P4View; } - public void initialize() + private void prepare() { - util = new Perl5Util(); //Get default P4 settings from environment - Mark would have done something cool with @@ -115,6 +114,14 @@ public abstract class P4Base extends org.apache.tools.ant.Task execP4Command( command, null ); } + public void execute() + throws TaskException + { + //Setup task before executing it + prepare(); + super.execute(); + } + /** * Execute P4 command assembled by subclasses. * diff --git a/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/sound/SoundTask.java b/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/sound/SoundTask.java index a4ae5024d..77214fd3f 100644 --- a/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/sound/SoundTask.java +++ b/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/sound/SoundTask.java @@ -79,15 +79,9 @@ public class SoundTask extends Task } - public void initialize() - { - } - /** * A class to be extended by any BuildAlert's that require the output of * sound. - * - * @author RT */ public class BuildAlert { diff --git a/proposal/myrmidon/src/todo/org/apache/tools/ant/Task.java b/proposal/myrmidon/src/todo/org/apache/tools/ant/Task.java index 1ba3a1a9d..49304d5c6 100644 --- a/proposal/myrmidon/src/todo/org/apache/tools/ant/Task.java +++ b/proposal/myrmidon/src/todo/org/apache/tools/ant/Task.java @@ -26,16 +26,6 @@ public abstract class Task { } - /** - * Called by the project to let the task initialize properly. - * - * @throws TaskException if someting goes wrong with the build - */ - public void initialize() - throws TaskException - { - } - /** * Log a mesage with the give priority. * diff --git a/proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/optional/ANTLR.java b/proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/optional/ANTLR.java index cd3adc916..b050223f6 100644 --- a/proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/optional/ANTLR.java +++ b/proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/optional/ANTLR.java @@ -112,6 +112,10 @@ public class ANTLR extends Task public void execute() throws TaskException { + //Adds the jars or directories containing Antlr this should make the forked + //JVM work without having to specify it directly. + addClasspathEntry( "/antlr/Tool.class" ); + validateAttributes(); //TODO: use ANTLR to parse the grammer file to do this. @@ -140,18 +144,6 @@ public class ANTLR extends Task } } - /** - * Adds the jars or directories containing Antlr this should make the forked - * JVM work without having to specify it directly. - * - * @exception TaskException Description of Exception - */ - public void initialize() - throws TaskException - { - addClasspathEntry( "/antlr/Tool.class" ); - } - /** * Search for the given resource and add the directory or archive that * contains it to the classpath.

diff --git a/proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java b/proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java index 7d1c6901e..3c26e4211 100644 --- a/proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java +++ b/proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java @@ -379,6 +379,15 @@ public class JUnitTask extends Task public void execute() throws TaskException { + /* + * Adds the jars or directories containing Ant, this task and JUnit to the + * classpath - this should make the forked JVM work without having to + * specify them directly. + */ + addClasspathEntry( "/junit/framework/TestCase.class" ); + addClasspathEntry( "/org/apache/tools/ant/Task.class" ); + addClasspathEntry( "/org/apache/tools/ant/taskdefs/optional/junit/JUnitTestRunner.class" ); + Enumeration list = getIndividualTests(); while( list.hasMoreElements() ) { @@ -390,18 +399,6 @@ public class JUnitTask extends Task } } - /** - * Adds the jars or directories containing Ant, this task and JUnit to the - * classpath - this should make the forked JVM work without having to - * specify them directly. - */ - public void initialize() - { - addClasspathEntry( "/junit/framework/TestCase.class" ); - addClasspathEntry( "/org/apache/tools/ant/Task.class" ); - addClasspathEntry( "/org/apache/tools/ant/taskdefs/optional/junit/JUnitTestRunner.class" ); - } - /** * Get the default output for a formatter. * diff --git a/proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/optional/perforce/P4Base.java b/proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/optional/perforce/P4Base.java index 509c7bc65..e9bb2ac32 100644 --- a/proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/optional/perforce/P4Base.java +++ b/proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/optional/perforce/P4Base.java @@ -93,9 +93,8 @@ public abstract class P4Base extends org.apache.tools.ant.Task this.P4View = P4View; } - public void initialize() + private void prepare() { - util = new Perl5Util(); //Get default P4 settings from environment - Mark would have done something cool with @@ -115,6 +114,14 @@ public abstract class P4Base extends org.apache.tools.ant.Task execP4Command( command, null ); } + public void execute() + throws TaskException + { + //Setup task before executing it + prepare(); + super.execute(); + } + /** * Execute P4 command assembled by subclasses. * diff --git a/proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/optional/sound/SoundTask.java b/proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/optional/sound/SoundTask.java index a4ae5024d..77214fd3f 100644 --- a/proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/optional/sound/SoundTask.java +++ b/proposal/myrmidon/src/todo/org/apache/tools/ant/taskdefs/optional/sound/SoundTask.java @@ -79,15 +79,9 @@ public class SoundTask extends Task } - public void initialize() - { - } - /** * A class to be extended by any BuildAlert's that require the output of * sound. - * - * @author RT */ public class BuildAlert {