Kinook Software Forum

Go Back   Kinook Software Forum > Visual Build Professional > [VBP] General Discussion

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 08-08-2005, 12:59 PM
jblocksom jblocksom is online now
Registered User
 
Join Date: 07-29-2005
Location: Springfield, VA
Posts: 6
Does saving a project macro modify it?

My build stores a project macro with the (multi line) output of a Perforce command and compares it with that same command the next time it is run. When I run the build from inside VBPro things work correctly, but when I run it from the command line the compare always returns that the macros are different -- even though they look exactly the same when I dump them to the output log.

I am saving the project, so that is not the problem. Does VBPro do anything like strip newlines or invisible characters?

Below is a copy of the log from two builds from within the IDE (sans my personal information).


--------------------Starting Build: 'p4_monitor'--------------------
Building project step 'Project steps'...
Building project step 'Perforce'...
Performing requested command...
Change 555 on 2005/08/05 by xxx@yyyy 'Adding some test data '
Building project step 'Set Macro'...
Created Temporary macro 'P4_LAST_CHANGE'
Building project step 'Log Message'...
*****
P4_LAST_CHANGE IS:
Performing requested command...
Change 555 on 2005/08/05 by xxx@yyyy 'Adding some test data '
===
P4_STORED_LAST_CHANGE IS:
Performing requested command...
Change 555 on 2005/08/05 by xxx@yyyy 'Adding some test data '
*****
P4_LAST_CHANGE in script:
Performing requested command...
Change 555 on 2005/08/05 by xxx@yyyy 'Adding some test data '
P4_STORED_LAST_CHANGE in script:
Performing requested command...
Change 555 on 2005/08/05 by xxx@yyyy 'Adding some test data '
Expression evaluates to:
-1
Building project step 'if last_change != stored_change'...
Building project step 'Set Macro'...
Updated Project macro 'P4_STORED_LAST_CHANGE'
Building project step 'Save file'...
Build successfully completed.
Registered to: ****
--------------------Starting Build: 'p4_monitor'--------------------
Building project step 'Project steps'...
Building project step 'Perforce'...
Performing requested command...
Change 555 on 2005/08/05 by xxx@yyyy 'Adding some test data '
Building project step 'Set Macro'...
Created Temporary macro 'P4_LAST_CHANGE'
Building project step 'Log Message'...
*****
P4_LAST_CHANGE IS:
Performing requested command...
Change 555 on 2005/08/05 by xxx@yyyy 'Adding some test data '
===
P4_STORED_LAST_CHANGE IS:
Performing requested command...
Change 555 on 2005/08/05 by xxx@yyyy 'Adding some test data '
*****
P4_LAST_CHANGE in script:
Performing requested command...
Change 555 on 2005/08/05 by xxx@yyyy 'Adding some test data '
P4_STORED_LAST_CHANGE in script:
Performing requested command...
Change 555 on 2005/08/05 by xxx@yyyy 'Adding some test data '
Expression evaluates to:
0
Building project step 'if last_change != stored_change'...
Step 'if last_change != stored_change' build rule evaluates false: [Trim(vbld_AllMacros()("P4_LAST_CHANGE").Value) <> Trim(vbld_AllMacros()("P4_STORED_LAST_CHANGE").Val ue)] is true
Step skipped
Building project step 'Set Macro'...
Step 'if last_change != stored_change' build rule evaluates false: [Trim(vbld_AllMacros()("P4_LAST_CHANGE").Value) <> Trim(vbld_AllMacros()("P4_STORED_LAST_CHANGE").Val ue)] is true
Step skipped
Building project step 'Save file'...
Step 'if last_change != stored_change' build rule evaluates false: [Trim(vbld_AllMacros()("P4_LAST_CHANGE").Value) <> Trim(vbld_AllMacros()("P4_STORED_LAST_CHANGE").Val ue)] is true
Step skipped
Build successfully completed.
Reply With Quote
  #2  
Old 08-08-2005, 01:10 PM
jblocksom jblocksom is online now
Registered User
 
Join Date: 07-29-2005
Location: Springfield, VA
Posts: 6
A couple of further notes after rereading this --
1) The build always executes the steps the first time it is run in the IDE. Further runs work correctly.
2) The evaluation of the expression in the log message is actually a strcompare, not exactly the same as in the next step (though this makes no difference)

Running this further makes me think it's a newline issue; when I look at the macros tab in the IDE, when I first load it there are two squares in the saved macro where the newline would be it but only one square after it runs the first time.
Reply With Quote
  #3  
Old 08-09-2005, 09:52 AM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 6,003
When VBP writes a file (.bld, .macros, etc.) to disk, any newlines will be normalized to Windows-standard newline format (CR/LF). So if a macro value contains only CR, after saving and reloading, the value will contain CR/LF instead. You may want to ensure that your macro value is created with CR/LF for newlines, or formulate your comparison to strip all newline characters first.
Reply With Quote
  #4  
Old 08-09-2005, 11:19 AM
jblocksom jblocksom is online now
Registered User
 
Join Date: 07-29-2005
Location: Springfield, VA
Posts: 6
Thanks for the info. I am now using a script command to grab just the part of the string that I need to compare, which is all on one line. The continuous integration sample code was very helpful as I have little experience with VBScript.
Reply With Quote
  #5  
Old 08-09-2005, 03:31 PM
pjaquiery pjaquiery is online now
Registered User
 
Join Date: 01-19-2003
Location: Dunedin, New Zealand
Posts: 114
Note that you can use JScript or other scripting languages such as Perl rather than VBScript.
Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



All times are GMT -5. The time now is 04:25 AM.


Copyright © 1999-2023 Kinook Software, Inc.