Skip to content

Nested directory/mod support for multifile inputs - #191

Merged
rooooooooob merged 4 commits into
masterfrom
nested-multifile-dirs
Jul 17, 2023
Merged

Nested directory/mod support for multifile inputs#191
rooooooooob merged 4 commits into
masterfrom
nested-multifile-dirs

Conversation

@rooooooooob

Copy link
Copy Markdown
Contributor

CDDL input directories can now contain folders which will correspond to nested modules in the generated code. e.g. inputs/foo/bar.cddl will create a bar module inside of the foo module.

You can also name files inside of the folders as mod.cddl to have them be the root module instead of a submodule e.g. inputs/foo/mod.cddl would be the same as inputs/foo.cddl

CDDL input directories can now contain folders which will correspond to
nested modules in the generated code. e.g. inputs/foo/bar.cddl will
create a bar module inside of the foo module.

You can also name files inside of the folders as mod.cddl to have them
be the root module instead of a submodule e.g. inputs/foo/mod.cddl would
be the same as inputs/foo.cddl
useful for projects like CML that, once generated, have common imports
like error, serialization, etc in a certain location which might be used
by other crates/modules using cddl-codegen

this lets us avoid a lot of imports/module changes by hand in this case
@rooooooooob
rooooooooob merged commit b05d631 into master Jul 17, 2023
@rooooooooob
rooooooooob deleted the nested-multifile-dirs branch July 17, 2023 15:45
SebastienGllmt pushed a commit that referenced this pull request Aug 18, 2026
* Nested directory/mod support for multifile inputs

CDDL input directories can now contain folders which will correspond to
nested modules in the generated code. e.g. inputs/foo/bar.cddl will
create a bar module inside of the foo module.

You can also name files inside of the folders as mod.cddl to have them
be the root module instead of a submodule e.g. inputs/foo/mod.cddl would
be the same as inputs/foo.cddl


* common import override

useful for projects like CML that, once generated, have common imports
like error, serialization, etc in a certain location which might be used
by other crates/modules using cddl-codegen

this lets us avoid a lot of imports/module changes by hand in this case
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants