git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@270336 13f79535-47bb-0310-9956-ffa450edef68master
| @@ -16,7 +16,7 @@ import org.apache.tools.ant.PathTokenizer; | |||||
| import org.apache.tools.ant.Project; | import org.apache.tools.ant.Project; | ||||
| import org.apache.tools.ant.Task; | import org.apache.tools.ant.Task; | ||||
| import org.apache.tools.ant.taskdefs.exec.Execute; | import org.apache.tools.ant.taskdefs.exec.Execute; | ||||
| import org.apache.tools.ant.taskdefs.exec.ExecuteWatchdog; | |||||
| import org.apache.myrmidon.framework.exec.ExecuteWatchdog; | |||||
| import org.apache.tools.ant.taskdefs.exec.LogStreamHandler; | import org.apache.tools.ant.taskdefs.exec.LogStreamHandler; | ||||
| import org.apache.tools.ant.types.Commandline; | import org.apache.tools.ant.types.Commandline; | ||||
| import org.apache.tools.ant.types.CommandlineJava; | import org.apache.tools.ant.types.CommandlineJava; | ||||
| @@ -265,14 +265,7 @@ public class JDependTask extends Task | |||||
| } | } | ||||
| else | else | ||||
| { | { | ||||
| ExecuteWatchdog watchdog = createWatchdog(); | |||||
| exitValue = executeAsForked( commandline, watchdog ); | |||||
| // null watchdog means no timeout, you'd better not check with null | |||||
| if( watchdog != null ) | |||||
| { | |||||
| //info will be used in later version do nothing for now | |||||
| //wasKilled = watchdog.killedProcess(); | |||||
| } | |||||
| exitValue = executeAsForked( commandline ); | |||||
| } | } | ||||
| // if there is an error/failure and that it should halt, stop everything otherwise | // if there is an error/failure and that it should halt, stop everything otherwise | ||||
| @@ -302,7 +295,7 @@ public class JDependTask extends Task | |||||
| * @exception TaskException Description of Exception | * @exception TaskException Description of Exception | ||||
| */ | */ | ||||
| // JL: comment extracted from JUnitTask (and slightly modified) | // JL: comment extracted from JUnitTask (and slightly modified) | ||||
| public int executeAsForked( CommandlineJava commandline, ExecuteWatchdog watchdog ) | |||||
| public int executeAsForked( CommandlineJava commandline ) | |||||
| throws TaskException | throws TaskException | ||||
| { | { | ||||
| // if not set, auto-create the ClassPath from the project | // if not set, auto-create the ClassPath from the project | ||||
| @@ -336,7 +329,8 @@ public class JDependTask extends Task | |||||
| commandline.createArgument().setValue( f.getPath() ); | commandline.createArgument().setValue( f.getPath() ); | ||||
| } | } | ||||
| Execute execute = new Execute( new LogStreamHandler( this, Project.MSG_INFO, Project.MSG_WARN ), watchdog ); | |||||
| Execute execute = | |||||
| new Execute( new LogStreamHandler( this, Project.MSG_INFO, Project.MSG_WARN ) ); | |||||
| execute.setCommandline( commandline.getCommandline() ); | execute.setCommandline( commandline.getCommandline() ); | ||||
| if( getDir() != null ) | if( getDir() != null ) | ||||
| { | { | ||||
| @@ -423,24 +417,6 @@ public class JDependTask extends Task | |||||
| return SUCCESS; | return SUCCESS; | ||||
| } | } | ||||
| /** | |||||
| * @return <tt>null</tt> if there is a timeout value, otherwise the watchdog | |||||
| * instance. | |||||
| * @exception TaskException Description of Exception | |||||
| */ | |||||
| protected ExecuteWatchdog createWatchdog() | |||||
| throws TaskException | |||||
| { | |||||
| return null; | |||||
| /* | |||||
| * if (getTimeout() == null){ | |||||
| * return null; | |||||
| * } | |||||
| * return new ExecuteWatchdog(getTimeout().intValue()); | |||||
| */ | |||||
| } | |||||
| public static class FormatAttribute extends EnumeratedAttribute | public static class FormatAttribute extends EnumeratedAttribute | ||||
| { | { | ||||
| private String[] formats = new String[]{"xml", "text"}; | private String[] formats = new String[]{"xml", "text"}; | ||||
| @@ -16,7 +16,7 @@ import org.apache.tools.ant.PathTokenizer; | |||||
| import org.apache.tools.ant.Project; | import org.apache.tools.ant.Project; | ||||
| import org.apache.tools.ant.Task; | import org.apache.tools.ant.Task; | ||||
| import org.apache.tools.ant.taskdefs.exec.Execute; | import org.apache.tools.ant.taskdefs.exec.Execute; | ||||
| import org.apache.tools.ant.taskdefs.exec.ExecuteWatchdog; | |||||
| import org.apache.myrmidon.framework.exec.ExecuteWatchdog; | |||||
| import org.apache.tools.ant.taskdefs.exec.LogStreamHandler; | import org.apache.tools.ant.taskdefs.exec.LogStreamHandler; | ||||
| import org.apache.tools.ant.types.Commandline; | import org.apache.tools.ant.types.Commandline; | ||||
| import org.apache.tools.ant.types.CommandlineJava; | import org.apache.tools.ant.types.CommandlineJava; | ||||
| @@ -265,14 +265,7 @@ public class JDependTask extends Task | |||||
| } | } | ||||
| else | else | ||||
| { | { | ||||
| ExecuteWatchdog watchdog = createWatchdog(); | |||||
| exitValue = executeAsForked( commandline, watchdog ); | |||||
| // null watchdog means no timeout, you'd better not check with null | |||||
| if( watchdog != null ) | |||||
| { | |||||
| //info will be used in later version do nothing for now | |||||
| //wasKilled = watchdog.killedProcess(); | |||||
| } | |||||
| exitValue = executeAsForked( commandline ); | |||||
| } | } | ||||
| // if there is an error/failure and that it should halt, stop everything otherwise | // if there is an error/failure and that it should halt, stop everything otherwise | ||||
| @@ -302,7 +295,7 @@ public class JDependTask extends Task | |||||
| * @exception TaskException Description of Exception | * @exception TaskException Description of Exception | ||||
| */ | */ | ||||
| // JL: comment extracted from JUnitTask (and slightly modified) | // JL: comment extracted from JUnitTask (and slightly modified) | ||||
| public int executeAsForked( CommandlineJava commandline, ExecuteWatchdog watchdog ) | |||||
| public int executeAsForked( CommandlineJava commandline ) | |||||
| throws TaskException | throws TaskException | ||||
| { | { | ||||
| // if not set, auto-create the ClassPath from the project | // if not set, auto-create the ClassPath from the project | ||||
| @@ -336,7 +329,8 @@ public class JDependTask extends Task | |||||
| commandline.createArgument().setValue( f.getPath() ); | commandline.createArgument().setValue( f.getPath() ); | ||||
| } | } | ||||
| Execute execute = new Execute( new LogStreamHandler( this, Project.MSG_INFO, Project.MSG_WARN ), watchdog ); | |||||
| Execute execute = | |||||
| new Execute( new LogStreamHandler( this, Project.MSG_INFO, Project.MSG_WARN ) ); | |||||
| execute.setCommandline( commandline.getCommandline() ); | execute.setCommandline( commandline.getCommandline() ); | ||||
| if( getDir() != null ) | if( getDir() != null ) | ||||
| { | { | ||||
| @@ -423,24 +417,6 @@ public class JDependTask extends Task | |||||
| return SUCCESS; | return SUCCESS; | ||||
| } | } | ||||
| /** | |||||
| * @return <tt>null</tt> if there is a timeout value, otherwise the watchdog | |||||
| * instance. | |||||
| * @exception TaskException Description of Exception | |||||
| */ | |||||
| protected ExecuteWatchdog createWatchdog() | |||||
| throws TaskException | |||||
| { | |||||
| return null; | |||||
| /* | |||||
| * if (getTimeout() == null){ | |||||
| * return null; | |||||
| * } | |||||
| * return new ExecuteWatchdog(getTimeout().intValue()); | |||||
| */ | |||||
| } | |||||
| public static class FormatAttribute extends EnumeratedAttribute | public static class FormatAttribute extends EnumeratedAttribute | ||||
| { | { | ||||
| private String[] formats = new String[]{"xml", "text"}; | private String[] formats = new String[]{"xml", "text"}; | ||||