-
Notifications
You must be signed in to change notification settings - Fork 704
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
Allow cabal to execute packager-defined commands #1354
Comments
I don't think I understand what you're asking for. (I'm not familiar with custom targets in make). Can you give some more specific examples of the kind of thing you would like to be able to do? |
I'd like the ability to add a 'command' to my project somehow, then run 'cabal my_command' which would do what I want. For instance, say I have a custom command for my project which uses Gettext to create catalogs from my source, then move them to a build directory. In a hypothetical situation where Cabal has this feature, I'd add the command 'langfiles' to my project.cabal file, which has a name and description for the hypothetical project-specific command section of 'cabal help', and a command 'runhaskell scripts/langfiles.hs' that it'd run when the command is issued. Another hypothetical situation would be to have this in my .cabal file:
Which would run hlint on my source file, and come up in 'cabal help' like so:
I'm aware that Cabal is meant to build packages, but it's the only build system around that's easy to use, and I think it shows evidence that it does non-package-related stuff already with executable documentation, code coverage, tests and benchmarks. This kind of stuff would allow easy extendibility. |
Note than you can combine |
Yes, you can also override Setup.hs and 'hijack' getArgs to do some of your own stuff, but considering Distribution.Simple already has its own command infrastructure it'd be nice to expose this? |
I renamed this to reflect the similarity to the recent #2349. |
With other build systems like Make you can add custom targets to do different tasks. An example is a 'lang' target to build language files. It'd be nice if custom targets could be added to Cabal.
The text was updated successfully, but these errors were encountered: