Ankit,


Thank you for such a quick fix.
It works now, except when you have a space in the command. It doesn't separate the command from the arguments properly.

e.g.:
<Exec Command="$(ProjectDir)MyFolder\My folder with space in its name\app.exe my arg1 myArg2" />
This gets executed as
command: $(ProjectDir)MyFolder\My
arguments: folder with space in its name\app.exe my arg1 myArg2

This also reproduces if $(ProjectDir) alone would contain spaces in its path.

Under Windows, the common thing to do is to surround the command and individual arguments that contain spaces with double quotes:

<Exec Command='"$(ProjectDir)MyFolder\My folder with space in its name\app.exe" "my arg1" myArg2' />

This doesn't work with xbuild it seems. Although the command and arguments look now separated properly:

i.e.:
command: "$(ProjectDir)MyFolder\My folder with space in its name\app.exe"
arguments: "my arg1" myArg2

xbuild doesn't remove the leading and trailing double quotes and launching the program fails (and possibly would have passed "my arg1" with quotes included - and shouldn't).

Would really appreciate a fix for this as well :) .


Thanks,
Vlad.


-- 

[][][] Vlad Alexandru Ionescu | Developer
  [][] LShift Ltd             | Tel: +44 (0)20 7729 7060
[]  [] www.lshift.net         | Email: [email protected]



Ankit Jain wrote:
This is fixed in svn r138900.

-Ankit

On Tue, Jul 28, 2009 at 4:55 PM, Ankit Jain<[email protected]> wrote:
  
On Tue, Jul 28, 2009 at 4:19 PM, vladatlshift<[email protected]> wrote:
    
Hi list,

I've been trying out xbuild for a while and everything seems great except
for the Exec task, which doesn't seem to work for me at all.
      
That seems to be a bug, i'm working on fixing that now.
BTW, please use the latest version of mono
(http://www.go-mono.com/mono-downloads/download.html)
as it has a much improved xbuild than the version that you seem to be
using.

-Ankit

    
For example, the following simple .proj file:

<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build"
xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
   <Target Name="Build">
       <Exec Command="echo Hello world!" />
   </Target>
</Project>


when run with xbuild, it outputs:

v...@mrforgetful:~/w/test$ xbuild test.proj
XBuild Engine Version 0.1
Mono, Version 2.0.1.0
Copyright (C) Marek Sieradzki 2005. All rights reserved.

Build started 27/07/2009 18:20:54.
__________________________________________________
Project "/home/vlad/w/test/test.proj" (Build target(s)):

Target Build:
               Tool echo Hello world! execution started with arguments:
System.ComponentModel.Win32Exception: ApplicationName='echo Hello world!',
CommandLine=' ', CurrentDirectory=''
 at System.Diagnostics.Process.Start_noshell
(System.Diagnostics.ProcessStartInfo startInfo, System.Diagnostics.Process
process) [0x00000]
 at System.Diagnostics.Process.Start_common
(System.Diagnostics.ProcessStartInfo startInfo, System.Diagnostics.Process
process) [0x00000]
 at System.Diagnostics.Process.Start () [0x00000]
 at (wrapper remoting-invoke-with-check) System.Diagnostics.Process:Start
()
 at Microsoft.Build.Utilities.ToolTask.RealExecute (System.String filename,
System.String arguments) [0x00000]
 at Microsoft.Build.Utilities.ToolTask.ExecuteTool (System.String
pathToTool, System.String responseFileCommands, System.String
commandLineCommands) [0x00000]
 at Microsoft.Build.Tasks.Exec.ExecuteTool (System.String pathToTool,
System.String responseFileCommands, System.String commandLineCommands)
[0x00000]
 at Microsoft.Build.Utilities.ToolTask.Execute () [0x00000]
 at Microsoft.Build.BuildEngine.TaskEngine.Execute () [0x00000]
 at Microsoft.Build.BuildEngine.BuildTask.Execute () [0x00000]

Build succeeded.
        0 Warning(s)
        1 Error(s)

Time Elapsed 00:00:00.0622170



Any idea what the problem could be? Am I doing something wrong?


Thanks,
Vlad.


PS. This works on Windows/msbuild.
--
View this message in context: http://www.nabble.com/Exec-task-in-xbuild-not-working-at-all-tp24685078p24685078.html
Sent from the Mono - General mailing list archive at Nabble.com.

_______________________________________________
Mono-list maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-list

      

--
Blog : http://www.ankitjain.org/blog

    



  

_______________________________________________
Mono-list maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-list

Reply via email to