Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Project file (.warproj / .warpcfg)

See also the guide: Project.

.warproj — @Project

KeyDescription
NameProject name.
DescriptionProject description.
VersionProject version (free-form string, e.g. 1.0).
Default ProfileName of the @Profile (defined in the .warpcfg, see below) used by generate/build/reverse/license-status when the CLI doesn’t receive --profile. Optional if the .warpcfg declares only one @Profile.

@Generator (nested inside @Project)

KeyDescription
NameGenerator name.
DescriptionGenerator description.
LanguageTarget language. Values: RPGLE, RPG.

@Paths (nested inside @Generator)

KeyDescription
ConfigPath to this project’s .warpcfg.
OutputFolder where the generated DDS/RPG is written.

.warpcfg — @GeneratorConfig

KeyDescriptionValues
Date FormatNative date format used to declare every Date variable (e.g. date(*dmy/) instead of plain date).ISO, USA, EUR, JIS, MDY, DMY, YMD, JUL
Date SeparatorDate separator character (e.g. / in date(*dmy/)). A single character.—
Time FormatNative time format used to declare every Time variable (e.g. time(*hms:) instead of plain time), and default for IsTime/StringToTime/TimeToString when their format argument is omitted. Usa is 12-hour with an AM/PM suffix, no seconds — structurally different from the other 4 (24-hour hh:mm:ss).Hms, Iso, Usa, Eur, Jis
Time SeparatorTime separator character (e.g. : in time(*hms:), also used by TIME()). A single character. Doesn’t apply to Usa (no separator between fields).—
Timestamp FormatDefault for IsTimestamp/StringToTimestamp/TimestampToString when their format argument is omitted. The timestamp type doesn’t accept a format in its declaration, unlike date/time. Iso is recommended for its broader compatibility.Iso, Usa, Eur, Jis
Print ModeWhat happens to the QPRINT spool file each Print("Block") writes to: with Screen the program displays it (DSPSPLF) and deletes it on exit; Printer/File just leave it spooled. Default Printer.Printer, File, Screen
CommitmentEnables commitment control for the whole project: generated programs declare their modified tables commit usropn and open them after a best-effort STRCMTCTL (tables must be journaled). A Program can override it with @Properties/Commitment. Default False.True, False
Commit on ExitWhether generated programs issue a final commit before finishing. Overridable via @Properties/Commit on Exit. Only effective if Commitment is True. Default False.True, False
DDS NamePattern for naming each Screen’s display file DDS based on its object name — e.g. <ObjectName>D appends a D. Default <ObjectName> (unchanged). Only affects the DSPF; the generated RPG driver program keeps the object name as-is. The result is always uppercased and truncated to 10 characters (OS/400 object name limit) — the variants that append D truncate to 9 first so the D is never what gets truncated.<ObjectName>, <ObjectName>D, D<ObjectName>, D<ObjectNameWithoutFirstChar>

Top-level keys (Date Format, Print Mode, Commitment, etc.), @Screen/@FunctionKeys, and the date/time/timestamp formats are unique at the project level: they aren’t repeated per profile.

@Profile (nested inside @GeneratorConfig)

A .warpcfg declares one or more deployment profiles (typically Dev, UAT, Prod, though the name is free-form) inside @GeneratorConfig. Each @Profile "Name" groups its own @Connection, @Deployment, and @License — so a single project can point to different servers/libraries/licenses depending on the environment, without maintaining several .warpcfg files.

@GeneratorConfig {
    @Profile "Dev" {
        @Connection { ... }
        @Deployment { ... }
    }
    @Profile "Prod" {
        @Connection { ... }
        @Deployment { ... }
        @License { ... }
    }
}

Declaring at least one @Profile is mandatory: @Connection/@Deployment/@License declared directly inside @GeneratorConfig (without wrapping them in @Profile) are no longer valid (error E00290). A @GeneratorConfig with no @Profile at all gives error E00291.

How the active profile is chosen for generate/build/reverse/license-status (the validate action ignores profiles):

  1. The CLI’s --profile <Name> flag, case-insensitive.
  2. If omitted, Default Profile from @Project (see the .warproj — @Project section above).
  3. If there’s no Default Profile either but the .warpcfg only declares one @Profile, that one is used.
  4. If none of the above applies and there are several profiles declared, the compiler fails with error E00293, listing the available profiles.

Requesting a profile that doesn’t exist (via --profile or Default Profile) fails with error E00292, also listing the available profiles.

@Screen (nested inside @GeneratorConfig)

KeyDescription
RowsNumber of screen rows. Numeric, default 24.
ColumnsNumber of screen columns. Numeric, default 80.

@FunctionKeys (nested inside @Screen)

One F<n> : "Label" entry per line (n from 1 to 24, e.g. F3 : "Exit"). Attached to its own event with Event 'Name' <n> ... EndEvent in a Screen’s @Source.

@Connection (nested inside @Profile)

How to reach the IBM i:

