Starting to make a lot of use out of the build events system in XE, but one thing I noticed is that I'm unable to set up default build events in the default project settings. Is there any sort of workaround/hack/whatever that would make this possible? I'm looking at CodeGear.Group.Targets and CodeGear.Delphi.Targets in the bin directory, if this is even doable, would that be where I should be looking?
Thanks
Ah ha. Answered my own question. (Is there a delete button somewhere? Lol)
I did some experimenting, added some easy to find pre and post build events (namely launching the registry editor and notepad..)
In Delphi's bin directory there's a file called CodeGear.Delphi.Targets. Inside that, after the import sections, I added:
<PropertyGroup>
<PreBuildEvent><![CDATA[regedit.exe]]></PreBuildEvent>
<PostBuildEvent><![CDATA[notepad.exe $(MSBuildProjectFile)]]></PostBuildEvent>
</PropertyGroup>
Restarted the IDE, and a new empty project executed those programs on pre and post build. Note that they don't show up on the project configuration screen though, but you can override them, negating whatever was put in the CodeGear.Delphi.Targets file. Cheap, but it seems to do the trick, and you can still override it if needed on a specific project. (Just make sure to back the original file up of course.)
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