Kinook Software Forum

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

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 08-18-2004, 08:07 PM
jmm jmm is online now
Registered User
 
Join Date: 07-29-2004
Posts: 10
Dynamic Build does *nothing*

I am having problrms trying to run a dynamic build from a Run Script. I couldn't find any sample code that did what I want, so guessed how to do it; I am most likely doing something wrong. The relevant chunk of the Run Script (VBScript) looks like:

Dim objBld, objApp, objMacro
Set objBld = CreateObject("VisBuildSvr.Builder")
Set objApp = CreateObject("VisBuildSvr.Application")
objBld.Initialize objApp
objApp.Project.Load "%PROJDIR%\BuildVB6.bld"
Set objMacro = objApp.Project.Macros.Add("PROJFILE", ProjFile)
Set objMacro = objApp.Project.Macros.Add("BLDVERSION", "1.2.3")
Rslt = objBld.SyncBuild
if Rslt <> 0 then
msgbox "Error - Build of " & ProjFile & " returned " & Rslt & "!", vbOKOnly, "Parser.bld"
end if


The called VBP project file ("%PROJDIR%\BuildVB6.bld") contains:

<?xml version='1.0'?>
<project version='5'>
<step action='Make VB6' type='0'>
<Attr type='11'>-1</Attr>
<BinCompat type='11'>-1</BinCompat>
<Filename>%PROJFILE%</Filename>
<IncrReason type='11'>-1</IncrReason>
<Version>%BLDVERSION%</Version>
<VersionSel type='3'>2</VersionSel>
<ignorefail type='11'>-1</ignorefail>
<indent type='3'>2</indent>
<name>VB6 build</name>
</step>
</project>


The facts as known:
1) BuildVB6.bld is being read: if I hide it I get a "can't find it" error.
2) objBld.SyncBuild always returns 0 and produces no log output.
3) objBld.SyncBuild always runs *very* quickly.

Can someone suggest what is wrong?

Thanks in advance - Michael
Reply With Quote
  #2  
Old 08-19-2004, 04:08 PM
kevina kevina is online now
Registered User
 
Join Date: 03-27-2003
Posts: 825
It is hard to say for sure, but it appears that PROJFILE is a macro in the calling Build step, but you don't have % % around it, so a new variable "ProjFile" is being created (containing an empty string) which is assigned to this macro in the secondary instance executing BuildVB6.bld.

Try changing line 6 to be:

objApp.Project.Macros.Add "PROJFILE", %ProjFile%

or

objApp.Project.Macros.Add "PROJFILE", "%ProjFile%"

if this macro can contain spaces and isn't already double-quoted
Reply With Quote
  #3  
Old 08-19-2004, 06:06 PM
jmm jmm is online now
Registered User
 
Join Date: 07-29-2004
Posts: 10
Thanks for the reply kevina.

I think my example was confusing. ProjFile is a VBScript variable. For clarity, my example code should have read:

Set objMacro = objApp.Project.Macros.Add("PROJFILE", "c:\build\foo.vbp")

rather than:

Set objMacro = objApp.Project.Macros.Add("PROJFILE", ProjFile)

Rather than debugging my code, perhaps what would be most useful for me is example VBScript source using the Project.Load method to run the VS6 or VS.NET IDE via a generated or pre-packaged {VBP}.bld file. I couldn't find anything like that in the help, sample code or on the VBP website.
Reply With Quote
  #4  
Old 08-19-2004, 11:34 PM
kevina kevina is online now
Registered User
 
Join Date: 03-27-2003
Posts: 825
I'm not entirely clear what is wrong with your sample script, but I put together a quick sample that does what it seems you need to do. Put all the provided files in a folder, and run Test1.bld. Test2.bld will be dynamically instantiated, and it will in turn compile Test.vbp (and the log from the second build will be added to the log of the parent build).

Hope that helps.
Attached Files
File Type: zip dynamic build invocation.zip (1.9 KB, 1491 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 07:22 PM.


Copyright © 1999-2023 Kinook Software, Inc.