Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autogenerate the list of modules #112

Closed
judah opened this issue Jul 31, 2017 · 1 comment
Closed

Autogenerate the list of modules #112

judah opened this issue Jul 31, 2017 · 1 comment

Comments

@judah
Copy link
Collaborator

judah commented Jul 31, 2017

Currently every proto file needs to be specified twice in the .cabal file: the raw .proto file in extra-src-files, and the Proto.* module in exposed-modules/other-modules.

From very basic experiments with stack, I think it's possible to drop the latter requirement and have our Setup script populate the list of Haskell modules automatically, by changing the PackageDescription and/or LocalBuildInfo.

In addition to less redundancy, this will help with:

The exact design of this feature is still an open question: can (should?) we provide control to the user over whether their protos end up in exposed-modules or other-modules? Or in individual components (e.g. tests, executables or benchmarks)? For example, proto-lens-combinators contains a proto test file which is test-only and not intended to be exported from the library.

@judah
Copy link
Collaborator Author

judah commented Oct 27, 2019

I'm closing this ticket due to lack of progress. Also, in hindsight, it's important to let the user specify which generated modules end up in which package components (libraries,binaries,tests,...) so I don't think there's a good way to automate this.

Additionally, I think globs/wildcards remove most of the noise from the redundancy. For example, in proto-lens-tests we just say:

extra-source-files: tests/*.proto

and then list the modules we actually want to generate in the rest of the .cabal file.

@judah judah closed this as completed Oct 27, 2019
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

No branches or pull requests

1 participant