donaldp 01/12/15 21:51:13
Modified: proposal/myrmidon/src/main/org/apache/tools/ant Task.java
proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional
ANTLR.java
proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/junit
JUnitTask.java
proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/perforce
P4Base.java
proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/sound
SoundTask.java
Log:
No need for there to be a initialize method.
Now that tasks are initialized and executed in one sweep initialize functions
could just be done at the start of an execute call.
Revision Changes Path
1.15 +0 -10
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/Task.java
Index: Task.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/Task.java,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- Task.java 2001/12/16 05:45:59 1.14
+++ Task.java 2001/12/16 05:51:12 1.15
@@ -27,16 +27,6 @@
}
/**
- * 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.
*
* @param msgLevel the message priority at which this message is to be
1.5 +4 -12
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/ANTLR.java
Index: ANTLR.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/ANTLR.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- ANTLR.java 2001/12/16 05:45:59 1.4
+++ ANTLR.java 2001/12/16 05:51:12 1.5
@@ -112,6 +112,10 @@
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.
@@ -138,18 +142,6 @@
exe.execute( project );
}
}
- }
-
- /**
- * 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" );
}
/**
1.5 +9 -12
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java
Index: JUnitTask.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/junit/JUnitTask.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- JUnitTask.java 2001/12/16 05:45:59 1.4
+++ JUnitTask.java 2001/12/16 05:51:12 1.5
@@ -379,6 +379,15 @@
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() )
{
@@ -388,18 +397,6 @@
execute( test );
}
}
- }
-
- /**
- * 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" );
}
/**
1.5 +9 -2
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/perforce/P4Base.java
Index: P4Base.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/perforce/P4Base.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- P4Base.java 2001/12/16 05:45:59 1.4
+++ P4Base.java 2001/12/16 05:51:12 1.5
@@ -93,9 +93,8 @@
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
@@ -113,6 +112,14 @@
throws TaskException
{
execP4Command( command, null );
+ }
+
+ public void execute()
+ throws TaskException
+ {
+ //Setup task before executing it
+ prepare();
+ super.execute();
}
/**
1.4 +1 -7
jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/sound/SoundTask.java
Index: SoundTask.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/proposal/myrmidon/src/main/org/apache/tools/ant/taskdefs/optional/sound/SoundTask.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- SoundTask.java 2001/12/16 05:45:59 1.3
+++ SoundTask.java 2001/12/16 05:51:13 1.4
@@ -25,7 +25,7 @@
* in xml and have Ant play them back
*
* @author Nick Pellow
- * @version $Revision: 1.3 $, $Date: 2001/12/16 05:45:59 $
+ * @version $Revision: 1.4 $, $Date: 2001/12/16 05:51:13 $
*/
public class SoundTask extends Task
@@ -79,15 +79,9 @@
}
- public void initialize()
- {
- }
-
/**
* A class to be extended by any BuildAlert's that require the output of
* sound.
- *
- * @author RT
*/
public class BuildAlert
{
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>