Jump to content

LabVOOP Class Library Management with VIPM and OpenG Package Builder


Recommended Posts

Crossposted to OpenG forums. However I thought that LAVA is really the correct place for these questions as OpenG forum is pretty dead.

GENERAL

Most of my software development nowdays is developing LabVOOP class libraries. Until now I've been developing classes "in-place" i.e. in their final location. Until now this has worked reasonably well as long as I've kept backups up to date. Now this path has finally reached it's end and we need to move to more sophisticated development process with an extra build step. So I want to develop my libraries in one location, build an installer package and install the package to another location.

I decided to go with the combination of OpenG Package Builder and VI Package Manager as dependency control is a must have when there are multiple related libraries with inter-library dependencies. LabVIEW application builder don't allow me to specify package dependencies which will eventually lead to problems to library users and that would mean support requests to me that is not an option.

First some general issues. My LVOOP classes depend on one another. Mostly the dependency is such that one class depend on another class but not vice versa. The dependencies can be inheritance, composition or usage on block diagram or front panel. I've been thinking of a package model in which I build independent classes first and install them to their final location using VIPM. Then when developing classes that depend on these independent classes, I link the dependent classes to the independent classes in the installed location and not in the source location. An example could help here.

<EXAMPLE>

Let's assume I have classes A, B and C.

  • Class C depends on classes A and B
  • Class B depends on class A

My source file locations for A, B and C are My Documents\A, My Documents\B and My Documents\C respectively. I'd like to install class A to <user.lib>\A, class B to <user.lib>\B and class C to <user.lib>\C.

So I first develop A in "My Documents\A", build a package from it and install it to <user.lib>\A. Then I develop class B in "My Documents\B" and link it to class A in <user.lib>\A. Then I package B and install B to <user.lib>\B. Finally I develop C in "My Documents\C", link it to classes A and B in <user.lib>\A and <user.lib>\B, build a package of C and install it to <user.lib>\C.

</EXAMPLE>

The issue that is open to me now is that if this is really wise way of doing the build process? The downside of this process is that if I want to modify something in all of the classes A, B, and C, then I cannot do that in a single project but I need to first modify A, then install modified A, then modify B, then install modified B and so on. This may be complicated when the project contains multiple dependent classes. Any recommendations and experience on this issue?

BUILDING PACKAGES WITH OPENG PACKAGE BUILDER

OpenG Package Builder is currently at version 0.1.0alpha6, so it's a pretty young product, however very nice and after some playing around quite intuitive as well. However it doesn't contain any help and when something is not clear, I don't find any answers. So I decided to ask them here.

  • In General tab there is a version and a release number. Is version number and the release number combined to a form major.minor.release or are version and release number complitely independent of one another.
  • In the Package Files tab, if I create a new file group and use file mask *.* for source files, are folders in the source directory included recursively into the build or do I need to manually select each sub folder in the source hierarchy
  • In the Package Files tab, if I chage Group Source Directory a message pops up "Abosulte value of dependent paths may be either kept as is or revised according to new base directory". What does this actually mean?
  • In the Package Files tab, there are a few replace modes. If I select "Is Newer" what actually is meant by newer in this context?
  • In the Platform tab, I'd need to require LV 8.20 or newer but this option is not yet supported. Perhaps somebody can make the modification...
  • In the Platform tab, What are allowerd values for the OS string? What is meant with "OS is greater than <some string>"?
  • I tried to add dependencies but I couldn't get them to work. VIPM didn't complain of dependecies even though I added them here. Should or can the Revision number be included in the version number in dependency management?
  • In the Script VIs tab, What is the interface for the VIs that can be used here?

INSTALLING PACKAGES WITH VIPM

VI Package Manager is currently at version 1.0 and is pretty polished and very easy to use. I have some VIPM related issues I'd like to ask here:

  • I can add add local Packages to the list of packages from the Package menu. Can I remove packages from the list somehow?
  • Can I add Packages by remote URL, not just files?
  • I didn't get the dependency management to work but I guess this is an issue of package builder.

Best regards,

Tomi

