I have tried every possible combination of specifying pre-post build actions in my premake script for a csharp project (targetted at mono), doing just simple things like:
configuration "Debug" defines { "DEBUG" } flags { "Symbols","Unsafe" } targetdir "bin/debug" prebuildcommands { "echo 'here!'" } postbuildcommands { "echo 'here!'" }
and, right out of the documentation:
configuration "not windows" prebuildcommands { "echo 'here!'" }
But nothing I can do will get the actions added to tho csproj:
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->I am using premake 4.3
Am I doing something wrong here?
I am working with a c# project that needs depends on C++ libs for unmanaged calls.
When I specify a c++ project as a "link", the xbuild action for mono simply ignores it:
/media/storage/development/repos/local/Toolkit/Toolkit.sln: warning : Ignoring vcproj 'ToolCore'.
(ToolCore is the c++ project, Toolkit is the C# project).
Right now, it looks like I am just going to have to make a script that will tell compile all of my c++, then call premake on the c#. It would be really nice if I could just run the c# build, and have it build the c++ as a prebuild action... but this doesn't seem to be supported...
Is this a bug, or intentional?
If chaining build actions worked as documented, then I could simply make a build action that would call the premake script for the c++ project, and then call the premake action for the c# project (see my previous post on the help forum).
Cheers,
-Dale

The prebuildcommand issues look like a bug, although I know others are using these command successfully. Can you file a bug report for it? You can just link back to this forum topic if you want.
To the best of my knowledge, you can't directly link C# and C++. You need to build the C++ as a shared library and use Interop to call into it; see Interop with Native Libraries on the Mono website.
In Premake you would have two separate projects in your solution, one to build the C++ library, and another to build the C#. Build order doesn't matter, since the interop call happen at runtime.
Hope that helps!
Added this as a bug.
I have a fix for this bug locally, how can I submit the patch?
Please attach it in the patch tracker on SourceForge