I have successfully registered an IDE notifier (IOTAIDENotifier80
) so I get AfterCompile notifications.
Is it possible to find out whether the project was built versus just being compiled/made?
I've found this answer about implementing a IOTAProjectCompileNotifier
but this is not available in D2007.
Any other way? I'd be fine with an undocumented way as this is for an inhouse expert only.
Update: I need this to replicate the "AutoInc build number" feature with an external .rc file containing the version info resource. Maybe this can be done via BuildEvents? Although I like the ability to log a message in the IDE showing the updated version number...
I have no idea about writing experts or hooking into the IDE, and I'm scared of trampolines. Having said that, I've noticed that you can tell the difference between a compile and build by monitoring the timestamps of the files in your project output folder, but this difference is only evident if no code (*.pas or *.dfm) has changed since last compile or build. In other words, when there is a code change, you can NOT tell the difference by monitoring the timestamps. However, when there is no code change since last compile or build, a compile will only change the timestamp of the exe (the dcu timestamps are not changed).
Therefore, in the absence of other more elegant solutions, and only if you are really desperate for this information (ie, was it compiled or was it built?) then I can suggest a 2-part solution for you.
Part 1. Write a process to monitor changes in timestamps in your output folder, and
Part 2. Tell your fellow developers there is a bug in D2007 which complicates your build process, but that this bug is easily overcome by simply compiling twice or building twice (or if you know how to automate this then go for your life). If you can get your developers to compile twice or build twice then upon the second compile or build you will be able to deduce whether it was a compile or build by testing if the timestamp of the dcu changed upon the second compile or build.
Now, I will go and stand in the naughty corner and ask myself "why me?". Cheers.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With