Skip to content

Commit 413b1d7

Browse files
Merge branch 'release-1.12.0'. Refs #336.
2 parents 52182ca + 5a52aa5 commit 413b1d7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+310
-107
lines changed

.github/workflows/repo-ghc-8.6-cabal-2.4-cfs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ jobs:
5353
git clone --recursive -b v6.7.0a https://github.com/nasa/cfs.git
5454
5555
# Generate cFS app with Ogma
56-
ogma cfs --app-target-dir cfs/apps/copilot \
56+
ogma cfs --target-dir cfs/apps/copilot \
5757
--input-file ogma-cli/examples/cfs-001-hello-ogma/expressions.json \
5858
--input-format ogma-cli/examples/cfs-001-hello-ogma/json-format.cfg \
5959
--prop-format literal \
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
name: diagram-ghc-8.6-cabal-2.4
2+
3+
on:
4+
- pull_request
5+
- push
6+
7+
jobs:
8+
cabal:
9+
name: ${{ matrix.os }} / ghc ${{ matrix.ghc }}
10+
runs-on: ${{ matrix.os }}
11+
strategy:
12+
matrix:
13+
os: [ubuntu-latest]
14+
cabal: ["2.4"]
15+
ghc:
16+
- "8.6"
17+
18+
steps:
19+
20+
- uses: haskell-actions/setup@main
21+
id: setup-haskell-cabal
22+
name: Setup Haskell
23+
with:
24+
ghc-version: ${{ matrix.ghc }}
25+
cabal-version: ${{ matrix.cabal }}
26+
27+
- name: Prepare environment
28+
run: |
29+
echo "$HOME/.ghcup/bin" >> $GITHUB_PATH
30+
echo "$HOME/.cabal/bin" >> $GITHUB_PATH
31+
32+
- uses: actions/checkout@v4
33+
34+
- name: Create sandbox
35+
run: |
36+
echo "$PWD/.cabal-sandbox/bin" >> $GITHUB_PATH
37+
cabal v1-sandbox init
38+
39+
- name: Install dependencies
40+
run: |
41+
sudo apt-get install -y libz-dev libbz2-dev libexpat-dev
42+
cabal v1-install alex happy
43+
cabal v1-install BNFC
44+
45+
- name: Install ogma
46+
run: |
47+
cabal v1-install copilot-4.6 ogma-**/ --constraint="aeson >= 2.0.3.0"
48+
49+
- name: Generate and enable app from diagram
50+
run: |
51+
ogma diagram --target-dir demo \
52+
--prop-format literal \
53+
--mode calculate \
54+
--input-format dot \
55+
--input-file ogma-cli/examples/diagram-001-hello-ogma/diagram-copilot.dot
56+
cd demo/
57+
cabal v1-sandbox init --sandbox=$PWD/../.cabal-sandbox
58+
cabal v1-exec -- runhaskell Copilot.hs
59+
gcc $PWD/../ogma-cli/examples/diagram-001-hello-ogma/main.c monitor.c -I$PWD -o main
60+
61+
- name: Run app and compare against expectation
62+
run: |
63+
cd demo/
64+
if [ "$(./main | sed -n 's/.*new state: \([0-9]\+\).*/\1/p' | paste -sd' ' -)" = "0 1 1 0 2 2 0" ]; then \
65+
echo "Execution of diagram test matches expectation"; \
66+
else \
67+
echo "Mismatch"; \
68+
exit 1; \
69+
fi

.github/workflows/repo-ghc-8.6-cabal-2.4-ros.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ jobs:
4545
4646
- name: Generate ROS app
4747
run: |
48-
ogma ros --app-target-dir demo --input-file ogma-cli/examples/ros-copilot/document.json --input-format ogma-cli/examples/ros-copilot/json-format.cfg --prop-format literal --variable-db ogma-cli/examples/ros-copilot/vars-db.json
48+
ogma ros --target-dir demo --input-file ogma-cli/examples/ros-copilot/document.json --input-format ogma-cli/examples/ros-copilot/json-format.cfg --prop-format literal --variable-db ogma-cli/examples/ros-copilot/vars-db.json
4949
cd demo/copilot/src/
5050
runhaskell Copilot.hs
5151
cd ../../