Link to comment

As usual Tomi gets paid by the word-count ;)

I'll try to answer some off you questions (Jim has a much better knowledge of builder)

QUOTE(Tomi Maila @ Apr 25 2007, 08:21 PM)

  • In General tab there is a version and a release number. Is version number and the release number combined to a form major.minor.release or are version and release number complitely independent of one another.

In general, it's up to the packager (eg. you)

QUOTE

In the
Package Files
tab, if I create a new file group and use file mask *.* for source files, are folders in the source directory included recursively into the build or do I need to manually select each sub folder in the source hierarchy

As far as I know it only does the actual directory, and reads the file on build/package time.

QUOTE

In the
Package Files
tab, if I chage
Group Source Directory
a message pops up "
Abosulte value of dependent paths may be either kept as is or revised according to new base directory
". What does this actually mean?

Let's say you had a source dir 'source_test' and a path 'data\file1' meaning source_test\data\file1

Now if you change 'source_test' to 'source' the new path can be left OR become source\data\file1

QUOTE

In the
Platform
tab, I'd need to require
LV
8.20 or newer but this option is not yet supported. Perhaps somebody can make the modification...

If I'm correct you can just add another version if you like

QUOTE

Should or can the Revision number be included in the version number in dependency management?

Yes

QUOTE

In the
Script VIs
tab, What is the interface for the VIs that can be used here?

The builder API vi's in the palette have some templates.

Please notice the times I said 'I think' etc. A lot can be traced by looking at the source code of builder/packager....

Be warned that the current version does not have lvclass support, the next version should have.

Ton

Link to comment

Hi Tomi,

> [GENERAL]

> I decided to go with the combination of OpenG Package Builder and VI Package Manager as dependency control is a must have when there are multiple related libraries with inter-library dependencies. LabVIEW application builder don't allow me to specify package dependencies which will eventually lead to problems to library users and that would mean support requests to me that is not an option.

That's great to hear. We (JKI) are going to work hard to make this a powerful solution for you, as a tool developer.

> The issue that is open to me now is that if this is really wise way of doing the build process? The downside of this process is that if I want to modify something in all of the classes A, B, and C, then I cannot do that in a single project but I need to first modify A, then install modified A, then modify B, then install modified B and so on. This may be complicated when the project contains multiple dependent classes. Any recommendations and experience on this issue?

This is a tough question to answer. There are costs and benefits on both sides. It really depends on how much value you will get by decoupling the development+release cycles of the classes, and there are two main factors to consider:

  • what the dependency tree/matrix looks like
  • how often you will be releasing each component

Personally, I prefer to develop each component seperately and rely on the dependency management capabilities of VIPM.

> [BUILDING PACKAGES WITH OPENG PACKAGE BUILDER]

> In General tab there is a version and a release number. Is version number and the release number combined to a form major.minor.release or are version and release number complitely independent of one another.

Release number applies to the package, independent of what is being packaged. For example, if we change the LabVIEW version compatibility declared by the package without actually changing (rebuilding) the library (that is being packaged/installed), we will increment the release number. The version and release number are used in the package name, as follows:

name-version-release.ogp

For example, let's look at the following package:

oglib_array-1.0-2.ogp

In this case:

  • name = oglib_array
  • version = 1.0
  • release = 2

> In the Package Files tab, if I create a new file group and use file mask *.* for source files, are folders in the source directory included recursively into the build or do I need to manually select each sub folder in the source hierarchy

Subfolders are not added recursively. This is an annoying limitation, and one which I would love to remedy, ASAP.

As a work-around, here is a VI that I use to create a File Group list of files from a directory, recursively:

http://forums.lavag.org/index.php?act=attach&type=post&id=5638

Note: This VI ignores CVS and .svn folders and also ignores files that begin with a period (".")

> In the Package Files tab, if I chage Group Source Directory a message pops up "Abosulte value of dependent paths may be either kept as is or revised according to new base directory". What does this actually mean?

There are many paths that can be specified relative to other paths.

