You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use the latest IntelliJ IDEA release and install the Scala plugin from within the IDE.
1
+
# Building Scala in IntelliJ IDEA
2
2
3
-
Compilation withing IDEA is performed in "-Dlocker.skip=1" mode: the sources are built
4
-
directly using the STARR compiler.
3
+
## Requirements
5
4
6
-
The following steps are required to use IntelliJ IDEA on Scala trunk
7
-
- Run `ant init`. This will download some JARs to `./build/deps`, which are included in IntelliJ's classpath.
8
-
- Run `./src/intellij/setup.sh`.
9
-
- Open `./src/intellij/scala.ipr` in IntelliJ.
10
-
-`File` → `Project Structure` → `Project` → `Project SDK`. Create an SDK entry named "1.6" containing the Java 1.6 SDK. (Or other SDK version; see "Requirements" in the repo's main README.)
5
+
Use the latest IntelliJ release and install the Scala plugin from within the IDE.
11
6
12
-
Compilation within IDEA is performed in `-Dlocker.skip=1` mode: the sources are built
13
-
directly using the STARR compiler (which is downloaded from [the Central Repository](http://central.sonatype.org/), according to `starr.version` in `versions.properties`).
7
+
## Initial setup
8
+
9
+
To create the IntelliJ project files:
10
+
11
+
- Run `sbt intellij`
12
+
- Open `src/intellij/scala.ipr` in IntelliJ
13
+
- In `File` → `Project Structure` → `Project` → `Project SDK`, create an SDK entry named "1.6" containing the Java 1.6 SDK
14
+
15
+
The project files are created by as copies of the `.SAMPLE` files, which are under version control.
16
+
The actual IntelliJ project files are in `.gitignore` so that local changes are ignored.
17
+
18
+
## Dependencies
19
+
20
+
For every module in the IntelliJ project there is a corresponding `-deps` library, for exmaple `compiler-deps` provides `ant.jar` for the compiler codebase.
21
+
The `.jar` files in these `-deps` libraries can be easily kept up-to-date by running `sbt intellij` again.
22
+
This is necessary whenever the dependencies in the sbt build change, for example when the STARR version is updated.
23
+
24
+
Note that this command only patches the dependency lists, all other settings in the IntelliJ project definition are unchanged.
25
+
To overwrite the project definition files by copying the `.SAMPLE` files again run `sbt intellijFromSample`.
26
+
27
+
## Usage
28
+
29
+
Compiling, running, JUnit tests and debugging should all work.
30
+
You can work on the compiler, the standard library, and other components as well.
31
+
32
+
Note that compilation within IntelliJ is performed in a single pass.
33
+
The code is compiled using the "STARR" (stable reference) compiler, as specified by `starr.version` in `versions.properties`.
34
+
This is consistent with the sbt build.
35
+
36
+
Note that the output directory when compiling in IntelliJ is the same as for the sbt build.
37
+
This allows building incrementally in IntelliJ and directly use the changes using the command-line scripts in `build/quick/bin/`.
38
+
39
+
## Updating the `.SAMPLE` files
40
+
41
+
The command `intellijToSample` overwrites the `.SAMPLE` files using the current project definition files.
0 commit comments