ogma-cli/CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Revision history for ogma-cli
22

3+
## [1.12.0] - 2026-01-21
4+
5+
* Version bump 1.12.0 (#336).
6+
* Add CI job to test diagram backend (#332).
7+
* Standardize argument names across commands (#334).
8+
39
## [1.11.0] - 2025-11-21
410

511
* Version bump 1.11.0 (#325).

ogma-cli/README.md

Lines changed: 20 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,8 @@ cFS applications are generated using the Ogma command `cfs`, which accepts
129129
the following arguments:
130130
- `--input-file FILENAME`: location of the specification or source file for
131131
which a cFS application is being generated.
132-
- `--app-target-dir DIR`: location where the cFS application files must be
133-
stored.
134-
- `--app-template-dir DIR`: location of the cFS application template to use.
132+
- `--target-dir DIR`: location where the cFS application files must be stored.
133+
- `--template-dir DIR`: location of the cFS application template to use.
135134
- `--variable-file FILENAME`: a file containing a list of variables to monitor
136135
in the cFS application.
137136
- `--variable-db FILENAME`: a file containing a database of known variables,
@@ -228,12 +227,12 @@ with a set of files with a cFS application template, which Ogma will use
228227
instead.
229228
230229
To choose this feature, one must call Ogma's `cfs` command with the argument
231-
`--app-template-dir DIR`, where `DIR` is the path to a directory containing a
232-
cFS application template. For example, assuming that the directory
233-
`my_template` contains a custom cFS application template, one can execute:
230+
`--template-dir DIR`, where `DIR` is the path to a directory containing a cFS
231+
application template. For example, assuming that the directory `my_template`
232+
contains a custom cFS application template, one can execute:
234233
235234
```
236-
$ ogma cfs --app-template-dir my_template/ --variable-db examples/cfs-variable-db.json --variable-file examples/cfs-variables
235+
$ ogma cfs --template-dir my_template/ --variable-db examples/cfs-variable-db.json --variable-file examples/cfs-variables
237236
```
238237
239238
Ogma will copy the files in that directory to the target path, filling in
@@ -304,9 +303,9 @@ for ROS app generation is considered preliminary.
304303
305304
ROS applications are generated using the Ogma command `ros`, which receives
306305
five main arguments:
307-
- `--app-target-dir DIR`: location where the ROS application files must be
306+
- `--target-dir DIR`: location where the ROS application files must be
308307
stored.
309-
- `--app-template-dir DIR`: location of the ROS application template to use.
308+
- `--template-dir DIR`: location of the ROS application template to use.
310309
- `--variable-file FILENAME`: a file containing a list of variables that must
311310
be made available to the monitor.
312311
- `--variable-db FILENAME`: a file containing a database of known variables,
@@ -319,7 +318,7 @@ and the topic they are included with.
319318
The following execution generates an initial ROS application for runtime
320319
monitoring using Copilot:
321320
```sh
322-
$ ogma ros --handlers filename --variable-file variables --variable-db ros-variable-db.json --app-target-dir ros_demo
321+
$ ogma ros --handlers filename --variable-file variables --variable-db ros-variable-db.json --target-dir ros_demo
323322
```
324323

325324
The application generated by Ogma contains the following files:
@@ -418,12 +417,12 @@ package. It's possible to customize the output by providing a directory with a
418417
set of files with a ROS package template, which Ogma will use instead.
419418

420419
To choose this feature, one must call Ogma's `ros` command with the argument
421-
`--app-template-dir DIR`, where `DIR` is the path to a directory containing a
422-
ROS 2 package template. For example, assuming that the directory `my_template`
420+
`--template-dir DIR`, where `DIR` is the path to a directory containing a ROS 2
421+
package template. For example, assuming that the directory `my_template`
423422
contains a custom ROS package template, one can execute:
424423

425424
```
426-
$ ogma ros --app-template-dir my_template/ --handlers filename --variable-file variables --variable-db ros-variable-db.json --app-target-dir ros_demo
425+
$ ogma ros --template-dir my_template/ --handlers filename --variable-file variables --variable-db ros-variable-db.json --target-dir ros_demo
427426
```
428427

429428
Ogma will copy the files in that directory to the target path, filling in
@@ -475,9 +474,8 @@ for F' component generation is considered preliminary.
475474

476475
F' components are generated using the Ogma command `fprime`, which receives
477476
five main arguments:
478-
- `--app-target-dir DIR`: location where the F' application files must be
479-
stored.
480-
- `--app-template-dir DIR`: directory holding F' component source template.
477+
- `--target-dir DIR`: location where the F' application files must be stored.
478+
- `--template-dir DIR`: directory holding F' component source template.
481479
- `--variable-file FILENAME`: a file containing a list of variables that must
482480
be made available to the monitor.
483481
- `--variable-db FILENAME`: a file containing a database of known variables,
@@ -490,7 +488,7 @@ and their types.
490488
The following execution generates an initial F' component for runtime
491489
monitoring using Copilot:
492490
```sh
493-
$ ogma fprime --handlers filename --variable-file filename --variable-db fprime-variable-db.json --app-target-dir fprime_demo
491+
$ ogma fprime --handlers filename --variable-file filename --variable-db fprime-variable-db.json --target-dir fprime_demo
494492
```
495493

496494
The component generated by Ogma contains the following files:
@@ -565,12 +563,12 @@ component. It's possible to customize the output by providing a directory with
565563
a set of files with an F' component template, which Ogma will use instead.
566564

567565
To choose this feature, one must call Ogma's `fprime` command with the argument
568-
`--app-template-dir DIR`, where `DIR` is the path to a directory containing an
569-
F' component specification template. For example, assuming that the directory
566+
`--template-dir DIR`, where `DIR` is the path to a directory containing an F'
567+
component specification template. For example, assuming that the directory
570568
`my_template` contains a custom F' component template, one can execute:
571569

572570
```
573-
$ ogma fprime --app-template-dir my_template/ --handlers filename --variable-file variables --variable-db fprime-variable-db.json --app-target-dir fprime_demo
571+
$ ogma fprime --template-dir my_template/ --handlers filename --variable-file variables --variable-db fprime-variable-db.json --target-dir fprime_demo
574572
```
575573

576574
Ogma will copy the files in that directory to the target path, filling in
@@ -633,7 +631,7 @@ files generated.
633631
code being generated. See the files under `ogma-core/templates/diagram/`, as
634632
well as other commands supporting template customization, to understand how to
635633
customize the template.
636-
- `--file-name FILENAME`: File with the diagram being transformed.
634+
- `--input-file FILENAME`: File with the diagram being transformed.
637635
- `-f,--input-format FORMAT_NAME`: Name of the input format. See below for
638636
details.
639637
- `-p,--prop-format FORMAT_NAME`: Format for the boolean properties or
@@ -751,7 +749,7 @@ typedef struct {
751749
Ogma can generate that code automatically with the `structs` subcommand:
752750

753751
```haskell
754-
$ ogma structs --header-file-name examples/point.h
752+
$ ogma structs --input-file examples/point.h
755753
data Point = Point
756754
{ pX :: Field "x" Double
757755
, pY :: Field "y" Double

ogma-cli/examples/cfs-001-hello-ogma/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ message is sent out to indicate that a trigger fired.
5252
An invocation of Ogma's cFS backend may look like the following:
5353

5454
```sh
55-
$ ogma cfs --app-target-dir demo \
55+
$ ogma cfs --target-dir demo \
5656
--input-file ogma-cli/examples/cfs-001-hello-ogma/expressions.json \
5757
--input-format ogma-cli/examples/cfs-001-hello-ogma/json-format.cfg \
5858
--prop-format literal \
@@ -228,7 +228,7 @@ To generate the cFS application from the source files listed above, we invoke
228228
`ogma` with the following arguments:
229229

230230
```sh
231-
$ ogma cfs --app-target-dir demo \
231+
$ ogma cfs --target-dir demo \
232232
--input-file ogma-cli/examples/cfs-001-hello-ogma/expressions.json \
233233
--input-format ogma-cli/examples/cfs-001-hello-ogma/json-format.cfg \
234234
--prop-format literal \

ogma-cli/examples/diagram-001-hello-ogma/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ An invocation of Ogma's diagram backend may look like the following:
5454
```sh
5555
$ ogma diagram --app-target-dir demo \
5656
--mode calculate \
57-
--file-name ogma-cli/examples/diagram-001-hello-ogma/diagram-copilot.dot \
57+
--input-file ogma-cli/examples/diagram-001-hello-ogma/diagram-copilot.dot \
5858
--file-format dot \
5959
--prop-format literal
6060
```
@@ -199,7 +199,7 @@ $ ogma diagram --app-target-dir demo \
199199
--prop-format literal \
200200
--mode calculate \
201201
--file-format dot \
202-
--file-name ogma-cli/examples/diagram-001-hello-ogma/diagram-copilot.dot
202+
--input-file ogma-cli/examples/diagram-001-hello-ogma/diagram-copilot.dot
203203
```
204204

205205
We specify the mode of operation `calculate`, which instructs Ogma to generate

ogma-cli/examples/ros2-001-hello-ogma/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ message is sent out to indicate that a trigger fired.
4949
An invocation of Ogma's ROS 2 backend may look like the following:
5050

5151
```sh
52-
$ ogma ros --app-target-dir demo \
52+
$ ogma ros --target-dir demo \
5353
--input-file expressions.json \
5454
--input-format json-format.cfg \
5555
--prop-format literal \
@@ -195,7 +195,7 @@ To generate the ROS 2 application from the source files listed above, we invoke
195195
`ogma` with the following arguments:
196196

197197
```sh
198-
$ ogma ros --app-target-dir demo \
198+
$ ogma ros --target-dir demo \
199199
--input-file expressions.json \
200200
--input-format json-format.cfg \
201201
--prop-format literal \

ogma-cli/ogma-cli.cabal

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ cabal-version: 2.0
1919
build-type: Simple
2020

2121
name: ogma-cli
22-
version: 1.11.0
22+
version: 1.12.0
2323
homepage: https://github.com/nasa/ogma
2424
bug-reports: https://github.com/nasa/ogma/issues
2525
license: Apache-2.0
@@ -143,7 +143,7 @@ executable ogma
143143
, microstache >= 1.0 && < 1.1
144144
, text >= 1.2.3.1 && < 2.2
145145

146-
, ogma-core >= 1.11.0 && < 1.12
146+
, ogma-core >= 1.12.0 && < 1.13
147147

148148
hs-source-dirs:
149149
src

ogma-cli/src/CLI/CommandCFSApp.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,15 +104,15 @@ commandOptsParser = CommandOpts
104104
)
105105
)
106106
<*> strOption
107-
( long "app-target-dir"
107+
( long "target-dir"
108108
<> metavar "DIR"
109109
<> showDefault
110110
<> value "copilot-cfs-demo"
111111
<> help strCFSAppDirArgDesc
112112
)
113113
<*> optional
114114
( strOption
115-
( long "app-template-dir"
115+
( long "template-dir"
116116
<> metavar "DIR"
117117
<> help strCFSAppTemplateDirArgDesc
118118
)

0 commit comments

Comments
 (0)