简体   繁体   English

intellij-我创建哪个Scala项目,Scala-Scala或Scala-SBT?

[英]intellij - Which Scala project do I create, Scala-Scala or Scala-SBT?

So Im learning Scala and using the Intellj IDE to make my projects with. 因此,我学习Scala并使用Intellj IDE进行项目开发。 When I click on New Project and then Scala I get the choice of 当我单击“新建项目”,然后单击“ Scala”时,我可以选择

  1. Scala 斯卡拉
  2. SBT SBT

when i hoover the mouse over them I get additional info 当我将鼠标悬停在它们上方时,会获得更多信息

  1. Sample module with attached Scala SDK 附带了Scala SDK的示例模块
  2. SBT based Scala Project 基于SBT的Scala项目

Now I have played around with SBT before I downloaded Intellij and used it to compile and run some Scala code, so i kind of know what it is. 现在,在下载Intellij并使用它来编译和运行一些Scala代码之前,我已经使用SBT了,所以我有点知道它是什么。

But I just don't know which one I should be choosing 1 or 2 and why someone would choose 1 over 2 or vise-versa? 但是我只是不知道我应该选择哪个还是1个,为什么有人会选择1个而不是2个,反之亦然?

Use SBT project . 使用SBT project This will lead to Intellij doing the autobuild using SBT wityhout you having to rework the build each time. 这将导致Intellij使用SBT进行自动构建,而无需每次都重新构建。 The first time Intellij runs the sbt it will take some time to set itself up but eventually it will be far more rewarding. Intellij第一次运行sbt时会花费一些时间进行设置,但最终会带来更多收益。 Also as mentioned by Boris for portability you would want a standard build / compile tool. 就像鲍里斯(Boris)提到的可移植性一样,您还需要一个标准的build / compile工具。

I think there is not the solution to your problem. 我认为无法解决您的问题。 If you just want to try out Scala and the Scala SDK, the first choice is fine because you don't have any needs for an automated build. 如果您只想试用Scala和Scala SDK,那么第一选择就很好了,因为您不需要任何自动构建。 In my opinion is this your choice if you want to play around a bit without any overhead. 我认为这是您的选择,如果您想玩一点而不产生任何开销。

If you want to do a more real project I suggest to use sbt because it will build your project and manage your dependencies. 如果您想做一个更真实的项目,我建议您使用sbt,因为它会构建您的项目并管理您的依赖项。 This makes your project more flexible, easy to build for somebody else. 这使您的项目更加灵活,易于为其他人构建。

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

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