typo fix
This is an example and template to create InterSystems package manager modules in deployed mode - without source code.
Learn more on deployed mode here.
Open IRIS terminal and install:
USER>zpm “install deployed-oscript-template”
Module will install two classes:
dc.deployed.ObjectScript and dc.withsource.ObjectScript
To test them run:
Do ##class(dc.deployed.ObjectScript).Test()
and then
Do ##class(dc.withsource.ObjectScript).Test()
you can check the source code with the following commands:
first deploed mode:
k text do ##class(%Compiler.UDL.TextServices).GetTextAsString($namespace, "dc.deployed.ObjectScript", .text) w text
and with source code:
k text do ##class(%Compiler.UDL.TextServices).GetTextAsString($namespace, "dc.withsource.ObjectScript", .text) w text
But if you check the source code you’ll see it only for dc.withsource.ObjectScript, whereas dc.deployed.ObjectScript will contain only the signatures of class and methods.
To make class package or a particlular class being published in registry as deployed include Deploy=“true” element in a resource. See the module.xml as an example.
So when you will publish the package it will be published in a deployed mode.
The idea is to be able working with a source code in your repository and publish packages for commercial usage without source code in a deployed mode.
This template illustrates the approach.
When you use load command e.g. to load package into IRIS it loads it with source code. So publish and install command work with a deployed mode.
The workflow looks as following:
Make sure you have git and Docker desktop installed.
Clone/git pull the repo into any local directory
$ git clone https://github.com/intersystems-community/objectscript-docker-template.git
Open the terminal in this directory and run:
$ docker-compose build
$ docker-compose up -d
Click on InterSystems Menu in the bottombar and choose Refresh Connection to connect VS-Code to a running IRIS instance
Open IRIS terminal:
$ docker-compose exec iris iris session iris
write ##class(dc.deployed.ObjectScript).Test()
This repository is ready to code in VSCode with ObjectScript plugin.
Install VSCode, Docker and ObjectScript plugin and open the folder in VSCode.
Open /src/cls/PackageSample/ObjectScript.cls class and try to make changes - it will be compiled in running IRIS docker container.