ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 31805] New: - ExecTask executes checkConfiguration() even though os does not match
Date Wed, 20 Oct 2004 17:13:03 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=31805>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=31805

ExecTask executes checkConfiguration() even though os does not match

           Summary: ExecTask executes checkConfiguration() even though os
                    does not match
           Product: Ant
           Version: 1.6.1
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Core tasks
        AssignedTo: dev@ant.apache.org
        ReportedBy: davidmboon@hotmail.com


I have the following task:

  <property name="windows.specific"         value="Windows XP, Windows 2000,
Windows NT"/>
  <property name="linux.specific"           value="Linux"/>
<target name="test-os-name">
  <echo>${os.name}</echo>
  <exec dir="${basedir}"
        os="${windows.specific}"
        executable="ls">
    <arg line="-ltr"/>
  </exec>
  
  <exec dir="${env.HOME}/khub/build"
        os="${linux.specific}"
        executable="ls">
    <arg line="-ltr"/>
  </exec>
</target>

The first exec should run on windows, the second should run on linux.  The
problem is, in the second exec the directory only exists on linux, not on
windows.  However this method checks for the directory before the os: 

    public void execute() throws BuildException {
        File savedDir = dir; // possibly altered in prepareExec
        cmdl.setExecutable(resolveExecutable(executable, false));
        checkConfiguration();
        if (isValidOs()) {
            try {
                runExec(prepareExec());
            } finally {
                dir = savedDir;
            }
        }
    }

Seems like the checkConfiguration() should be run after the isValidOs().

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message