Forums

cobra -cin foo.cobra

General discussion about Cobra. Releases and general news will also be posted here.
Feel free to ask questions or just say "Hello".

cobra -cin foo.cobra

Postby Charles » Wed Jun 03, 2009 7:46 pm

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.
Charles
 
Posts: 2515
Location: Los Angeles, CA

Re: cobra -cin foo.cobra

Postby Charles » Sat Jun 06, 2009 1:45 pm

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.
Charles
 
Posts: 2515
Location: Los Angeles, CA


Return to Discussion

Who is online

Users browsing this forum: No registered users and 9 guests