native execution environment loading os detection into a new hierarchy aut. AUT basically being completely independent of Ant. git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@270681 13f79535-47bb-0310-9956-ffa450edef68master
| @@ -14,8 +14,8 @@ import org.apache.avalon.excalibur.i18n.ResourceManager; | |||||
| import org.apache.avalon.excalibur.i18n.Resources; | import org.apache.avalon.excalibur.i18n.Resources; | ||||
| import org.apache.myrmidon.api.AbstractTask; | import org.apache.myrmidon.api.AbstractTask; | ||||
| import org.apache.myrmidon.api.TaskException; | import org.apache.myrmidon.api.TaskException; | ||||
| import org.apache.myrmidon.framework.exec.Environment; | |||||
| import org.apache.myrmidon.framework.exec.ExecException; | |||||
| import org.apache.aut.nativelib.Environment; | |||||
| import org.apache.aut.nativelib.ExecException; | |||||
| /** | /** | ||||
| * This task is responsible for loading that OS-specific environment | * This task is responsible for loading that OS-specific environment | ||||
| @@ -5,7 +5,7 @@ | |||||
| * version 1.1, a copy of which has been included with this distribution in | * version 1.1, a copy of which has been included with this distribution in | ||||
| * the LICENSE.txt file. | * the LICENSE.txt file. | ||||
| */ | */ | ||||
| package org.apache.myrmidon.framework.exec; | |||||
| package org.apache.aut.nativelib; | |||||
| import java.io.IOException; | import java.io.IOException; | ||||
| @@ -5,7 +5,7 @@ | |||||
| * version 1.1, a copy of which has been included with this distribution in | * version 1.1, a copy of which has been included with this distribution in | ||||
| * the LICENSE.txt file. | * the LICENSE.txt file. | ||||
| */ | */ | ||||
| package org.apache.myrmidon.framework.exec; | |||||
| package org.apache.aut.nativelib; | |||||
| import org.apache.avalon.framework.logger.AbstractLogEnabled; | import org.apache.avalon.framework.logger.AbstractLogEnabled; | ||||
| @@ -5,7 +5,7 @@ | |||||
| * version 1.1, a copy of which has been included with this distribution in | * version 1.1, a copy of which has been included with this distribution in | ||||
| * the LICENSE.txt file. | * the LICENSE.txt file. | ||||
| */ | */ | ||||
| package org.apache.myrmidon.framework.exec; | |||||
| package org.apache.aut.nativelib; | |||||
| import java.io.BufferedReader; | import java.io.BufferedReader; | ||||
| import java.io.ByteArrayOutputStream; | import java.io.ByteArrayOutputStream; | ||||
| @@ -16,7 +16,6 @@ import java.util.Locale; | |||||
| import java.util.Properties; | import java.util.Properties; | ||||
| import org.apache.avalon.excalibur.util.StringUtil; | import org.apache.avalon.excalibur.util.StringUtil; | ||||
| import org.apache.myrmidon.api.TaskException; | import org.apache.myrmidon.api.TaskException; | ||||
| import org.apache.myrmidon.framework.Os; | |||||
| import org.apache.tools.ant.taskdefs.exec.Execute; | import org.apache.tools.ant.taskdefs.exec.Execute; | ||||
| /** | /** | ||||
| @@ -5,7 +5,7 @@ | |||||
| * version 1.1, a copy of which has been included with this distribution in | * version 1.1, a copy of which has been included with this distribution in | ||||
| * the LICENSE.txt file. | * the LICENSE.txt file. | ||||
| */ | */ | ||||
| package org.apache.myrmidon.framework.exec; | |||||
| package org.apache.aut.nativelib; | |||||
| import org.apache.avalon.framework.CascadingException; | import org.apache.avalon.framework.CascadingException; | ||||
| @@ -5,7 +5,7 @@ | |||||
| * version 1.1, a copy of which has been included with this distribution in | * version 1.1, a copy of which has been included with this distribution in | ||||
| * the LICENSE.txt file. | * the LICENSE.txt file. | ||||
| */ | */ | ||||
| package org.apache.myrmidon.framework.exec; | |||||
| package org.apache.aut.nativelib; | |||||
| import java.io.IOException; | import java.io.IOException; | ||||
| import java.io.InputStream; | import java.io.InputStream; | ||||
| @@ -5,7 +5,7 @@ | |||||
| * version 1.1, a copy of which has been included with this distribution in | * version 1.1, a copy of which has been included with this distribution in | ||||
| * the LICENSE.txt file. | * the LICENSE.txt file. | ||||
| */ | */ | ||||
| package org.apache.myrmidon.framework.exec; | |||||
| package org.apache.aut.nativelib; | |||||
| import java.io.File; | import java.io.File; | ||||
| import java.util.Properties; | import java.util.Properties; | ||||
| @@ -5,7 +5,7 @@ | |||||
| * version 1.1, a copy of which has been included with this distribution in | * version 1.1, a copy of which has been included with this distribution in | ||||
| * the LICENSE.txt file. | * the LICENSE.txt file. | ||||
| */ | */ | ||||
| package org.apache.myrmidon.framework.exec; | |||||
| package org.apache.aut.nativelib; | |||||
| /** | /** | ||||
| * This class is used to receive notifications of what the native | * This class is used to receive notifications of what the native | ||||
| @@ -5,7 +5,7 @@ | |||||
| * version 1.1, a copy of which has been included with this distribution in | * version 1.1, a copy of which has been included with this distribution in | ||||
| * the LICENSE.txt file. | * the LICENSE.txt file. | ||||
| */ | */ | ||||
| package org.apache.myrmidon.framework; | |||||
| package org.apache.aut.nativelib; | |||||
| import java.util.Locale; | import java.util.Locale; | ||||
| import org.apache.avalon.excalibur.i18n.ResourceManager; | import org.apache.avalon.excalibur.i18n.ResourceManager; | ||||
| @@ -32,18 +32,20 @@ public class Os | |||||
| private final static String PATH_SEP = | private final static String PATH_SEP = | ||||
| System.getProperty( "path.separator" ); | System.getProperty( "path.separator" ); | ||||
| private String m_arch; | |||||
| private String m_family; | |||||
| private String m_name; | |||||
| private String m_version; | |||||
| public Os() | |||||
| /** | |||||
| * Private constructor to block instantiation. | |||||
| */ | |||||
| private Os() | |||||
| { | { | ||||
| } | } | ||||
| public Os( final String family ) | |||||
| /** | |||||
| * Determines if the OS on which Ant is executing matches the given OS | |||||
| * version. | |||||
| */ | |||||
| public static boolean isVersion( final String version ) | |||||
| { | { | ||||
| setFamily( family ); | |||||
| return isOs( null, null, null, version ); | |||||
| } | } | ||||
| /** | /** | ||||
| @@ -93,10 +95,10 @@ public class Os | |||||
| * @param version The OS version | * @param version The OS version | ||||
| * @return The Os value | * @return The Os value | ||||
| */ | */ | ||||
| private static boolean isOs( final String family, | |||||
| final String name, | |||||
| final String arch, | |||||
| final String version ) | |||||
| public static boolean isOs( final String family, | |||||
| final String name, | |||||
| final String arch, | |||||
| final String version ) | |||||
| { | { | ||||
| if( family != null || name != null || arch != null || version != null ) | if( family != null || name != null || arch != null || version != null ) | ||||
| { | { | ||||
| @@ -181,74 +183,4 @@ public class Os | |||||
| } | } | ||||
| return isFamily; | return isFamily; | ||||
| } | } | ||||
| /** | |||||
| * Determines if the OS on which Ant is executing matches the given OS | |||||
| * version. | |||||
| */ | |||||
| public static boolean isVersion( final String version ) | |||||
| { | |||||
| return isOs( null, null, null, version ); | |||||
| } | |||||
| /** | |||||
| * Sets the desired OS architecture | |||||
| * | |||||
| * @param arch The OS architecture | |||||
| */ | |||||
| public void setArch( final String arch ) | |||||
| { | |||||
| m_arch = arch.toLowerCase( Locale.US ); | |||||
| } | |||||
| /** | |||||
| * Sets the desired OS family type | |||||
| * | |||||
| * @param f The OS family type desired<br /> | |||||
| * Possible values:<br /> | |||||
| * | |||||
| * <ul> | |||||
| * <li> dos</li> | |||||
| * <li> mac</li> | |||||
| * <li> netware</li> | |||||
| * <li> os/2</li> | |||||
| * <li> unix</li> | |||||
| * <li> windows</li> | |||||
| * </ul> | |||||
| */ | |||||
| public void setFamily( String f ) | |||||
| { | |||||
| m_family = f.toLowerCase( Locale.US ); | |||||
| } | |||||
| /** | |||||
| * Sets the desired OS name | |||||
| * | |||||
| * @param name The OS name | |||||
| */ | |||||
| public void setName( String name ) | |||||
| { | |||||
| m_name = name.toLowerCase( Locale.US ); | |||||
| } | |||||
| /** | |||||
| * Sets the desired OS version | |||||
| * | |||||
| * @param version The OS version | |||||
| */ | |||||
| public void setVersion( String version ) | |||||
| { | |||||
| m_version = version.toLowerCase( Locale.US ); | |||||
| } | |||||
| /** | |||||
| * Determines if the OS on which Ant is executing matches the type of that | |||||
| * set in setFamily. | |||||
| * | |||||
| * @see Os#setFamily(String) | |||||
| */ | |||||
| public boolean eval() | |||||
| { | |||||
| return isOs( m_family, m_name, m_arch, m_version ); | |||||
| } | |||||
| } | } | ||||
| @@ -5,7 +5,7 @@ | |||||
| * version 1.1, a copy of which has been included with this distribution in | * version 1.1, a copy of which has been included with this distribution in | ||||
| * the LICENSE.txt file. | * the LICENSE.txt file. | ||||
| */ | */ | ||||
| package org.apache.myrmidon.framework.exec.impl; | |||||
| package org.apache.aut.nativelib.impl; | |||||
| import java.io.File; | import java.io.File; | ||||
| import java.io.IOException; | import java.io.IOException; | ||||
| @@ -13,16 +13,16 @@ import java.io.InputStream; | |||||
| import java.io.OutputStream; | import java.io.OutputStream; | ||||
| import java.util.Locale; | import java.util.Locale; | ||||
| import org.apache.avalon.excalibur.io.FileUtil; | import org.apache.avalon.excalibur.io.FileUtil; | ||||
| import org.apache.myrmidon.framework.Os; | |||||
| import org.apache.myrmidon.framework.exec.CommandLauncher; | |||||
| import org.apache.myrmidon.framework.exec.ExecException; | |||||
| import org.apache.myrmidon.framework.exec.ExecManager; | |||||
| import org.apache.myrmidon.framework.exec.ExecMetaData; | |||||
| import org.apache.myrmidon.framework.exec.ExecOutputHandler; | |||||
| import org.apache.myrmidon.framework.exec.launchers.DefaultCommandLauncher; | |||||
| import org.apache.myrmidon.framework.exec.launchers.MacCommandLauncher; | |||||
| import org.apache.myrmidon.framework.exec.launchers.ScriptCommandLauncher; | |||||
| import org.apache.myrmidon.framework.exec.launchers.WinNTCommandLauncher; | |||||
| import org.apache.aut.nativelib.Os; | |||||
| import org.apache.aut.nativelib.CommandLauncher; | |||||
| import org.apache.aut.nativelib.ExecException; | |||||
| import org.apache.aut.nativelib.ExecManager; | |||||
| import org.apache.aut.nativelib.ExecMetaData; | |||||
| import org.apache.aut.nativelib.ExecOutputHandler; | |||||
| import org.apache.aut.nativelib.launchers.DefaultCommandLauncher; | |||||
| import org.apache.aut.nativelib.launchers.MacCommandLauncher; | |||||
| import org.apache.aut.nativelib.launchers.ScriptCommandLauncher; | |||||
| import org.apache.aut.nativelib.launchers.WinNTCommandLauncher; | |||||
| /** | /** | ||||
| * Default implementation of <code>ExecManager</code>. | * Default implementation of <code>ExecManager</code>. | ||||
| @@ -5,12 +5,12 @@ | |||||
| * version 1.1, a copy of which has been included with this distribution in | * version 1.1, a copy of which has been included with this distribution in | ||||
| * the LICENSE.txt file. | * the LICENSE.txt file. | ||||
| */ | */ | ||||
| package org.apache.myrmidon.framework.exec.impl; | |||||
| package org.apache.aut.nativelib.impl; | |||||
| import java.io.ByteArrayOutputStream; | import java.io.ByteArrayOutputStream; | ||||
| import java.io.IOException; | import java.io.IOException; | ||||
| import java.io.OutputStream; | import java.io.OutputStream; | ||||
| import org.apache.myrmidon.framework.exec.ExecOutputHandler; | |||||
| import org.apache.aut.nativelib.ExecOutputHandler; | |||||
| import org.apache.avalon.framework.logger.Logger; | import org.apache.avalon.framework.logger.Logger; | ||||
| /** | /** | ||||
| @@ -5,7 +5,7 @@ | |||||
| * version 1.1, a copy of which has been included with this distribution in | * version 1.1, a copy of which has been included with this distribution in | ||||
| * the LICENSE.txt file. | * the LICENSE.txt file. | ||||
| */ | */ | ||||
| package org.apache.myrmidon.framework.exec.impl; | |||||
| package org.apache.aut.nativelib.impl; | |||||
| import java.lang.reflect.Method; | import java.lang.reflect.Method; | ||||
| import java.util.ArrayList; | import java.util.ArrayList; | ||||
| @@ -5,7 +5,7 @@ | |||||
| * version 1.1, a copy of which has been included with this distribution in | * version 1.1, a copy of which has been included with this distribution in | ||||
| * the LICENSE.txt file. | * the LICENSE.txt file. | ||||
| */ | */ | ||||
| package org.apache.myrmidon.framework.exec.impl; | |||||
| package org.apache.aut.nativelib.impl; | |||||
| import java.io.IOException; | import java.io.IOException; | ||||
| import java.io.InputStream; | import java.io.InputStream; | ||||
| @@ -5,7 +5,7 @@ | |||||
| * version 1.1, a copy of which has been included with this distribution in | * version 1.1, a copy of which has been included with this distribution in | ||||
| * the LICENSE.txt file. | * the LICENSE.txt file. | ||||
| */ | */ | ||||
| package org.apache.myrmidon.framework.exec.launchers; | |||||
| package org.apache.aut.nativelib.launchers; | |||||
| import java.io.File; | import java.io.File; | ||||
| import java.io.IOException; | import java.io.IOException; | ||||
| @@ -14,10 +14,10 @@ import java.lang.reflect.Method; | |||||
| import java.util.Properties; | import java.util.Properties; | ||||
| import org.apache.avalon.excalibur.i18n.ResourceManager; | import org.apache.avalon.excalibur.i18n.ResourceManager; | ||||
| import org.apache.avalon.excalibur.i18n.Resources; | import org.apache.avalon.excalibur.i18n.Resources; | ||||
| import org.apache.myrmidon.framework.exec.CommandLauncher; | |||||
| import org.apache.myrmidon.framework.exec.Environment; | |||||
| import org.apache.myrmidon.framework.exec.ExecException; | |||||
| import org.apache.myrmidon.framework.exec.ExecMetaData; | |||||
| import org.apache.aut.nativelib.CommandLauncher; | |||||
| import org.apache.aut.nativelib.Environment; | |||||
| import org.apache.aut.nativelib.ExecException; | |||||
| import org.apache.aut.nativelib.ExecMetaData; | |||||
| /** | /** | ||||
| * A command launcher for a particular JVM/OS platform. This class is a | * A command launcher for a particular JVM/OS platform. This class is a | ||||
| @@ -5,16 +5,16 @@ | |||||
| * version 1.1, a copy of which has been included with this distribution in | * version 1.1, a copy of which has been included with this distribution in | ||||
| * the LICENSE.txt file. | * the LICENSE.txt file. | ||||
| */ | */ | ||||
| package org.apache.myrmidon.framework.exec.launchers; | |||||
| package org.apache.aut.nativelib.launchers; | |||||
| import java.io.File; | import java.io.File; | ||||
| import java.io.IOException; | import java.io.IOException; | ||||
| import java.util.ArrayList; | import java.util.ArrayList; | ||||
| import java.util.Iterator; | import java.util.Iterator; | ||||
| import java.util.Properties; | import java.util.Properties; | ||||
| import org.apache.myrmidon.framework.exec.Environment; | |||||
| import org.apache.myrmidon.framework.exec.ExecException; | |||||
| import org.apache.myrmidon.framework.exec.ExecMetaData; | |||||
| import org.apache.aut.nativelib.Environment; | |||||
| import org.apache.aut.nativelib.ExecException; | |||||
| import org.apache.aut.nativelib.ExecMetaData; | |||||
| /** | /** | ||||
| * A set of utility functions useful when writing CommandLaunchers. | * A set of utility functions useful when writing CommandLaunchers. | ||||
| @@ -5,13 +5,13 @@ | |||||
| * version 1.1, a copy of which has been included with this distribution in | * version 1.1, a copy of which has been included with this distribution in | ||||
| * the LICENSE.txt file. | * the LICENSE.txt file. | ||||
| */ | */ | ||||
| package org.apache.myrmidon.framework.exec.launchers; | |||||
| package org.apache.aut.nativelib.launchers; | |||||
| import java.io.File; | import java.io.File; | ||||
| import java.io.IOException; | import java.io.IOException; | ||||
| import org.apache.myrmidon.framework.exec.CommandLauncher; | |||||
| import org.apache.myrmidon.framework.exec.ExecException; | |||||
| import org.apache.myrmidon.framework.exec.ExecMetaData; | |||||
| import org.apache.aut.nativelib.CommandLauncher; | |||||
| import org.apache.aut.nativelib.ExecException; | |||||
| import org.apache.aut.nativelib.ExecMetaData; | |||||
| /** | /** | ||||
| * A command launcher for Mac that uses a dodgy mechanism to change working | * A command launcher for Mac that uses a dodgy mechanism to change working | ||||
| @@ -5,12 +5,12 @@ | |||||
| * version 1.1, a copy of which has been included with this distribution in | * version 1.1, a copy of which has been included with this distribution in | ||||
| * the LICENSE.txt file. | * the LICENSE.txt file. | ||||
| */ | */ | ||||
| package org.apache.myrmidon.framework.exec.launchers; | |||||
| package org.apache.aut.nativelib.launchers; | |||||
| import java.io.IOException; | import java.io.IOException; | ||||
| import org.apache.myrmidon.framework.exec.CommandLauncher; | |||||
| import org.apache.myrmidon.framework.exec.ExecException; | |||||
| import org.apache.myrmidon.framework.exec.ExecMetaData; | |||||
| import org.apache.aut.nativelib.CommandLauncher; | |||||
| import org.apache.aut.nativelib.ExecException; | |||||
| import org.apache.aut.nativelib.ExecMetaData; | |||||
| /** | /** | ||||
| * A command launcher that uses an auxiliary script to launch commands in | * A command launcher that uses an auxiliary script to launch commands in | ||||
| @@ -5,12 +5,12 @@ | |||||
| * version 1.1, a copy of which has been included with this distribution in | * version 1.1, a copy of which has been included with this distribution in | ||||
| * the LICENSE.txt file. | * the LICENSE.txt file. | ||||
| */ | */ | ||||
| package org.apache.myrmidon.framework.exec.launchers; | |||||
| package org.apache.aut.nativelib.launchers; | |||||
| import java.io.IOException; | import java.io.IOException; | ||||
| import org.apache.myrmidon.framework.exec.CommandLauncher; | |||||
| import org.apache.myrmidon.framework.exec.ExecException; | |||||
| import org.apache.myrmidon.framework.exec.ExecMetaData; | |||||
| import org.apache.aut.nativelib.CommandLauncher; | |||||
| import org.apache.aut.nativelib.ExecException; | |||||
| import org.apache.aut.nativelib.ExecMetaData; | |||||
| /** | /** | ||||
| * A command launcher for Windows 2000/NT that uses 'cmd.exe' when launching | * A command launcher for Windows 2000/NT that uses 'cmd.exe' when launching | ||||
| @@ -12,7 +12,7 @@ import java.util.ArrayList; | |||||
| import java.util.Date; | import java.util.Date; | ||||
| import java.util.Iterator; | import java.util.Iterator; | ||||
| import org.apache.myrmidon.api.TaskException; | import org.apache.myrmidon.api.TaskException; | ||||
| import org.apache.myrmidon.framework.Os; | |||||
| import org.apache.aut.nativelib.Os; | |||||
| import org.apache.tools.ant.DirectoryScanner; | import org.apache.tools.ant.DirectoryScanner; | ||||
| import org.apache.tools.ant.types.FileList; | import org.apache.tools.ant.types.FileList; | ||||
| import org.apache.tools.ant.types.FileSet; | import org.apache.tools.ant.types.FileSet; | ||||
| @@ -12,7 +12,6 @@ import java.lang.reflect.Method; | |||||
| import java.net.URL; | import java.net.URL; | ||||
| import java.net.URLClassLoader; | import java.net.URLClassLoader; | ||||
| import org.apache.myrmidon.api.TaskException; | import org.apache.myrmidon.api.TaskException; | ||||
| import org.apache.tools.ant.Project; | |||||
| import org.apache.tools.ant.types.Commandline; | import org.apache.tools.ant.types.Commandline; | ||||
| import org.apache.tools.ant.types.Path; | import org.apache.tools.ant.types.Path; | ||||
| import org.apache.tools.ant.types.SysProperties; | import org.apache.tools.ant.types.SysProperties; | ||||
| @@ -43,11 +42,11 @@ public class ExecuteJava | |||||
| m_sysProperties = sysProperties; | m_sysProperties = sysProperties; | ||||
| } | } | ||||
| public void execute( Project project ) | |||||
| public void execute() | |||||
| throws TaskException | throws TaskException | ||||
| { | { | ||||
| final String classname = m_javaCommand.getExecutable(); | final String classname = m_javaCommand.getExecutable(); | ||||
| final Object[] argument = {m_javaCommand.getArguments()}; | |||||
| final Object[] argument = new Object[]{m_javaCommand.getArguments()}; | |||||
| try | try | ||||
| { | { | ||||
| @@ -31,7 +31,6 @@ import org.apache.tools.ant.util.SourceFileScanner; | |||||
| */ | */ | ||||
| public class ExecuteOn extends ExecTask | public class ExecuteOn extends ExecTask | ||||
| { | { | ||||
| protected ArrayList filesets = new ArrayList(); | protected ArrayList filesets = new ArrayList(); | ||||
| private boolean relative = false; | private boolean relative = false; | ||||
| private boolean parallel = false; | private boolean parallel = false; | ||||
| @@ -12,7 +12,7 @@ import java.util.ArrayList; | |||||
| import java.util.Iterator; | import java.util.Iterator; | ||||
| import org.apache.myrmidon.api.TaskException; | import org.apache.myrmidon.api.TaskException; | ||||
| import org.apache.myrmidon.framework.JavaVersion; | import org.apache.myrmidon.framework.JavaVersion; | ||||
| import org.apache.myrmidon.framework.Os; | |||||
| import org.apache.aut.nativelib.Os; | |||||
| import org.apache.tools.ant.DirectoryScanner; | import org.apache.tools.ant.DirectoryScanner; | ||||
| import org.apache.tools.ant.taskdefs.compilers.CompilerAdapter; | import org.apache.tools.ant.taskdefs.compilers.CompilerAdapter; | ||||
| import org.apache.tools.ant.taskdefs.compilers.CompilerAdapterFactory; | import org.apache.tools.ant.taskdefs.compilers.CompilerAdapterFactory; | ||||
| @@ -12,9 +12,9 @@ import java.io.IOException; | |||||
| import java.io.OutputStream; | import java.io.OutputStream; | ||||
| import java.util.Properties; | import java.util.Properties; | ||||
| import org.apache.myrmidon.api.TaskException; | import org.apache.myrmidon.api.TaskException; | ||||
| import org.apache.myrmidon.framework.exec.ExecException; | |||||
| import org.apache.myrmidon.framework.exec.ExecMetaData; | |||||
| import org.apache.myrmidon.framework.exec.impl.DefaultExecManager; | |||||
| import org.apache.aut.nativelib.ExecException; | |||||
| import org.apache.aut.nativelib.ExecMetaData; | |||||
| import org.apache.aut.nativelib.impl.DefaultExecManager; | |||||
| /** | /** | ||||
| * Runs an external program. | * Runs an external program. | ||||
| @@ -12,11 +12,11 @@ import java.io.IOException; | |||||
| import java.util.Properties; | import java.util.Properties; | ||||
| import org.apache.avalon.framework.logger.AbstractLogEnabled; | import org.apache.avalon.framework.logger.AbstractLogEnabled; | ||||
| import org.apache.myrmidon.api.TaskException; | import org.apache.myrmidon.api.TaskException; | ||||
| import org.apache.myrmidon.framework.exec.DefaultExecOutputHandler; | |||||
| import org.apache.myrmidon.framework.exec.ExecException; | |||||
| import org.apache.myrmidon.framework.exec.ExecMetaData; | |||||
| import org.apache.myrmidon.framework.exec.ExecOutputHandler; | |||||
| import org.apache.myrmidon.framework.exec.impl.DefaultExecManager; | |||||
| import org.apache.aut.nativelib.DefaultExecOutputHandler; | |||||
| import org.apache.aut.nativelib.ExecException; | |||||
| import org.apache.aut.nativelib.ExecMetaData; | |||||
| import org.apache.aut.nativelib.ExecOutputHandler; | |||||
| import org.apache.aut.nativelib.impl.DefaultExecManager; | |||||
| /** | /** | ||||
| * Runs an external program. | * Runs an external program. | ||||
| @@ -16,8 +16,8 @@ import java.util.ArrayList; | |||||
| import java.util.Iterator; | import java.util.Iterator; | ||||
| import java.util.StringTokenizer; | import java.util.StringTokenizer; | ||||
| import org.apache.myrmidon.api.TaskException; | import org.apache.myrmidon.api.TaskException; | ||||
| import org.apache.myrmidon.framework.Os; | |||||
| import org.apache.myrmidon.framework.exec.ExecOutputHandler; | |||||
| import org.apache.aut.nativelib.Os; | |||||
| import org.apache.aut.nativelib.ExecOutputHandler; | |||||
| import org.apache.tools.ant.DirectoryScanner; | import org.apache.tools.ant.DirectoryScanner; | ||||
| import org.apache.tools.ant.Task; | import org.apache.tools.ant.Task; | ||||
| import org.apache.tools.ant.taskdefs.exec.Execute2; | import org.apache.tools.ant.taskdefs.exec.Execute2; | ||||
| @@ -15,7 +15,7 @@ import java.io.PrintWriter; | |||||
| import java.util.ArrayList; | import java.util.ArrayList; | ||||
| import java.util.Iterator; | import java.util.Iterator; | ||||
| import org.apache.myrmidon.api.TaskException; | import org.apache.myrmidon.api.TaskException; | ||||
| import org.apache.myrmidon.framework.Os; | |||||
| import org.apache.aut.nativelib.Os; | |||||
| import org.apache.tools.ant.DirectoryScanner; | import org.apache.tools.ant.DirectoryScanner; | ||||
| import org.apache.tools.ant.taskdefs.MatchingTask; | import org.apache.tools.ant.taskdefs.MatchingTask; | ||||
| import org.apache.tools.ant.taskdefs.exec.ExecTask; | import org.apache.tools.ant.taskdefs.exec.ExecTask; | ||||
| @@ -8,7 +8,7 @@ | |||||
| package org.apache.tools.ant.taskdefs.optional.ccm; | package org.apache.tools.ant.taskdefs.optional.ccm; | ||||
| import org.apache.myrmidon.api.TaskException; | import org.apache.myrmidon.api.TaskException; | ||||
| import org.apache.myrmidon.framework.exec.ExecOutputHandler; | |||||
| import org.apache.aut.nativelib.ExecOutputHandler; | |||||
| import org.apache.tools.ant.types.Commandline; | import org.apache.tools.ant.types.Commandline; | ||||
| /** | /** | ||||
| @@ -11,7 +11,7 @@ import java.io.File; | |||||
| import java.io.IOException; | import java.io.IOException; | ||||
| import org.apache.myrmidon.api.AbstractTask; | import org.apache.myrmidon.api.AbstractTask; | ||||
| import org.apache.myrmidon.api.TaskException; | import org.apache.myrmidon.api.TaskException; | ||||
| import org.apache.myrmidon.framework.exec.ExecOutputHandler; | |||||
| import org.apache.aut.nativelib.ExecOutputHandler; | |||||
| import org.apache.tools.ant.taskdefs.exec.Execute2; | import org.apache.tools.ant.taskdefs.exec.Execute2; | ||||
| import org.apache.tools.ant.types.Commandline; | import org.apache.tools.ant.types.Commandline; | ||||
| @@ -20,7 +20,7 @@ import javax.xml.parsers.DocumentBuilderFactory; | |||||
| import javax.xml.parsers.ParserConfigurationException; | import javax.xml.parsers.ParserConfigurationException; | ||||
| import org.apache.avalon.framework.logger.AbstractLogEnabled; | import org.apache.avalon.framework.logger.AbstractLogEnabled; | ||||
| import org.apache.myrmidon.api.TaskException; | import org.apache.myrmidon.api.TaskException; | ||||
| import org.apache.myrmidon.framework.exec.ExecOutputHandler; | |||||
| import org.apache.aut.nativelib.ExecOutputHandler; | |||||
| import org.apache.tools.ant.taskdefs.exec.ExecuteStreamHandler; | import org.apache.tools.ant.taskdefs.exec.ExecuteStreamHandler; | ||||
| import org.apache.tools.ant.util.DOMElementWriter; | import org.apache.tools.ant.util.DOMElementWriter; | ||||
| import org.apache.tools.ant.util.regexp.RegexpMatcher; | import org.apache.tools.ant.util.regexp.RegexpMatcher; | ||||
| @@ -9,7 +9,7 @@ package org.apache.tools.ant.taskdefs.optional.perforce; | |||||
| import java.io.IOException; | import java.io.IOException; | ||||
| import org.apache.myrmidon.api.TaskException; | import org.apache.myrmidon.api.TaskException; | ||||
| import org.apache.myrmidon.framework.exec.ExecOutputHandler; | |||||
| import org.apache.aut.nativelib.ExecOutputHandler; | |||||
| import org.apache.oro.text.perl.Perl5Util; | import org.apache.oro.text.perl.Perl5Util; | ||||
| import org.apache.tools.ant.taskdefs.exec.Execute2; | import org.apache.tools.ant.taskdefs.exec.Execute2; | ||||
| import org.apache.tools.ant.types.Commandline; | import org.apache.tools.ant.types.Commandline; | ||||
| @@ -82,19 +82,19 @@ import org.apache.myrmidon.api.TaskException; | |||||
| * | * | ||||
| * @author <A HREF="mailto:leslie.hughes@rubus.com">Les Hughes</A> | * @author <A HREF="mailto:leslie.hughes@rubus.com">Les Hughes</A> | ||||
| */ | */ | ||||
| public class P4Sync extends P4Base | |||||
| public class P4Sync | |||||
| extends P4Base | |||||
| { | { | ||||
| private String m_syncCmd = ""; | private String m_syncCmd = ""; | ||||
| private String m_label; | private String m_label; | ||||
| public void setForce( final String force ) | |||||
| public void setForce( final boolean force ) | |||||
| throws TaskException | throws TaskException | ||||
| { | { | ||||
| if( force == null && !m_label.equals( "" ) ) | |||||
| if( force ) | |||||
| { | { | ||||
| throw new TaskException( "P4Sync: If you want to force, set force to non-null string!" ); | |||||
| m_p4CmdOpts = "-f"; | |||||
| } | } | ||||
| m_p4CmdOpts = "-f"; | |||||
| } | } | ||||
| public void setLabel( String label ) | public void setLabel( String label ) | ||||
| @@ -10,7 +10,7 @@ package org.apache.tools.ant.taskdefs.unix; | |||||
| import java.io.File; | import java.io.File; | ||||
| import java.io.IOException; | import java.io.IOException; | ||||
| import org.apache.myrmidon.api.TaskException; | import org.apache.myrmidon.api.TaskException; | ||||
| import org.apache.myrmidon.framework.Os; | |||||
| import org.apache.aut.nativelib.Os; | |||||
| import org.apache.tools.ant.taskdefs.ExecuteOn; | import org.apache.tools.ant.taskdefs.ExecuteOn; | ||||
| import org.apache.tools.ant.taskdefs.exec.Execute; | import org.apache.tools.ant.taskdefs.exec.Execute; | ||||
| import org.apache.tools.ant.types.FileSet; | import org.apache.tools.ant.types.FileSet; | ||||
| @@ -12,7 +12,7 @@ import java.util.ArrayList; | |||||
| import java.util.Date; | import java.util.Date; | ||||
| import java.util.Iterator; | import java.util.Iterator; | ||||
| import org.apache.myrmidon.api.TaskException; | import org.apache.myrmidon.api.TaskException; | ||||
| import org.apache.myrmidon.framework.Os; | |||||
| import org.apache.aut.nativelib.Os; | |||||
| import org.apache.tools.ant.DirectoryScanner; | import org.apache.tools.ant.DirectoryScanner; | ||||
| import org.apache.tools.ant.types.FileList; | import org.apache.tools.ant.types.FileList; | ||||
| import org.apache.tools.ant.types.FileSet; | import org.apache.tools.ant.types.FileSet; | ||||
| @@ -12,7 +12,6 @@ import java.lang.reflect.Method; | |||||
| import java.net.URL; | import java.net.URL; | ||||
| import java.net.URLClassLoader; | import java.net.URLClassLoader; | ||||
| import org.apache.myrmidon.api.TaskException; | import org.apache.myrmidon.api.TaskException; | ||||
| import org.apache.tools.ant.Project; | |||||
| import org.apache.tools.ant.types.Commandline; | import org.apache.tools.ant.types.Commandline; | ||||
| import org.apache.tools.ant.types.Path; | import org.apache.tools.ant.types.Path; | ||||
| import org.apache.tools.ant.types.SysProperties; | import org.apache.tools.ant.types.SysProperties; | ||||
| @@ -43,11 +42,11 @@ public class ExecuteJava | |||||
| m_sysProperties = sysProperties; | m_sysProperties = sysProperties; | ||||
| } | } | ||||
| public void execute( Project project ) | |||||
| public void execute() | |||||
| throws TaskException | throws TaskException | ||||
| { | { | ||||
| final String classname = m_javaCommand.getExecutable(); | final String classname = m_javaCommand.getExecutable(); | ||||
| final Object[] argument = {m_javaCommand.getArguments()}; | |||||
| final Object[] argument = new Object[]{m_javaCommand.getArguments()}; | |||||
| try | try | ||||
| { | { | ||||
| @@ -31,7 +31,6 @@ import org.apache.tools.ant.util.SourceFileScanner; | |||||
| */ | */ | ||||
| public class ExecuteOn extends ExecTask | public class ExecuteOn extends ExecTask | ||||
| { | { | ||||
| protected ArrayList filesets = new ArrayList(); | protected ArrayList filesets = new ArrayList(); | ||||
| private boolean relative = false; | private boolean relative = false; | ||||
| private boolean parallel = false; | private boolean parallel = false; | ||||
| @@ -12,7 +12,7 @@ import java.util.ArrayList; | |||||
| import java.util.Iterator; | import java.util.Iterator; | ||||
| import org.apache.myrmidon.api.TaskException; | import org.apache.myrmidon.api.TaskException; | ||||
| import org.apache.myrmidon.framework.JavaVersion; | import org.apache.myrmidon.framework.JavaVersion; | ||||
| import org.apache.myrmidon.framework.Os; | |||||
| import org.apache.aut.nativelib.Os; | |||||
| import org.apache.tools.ant.DirectoryScanner; | import org.apache.tools.ant.DirectoryScanner; | ||||
| import org.apache.tools.ant.taskdefs.compilers.CompilerAdapter; | import org.apache.tools.ant.taskdefs.compilers.CompilerAdapter; | ||||
| import org.apache.tools.ant.taskdefs.compilers.CompilerAdapterFactory; | import org.apache.tools.ant.taskdefs.compilers.CompilerAdapterFactory; | ||||
| @@ -12,9 +12,9 @@ import java.io.IOException; | |||||
| import java.io.OutputStream; | import java.io.OutputStream; | ||||
| import java.util.Properties; | import java.util.Properties; | ||||
| import org.apache.myrmidon.api.TaskException; | import org.apache.myrmidon.api.TaskException; | ||||
| import org.apache.myrmidon.framework.exec.ExecException; | |||||
| import org.apache.myrmidon.framework.exec.ExecMetaData; | |||||
| import org.apache.myrmidon.framework.exec.impl.DefaultExecManager; | |||||
| import org.apache.aut.nativelib.ExecException; | |||||
| import org.apache.aut.nativelib.ExecMetaData; | |||||
| import org.apache.aut.nativelib.impl.DefaultExecManager; | |||||
| /** | /** | ||||
| * Runs an external program. | * Runs an external program. | ||||
| @@ -12,11 +12,11 @@ import java.io.IOException; | |||||
| import java.util.Properties; | import java.util.Properties; | ||||
| import org.apache.avalon.framework.logger.AbstractLogEnabled; | import org.apache.avalon.framework.logger.AbstractLogEnabled; | ||||
| import org.apache.myrmidon.api.TaskException; | import org.apache.myrmidon.api.TaskException; | ||||
| import org.apache.myrmidon.framework.exec.DefaultExecOutputHandler; | |||||
| import org.apache.myrmidon.framework.exec.ExecException; | |||||
| import org.apache.myrmidon.framework.exec.ExecMetaData; | |||||
| import org.apache.myrmidon.framework.exec.ExecOutputHandler; | |||||
| import org.apache.myrmidon.framework.exec.impl.DefaultExecManager; | |||||
| import org.apache.aut.nativelib.DefaultExecOutputHandler; | |||||
| import org.apache.aut.nativelib.ExecException; | |||||
| import org.apache.aut.nativelib.ExecMetaData; | |||||
| import org.apache.aut.nativelib.ExecOutputHandler; | |||||
| import org.apache.aut.nativelib.impl.DefaultExecManager; | |||||
| /** | /** | ||||
| * Runs an external program. | * Runs an external program. | ||||
| @@ -16,8 +16,8 @@ import java.util.ArrayList; | |||||
| import java.util.Iterator; | import java.util.Iterator; | ||||
| import java.util.StringTokenizer; | import java.util.StringTokenizer; | ||||
| import org.apache.myrmidon.api.TaskException; | import org.apache.myrmidon.api.TaskException; | ||||
| import org.apache.myrmidon.framework.Os; | |||||
| import org.apache.myrmidon.framework.exec.ExecOutputHandler; | |||||
| import org.apache.aut.nativelib.Os; | |||||
| import org.apache.aut.nativelib.ExecOutputHandler; | |||||
| import org.apache.tools.ant.DirectoryScanner; | import org.apache.tools.ant.DirectoryScanner; | ||||
| import org.apache.tools.ant.Task; | import org.apache.tools.ant.Task; | ||||
| import org.apache.tools.ant.taskdefs.exec.Execute2; | import org.apache.tools.ant.taskdefs.exec.Execute2; | ||||
| @@ -15,7 +15,7 @@ import java.io.PrintWriter; | |||||
| import java.util.ArrayList; | import java.util.ArrayList; | ||||
| import java.util.Iterator; | import java.util.Iterator; | ||||
| import org.apache.myrmidon.api.TaskException; | import org.apache.myrmidon.api.TaskException; | ||||
| import org.apache.myrmidon.framework.Os; | |||||
| import org.apache.aut.nativelib.Os; | |||||
| import org.apache.tools.ant.DirectoryScanner; | import org.apache.tools.ant.DirectoryScanner; | ||||
| import org.apache.tools.ant.taskdefs.MatchingTask; | import org.apache.tools.ant.taskdefs.MatchingTask; | ||||
| import org.apache.tools.ant.taskdefs.exec.ExecTask; | import org.apache.tools.ant.taskdefs.exec.ExecTask; | ||||
| @@ -8,7 +8,7 @@ | |||||
| package org.apache.tools.ant.taskdefs.optional.ccm; | package org.apache.tools.ant.taskdefs.optional.ccm; | ||||
| import org.apache.myrmidon.api.TaskException; | import org.apache.myrmidon.api.TaskException; | ||||
| import org.apache.myrmidon.framework.exec.ExecOutputHandler; | |||||
| import org.apache.aut.nativelib.ExecOutputHandler; | |||||
| import org.apache.tools.ant.types.Commandline; | import org.apache.tools.ant.types.Commandline; | ||||
| /** | /** | ||||
| @@ -11,7 +11,7 @@ import java.io.File; | |||||
| import java.io.IOException; | import java.io.IOException; | ||||
| import org.apache.myrmidon.api.AbstractTask; | import org.apache.myrmidon.api.AbstractTask; | ||||
| import org.apache.myrmidon.api.TaskException; | import org.apache.myrmidon.api.TaskException; | ||||
| import org.apache.myrmidon.framework.exec.ExecOutputHandler; | |||||
| import org.apache.aut.nativelib.ExecOutputHandler; | |||||
| import org.apache.tools.ant.taskdefs.exec.Execute2; | import org.apache.tools.ant.taskdefs.exec.Execute2; | ||||
| import org.apache.tools.ant.types.Commandline; | import org.apache.tools.ant.types.Commandline; | ||||
| @@ -20,7 +20,7 @@ import javax.xml.parsers.DocumentBuilderFactory; | |||||
| import javax.xml.parsers.ParserConfigurationException; | import javax.xml.parsers.ParserConfigurationException; | ||||
| import org.apache.avalon.framework.logger.AbstractLogEnabled; | import org.apache.avalon.framework.logger.AbstractLogEnabled; | ||||
| import org.apache.myrmidon.api.TaskException; | import org.apache.myrmidon.api.TaskException; | ||||
| import org.apache.myrmidon.framework.exec.ExecOutputHandler; | |||||
| import org.apache.aut.nativelib.ExecOutputHandler; | |||||
| import org.apache.tools.ant.taskdefs.exec.ExecuteStreamHandler; | import org.apache.tools.ant.taskdefs.exec.ExecuteStreamHandler; | ||||
| import org.apache.tools.ant.util.DOMElementWriter; | import org.apache.tools.ant.util.DOMElementWriter; | ||||
| import org.apache.tools.ant.util.regexp.RegexpMatcher; | import org.apache.tools.ant.util.regexp.RegexpMatcher; | ||||
| @@ -9,7 +9,7 @@ package org.apache.tools.ant.taskdefs.optional.perforce; | |||||
| import java.io.IOException; | import java.io.IOException; | ||||
| import org.apache.myrmidon.api.TaskException; | import org.apache.myrmidon.api.TaskException; | ||||
| import org.apache.myrmidon.framework.exec.ExecOutputHandler; | |||||
| import org.apache.aut.nativelib.ExecOutputHandler; | |||||
| import org.apache.oro.text.perl.Perl5Util; | import org.apache.oro.text.perl.Perl5Util; | ||||
| import org.apache.tools.ant.taskdefs.exec.Execute2; | import org.apache.tools.ant.taskdefs.exec.Execute2; | ||||
| import org.apache.tools.ant.types.Commandline; | import org.apache.tools.ant.types.Commandline; | ||||
| @@ -82,19 +82,19 @@ import org.apache.myrmidon.api.TaskException; | |||||
| * | * | ||||
| * @author <A HREF="mailto:leslie.hughes@rubus.com">Les Hughes</A> | * @author <A HREF="mailto:leslie.hughes@rubus.com">Les Hughes</A> | ||||
| */ | */ | ||||
| public class P4Sync extends P4Base | |||||
| public class P4Sync | |||||
| extends P4Base | |||||
| { | { | ||||
| private String m_syncCmd = ""; | private String m_syncCmd = ""; | ||||
| private String m_label; | private String m_label; | ||||
| public void setForce( final String force ) | |||||
| public void setForce( final boolean force ) | |||||
| throws TaskException | throws TaskException | ||||
| { | { | ||||
| if( force == null && !m_label.equals( "" ) ) | |||||
| if( force ) | |||||
| { | { | ||||
| throw new TaskException( "P4Sync: If you want to force, set force to non-null string!" ); | |||||
| m_p4CmdOpts = "-f"; | |||||
| } | } | ||||
| m_p4CmdOpts = "-f"; | |||||
| } | } | ||||
| public void setLabel( String label ) | public void setLabel( String label ) | ||||
| @@ -10,7 +10,7 @@ package org.apache.tools.ant.taskdefs.unix; | |||||
| import java.io.File; | import java.io.File; | ||||
| import java.io.IOException; | import java.io.IOException; | ||||
| import org.apache.myrmidon.api.TaskException; | import org.apache.myrmidon.api.TaskException; | ||||
| import org.apache.myrmidon.framework.Os; | |||||
| import org.apache.aut.nativelib.Os; | |||||
| import org.apache.tools.ant.taskdefs.ExecuteOn; | import org.apache.tools.ant.taskdefs.ExecuteOn; | ||||
| import org.apache.tools.ant.taskdefs.exec.Execute; | import org.apache.tools.ant.taskdefs.exec.Execute; | ||||
| import org.apache.tools.ant.types.FileSet; | import org.apache.tools.ant.types.FileSet; | ||||