KeyDescriptionValues
HostHostname or IP of the IBM i. Required.—
UserUser profile to connect with. Required.—
Auth MethodHow to authenticate. Required. password reads the password from the WARPGATE_PASSWORD environment variable; interactive, when run from the VSCode extension, prompts for it with a dialog box on every Build & Deploy (running the raw binary from a terminal, it behaves the same as password).key, password, interactive
Key FilePath to the private key file. Required only if Auth Method: key.—
ProtocolTransport protocol. Required. ftp can’t be combined with Auth Method: key.ssh, sftp, ftp
PortTCP port. Numeric, default 22.—
TimeoutConnection timeout in seconds. Numeric (-128 to 127), default 30.—

ssh/sftp/ftp use native clients: there’s no need to have any ssh/scp/sftp/ftp client installed on the machine running the compiler.

Examples by protocol and authentication method

SSH or SFTP with a key (ssh/sftp are equivalent: the native client uses the same transport for both):

@Connection {
    Host        : MYHOST
    User        : MYUSER
    Auth Method : key
    Key File    : ~/.ssh/id_ed25519_ibmi
    Protocol    : ssh
    Port        : 22
    Timeout     : 30
}

SSH or SFTP with a password — the password isn’t written into the .warpcfg; it’s read from the WARPGATE_PASSWORD environment variable, which must exist before opening VSCode (or the terminal the compiler runs from):

@Connection {
    Host        : MYHOST
    User        : MYUSER
    Auth Method : password
    Protocol    : sftp
    Port        : 22
    Timeout     : 30
}

FTP with a password — FTP has no concept of key-based authentication (Auth Method: key with Protocol: ftp is a validation error), so it only accepts password/interactive, both read from the same WARPGATE_PASSWORD variable:

@Connection {
    Host        : MYHOST
    User        : MYUSER
    Auth Method : password
    Protocol    : ftp
    Port        : 21
    Timeout     : 30
}

Generating the Key File

Auth Method: key needs an SSH key pair: a private one (the one Key File points to) and a public one, which must be authorized on the IBM i user profile.

  1. Generate the key pair (on the machine running the compiler/VSCode, not on the IBM i):
    ssh-keygen -t ed25519 -f ~/.ssh/id_ed25519_ibmi -N ""
    
    This creates id_ed25519_ibmi (private — the path that goes in Key File) and id_ed25519_ibmi.pub (public). -N "" leaves the key without a passphrase, a requirement for Auth Method: key.
  2. Copy the contents of id_ed25519_ibmi.pub (a single line) to the end of the .ssh/authorized_keys file inside the IBM i user’s IFS home directory (e.g. /home/MYUSER/.ssh/authorized_keys) — create the file and directory if they don’t exist. The IBM i’s SSH daemon (SSHD, from product 5733-SC1) must be active and configured to accept key-based authentication.
  3. Verify that Key File in @Connection points to the private key’s path on the local machine (not the .pub one), and that Auth Method is key.

@Deployment (nested inside @Profile)

Where/how to deploy and compile on the IBM i:

KeyDescriptionValues
CL SourceName of the generated CL source member (OS/400 object name, max. 10 characters). Required.—
CleanupWhether the staged source is removed after a successful compile.true, false
Target ReleaseTarget OS/400 release for the compile (e.g. V7R4M0).—
OptimizationCompiler optimization level.—
DebugWhether to compile with the debug view enabled.true, false
Temp PathIFS staging directory used during deploy. Required.—
Data LibraryLibrary where the compiled DDS physical/logical file objects are created (OS/400 object name). Required.—
Objects LibraryLibrary holding the DDS/CL source members (QDDSSRC/QCLSRC) and where the compiled CL program object is created (OS/400 object name). Required.—
Source TablesSource member holding the physical/logical DDS source (OS/400 object name). Required.—
Source ProgramsSource member holding the generated RPGLE/CL.—
Compile LibraryComma-separated list of libraries added to the compile job’s library list, in order, instead of just Data Library — for programs whose tables live across several libraries.—

@License (nested inside @Profile)

Optional block with the licensing configuration, specific to each profile — so Dev/UAT/Prod can consume different licenses or licensing services. Keys are case-insensitive. See the Licensing guide.

KeyDescriptionValues
HostLicense service host. With Host the mode is organization and File is ignored; without Host, the mode is individual.—
PortService TCP port. Default 7443.1-65535
FingerprintSHA-256 fingerprint of the service certificate (accepts : and uppercase).64 hex
SPNKerberos service name. Default warpgate-license/<host>.—
FileIndividual license file. Default ~/.config/warpgate/license.json (%APPDATA%\warpgate\license.json on Windows).—
@License {
    Host        : "servidor01.dominio.local"
    Port        : 7443
    Fingerprint : "3f2a9c41d87b05e6a1c4f0937be2d5688a1f4c0d29e7b3a65c8d1f0e4b7a9c23"
}

Full example

See Project: .warproj and .warpcfg for a complete example with both files.