sbt 中的项目文件夹 [英] project folder in sbt
本文介绍了sbt 中的项目文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我知道在 sbt
项目中,sbt
会生成一个名为 project 的文件夹,其中包含 build.properties
和 plugins.sbt代码>.现在,如果我有一个包含多个子项目的项目,我应该在根项目中只有一个名为
project
的文件夹还是每个子项目名为 project 的不同文件夹?
I understand that in an sbt
project, sbt
generates a folder called project containing build.properties
and plugins.sbt
. Now if I have one project that has multi subprojects, should I have only one folder called project
in the root project or different folders named project foreach subproject?
推荐答案
你应该只有一个 project
文件夹.您可以在 Multi-项目在 sbt 文档中构建.
You should have only one project
folder. You can read about it at Multi-project builds in sbt documentation.
以下面的sbt为例:
name := "new_proj"
version := "0.1"
scalaVersion := "2.13.4"
lazy val root = (project in file("."))
.aggregate(util, core)
lazy val util = (project in file("util"))
lazy val core = (project in file("core"))
你应该有这样的结构:
new_proj
|- build.sbt
|- project
|- build.properties
|- core
|- src
|- main
|- scala
|- util
|- src
|- main
|- scala
这篇关于sbt 中的项目文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文