Kinook Software Forum

Go Back   Kinook Software Forum > Visual Build Professional > [VBP] General Discussion
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Rating: Thread Rating: 3 votes, 5.00 average. Display Modes
  #1  
Old 01-05-2006, 02:47 PM
wallywojo wallywojo is online now
Registered User
 
Join Date: 01-05-2006
Posts: 10
Command line usage

Can someone supply a working sample where multiple macros are defined from the command line. I have not been able to get this working.
Reply With Quote
  #2  
Old 01-05-2006, 03:27 PM
kevina kevina is online now
Registered User
 
Join Date: 03-27-2003
Posts: 825
invoke the provided .bld file from this command line:

visbuildpro "TEMPMACRO1=T1" "TEMPMACRO2=T2" "TEMPMACRO3=T3" /d /b "c:\path\to\multiplemacros.bld"

See the following for more details:
http://www.visualbuild.com/Manual/?command_linegui.htm
http://www.visualbuild.com/Manual/?consoleapp.htm

You can also have VBP generate the command-line for you by adding some temporary macros and then choosing Tools | Create Scheduled Task on the menu, then copying the command from the task and deleting the task:
http://www.visualbuild.com/Manual/?s...eautomatic.htm
Attached Files
File Type: bld multiplemacros.bld (391 Bytes, 2669 views)
Reply With Quote
  #3  
Old 01-05-2006, 04:12 PM
wallywojo wallywojo is online now
Registered User
 
Join Date: 01-05-2006
Posts: 10
Thank You.

It ended up that the problem was Word formatting of the quotes. Thanks for reinforcing that the parameters were as expected.

Wally
Reply With Quote
  #4  
Old 01-17-2006, 08:14 PM
mseminatore mseminatore is online now
Registered User
 
Join Date: 09-14-2005
Posts: 17
What if I want to have Project macros that are overridden by the command line? Is that possible? Using temporaries means that I can't run using the GUI without defining the temporaries.

Do the values passed on the command line equate to temporary macros? If so do folks just tend to create some steps to check for the temporaries and initialize them to defaults if not found?
Reply With Quote
  #5  
Old 01-18-2006, 08:10 AM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 6,034
VBP implements an order of precedence (temporary, project, global, system [highest to lowest]) when macros are referenced like %MACRO_NAME% within step fields (or like Application.ExpandMacrosAndScript("%MACRO_NAME%") within script code), and overriding a project macro (which defines the default) with a temporary macro (on the command-line) is an ideal use of this feature. See the following help topics/samples for more details:

http://www.visualbuild.com/Manual/?macrostab.htm
http://www.visualbuild.com/Manual/?hints.htm (3rd from last bullet)
http://www.visualbuild.com/Manual/?v...dprosample.htm
Reply With Quote
  #6  
Old 01-18-2006, 11:54 AM
mseminatore mseminatore is online now
Registered User
 
Join Date: 09-14-2005
Posts: 17
Right I realized I meant to ask a related question. Is it possible to use environment variables to the same effect? IOW rather than having to customize the command line can I simply set some environment variables (say from within a batch file) and have those override Project macros which define the default.

My recollection is that env vars are considered to be System macros and are thus lower priority than System macros.
Reply With Quote
  #7  
Old 01-18-2006, 01:05 PM
mseminatore mseminatore is online now
Registered User
 
Join Date: 09-14-2005
Posts: 17
Alternatively if the temp macros could be read from a text file that would be handy. I have something like 20 macros I would like to define in order to parameterize my builds. Specifying them all on command line is a little cumbersome.
Reply With Quote
  #8  
Old 01-18-2006, 05:04 PM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 6,034
Regarding environment variables, you could add a Run Script step at the beginning of the project to iterate over all environment variables, storing them in temporary macros. Although you probably don't want to do this for all variables, so you'd need to filter the list in some way. In VBScript, something like this:

Set shell = CreateObject("WScript.Shell")
Set env = shell.Environment("PROCESS")
For Each var In env
' logic here to parse the name/value out and
' determine if this variable should be processed
vbld_TempMacros.Add name, val
Next

Regarding reading from a file, you could again use a Run Script step to iterate over the file contents and assign the values to temporary macros. Something like the attached sample.
Attached Files
File Type: bld readtempmacros.bld (1.3 KB, 2624 views)
Reply With Quote
  #9  
Old 04-24-2014, 05:39 PM
deramor deramor is online now
Registered User
 
Join Date: 05-11-2011
Posts: 27
Quote:
Originally Posted by kinook View Post
VBP implements an order of precedence (temporary, project, global, system [highest to lowest]) when macros are referenced like %MACRO_NAME% within step fields (or like Application.ExpandMacrosAndScript("%MACRO_NAME%") within script code), and overriding a project macro (which defines the default) with a temporary macro (on the command-line) is an ideal use of this feature. See the following help topics/samples for more details:

http://www.visualbuild.com/Manual/?macrostab.htm
http://www.visualbuild.com/Manual/?hints.htm (3rd from last bullet)
http://www.visualbuild.com/Manual/?v...dprosample.htm
I realize this is an old topic but I couldn't find an answer to my question and this thread was the closest I could get. I attempted to pass a value on the command line to change the value of a project macro. However this method caused a temporary macro to be created instead. From reading the thread and the links this is expected. Is there any way other than some workaround (registry/external file) to define a project macro on the command line?
Reply With Quote
  #10  
Old 04-24-2014, 05:51 PM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 6,034
Only temporary macros can be created on the command-line. You could add a Run Script step to create/update a project macro for each temporary macro. See the attached sample.

But normally you would not want to modify a project within a build, because Visual Build will prompt for changes on exit.
http://www.kinook.com/Forum/showthread.php?t=245
Attached Files
File Type: bld ProjMacros.bld (918 Bytes, 2383 views)
Reply With Quote
Reply


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 06:15 AM.


Copyright © 1999-2023 Kinook Software, Inc.