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.