[Mono-bugs] [Bug 598311] xbuild executes PostBuildEvent block as one large command rather than each line as a separate command.

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Wed Apr 21 03:35:44 EDT 2010


http://bugzilla.novell.com/show_bug.cgi?id=598311

http://bugzilla.novell.com/show_bug.cgi?id=598311#c1


Ankit Jain <jankit at novell.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |NEEDINFO
       InfoProvider|                            |mchristensen at novell.com

--- Comment #1 from Ankit Jain <jankit at novell.com> 2010-04-21 07:35:43 UTC ---
The way this executes is, that the entire content of that Command property of
the Exec task is put into a script file, and that gets executed by sh or
cmd.exe . This is what msbuild also does. I tried building mojoportal myself,
and the errors i get are:

        Target PostBuildEvent:
                Executing: xcopy /s /y
"/home/radical/build/sourcecode/mojoportal/mojoPortal.Features.UI/bin/mojoPortal.Features.UI.dll"
"Web/bin/"
xcopy /s /y
"/home/radical/build/sourcecode/mojoportal/mojoPortal.Features.UI/bin/mojoPortal.Features.Business.dll"
"Web/bin/"
... (lots more)
                /tmp/tmp3e177b2f.tmp: line 1: xcopy: command not found
                /tmp/tmp3e177b2f.tmp: line 2: xcopy: command not found
                /tmp/tmp3e177b2f.tmp: line 3: xcopy: command not found
                /tmp/tmp3e177b2f.tmp: line 4: xcopy: command not found
                /tmp/tmp3e177b2f.tmp: line 5: xcopy: command not found
                /tmp/tmp3e177b2f.tmp: line 6: xcopy: command not found
                /tmp/tmp3e177b2f.tmp: line 7: xcopy: command not found
                /tmp/tmp3e177b2f.tmp: line 8: xcopy: command not found
.. (lots more)

The errors listed in the end, has only the error part of it, not the output
from executing the commands. So, you probably missed the "..xcopy: command not
found" lines.
So, they are actually executing line by line, just that the shell is handling
that, rather than xbuild itself.

I tried changing the "xcopy /s /y" --> "cp -rv", and it seems to work for me.
It gives errors for some non-existant files though.

Let me know if my analysis fits what you are getting with xbuild.

For handling such cases, see :
http://www.mono-project.com/Porting_MSBuild_Projects_To_XBuild 

It has a part on Pre/PostBuildEvents .

-- 
Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.


More information about the mono-bugs mailing list