如何界定游戏框架中的任意任务?
我指的是由指挥线执行的任务,类似于瓦 rub。
我知道这一工具,但想找到更好的选择。
如何界定游戏框架中的任意任务?
我指的是由指挥线执行的任务,类似于瓦 rub。
我知道这一工具,但想找到更好的选择。
<><>>>>>> 答案是游戏1.*系列:。
您应撰写一个习俗单元,然后,您的指令进入commands.py
文档,检索:http://www.playframework.org/documentation/1.2.4/releasenotes-1.1#commands 。
https://github.com/sim51/logisima-play-yml/blob/master/commands.py”rel=“nofollow”
基本上,你界定了你想要的指挥,并从“赤贫”方法中发射:
COMMANDS = [ namespace:command ]
def execute(**kargs):
command = kargs.get("command")
app = kargs.get("app")
args = kargs.get("args")
env = kargs.get("env")
if command == "namespace:command":
do_something()
如果你想要发射一些 j——常常是这样——:
def do_something():
java_cmd = app.java_cmd([], None, "play.modules.mymodule.MyClass", args)
try:
subprocess.call(java_cmd, env=os.environ)
except OSError:
print "Could not execute the java executable, please make sure the JAVA_HOME environment variable is set properly (the java executable should reside at JAVA_HOME/bin/java). "
sys.exit(-1)
print
Ps.
a. 建立习惯单元的难度很大,因为:
play new-module mymodule
这是主人:。 考虑到官方网站
<><>>> 我认为我补充一点信息: 在能够执行你的指挥之前,你必须掌握你的单元。 它并不像其他玩物一样,有动态的汇编。 新的单元/楼房-单元预计该单元将成为项目组合的根基,但如果你们有许多人成为一片。 play build-module mymodule
对“游戏2”来说,你可以通过在此附上文件来创造新的任务:
在“游戏2”生成的<代码>Build.scala的背景下,它不妨照此办理:
import sbt._
import Keys._
import play.Project._
object ApplicationBuild extends Build {
val appName = "foo"
val appVersion = "1.0-SNAPSHOT"
val appDependencies = Seq(
// Add your project dependencies here,
jdbc,
anorm
)
val hello = TaskKey[Unit]("hello", "Prints Hello World ")
val helloTask = hello := {
println("Hello World")
}
lazy val main = play.Project(appName, appVersion, appDependencies).settings(
helloTask
)
}
I m starting to use vlad for new deployments and am wondering what s the best way to set it up so I can use the same tasks for my local development and remote production servers? I thought about ...
I have a .NET project with a Rake build script. Rake calls msbuild.exe to do the actual compilation. When I configure a TeamCity 5.0 build using the Rake runner, compilation errors are not recognized ...
I installed Ruby on WinXP. Used rubyinstaller-1.8.6-p383-rc1.exe. Ran gem install rake Get error: Error installing rake: invalid gem format for C:/Ruby/lib/ruby/gems/1.8/cache/rake-0.8.7.gem I ...
(in /Users/sayedgamal/apps/test) /Users/sayedgamal/apps/test/config/boot.rb:20:Warning: Gem::SourceIndex#search support for String patterns is deprecated == CreatePeople: migrating ====================...
When I call mysqldump from a controller or model I need to fully path the binary, when I call it from Rake I don t need to. If I do not fully path I get a zero byte file... I can confirm both ...
I have ran gem install rails and am running 2.3.4 but i am missing some rake tasks like db and gems if i run rake -T i get the following tasks. How can i get all the others ? rake apache2 # ...
I am attempting to write a very simple rake task (and merge it into a rather large rake task) that will call the following command and pass in a randomly generated password. For the moment, let s even ...
I had read through a rails book and once found we can add # TODO: and some # stuff in codes, so we can you some rake cmd to look back. My problems is I can t find where are those "# stuff" ...