Jump to content

Feature Guide: Integrating Dragon with Source Code Control (e.g. Git or SVN)

Jim Kring

Recommended Posts

When working with a source code control system like Git or SVN, here's how you'll want to treat the various files used by Dragon.

First, it's important to note that, in general, you should NOT add the virtual environment ("lv-venv" folder) to source code control (see LabVIEW Virtual Environments for more information about working with virtual environments).

Dragon will create and manage the virtual environment on each developer's system independently. This folder may contain platform and system dependent components, which could be different on each developer's system.

With that said, here are the file types that you DO want to add to source code control:

  • *.dragon - This is a Dragon Project file and all of its settings.
  • *.vipc - This is a VI Package Configuration file. It contains a list of all the packages required by your project, and optionally can contain a copy of the actual package file itself.
  • *.vipb - This is a VI Package Build Specification file. It is used by projects that have a VI Package build output. 



Link to comment
Share on other sites

What would occur in this situation?

1.- LV-env folder is out of source code control.

2.- .dragon and .vipc have, for example , 2 packages installed on the lv-env folder.

3.- I use some of the vis in my source code

4.- I’m happy with that and I make a commit

5.- Now I include another package so .vipc changes (.dragon only points this .vipc file so it doesn’t change)

6.- I make changes on my source code including vis of the new package

7.- I’m happy with that again and make a new commit

But I want to return to previous commit (step 4) reverting code with GIT for example.

My source code returns correctly and the same happens to the .dragon and .vipc, but the content of the lv-env folder does not reflect what is written on the .vipc. It has some… “orphan vis”….

How to deal with this situation?... I suppose I can delete the lv-env folder and generate it again applying the .vipc file. But if I have many packages installed this could take a lot of time

It would be great if it was only necessary to apply the .vipc file and dragon recognize that there are some “orphan packages” installed and delete them


Link to comment
Share on other sites

Great question @Mariano Aristu.

Short answer: Dragon will show you this dialog, asking if you want to install the packages defined in your .vipc file, when you open the project.


Longer answer: When you open the project in Dragon, for example by double-clicking the .dragon file in Windows Explorer or opening it from the recent project's list in the Dragon Welcome screen, then Dragon will check to make sure that your project's virtual environment has all the packages installed that are defined in the .vipc file.  If Dragon detects that there are packages that need to be installed, then it will prompt you to install them, before it loads the .lvproj file into memory.  Or, if your project is configured to not use a virtual environment, then Dragon will check to make sure all the packages in the .vipc file are installed in the global LabVIEW environment.

Let me know if that makes sense or if you have any more questions. This is a great question, I'm sure others will have, too.


Link to comment
Share on other sites

The current behavior is: Dragon won't prompt you, if you have packages installed that are not in the .vipc.  Consider the .vipc as the "requirements" and if all the requirements are satisfied, then things are "OK."

Can you think of situations and use-cases where you need a different behavior?

Link to comment
Share on other sites

Ok, Now I understand. Dragon still knows the packages that are installed on lv-env folder despite the vipc file says that source code does not need them.

The behavior seems now correct to me. I'm doing some tests but not in my production code, but I'm exicted to use it in production. I have several programs divided in many packages installed in the same vi.lib folder and dragon will help me to  lighten up the functions palette.

Thank you.

  • Like 1
Link to comment
Share on other sites

Yes, exactly. Dragon knows, by looking at the virtual environment (since it contains a package installation database), which packages are installed.

I'm glad this looks promising to you, for use in production.

Thanks for keeping the great questions coming.

Link to comment
Share on other sites

Join the conversation

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

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.