Re: [sbt] Transforming/modifying a sbt.Command

29 views
Skip to first unread message

Josh Suereth

unread,
Jun 6, 2012, 4:34:36 PM6/6/12
to simple-b...@googlegroups.com
Well, while a command is simple a transformation of State => State conceptually, the interface exposed is going to leave you limited.

You could look at the list of command and replace the one you want with your own and add something that happens before a command is parsed, but that's kind of limited.


As an alternative option, you can create your own command that runs your behavior, then adds the play command to the 'queue' of what to run.
You can also create a command that adds the `play` command to the queue and then another command of your own.

So, you can sort of accomplish what you want, but it's not going to be amazingly pretty.


On Wed, Jun 6, 2012 at 11:04 AM, johanandren <johan....@mejsla.se> wrote:
Im trying to customize the Play Framework-2 SBT build for a project and I have stumbled into this problem: play defines a set of sbt.Commands rather than tasks for the main operations used on a play project ("run", "start", etc.). I want to modify those, running my custom SBT Tasks before and after those commands. Cant find any good resources on transforming commands.

Is the only way to do such a thing to declare my own commands wrapping the play commands and if so, how do I do that?

Is there a better way?

--
You received this message because you are subscribed to the Google Groups "simple-build-tool" group.
To view this discussion on the web visit https://groups.google.com/d/msg/simple-build-tool/-/SHSdwaEvFIEJ.
To post to this group, send email to simple-b...@googlegroups.com.
To unsubscribe from this group, send email to simple-build-t...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/simple-build-tool?hl=en.

Reply all
Reply to author
Forward
0 new messages