播放2.0“管理"控制台命令 [英] Play 2.0 "management" console commands

查看:79
本文介绍了播放2.0“管理"控制台命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创建一些自定义命令来管理我的play 2.0应用程序(类似于Django的管理命令),因此我可以运行play import-data <data>之类的东西.

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>.

这似乎是通过编写SBT命令(例如Play自己的命令)来完成的,但是它特定于特定项目并且可以访问项目的资源(模型等)

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.)

对于Scala来说是相当新的东西,对于Play和SBT来说都是新的东西,我无法全神贯注于如何做到这一点,尤其是所涉及的依赖项管理. SBT插件文档非常好,但是似乎假设我想创建独立版本,已发布的插件,而不是依赖于主项目的插件.

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?

推荐答案

首先,您可以看一下现有Play的sbt插件:

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

这篇关于播放2.0“管理"控制台命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