Jump to content

Programatically Adjusting Build Specs


Recommended Posts

So, I have a tricky, but theoretically simple goal... I would like to ensure that when I build packed library (or any other format of plugin / source distribution), that the build version is set to the same number of my top level library. This way, both within and outside labview I can have everything see the correct version number.

Right now, I have to remember to set bot the lvlib/lvclass version number before running my build, so I started thinking "there must be a better way". I got a chunk of the way there, using various property nodes, and a Pre-Build VI, but I seem to be missing a few pieces of the puzzle.

I have attached one of my attempts, in the hope that maybe one of you guys might be able to help me get to my goal here :)

(I'm also open to tackling the problem from the other side, getting the build spec version and making the lvlib match)

Shaun

Pre-Build Action (attempt 1).vi

Link to comment

So, I have a tricky, but theoretically simple goal... I would like to ensure that when I build packed library (or any other format of plugin / source distribution), that the build version is set to the same number of my top level library. This way, both within and outside labview I can have everything see the correct version number.

Right now, I have to remember to set bot the lvlib/lvclass version number before running my build, so I started thinking "there must be a better way". I got a chunk of the way there, using various property nodes, and a Pre-Build VI, but I seem to be missing a few pieces of the puzzle.

I have attached one of my attempts, in the hope that maybe one of you guys might be able to help me get to my goal here :)

(I'm also open to tackling the problem from the other side, getting the build spec version and making the lvlib match)

Shaun

Hey Shaun

I have an API for interacting with the project, I do similar things with builds for exes and installers so I thought I'd give PPL a go and see if it works.

I was able to get it to go however, I don't use the AppBuilder_API (I have never really), instead I use PN's and set the XML tags.

You should be able to replicate from this quick video:

<object id="scPlayer" width="1150" height="815" type="application/x-shockwave-flash" data="http://content.screencast.com/users/jgcode/folders/LabVIEW%202010/media/37d3ee95-c471-4465-b73f-86cb2417a0c4/jingswfplayer.swf" > <param name="movie" value="http://content.screencast.com/users/jgcode/folders/LabVIEW%202010/media/37d3ee95-c471-4465-b73f-86cb2417a0c4/jingswfplayer.swf" /> <param name="quality" value="high" /> <param name="bgcolor" value="#FFFFFF" /> <param name="flashVars" value="thumb=http://content.screencast.com/users/jgcode/folders/LabVIEW%202010/media/37d3ee95-c471-4465-b73f-86cb2417a0c4/FirstFrame.jpg&containerwidth=1150&containerheight=815&content=http://content.screencast.com/users/jgcode/folders/LabVIEW%202010/media/37d3ee95-c471-4465-b73f-86cb2417a0c4/Build%20PPL%20Build%20Spec.swf&blurover=false" /> <param name="allowFullScreen" value="true" /> <param name="scale" value="showall" /> <param name="allowScriptAccess" value="always" /> <param name="base" value="http://content.screencast.com/users/jgcode/folders/LabVIEW%202010/media/37d3ee95-c471-4465-b73f-86cb2417a0c4/" /> Unable to display content. Adobe Flash is required. </object>

  • Like 1
Link to comment

Hey Shaun

I have an API for interacting with the project, I do similar things with builds for exes and installers so I thought I'd give PPL a go and see if it works.

I was able to get it to go however, I don't use the AppBuilder_API (I have never really), instead I use PN's and set the XML tags.

You should be able to replicate from this quick video:

That's sweet. I'm not a great fan of the app builder API either. At what point does the build.vi get executed? Is it run whenever you create a new project? (wasn't clear from the video which I had to scroll around to see...lol)

Link to comment

That's sweet. I'm not a great fan of the app builder API either. At what point does the build.vi get executed? Is it run whenever you create a new project? (wasn't clear from the video which I had to scroll around to see...lol)

In the video the build script gets run @ 0:30s mark - its when the VI comes into focus (and I hit run but unfortunately it was to the left, offscreen).

Typically, you would run a build script like this anytime you want to create a build.

The script will handle e.g. synchronizing an exe's version to an installer(s) version or maybe run tests, move files around to handle 2009's new layout and error 6 (which has been fixed in 2011!) etc...

2010 released a feature where you can code pre/post build action VIs, I haven't checked these out in too much detail, and I already used to using a script

Link to comment

Thanks! That's great - I was looking into the tags, but could not see the fix/build numbers, so wasnt sure if I was in the right place (In the end, I'm presuming they were not there as those numbers are currently 0).

I'll give that a try this morning and see how I get on- thanks again!

Link to comment

Thanks! That's great - I was looking into the tags, but could not see the fix/build numbers, so wasnt sure if I was in the right place (In the end, I'm presuming they were not there as those numbers are currently 0).

No probs, glad you got your script to work - and yes that is correct, those tags are not included if value == 0.

Link to comment

Dammit... I spoke to soon - the build spec does get updated in the Pre-Build VI, but it only comes into affect on the NEXT build (so when I was testing it seemed to be working, as I was running it all over and over again ;) )

I bet if I made a stand alone builder (like yours) it would all work, but trying to hook into the regular build action seems to be a failure (in this case)

...If only there were a way to get the ref to the running build spec...

Link to comment

Dammit... I spoke to soon - the build spec does get updated in the Pre-Build VI, but it only comes into affect on the NEXT build (so when I was testing it seemed to be working, as I was running it all over and over again ;) )

I bet if I made a stand alone builder (like yours) it would all work, but trying to hook into the regular build action seems to be a failure (in this case)

...If only there were a way to get the ref to the running build spec...

Yes the building build spec runs in a different application instance. Maybe you can get your prebuild action to spit out a ref to its own application.

Link to comment

Dammit... I spoke to soon - the build spec does get updated in the Pre-Build VI, but it only comes into affect on the NEXT build (so when I was testing it seemed to be working, as I was running it all over and over again ;) )

I bet if I made a stand alone builder (like yours) it would all work, but trying to hook into the regular build action seems to be a failure (in this case)

...If only there were a way to get the ref to the running build spec...

I haven't checked your new script, and this is just off the top of my head, but if the Pre-Build VI saves the Project, does the change persist for that time its run?

Link to comment
  • 2 years later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.