· Sep 29, 2019 2m read

Setting up The Folder Structure of ObjectScript Code For InterSystems Package Manager

Hi Developers!

When you prepare your modules for ZPM (InterSystems Package Manager) it expects the certain directory structure for ObjectScript source files.

ObjectScript in your source folder need to be stored by types in the following subfolders. E.g. if you have the source folder named as /src the structure should be as follows:


        /cls - for classes

         /inc - for include files

         /mac - for mac files

         /int - for interpretable files

         /gbl - for globals

And the ObjectScript should be in CLS (a.k.a UDL) and not in XML.


Ok! But how could you setup it for your current ObjectScript packages?  Manually?


There are at least 2 ways to manage this.

1. Use isc-dev module

Import isc-dev module via ZPM as:

zpm:USER>install isc-dev

Or import the release into the namespace.

Setup the workdir for isc-dev:

USER>Do ##class(dev.code).workdir("/yoursourcedir")

USER>Do ##class(dev.code).export()

It will export all the source code in CLS into "/yoursourcedir" folder and will create proper folders structure with file types and packages.


2. Another way to do the proper export is to use VSCode ObjectScript

1. Open the folder with your project where your want to export sources.

2. Create the source folder, .e.g. /src

3. Put the src folder in VSCode settings.json and add   

  "objectscript.export.addCategory": true,


    "objectscript.export.folder": "src"

into the settings. E.g. here is the example of settings.json file:

  "": true,

    "objectscript.conn.version": 3,

    "objectscript.conn.ns": "USER",

    "objectscript.conn.port": 52773, 

    "objectscript.export.addCategory": true,

    "objectscript.export.folder": "src"

After that open InterSystems ObjectScript section in VSCode, find the package you want to export or all of them and click Export:

Discussion (0)1
Log in or sign up to continue