#1
|
|||
|
|||
looses Macro setting ?
Hi,
Strange thing, I've set up a Project Macro with nothing in it, then I run through some SQL and populate the Macro with a value. One of my steps is set to only run if that Macro Value is defined. I've check both before and after it is set, before it's blank, after it has the value I want. Problem, sometime the step just jump right over and says the macro was'nt there, any suggestions? CAB |
#2
|
|||
|
|||
Please ZIP and send or post:
1) The info from Help | About | Install Info 2) A reproducible test case (.bld file that can be built here and reproduces the problem) 3) A build log file |
#3
|
|||
|
|||
fixed
flicked my logic upside down and it worked.
|
#4
|
|||
|
|||
I'm having a similar problem. I have some steps where if a macro is undefined the steps should be skipped. If the macro is defined the script should build those steps.
What happens each time is that the steps where the macro being undefined should mean the steps are skipped, the steps are built. The steps where the macro being undefined should mean the steps are built, are skipped. I would like to know how the other person experiencing this problem resolved it. I have tried many other things. The only workaround I have found is to enter a value for the macro and use the "is equal to" and "is not equal to" logic to skip/build the desired steps. |
#5
|
|||
|
|||
Make sure you are specifying the macro like %MACRONAME% in the 'Build only if macro or expression' field. If that doesn't help, please ZIP and send or post:
1) The info from Help | About | Install Info 2) A reproducible test case (.bld file that can be built here and reproduces the problem) 3) A build log file Thanks. |
#6
|
|||
|
|||
I used
"is equal to" and "is not equal to"
Tha's how I got around it. cab |
#7
|
|||
|
|||
Info from Help About:
Visual Build Professional 6.1 Registered to: Orrtax Software (3-computer license) Windows Version: 5.1.2600.2.0 Install path: C:\Program Files\VisBuildPro6 SftTree_IX86_U_50.dll version 5.04 unins000.exe version 51.42.0.0 VisBuildCmd.exe version 6.1.0.0 VisBuildPro.exe version 6.1.0.0 VisBuildBld.dll version 6.1.0.0 VisBuildCore.dll version 6.1.0.0 VisBuildDotNET.dll version 6.1.0.0 VisBuildExt.dll version 6.1.0.0 VisBuildLog.dll version 6.1.0.0 VisBuildMisc.dll version 6.1.0.0 VisBuildMS.dll version 6.1.0.0 VisBuildMS2.dll version 6.1.0.0 VisBuildNet.dll version 6.1.0.0 VisBuildSvr.dll version 6.1.0.0 VisBuildSvr.Interop.dll version 1.0.0.0 -------------------------------------- Build Log: 6/6/2006 3:45:00 PM: --------------------Starting Build: 'C:\Documents and Settings\Joel\Desktop\Undefined_Macro_Example.bld'-------------------- 6/6/2006 3:45:00 PM: Building project step 'Project steps'... 6/6/2006 3:45:00 PM: Building project step 'Branching'... 6/6/2006 3:45:00 PM: Building project step 'Branch for Milestone - MAINLINE'... Step 'Branch for Milestone - MAINLINE' build rule evaluates false: %_FROMBRANCH% is undefined 6/6/2006 3:45:01 PM: Step skipped 6/6/2006 3:45:01 PM: Building project step 'Create Snapshot Branch'... Step 'Branch for Milestone - MAINLINE' build rule evaluates false: %_FROMBRANCH% is undefined 6/6/2006 3:45:01 PM: Step skipped 6/6/2006 3:45:01 PM: Building project step 'Branch for Milestone - FROMBRANCH'... 6/6/2006 3:45:01 PM: Building project step 'Create Snapshot Branch'... C:\Program Files\Seapine\Surround SCM\sscm.exe mkbranch NEW_BRANCH1.1 MAINLINE -ssnapshot -zSERVER1:4900 -yUSERassword "-ccCreated snapshot branch from " Failed to create process: The directory name is invalid. 6/6/2006 3:45:01 PM: Step 'Create Snapshot Branch' failed 6/6/2006 3:45:01 PM: Build ended. ---------------------- The attached file will bring you the exact same results. %FROMBRANCH% is undefined, yet it act as if it is defined. |
#8
|
|||
|
|||
In your example, a project macro named _FROMBRANCH, which is referenced by the build rules (i.e, %_FROMBRANCH%), *is* defined (to an empty value). If you want to build/skip based on whether the macro value is empty or not, use a build rule of
is equal to <blank> (will build if macro value is empty) and is not equal to <blank> (will build if macro value is not empty) Also, if you have 'Tools | Application Options | General | Implement nesting of conditional build rules' checked, the build rule only needs to be defined on the parent step (and it will automatically apply to all children as well). |
#9
|
|||
|
|||
That works, thanks!
|
Thread Tools | |
Display Modes | Rate This Thread |
|
|