Delphi build-events are not batch files. They are statements concatenated into one big statement using ampersands.. Which means that when you use if statements, you need to wrap them in parentheses:
Delphi build-events are not batch files. They are statements concatenated into one big statement using ampersands.. Which means that when you use if statements, you need to wrap them in parentheses:
https://stackoverflow.com/questions/51386746/post-build-event-with-multiple-if-copy-combinations-only-execute-if-first-file-d
Which means I need to update https://wiert.me/2014/11/20/delphi-prebuildpostbuild-events/
https://stackoverflow.com/questions/51386746/post-build-event-with-multiple-if-copy-combinations-only-execute-if-first-file-d
https://stackoverflow.com/questions/51386746/post-build-event-with-multiple-if-copy-combinations-only-execute-if-first-file-d
Which means I need to update https://wiert.me/2014/11/20/delphi-prebuildpostbuild-events/
https://stackoverflow.com/questions/51386746/post-build-event-with-multiple-if-copy-combinations-only-execute-if-first-file-d
Which is why my build events don't contain the actual code but instead call external script files which can then be clearly visible in revision control
ReplyDeleteDavid Heffernan I tried that. Success depends on how many parameters you need to push to that script.
ReplyDeleteJeroen Wiert Pluimers Why are you pushing lots of parameters? I encode the project specific details in the script.
ReplyDeleteDavid Heffernan Dear professor can you please show us a sample?
ReplyDeleteDidier Tactisoft call MyScript.bat
ReplyDeleteDavid Heffernan to ensure the batch file has all the information at hand.
ReplyDeleteJeroen Wiert Pluimers Usually variations are project specific and so would be coded in the script. In my experience I've not had to pass many parameters. Perhaps the target arch, but what else might be needed?
ReplyDeletevarious directories, defines, project name, build platform/bitness/type, quoted appropriately.
ReplyDeleteDirectories are seldom needed, they come with the working directory. As for the others, that's similar to what I do, but it's not very difficult to do. Certainly it's not as hard as you claim.
ReplyDeleteDavid Heffernan you make too many absolute statements.
ReplyDeleteJeroen Wiert Pluimers passing any of those things as parameters is quite easy. I don't see the complication.
ReplyDeleteDavid Heffernan parameter quoting and order makes this convoluted, just like any other child process you start.
ReplyDeleteJeroen Wiert Pluimers I honestly don't see it as hard to pass parameters in the correct order
ReplyDeleteDavid Heffernan Try dissecting the list of conditional defines if your target systems have just batch files or PowerShell 2.0.
ReplyDeleteBut maybe your perception of difficulty is different than mine.
Jeroen Wiert Pluimers Are you talking about writing the code in the script, or passing the arguments. I'm talking about the latter. For the former I shell out to Python and then everything is peachy!!!!
ReplyDeleteDavid Heffernan I'm not in the luxury to have Python available at all sites. Even with it, passing more parameters means more complexity (because order, quoting and delimiting matter). It helps a lot for instance to put "$(DEFINES)" at the end.
ReplyDelete