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 03-22-2004, 07:12 AM
rajivraj rajivraj is online now
Registered User
 
Join Date: 03-22-2004
Posts: 5
Send a message via Yahoo to rajivraj
Adding Steps dynamically...

Hi,

Am Rajiv...

I am an amatuer VisualBuild user

I need to dynamically generate steps during the build process. To keep it simple, I want to add multiple "Make VS.NET" steps and associated them to the proj file.

For now, I have managed to add a new Make VS.NET step to the existing steps.

Set steps=Application.Project.Steps(vbldStepMain)
steps.Add "Make VS.NET",6
steps.Item(6).Indent=2

Now, I need to set the other properties for the step. I guess,
steps.Item(6).Property(ByVal name As String)="<path of .csproj file"

For name, I tried "Filename" and it worked. Where can I find a listing of all properities?

This code I have added in a "Run Script" action. This will generate the steps and which wil subsequently be built.

Is my overall approach correct?

Cheers!
Rajiv. R
Rajspace.Org

Last edited by rajivraj; 03-22-2004 at 07:14 AM.
Reply With Quote
  #2  
Old 03-22-2004, 08:47 AM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 6,034
You've got it. One thing you could do is store the return value of the Add call and use it to set the properties (a little more efficient and compact):

set objStep = steps.Add("Make VS.NET", 6)
objStep.Indent=2
objStep.Property("xyz") = value
...

The Script.bld also demonstrates this (Dynamic project section), although it creates the steps in a separate project file and then calls it.

To see the properties you need for that action, manually create and populate a Make VS.NET step, then either print/preview the project (ensure that 'Tools | User Options | Printing | Show extended step properties' is checked) to see the custom step property names, or save and then open the .bld file in a text editor and examine the element names within that step.

Note that the property names are case sensitive. Also, be aware that when a property is set to its default value (i.e., unchecked for checkboxes, blank for strings, etc.), VBP optimizes the file/step object size by removing those properties. As long as you customize the temporary/manual step in the same way your code will need to generate it, this shouldn't be a problem (you will not need to populate such properties on the dynamic step either).
Reply With Quote
  #3  
Old 03-26-2004, 01:57 AM
rajivraj rajivraj is online now
Registered User
 
Join Date: 03-22-2004
Posts: 5
Send a message via Yahoo to rajivraj
Thanks for that!

To use print-preview for properities is nice tip.

Am now facing a weird problem! When I try to build a "Make VS.NET" step which was generated dynamically, I get this error:

Object reference not set to an instance of an object.

When I go to the step properities, check & uncheck some property (So that the Apply button is enabled) and then click on OK. Now I try to execute this step and I dont get the above listed error!!!!!! Hope I conveyed the issue.

Please advice!

Regards,
Rajiv. R
Rajspace.Org
Reply With Quote
  #4  
Old 03-26-2004, 07:36 AM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 6,034
Sounds like something is different about your dynamically generated step. Compare the before/after version of the saved step in the .bld file when checking/applying the change from the GUI and see if a property is missing or set incorrectly.
Reply With Quote
  #5  
Old 03-26-2004, 07:48 AM
rajivraj rajivraj is online now
Registered User
 
Join Date: 03-22-2004
Posts: 5
Send a message via Yahoo to rajivraj
Interesting point!

I noticed in PrintPreview that FileVer and Attr were getting added after applying the change. But even after I added these properties in my dynamic step generation, I got the same error.

Next, I noticed that I was setting Config to "release" and wondered if making it "Release" would help!

And guess what, it worked !

Then I removed FileVer and Attr properities and it still worked! So the cause was the value of Config. Also, it means that value is case-sensitive too!

Thanks.

Cheers!
Rajiv. R
Rajspace.Org
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 04:13 PM.


Copyright © 1999-2023 Kinook Software, Inc.