Files
tldr/pages.zh/common/sbt.md

36 lines
647 B
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# sbt
> Scala 和 Java 项目的构建工具。
> 更多信息:<https://www.scala-sbt.org/1.x/docs/>。
- 启动 REPL交互式 shell
`sbt`
- 从 GitHub 上的现有 Giter8 模板创建一个新的 Scala 项目:
`sbt new {{scala/hello-world.g8}}`
- 编译并运行所有测试:
`sbt test`
- 删除 `target` 目录中的所有生成文件:
`sbt clean`
- 编译 `src/main/scala``src/main/java` 目录中的主源文件:
`sbt compile`
- 使用指定版本的 sbt
`sbt -sbt-version {{version}}`
- 使用特定的 jar 文件作为 sbt 启动器:
`sbt -sbt-jar {{path}}`
- 列出所有 sbt 选项:
`sbt -h`