Play 2.0 “management” console commands

谁说我不能喝 提交于 2019-12-22 09:04:15

问题


I'd like to create some custom commands to manage my play 2.0 application (similar to Django's management commands), so I can run things like play import-data <data>.

This seems to be something one would do by writing SBT commands (like Play's own), but specific to the particular project and with access to a project's resources (models etc.)

Being fairly new to Scala, and new to both Play and SBT, I cannot get my head around how to do this, and particularly the dependency management that is involved. The SBT plugin documentation is very nice, but it seems to assume I want to create standalone, published plugins, rather than ones that depend on the main project.

Does anyone know of a walkthrough for something similar, or have any specific suggestions for how "management commands" could otherwise be implemented?


回答1:


To begin, you could take a look at the existing Play's sbt-plugins: https://github.com/playframework/Play20/tree/master/framework/src/sbt-plugin/src/main/scala



来源:https://stackoverflow.com/questions/11344685/play-2-0-management-console-commands

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!