The paths of files in a File Group are specified relative to the File Group's Source directory. If you change the Source directory, you have two options:

  1. Abosulte value of dependent paths may be either kept as is - do not change the absolute path of the files and recalculate the relative path to the new Source directory
  2. (Abosulte value) revised according to new base directory - change the absolute path of the files, leaving the relative path to the Source directory unchanged

> In the Package Files tab, there are a few replace modes. If I select "Is Newer" what actually is meant by newer in this context?

"Is Newer" means "Replace the file if the one in the package is newer (by timestamp) than the one on disk".

>In the Platform tab, I'd need to require LV 8.20 or newer but this option is not yet supported. Perhaps somebody can make the modification...

Thanks for reporting this -- I'll make the change. Actually you can just type in "8.2" -- this text input is a string control with a menu ring, for convenience.

>In the Platform tab, What are allowerd values for the OS string?

This is tested against the LabVIEW Application property "Operating System: Name". Valid values are:

  • Windows 95
  • Windows NT
  • Mac OS
  • Linux

>What is meant with "OS is greater than <some string>"?

Operating systems have a version. This tested against the LabVIEW Application property "Operating System:Version Number"

Note that

Windows NT = 5.1 ==> "Windows XP"

Windows NT = 5.0 ==> "Windows 2000"

I'm not sure, off hand, what Windows Vista will be, in terms of "Operating System: Name" and "Operating System: Version Number".

>I tried to add dependencies but I couldn't get them to work. VIPM didn't complain of dependecies even though I added them here. Should or can the Revision number be included in the version number in dependency management?

Yes, revision numbers can be used in dependency declarations.

>In the Script VIs tab, What is the interface for the VIs that can be used here?

There is no defined interface. The VIs are invoked with the VI "Run" method and are not passed any data. If the VI has an "error out" indicator, it will be read by VIPM after the VI completes execution.

> [INSTALLING PACKAGES WITH VIPM]

> VI Package Manager is currently at version 1.0 and is pretty polished and very easy to use. I have some VIPM related issues I'd like to ask here:

Thanks. That's good to hear :)

> I can add add local Packages to the list of packages from the Package menu. Can I remove packages from the list somehow?

There is no simple way to do this, right now. It is on our radar. For now, simply go into the "cache" folder and delete your_package.ogp, your_package.bmp, and your_package.spec -- this will cause the package to disappear, the next time you check the network for packages or restart VIPM.

> Can I add Packages by remote URL, not just files?

No, VIPM does not have such a feature. I've made a note of it and we will consider it, for future development.

> I didn't get the dependency management to work but I guess this is an issue of package builder.

It should be working. Ping me, off-line, and I'll be happy to work out any details with you.

Thanks for your interest. Keep the questions coming and I'll do my best to address them :)

Lastly, there is a very old document, here, that documents the spec file format. This is not 100% accurate/current, but may have some answers to questions.

Thanks,

-Jim

Link to comment

Ton and Jim,

Thanks for extensive answeres.

> [BUILDING PACKAGES WITH OPENG PACKAGE BUILDER]

> Subfolders are not added recursively. This is an annoying limitation, and one which I would love to remedy, ASAP.

There are two must have features:

- adding files recursively boolean option

- for each include files pattern, excluding files that match another pattern (with recursive boolean option as well)

Do you Jim have time to work on these two?

Additional nice to have features would be:

- adding support for project file (lvproj), a library (lvlib), a class file (lvclass), XControl (xcontrol), XNode (xnode) in such a way that all items referred in these files will be automatically included in the build. Notice that items of project files can also be project files so these files need to be iterated recursively.

- ability to exclude certain files from the project

>>I tried to add dependencies but I couldn't get them to work. VIPM didn't complain of dependecies even though I added them here. Should or can the Revision number be included in the version number in dependency management?

>Yes, revision numbers can be used in dependency declarations.

Ok. There is a bug in the Package Builder that doesn't allow adding the dependency in the form x.y-z but requires it to be of the form x.y.z. When I added the dependency in the form x.y.z it didn't seem to work correctly with VIPM. So there is also a bug in the VIPM as it should generate an error and not try to install a package for which dependency is not found.

