- Scala Programming Projects
- Mikael Valot Nicolas Jorand
- 273字
- 2021-07-23 16:25:11
SBT synchronization
Now, let's have a look at our build configuration. SBT (short for Simple Build Tool) is the de facto build tool in the Scala community. Double-click on build.sbt:
name := 'scala_fundamentals"
version := "0.1"
scalaVersion := "2.12.4"
This file describes how SBT will compile, test, and deploy our project. For now, it is fairly simple.
One important thing to keep in mind is that IntelliJ manages its own set of files to define a project structure. They are located in the .idea directory of your project.
Whenever you change build.sbt, IntelliJ has to interpret the changes and translate them.
For instance, If I change the Scala version to 2.12.3 and save (Ctrl + S or cmd + S), IntelliJ will propose to synchronize the changes or enable autoimport:
On a small project, it is ok to use autoimport, but on a large one, it can be a bit annoying. The synchronization can take time and it might kick off too often.
When you program in Scala using IntelliJ, you therefore have two ways of compiling your project:
- SBT, in which case you would only use IntelliJ as an advanced text editor
- IntelliJ
You could, in theory, mix and match: start building with SBT and continue with IntelliJ or the other way around. However, I strongly discourage you to do so, as you may get some unexpected compilation errors. When you want to switch to one tool or the other, it is best to clean all compiled files first.
We will further expand on SBT later in this book, but for now, we are only going to use IntelliJ's own build.
- Mastering Node.js(Second Edition)
- 物聯網網絡安全及應用
- Django 2 by Example
- 網絡故障現場處理實踐(第4版)
- Web Application Development with R Using Shiny
- 計算機網絡安全實訓教程(第二版)
- 信息通信網絡建設安全管理概要2
- 面向物聯網的嵌入式系統開發:基于CC2530和STM32微處理器
- 面向云平臺的物聯網多源異構信息融合方法
- Mastering JavaFX 10
- 異構蜂窩網絡關鍵理論與技術
- 5G時代的大數據技術架構和關鍵技術詳解
- 5G智慧交通
- Hands-On Reactive Programming in Spring 5
- 加密與解密實戰全攻略