简体   繁体   English

SBT多项目项目中项目文件夹的深层嵌套

[英]Deep nesting of project folder in a SBT multi-project project

I have an SBT project that aggregates over multiple projects like this: 我有一个SBT项目,汇总了多个项目,如下所示:

object ClientCore extends Build {
/**
 * This is the root project
 */
lazy val rootProj = Project(id = "clientcore", base = file(".")) aggregate(
    utilsProj,
    commonUiProj,
    spatialMathProj,
    sessionManagerProj,
    lobbyProj,
)

/**
 * This is a utils library
 */
lazy val utilsProj = Project(id = "utils", base = file("Utils"))

/**
 * A shared library for UI elements
 */
lazy val commonUiProj = Project(id = "commonui", base = file("CommonUI"))

/**
 * This is a spatial math library
 */
lazy val spatialMathProj = Project(id = "spatialmath", base = file("SpatialMath"))

lazy val sessionManagerProj = Project(id = "sessionmanager", base = file("sessionManager"),
    settings = buildSettings ++ assemblySettings) settings(
        outputPath in assembly := new File(s"$outDir\\SessionManagerClient.jar"),
        jarName in assembly := "SessionManagerClient.jar",
        test in assembly := {}
    ) dependsOn(utilsProj)

lazy val lobbyProj = Project(id = "lobby", base = file("Lobby"),
    settings = buildSettings ++ assemblySettings) settings(
        outputPath in assembly := new File(s"$outDir\\Lobby.jar"),
        jarName in assembly := "Lobby.jar",
        test in assembly := {}
  ) dependsOn(utilsProj)

} }

For some reason some of the projects end up with a deep nesting of 'project' folders. 由于某些原因,某些项目最终以“项目”文件夹的深度嵌套而告终。 For example Utils might look like: 'Util/project/project/project/project/... 例如,实用程序可能看起来像:'实用程序/项目/项目/项目/项目/ ...

I'm using Intellij's SBT plugin to sync the presentation but managing the project with SBT. 我正在使用Intellij的SBT插件同步演示文稿,但使用SBT管理项目。 I'm not certain whether this is an SBT issue or an Intellij one. 我不确定这是SBT还是Intellij。

Thanks for any help you can provide. 感谢您的任何帮助,您可以提供。

Kurt 库尔特

This is an IntelliJ issue (among many others related to the SBT plugin...) 这是一个IntelliJ问题(与SBT插件有关的许多其他问题...)

I think you may have refreshed your config somewhere before defining a module and adding that module to the root project aggregates, which has a tendency to make a mess in IntelliJ. 我认为您可能在定义模块并将该模块添加到根项目聚合之前刷新了配置,这在IntelliJ中会造成混乱。

This can be fixed in IntelliJ: 这可以在IntelliJ中修复:

  • detach your project from IntelliJ 从IntelliJ分离项目
  • restart IntelliJ 重新启动IntelliJ
  • reimport your project 重新导入您的项目

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM