structurizr / cli

A command line utility for Structurizr.
https://docs.structurizr.com/cli
Apache License 2.0
492 stars 75 forks source link

!include <dir> causes a DSL parser exception #135

Closed okamiraner closed 1 year ago

okamiraner commented 1 year ago

Question

Hello

Documentation says that I can use !include for including all .dsl files inside the directory. In fact, when trying to export a workspace, I get the following exception randomly:

com.structurizr.dsl.StructurizrDslParserException: Input length = 1 at line 3: !include model
    at com.structurizr.dsl.StructurizrDslParser.parse(StructurizrDslParser.java:901)
    at com.structurizr.dsl.StructurizrDslParser.parse(StructurizrDslParser.java:128)
    at com.structurizr.cli.export.ExportCommand.run(ExportCommand.java:131)
    at com.structurizr.cli.StructurizrCliApplication.run(StructurizrCliApplication.java:77)
    at com.structurizr.cli.StructurizrCliApplication.main(StructurizrCliApplication.java:112)

Besides, including a single file works 100% of the time, but in breaks he whole point of a modular workspace adding excessive references that duplicate the folder content.

Its is hard to identify the problem, since the behaviour changes in different runs with the same files.

My directory tree:

├── model
│   ├── person.dsl
│   └── workspace.dsl
├── view
│   └── workspace.dsl
└── workspace.dsl

and the root file:

workspace {
    model {
        !include model
    }

    views {
        !include view
    }
}