scala - SBT 目录结构。 "project"是什么?

标签 scala playframework-2.0 sbt

Play 项目有一个“项目”文件夹,如下所示:

  • 项目
    • 目标
    • 项目
      • 目标

我一直认为这只是我不应该想太多的生活奥秘之一,但今天我的好奇心战胜了我。

谷歌搜索给了我this其中提到顶级“project”文件夹用于 sbt 配置。我想知道为什么他们没有将其称为“.sbt”和“.git”,以及为什么在该文件夹之外仍然有一个文件“build.sbt”,但我认为让事情真正有意义并没有什么乐趣。

它也没有提到为什么它包含另一个“项目”文件夹。

为什么会有一个嵌套的“project”文件夹?

最佳答案

http://www.scala-sbt.org/0.13/tutorial/Organizing-Build.html :

build.sbt conceals how sbt really works. sbt builds are defined with Scala code. That code, itself, has to be built. What better way than with sbt?

The project directory is another build inside your build, which knows how to build your build. To distinguish the builds, we sometimes use the term proper build to refer to your build, and meta-build to refer to the build in project. The projects inside the metabuild can do anything any other project can do. Your build definition is an sbt project.

And the turtles go all the way down. If you like, you can tweak the build definition of the build definition project, by creating a project/project/ directory.

关于scala - SBT 目录结构。 "project"是什么?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34254579/

相关文章:

scala - 如何在 Play 2 中设置选项值以形成映射?

scala - 使用 sbt-release 指定自定义 git 标签

scala - 为什么 Typesafe 激活器命令 `activator dependencies` 不起作用?

scala - 在 Spark 中加载 Word2Vec 模型

scala - 我将如何在 Scala 中表示复合键?

scala - 为什么 IntelliJ 找不到 SBT 快照依赖项?

sbt 根据子项目中的测试给出 "configuration not public"

scala - 如何在 Scala 中正确使用模棱两可的隐式进行类型否定

scala - Scala 中的递归数据类型

java - 在 SBT/Play 中的构建定义内运行 Java 方法