We are experiencing the following behavior which we think is unintended.
- a Repository definition for perforce whose view contains variable-dependent entries we want discoverable at runtime (i.e. //depot/${vars.getvalue('newScripts')}/... //client/Scripts/...)
- a build job that does the following in order: conditionally set the variable newScripts to the correct folder, a repo Take Snapshot step, a repo Record Changes step, a repo Checkout step to sync the folder.
A system-defined pre-build script ends up taking a snapshot prior to the build being run, using a default value of the newScripts variable which is incorrect. However, I would have expected that the Take Snapshot and Record Changes steps to operate on a client with the new/correct view, and make the checkout step sync the correct data, but it does not. In the above scenario, the checkout step syncs the incorrect folder, one specified by the default value of the variable as opposed to its new value.
Currently we work around this by setting the "Snapshot Taking" advanced configuration setting to be a null op "groovy: return". Is this by design? Why wouldn't the Take Snapshot step (during the build but after the variable is set) not fix this problem?
Thanks,
Tom Z