Page 1 of 1

cobra -cin foo.cobra

PostPosted: Wed Jun 03, 2009 7:46 pm
by Charles
Thanks to hopscc who supplied a patch for ticket:14, you can now pass a flag to the cobra command line to prevent it from compiling if the output file (.exe, .dll, .class, etc.) exists and is newer than all source files. In other words, compile only if the output file is missing or any source file is newer.

The flag is called -compile-if-needed or -cin for short.

For example:
Code: Select all
cobra -cin hello.cobra
cobra -cin hello.cobra

In the above commands, the second one is not going to recompile the source to produce hello.exe/hello.class because it's newer than the source file hello.cobra.

The reason this is an option instead of the norm is that Cobra doesn't know what files went into the original binary. Consider:
Code: Select all
cobra a.cobra b.cobra
cobra a.cobra c.cobra

In the above commands, the second line needs to recompile because a source file has been changed.

This is often not a problem and you can feel free to use -cin according to your judgment.

For more complex build scenarios, please use NAnt, MSBulid, make, etc.

Re: cobra -cin foo.cobra

PostPosted: Sat Jun 06, 2009 1:45 pm
by Charles
In the original post (and checkin) the abbreviation was -cif even though the full option name was -compile-if-needed. I have since fixed the abbreviation to -cin to match the full name. If you had already started using this, I apologize for any disruption.