Difference between revisions of "VMS IDE Developing"

From VSI OpenVMS Wiki
Jump to: navigation, search
Line 1: Line 1:
* Bulleted list item
+
==Loading Existing Project==  
=Developing=
+
When you start working on a project that resides on OpenVMS machine, you need to download source files to your local machine. Use the '''Synchronizer''' tool as described below to download the source files.
 
 
==Syncing Source Code==
 
When you start working on a project that resides on an OpenVMS machine, you need to download source files to your local machine. For this,
 
 
# Change the <code>downloadNewFiles</code> option to "overwrite" or "edit"
 
# Change the <code>downloadNewFiles</code> option to "overwrite" or "edit"
 
# Run "VMS-IDE: Synchronize project files with VMS" command
 
# Run "VMS-IDE: Synchronize project files with VMS" command
Line 9: Line 6:
  
 
==Managing Project Source Files==
 
==Managing Project Source Files==
You can view and edit all project files from the Explorer view of Visual Studio Code.  
+
You can view and edit all project files from the '''Explorer''' view of Visual Studio Code. Please refer to Visual Studio Code [http://documentation https://code.visualstudio.com/docs/getstarted/userinterface documentation] if you want to learn more about '''Explorer''' view.
 +
 
 +
The OpenVMS project structure may look like shown below:
 +
[[File:Vms ide explorer.png|200px|thumb|none|VMS IDE Explorer]]
  
 
==Managing the Project==
 
==Managing the Project==
You can manage your VMS project from the Project Explorer view. To open the view, click Project Explorer icon on the Activity Bar  
+
You can manage your VMS project from the [[VMS_IDE_Project_Explorer|'''Project Explorer''']] view. To open the view, click ''Project Explorer'' icon on the Activity Bar.
  
 
===Managing Dependencies===
 
===Managing Dependencies===
Use the Project Dependencies panel to manage project dependencies.  
+
If you work on a complex project and you need to add dependencies, use the '''PROJET DEPENDENCIES''' section. <br>
 
Assuming that you want to add "Project B" to "Project A" dependencies, <br>
 
Assuming that you want to add "Project B" to "Project A" dependencies, <br>
 
# Select "Project A" in the Project Dependencies panel
 
# Select "Project A" in the Project Dependencies panel
 
# Right-click "Project B", and select "Add in dependencies to selected" item from the context menu.
 
# Right-click "Project B", and select "Add in dependencies to selected" item from the context menu.
 +
<br>
 +
To remove a project from dependencies
 +
# Open the '''Project Dependencies''' section.
 +
# Right-click the project, then select ''Remove from dependencies''.
  
 
=Building=
 
=Building=
 +
 +
===Building MMS===
 +
In most cases,'''MMS''' file is generated automatically when running build command. If you need to create the '''MMS''' file separately, you can do this by pressing <code>F1</code> and running <code>VMS-IDE: Create MMS</code>.
 +
 +
===Building VMS Project===
 
To build a project in VMS IDE:  
 
To build a project in VMS IDE:  
# Open the Project Explorer view.
+
# Open the [[VMS_IDE_Project_Explorer|'''Project Explorer''']] view.
# Select the project you want to build in the Project Dependencies panel.
+
# Select the project you want to build in the '''Project Dependencies''' section.
# In the Project Description panel, select the required build type (<code>DEBUG</code> or <code>RELEASE</code>) simply by clicking the '''buildType''' parameter.
+
# In the '''Project Description''' section, select the required build type (<code>DEBUG</code> or <code>RELEASE</code>) by clicking the '''buildType''' parameter.
 
# Right-click the project and select ''Build with dependencies'' from the context menu.
 
# Right-click the project and select ''Build with dependencies'' from the context menu.
  
 +
Before running build procedure VMS IDE checks that files are modified (''sourceState'' parameter is set to ''modified'') and there is no actual build on the server (''buildState'' is ''not build'').
 +
If conditions are met, VMS IDE uploads source files to the OpenVMS machine and runs build procedure.
 +
If you need to build the project, even if there are no changes, use ''Rebuild with dependencies''.
 +
 +
===Building with Custom Procedure===
 
To build a project using a custom build procedure, edit the ''task.json'' file  
 
To build a project using a custom build procedure, edit the ''task.json'' file  
 
<pre>{
 
<pre>{
Line 32: Line 46:
 
   "command": "vmssoftware.synchronizer.buildProject",
 
   "command": "vmssoftware.synchronizer.buildProject",
 
   "extension": "vmssoftware.synchronizer",
 
   "extension": "vmssoftware.synchronizer",
   "parameter": "time.com",
+
   "parameter": "build.com",
   "label": "VMS: Time",
+
   "label": "Build Procedure",
 
   "problemMatcher": []
 
   "problemMatcher": []
 
}</pre>
 
}</pre>
Line 41: Line 55:
 
All other parameters must be as shown in example.
 
All other parameters must be as shown in example.
  
=Running=
+
'''NOTE''': see Visual Studio Code [https://code.visualstudio.com/docs/editor/tasks documentation] for more information on '''tasks'''.
  
 
=Debugging=
 
=Debugging=
To debug your application, press <code>F5</code>. If there is no "launch.json" file in the project directory, you will be asked to select environment. Select VMS Debugger from the popup list.
+
Use [[VMS_IDE_Debugger|Debugger]] view for debugging OpenVMS projects.
 
+
To start debugging session, press <code>F5</code>. If there is no "launch.json" file in the project directory, you will be asked to select the environment. Select <code>VMS Debugger</code> from the popup list.
The "launch.json" file will be created and filled with the required information. There are two types of launch - '''DEBUG''' and '''RUN'''.
+
The '''launch.json''' file will be created and filled with the required information. There are two types of launch configuration - '''DEBUG''' and '''RUN'''.
For the "program" field, specify the relative path to the executable (from home directory), for example "[.project.bin.release]hello.exe".  
+
<pre>"configurations": [
If the field is empty, VMS IDE will try to fill it with data from project settings.
+
        {
 
+
            "type": "vms_dbg",
To choose which configuration will take action go to "Debug" (Ctrl-Shift-D) and select the appropriate configuration from the drop-down list.
+
            "request": "launch",
 +
            "name": "Debug",
 +
            "program": "",
 +
            "arguments": "",
 +
            "stopOnEntry": true,
 +
            "typeRun": "DEBUG"
 +
        }
 +
    ]
 +
}</pre>
 +
For the '''program''' field, specify the relative path to the executable, for example <code>[.project.bin.release]hello.exe</code>.  
 +
If the field is empty, VMS IDE will try to fill it with data from the project settings.
  
 +
To choose which configuration will take action go to "Debug" (<code>Ctrl-Shift-D</code>) and select the appropriate configuration from the drop-down list.
 
Press <code>F5</code> again to run debugger.
 
Press <code>F5</code> again to run debugger.

Revision as of 13:47, 29 March 2019

Loading Existing Project

When you start working on a project that resides on OpenVMS machine, you need to download source files to your local machine. Use the Synchronizer tool as described below to download the source files.

  1. Change the downloadNewFiles option to "overwrite" or "edit"
  2. Run "VMS-IDE: Synchronize project files with VMS" command
  3. After all project files are downloaded, change the downloadNewFiles option to "skip" or "edit" to prevent silent overwriting of local files.

Managing Project Source Files

You can view and edit all project files from the Explorer view of Visual Studio Code. Please refer to Visual Studio Code https://code.visualstudio.com/docs/getstarted/userinterface documentation if you want to learn more about Explorer view.

The OpenVMS project structure may look like shown below:

VMS IDE Explorer

Managing the Project

You can manage your VMS project from the Project Explorer view. To open the view, click Project Explorer icon on the Activity Bar.

Managing Dependencies

If you work on a complex project and you need to add dependencies, use the PROJET DEPENDENCIES section.
Assuming that you want to add "Project B" to "Project A" dependencies,

  1. Select "Project A" in the Project Dependencies panel
  2. Right-click "Project B", and select "Add in dependencies to selected" item from the context menu.


To remove a project from dependencies

  1. Open the Project Dependencies section.
  2. Right-click the project, then select Remove from dependencies.

Building

Building MMS

In most cases,MMS file is generated automatically when running build command. If you need to create the MMS file separately, you can do this by pressing F1 and running VMS-IDE: Create MMS.

Building VMS Project

To build a project in VMS IDE:

  1. Open the Project Explorer view.
  2. Select the project you want to build in the Project Dependencies section.
  3. In the Project Description section, select the required build type (DEBUG or RELEASE) by clicking the buildType parameter.
  4. Right-click the project and select Build with dependencies from the context menu.

Before running build procedure VMS IDE checks that files are modified (sourceState parameter is set to modified) and there is no actual build on the server (buildState is not build). If conditions are met, VMS IDE uploads source files to the OpenVMS machine and runs build procedure. If you need to build the project, even if there are no changes, use Rebuild with dependencies.

Building with Custom Procedure

To build a project using a custom build procedure, edit the task.json file

{
  "type": "task2cmd",
  "command": "vmssoftware.synchronizer.buildProject",
  "extension": "vmssoftware.synchronizer",
  "parameter": "build.com",
  "label": "Build Procedure",
  "problemMatcher": []
}

where

  • parameter is the name of your build procedure (COM file)
  • label meaningful task name

All other parameters must be as shown in example.

NOTE: see Visual Studio Code documentation for more information on tasks.

Debugging

Use Debugger view for debugging OpenVMS projects. To start debugging session, press F5. If there is no "launch.json" file in the project directory, you will be asked to select the environment. Select VMS Debugger from the popup list. The launch.json file will be created and filled with the required information. There are two types of launch configuration - DEBUG and RUN.

"configurations": [
        {
            "type": "vms_dbg",
            "request": "launch",
            "name": "Debug",
            "program": "",
            "arguments": "",
            "stopOnEntry": true,
            "typeRun": "DEBUG"
        }
    ]
}

For the program field, specify the relative path to the executable, for example [.project.bin.release]hello.exe. If the field is empty, VMS IDE will try to fill it with data from the project settings.

To choose which configuration will take action go to "Debug" (Ctrl-Shift-D) and select the appropriate configuration from the drop-down list. Press F5 again to run debugger.