|
|
|
|||||
|
Pre-Build needs no spaces!
I noticed that if i did a prebuild in a directory like C:\Documents and Settings it would fail because it thaught you were doing another argument.. a possible way to fix this would be like:
Code:
generate.exe --solutionDir=C:\Documents and settings--ProjectDir=C:\Documents and Settings\project--ProjectName=project |
|
||||||
|
I tried various quoting tricks to allow the code to be built if the source tree is installed somewhere where a directory name contains a space, but to no avail. The problem isn't with generate.cs, but with the way Visual C# parses command-line arguments for the pre-build step. While it correctly invokes the generate.exe program if I put double quotes around the executable path in the pre-build step, it incorrectly breaks the executable name into to separate arguments where the space is, so generate.exe (correctly) concludes that it has been given invalid arguments.
For example, if you rename the root directory (icecs) to (ice cs) and try to build, you get a pre-build failure because generate.exe is not found. If you then put double quotes around the command in the pre-build step, generate.exe is executed, but the command-line argument then are: [0] @"C:\cygwin\home\michi\src\ice" [1] @"cs\" [2] @"C:\cygwin\home\michi\src\ice" [3] @"cs\src\Ice\" [4] "Ice" Note that Visual C# splits the first argument into two arguments, which is simply wrong. This is a bug in Visual C#, and I don't believe there is a fix. My only suggestion is not to build in a directory hierarchy where a directory name contains a space. Cheers, Michi. |
|
|||||
|
I have an idea, this is what i did with a similar "echo" command for one of my control panels. I would rebuild the string array. Like so.. (assume args is the argument array)
Code:
string text = "";
foreach(string arg in args)
{
if(text == "")
{
text += arg;
}
else
{
text += " " + arg;
}
}
**edit again** I'll add the processing code too. Then assume that each argument would be prepended with a ":" (not allowed in folder names). Code:
string[] arguments = text.Split(char.Parse(":"));
solution_dir = arguments[0];
project_dir = arguments[1];
project_name = arguments[2];
arguments = arguments[3];
Last edited by Wayetender : 08-16-2004 at 08:38 PM. |
|
||||||
|
Well, maybe some sort of hack along those lines would work. But, to be honest, I'd rather just say "don't build Ice in a directory that has a space in its name". That's a lot easier and doesn't require writing any code
![]() Cheers, Michi. |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Use spaces instead of tabs | Edward Bishop | Comments | 5 | 01-24-2007 05:42 PM |
| Patch #8 for Ice 3.1.0: support for paths with spaces in -I option | benoit | Patches | 2 | 01-05-2007 04:50 AM |
| Patch to handle spaces in filenames for slice compilers | acbell | Patches | 1 | 04-26-2005 05:04 PM |
| Unable to build demoj using supplied build.xml files | vsonnathi | Bug Reports | 1 | 10-21-2004 12:34 PM |
| Pre-Build Failure | Wayetender | Help Center | 8 | 08-07-2004 07:06 PM |