Typesafe 激活器可用命令行 options/features

Typesafe activator available command line options/features

有没有办法找出所有可能的激活器命令行选项?

activator -help 只提供了最低限度的可用 option/feature 列表,但所有好的东西都被隐藏了,甚至在类型安全网站在线文档中也不可用。

到目前为止我知道以下commands/features:

activator run
activator -jvm-debug 9999 run
activator compile
activator clean
activator clean compile dist
activator doc //creates a nice documentation of your whole project

知道在哪里可以获得这些信息吗?

(正在使用激活器 运行 玩框架项目)

Activator 不是一些具有广泛选项的工具。它看起来像,但它只是 运行 sbt 项目的包装器。来自 git 中的激活器源页面:

Activator aims to be a friendly one-stop-shop to bootstrap your Scala, Akka, and Play development. It can be used as a wrapper script that launches into traditional command line sbt, but it also includes a template and tutorial system, and an optional GUI for getting started.

You can think of Activator as traditional sbt (activator shell or activator ), plus an optional UI mode (activator ui), plus a template system (activator new).

就是这样。实际上只有四个命令:

  • ui - 到 运行 ui 模式
  • new - 从模板创建新项目
  • list-templates - 显示所有可用模板
  • shell - 到 运行 sbt shell

让我们详细了解一下。

源代码

https://github.com/typesafehub/activator/blob/master/launcher/src/main/scala/activator/ActivatorLauncher.scala

try configuration.arguments match {
  case Array("ui") => RebootToUI(configuration, version = checkForUpdatedVersion.getOrElse(APP_VERSION))
  case Array("new", _*) => Exit(ActivatorCli(configuration))
  case Array("list-templates") => Exit(TemplateHandler())
  case Array("shell") => RebootToSbt(configuration, useArguments = false)
  case _ if Sbt.looksLikeAProject(new File(".")) => RebootToSbt(configuration, useArguments = true)
  case _ => displayHelp(configuration)
} catch {
  case e: Exception => generateErrorReport(e)
}

可以看到只有4条命令ui,new,list-template shell 和一个元命令:

case _ if Sbt.looksLikeAProject(new File(".")) => RebootToSbt(configuration, useArguments = true)

表示如果你在工程目录下运行 activator命令(而且不是ui, new, list-template, shell) 而不是激活器将 运行 sbt 使用您传递给激活器的命令和参数。所以 run, compile, stage 不是激活命令而是 sbt 命令。

如果你将 运行 激活器不在项目目录中(并且它不是 uinewlist-templateshell 命令),那么它会告诉你一些 "help page"

Activator 还允许传递 java 将用于 运行 的参数 activator.jar - 您可以通过检查 "activator.bat" 文件或激活器 shell 脚本。

SBT

您可以在此处找到 sbt 命令参考:http://www.scala-sbt.org/0.13/docs/Command-Line-Reference.html

我也找不到激活器命令选项的完整列表。 Activator本身并不完全开源,官方文档也没有给出太多信息。

但只是为了给你一个不同的角度,activator 是基于 sbt 构建的。所以 sbt 的命令选项也应该在激活器中有效。参见:http://www.scala-sbt.org/0.13/docs/Command-Line-Reference.html.

如您所见,一些激活器命令选项直接来自 sbt。 除此之外,激活器还有一些自定义选项,如您在问题中列出的 -jvm-debugdist

希望对您有所帮助。