>>In the Script VIs tab, What is the interface for the VIs that can be used here?

>There is no defined interface. The VIs are invoked with the VI "Run" method and are not passed any data. If the VI has an "error out" indicator, it will be read by VIPM after the VI completes execution.

If no data is passed to these VIs, how do I find out the installation location, the source location etc? It may be hard to execute any meaningful actions if the installation parameters cannot be accessed. I suggest that VIPM would set up some way to access all the build and current build step related information from the custom build steps.

>Ton: Be warned that the current version does not have lvclass support, the next version should have.

What do you mean by lvclass support? What would it do?

> [INSTALLING PACKAGES WITH VIPM]

>> I can add add local Packages to the list of packages from the Package menu. Can I remove packages from the list somehow?

>There is no simple way to do this, right now.

It would be nice to have remove funtionality in the UI.

>> Can I add Packages by remote URL, not just files?

>No, VIPM does not have such a feature. I've made a note of it and we will consider it, for future development.

I strongly recommend JKI to adopt the mechanism that is used for Eclipse plugins. Eclipse has a default package repository in a similar way as VIPM has a default repository. However Eclipse allows users to add any number of custom repositories as well. These repositories are specified by an URI. The repositories can be local (file://) or on the network (http://).

>Thanks for your interest. Keep the questions coming and I'll do my best to address them :)

I'd like to see embedded version of VIPM that I could include in my application to manage my software related packages. I will not need this feature yet, but I guess I will need it later on. Do you think this would be possible? I ask this now because if this is not possible, then I may still need to reconsider if VIPM is the right solution for managing my tools. ;)

Tomi

Link to comment

QUOTE(Tomi Maila @ Apr 26 2007, 12:14 PM)

There are two must have features:

- adding files recursively boolean option

- for each include files pattern, excluding files that match another pattern (with recursive boolean option as well)

That would be great, a colleague of mine is doing something like this, I'll ask him what his opinions are (or just steal the code :o )

QUOTE

- adding support for project file (lvproj), a library (lvlib), a class file (lvclass), XControl (xcontrol), XNode (xnode) in such a way that all items referred in these files will be automatically included in the build. Notice that items of project files can also be project files so these files need to be iterated recursively.

- ability to exclude certain files from the project

Currently builder is mainly a LV 6.1 project, so it is kinda hard to include support for lvproj etc. However Jim has managed to do this!

I have used some beta version that has support for xctl/lvlib. It works, but it isn't fully clear what the program should do with leftovers (NI removes these with 'remove unreferenced library members') and how to detect them.

QUOTE

What do you mean by lvclass support? What would it do?

I'm not sure because I never used lvclasses. But I think just like the XCTL code I used where I could select a XCTL as top-level and build a LLB with the XCTL as top-level item and I could just load the xctl! I think for lvclasses something similar can be done, I advice you to share your insights with Jim.

I have thought about LVproject support (like importing the current NI builder rules or something, but that is kinda hard to do.

What thoughts for project did you have in mind?

Ton

Link to comment

QUOTE(chrisdavis @ Apr 28 2007, 07:01 PM)

I believe OpenG Package Builder will allow you to package any type of file, not just VIs. I do believe Tomi would like a way to recursivly add directories of files to an OpenG Package which is a valid request for the package builder.

In my response to Tomi, I posted a work-around that will allow recursively adding directories. I would like to add native support for this -- I need it, too :)

Link to comment

I made this modification to my copy and I was able to add files recursively. I didn't make an exhaustive test, just a couple of files, but I don't see why it wouldn't work all the time. With a few more UI tweaks it could be made to be turned on with a checkbox.

The old version

http://forums.lavag.org/index.php?act=attach&type=post&id=5667

The new version

http://forums.lavag.org/index.php?act=attach&type=post&id=5668

Jim's workaround has the nice capability to not add subversion and CVS files, which could also be added at this point in the code.

On second thought, that capability might be more appropriate if added to the recursive file listing VI in the OpenG file package...

Link to comment

Join the conversation

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

Guest
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.