Skip to content

Commit 8d8f370

Browse files
committed
Added walkthrough for local development
Signed-off-by: Liam Barry Allan <[email protected]>
1 parent 9f6b0f3 commit 8d8f370

File tree

13 files changed

+168
-0
lines changed

13 files changed

+168
-0
lines changed
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
#
2+
3+
## Creating an `actions.json` file
4+
5+
The `actions.json` file defines what commands should be used to build your application. It belongs in the `.vscode` folder.
6+
7+
The company_system repository comes with an existing one that uses `gmake` (GNU Make) to build the application, but you could also set up an action to:
8+
9+
* run the `CRTBNDxxx` directory
10+
* run `gmake`
11+
* run `makei` (ibmi-bob)
12+
13+
**You do not need a build tool** like ibmi-bob or GNU Make to compile programs.
14+
15+
You also have access to some variables in the command:
16+
17+
* `&CURLIB` and `&BUILDLIB` is the current library as setup in VS Code
18+
* `&RELATIVEPATH` is the path to the source being compiled
19+
* `&BASENAME` for the name and extension of the file
20+
* `&NAME` for just the name, useful for object parameter
21+
* `&USERNAME` for the currently signed in username
22+
23+
For the errors (EVFEVENT) to be returned for the compile on the active source, `*EVENTF` must be in the command string. Notice below that `deployFirst` is set to `true` on all Actions. This is to make sure source code gets uploaded to the Deploy directory before the Action is run.
24+
25+
#### Running an ILE command
26+
27+
```json
28+
{
29+
"name": "Compile with CRTBNDRPG 🔨",
30+
"command": "CRTBNDRPG PGM(&CURLIB/&NAME) SRCSTMF('&RELATIVEPATH') OPTION(*EVENTF) DBGVIEW(*SOURCE) TGTRLS(*CURRENT)",
31+
"environment": "ile",
32+
"deployFirst": true,
33+
"extensions": [
34+
"RPGLE"
35+
]
36+
}
37+
```
38+
39+
#### Running a pase command (make)
40+
41+
**Note:** this would build the entire project.
42+
43+
```json
44+
{
45+
"name": "Build and deploy with make 🔨",
46+
"command": "/QOpenSys/pkgs/bin/gmake BIN_LIB=&CURLIB OPT=*EVENTF",
47+
"environment": "pase",
48+
"deployFirst": true,
49+
"extensions": [
50+
"GLOBAL"
51+
]
52+
}
53+
```
54+
55+
#### Running a pase command (ibmi-bob)
56+
57+
**Note:** this would build the entire project. Look into use `makei compile` to build a single source.
58+
59+
```json
60+
{
61+
"name": "Deploy & build with bob 🔨",
62+
"command": "OPT=*EVENTF BUILDLIB=&CURLIB /QOpenSys/pkgs/bin/makei build",
63+
"extensions": [
64+
"GLOBAL"
65+
],
66+
"environment": "pase",
67+
"deployFirst": true
68+
}
69+
```
715 KB
Loading
761 KB
Loading
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#
2+
3+
## Running an Action / compiling code
4+
5+
You can use the Control / Command + E shortcut to run an Action when you have opened some source code. This will prompt all available Actions for the current source.
6+
7+
![](./actions-running.png)
8+
9+
Selecting an Action with `deployFirst` as `true` will ask you which files you want to deploy:
10+
11+
* All: deploy all sources from my local machine
12+
* Working changes: deploy my working changes (when git is used)
13+
* Staged changes: deploy my staged changes (when git is used)
14+
15+
You should do 'All' for the first time, and then when you're confident the source is on the server you can use Working or Staged changes.
16+
17+
![](./actions-results-1.png)
18+
19+
You can see what happened from the Action being run here:
20+
21+
1. it set the working home directory to the Deploy directory on the IFS
22+
2. It uploaded files to that directory
23+
3. It failed to run the command. You can click on Show Output to see the job log and spool file if there is one.
24+
25+
![](./actions-results-2.png)
26+
27+
If there are any source errors, you will see them appear in the editor. **This requires \*EVENTF on the Action command**.
633 KB
Loading

content/code-ibmi-local/connect.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#
2+
3+
## Get connected
4+
5+
The next step is to get connect to the system where you want to compile your code. Head over to the Code for IBM i tab and either connect to a new system (red arrow) or connect to an existing one (blue arrow).
6+
7+
![](./connect.png)
8+
9+
The first time you connect with a folder / workspace open, it will give you two notices.
10+
11+
* What your current library is. You can click Change to change it to the library you want to build your objects in. This is usually your own developer library.
12+
* If you'd like to use a default location to upload your local sources to (the 'Deploy directory'). It defaults a builds folder in the standard home directory for a user. You should select Yes. You can change this later if you wanted to.pop
13+
14+
![](./popups.png)
425 KB
Loading

content/code-ibmi-local/git.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
## Using git in Visual Studio Code
2+
3+
Visual Studio Code has an excellent git client to go along with it. Because you are developing on the local machine, it means you can use the great git tools available.
4+
5+
![](./git.png)

content/code-ibmi-local/git.png

706 KB
Loading

content/code-ibmi-local/popups.png

763 KB
Loading

0 commit comments

Comments
 (0)