We are currently in the process of switching from Delphi XE to Delphi XE3, and we are having serious problems with our pre-build-events.
Our pre-build events look like this:
SubWCRev "<SVN-Path>" "<InputFile>" VersionInfo.rc
brcc32 -foProject.res VersionInfo.rc
(note that these two commands appear on separate lines; and contain the absolute paths in our "real" commands) i.e. we first extract the current SVN version from the working copy, write this information to VersionInfo.rc and then use the Borland resource compiler to generate a resource file.
This worked perfectly in previous Delphi versions, but whenever we open the project options in XE3, XE3 converts this to:
SubWCRev "<SVN-Path>" "<InputFile>" VersionInfo.rc &brcc32 -foProject.res VersionInfo.rc
(note that this is a single line, both commands separated by a single ampersand). which causes the build to fail.
Our current workaround is to manually change this to
SubWCRev "<SVN-Path>" "<InputFile>" VersionInfo.rc && brcc32 -foProject.res VersionInfo.rc
i.e. we use two ampersands to execute the second command if the first one succeeds.
This works, but only until we edit the project options again - Delphi XE3 always messes up the pre-build event :-(
Does anybody know a solution/workaround for this? I guess we could write a simple command line tool that calls SubWCRev and brcc32, but I'd prefer a simpler solution.
UPDATE: Steps to easily reproduce this bug
IDE
- File -> New -> VCL forms application (Delphi)
- Build Project1
- File -> Save all, keep suggested names Unit1.pas / Project1.dpr
- Project -> Options
- choose target "All configurations - all platforms"
Build Events -> Pre-build events, enter this (two lines, sor