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: .warproj and .warpcfg

Every .warp file is compiled in the context of a project (.warproj), which in turn points to a generator config file (.warpcfg) holding the code generation rules and the IBM i deployment settings.

1. .warproj

@Project {
    Name            : Example
    Description     : "Sample project"
    Version         : 1.0
    Default Profile : Dev
    @Generator {
        Name        : "waRPGate generator"
        Language    : RPGLE
        Description : "RPGLE generator"
        @Paths {
            Config : ../example/generator/rpg/rpg.warpcfg
            Output : output/rpg
        }
    }
}
  • @Paths/Config: path to the .warpcfg (relative to the .warproj).
  • @Paths/Output: folder where the generated RPGLE/DDS is written.

2. .warpcfg

@GeneratorConfig {
    Date Format     : DMY
    Date Separator  : /
    Time Format     : 24H
    Time Separator  : :
    Print Mode      : File
    Commitment      : True
    Commit on Exit  : True
    DDS Name        : <ObjectName>
    @Screen {
        Rows        : 24
        Columns     : 80
        @FunctionKeys {
            F3      : "Exit"
            F5      : "Refresh"
            F24     : "More keys"
        }
    }
    @Profile "Dev" {
        @Connection {
            Host        : DEVSERVER
            User        : myuser
            Auth Method : key
            Key File    : ~/.ssh/id_rsa_ibmi
            Protocol    : ssh
            Port        : 22
            Timeout     : 30
        }
        @Deployment {
            CL Source       : QCLSRC
            Cleanup         : true
            Target Release  : *Current
            Optimization    : 40
            Debug           : false
            Temp Path       : /tmp
            Data Library    : DTALIB02
            Objects Library : OBJLIB01
            Source Tables   : QDDSSRC
            Source Programs : QRPGLESRC
            Compile Library : DTALIB01,DTALIB02,DTALIB03,OBJLIB01
        }
    }
    @Profile "Prod" {
        @Connection {
            Host        : PRODSERVER
            User        : myuser
            Auth Method : key
            Key File    : ~/.ssh/id_rsa_ibmi
            Protocol    : ssh
            Port        : 22
            Timeout     : 30
        }
        @Deployment {
            CL Source       : QCLSRC
            Cleanup         : true
            Target Release  : *Current
            Optimization    : 40
            Debug           : false
            Temp Path       : /tmp
            Data Library    : DTALIB02
            Objects Library : OBJLIB01
            Source Tables   : QDDSSRC
            Source Programs : QRPGLESRC
            Compile Library : DTALIB01,DTALIB02,DTALIB03,OBJLIB01
        }
    }
}

What each block controls

  • Top level (Date Format, Print Mode, Commitment, Commit on Exit, DDS Name): code generation rules, applied to the whole project. Commitment/Commit on Exit can be overridden per object in a specific .warp file’s @Properties.
  • @Screen: default screen size (24x80 if omitted) and the function keys (@FunctionKeys) available to the project’s Screens — the label shown in the attention line. A Screen attaches a key to its own event with Event 'Name' <n> ... EndEvent.
  • @Profile "Name": a deployment environment (Dev, UAT, Prod, the name is free-form). Each profile groups its own @Connection, @Deployment, and, optionally, @License. A .warpcfg must declare at least one @Profile.
    • @Connection: how the compiler reaches the IBM i for --action build/reverse (doesn’t apply to validate/generate, which are purely local).
    • @Deployment: libraries and source member where the generated code gets uploaded and compiled (CRTPF/CRTLF/CRTCLPGM).

With more than one @Profile, it’s necessary to indicate which one to use: either with --profile <Name> on the CLI, or by leaving Default Profile set in @Project (as in the .warproj example above). The VSCode extension has its own picker — see VSCode commands.

See Project file for the full list of keys and their allowed values.