cobra -cin foo.cobra
Posted: 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:
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:
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.
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.