From 5f5cc186cbedff6dc55993cb3b0dcfe36038efa1 Mon Sep 17 00:00:00 2001 From: Lukas Rytz Date: Wed, 16 Mar 2016 21:55:08 +0100 Subject: Update IntelliJ build for use with sbt --- src/intellij/README.md | 48 ++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 38 insertions(+), 10 deletions(-) (limited to 'src/intellij/README.md') diff --git a/src/intellij/README.md b/src/intellij/README.md index 64e7b8188a..c311afda9c 100644 --- a/src/intellij/README.md +++ b/src/intellij/README.md @@ -1,13 +1,41 @@ -Use the latest IntelliJ IDEA release and install the Scala plugin from within the IDE. +# Building Scala in IntelliJ IDEA -Compilation withing IDEA is performed in "-Dlocker.skip=1" mode: the sources are built -directly using the STARR compiler. +## Requirements -The following steps are required to use IntelliJ IDEA on Scala trunk - - Run `ant init`. This will download some JARs to `./build/deps`, which are included in IntelliJ's classpath. - - Run `./src/intellij/setup.sh`. - - Open `./src/intellij/scala.ipr` in IntelliJ. - - `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.) +Use the latest IntelliJ release and install the Scala plugin from within the IDE. -Compilation within IDEA is performed in `-Dlocker.skip=1` mode: the sources are built -directly using the STARR compiler (which is downloaded from [the Central Repository](http://central.sonatype.org/), according to `starr.version` in `versions.properties`). +## Initial setup + +To create the IntelliJ project files: + + - Run `sbt intellij` + - Open `src/intellij/scala.ipr` in IntelliJ + - In `File` → `Project Structure` → `Project` → `Project SDK`, create an SDK entry named "1.6" containing the Java 1.6 SDK + +The project files are created by as copies of the `.SAMPLE` files, which are under version control. +The actual IntelliJ project files are in `.gitignore` so that local changes are ignored. + +## Dependencies + +For every module in the IntelliJ project there is a corresponding `-deps` library, for exmaple `compiler-deps` provides `ant.jar` for the compiler codebase. +The `.jar` files in these `-deps` libraries can be easily kept up-to-date by running `sbt intellij` again. +This is necessary whenever the dependencies in the sbt build change, for example when the STARR version is updated. + +Note that this command only patches the dependency lists, all other settings in the IntelliJ project definition are unchanged. +To overwrite the project definition files by copying the `.SAMPLE` files again run `sbt intellijFromSample`. + +## Usage + +Compiling, running, JUnit tests and debugging should all work. +You can work on the compiler, the standard library, and other components as well. + +Note that compilation within IntelliJ is performed in a single pass. +The code is compiled using the "STARR" (stable reference) compiler, as specified by `starr.version` in `versions.properties`. +This is consistent with the sbt build. + +Note that the output directory when compiling in IntelliJ is the same as for the sbt build. +This allows building incrementally in IntelliJ and directly use the changes using the command-line scripts in `build/quick/bin/`. + +## Updating the `.SAMPLE` files + +The command `intellijToSample` overwrites the `.SAMPLE` files using the current project definition files. -- cgit v1.2.3 From 3721775b8a1b0ace9bdea9756bf96f84303588b2 Mon Sep 17 00:00:00 2001 From: Lukas Rytz Date: Mon, 21 Mar 2016 12:11:55 +0100 Subject: Updates to IntelliJ files for 2.12.x --- build.sbt | 2 -- src/intellij/README.md | 11 +++++++- src/intellij/scala.ipr.SAMPLE | 62 +++++++++++++++++++++---------------------- 3 files changed, 41 insertions(+), 34 deletions(-) (limited to 'src/intellij/README.md') diff --git a/build.sbt b/build.sbt index b98be2e5b1..03781ab112 100644 --- a/build.sbt +++ b/build.sbt @@ -814,10 +814,8 @@ intellij := { val buildModule = ("scala-build", scalabuild.BuildInfo.buildClasspath.split(":").toSeq.map(new File(_))) // `sbt projects` lists all modules in the build buildModule :: List( - moduleDeps("actors").value, moduleDeps("compiler").value, // moduleDeps("dist").value, // No sources, therefore no module in IntelliJ - moduleDeps("forkjoin").value, moduleDeps("interactive").value, moduleDeps("junit").value, moduleDeps("library").value, diff --git a/src/intellij/README.md b/src/intellij/README.md index c311afda9c..dcad699d43 100644 --- a/src/intellij/README.md +++ b/src/intellij/README.md @@ -10,7 +10,7 @@ To create the IntelliJ project files: - Run `sbt intellij` - Open `src/intellij/scala.ipr` in IntelliJ - - In `File` → `Project Structure` → `Project` → `Project SDK`, create an SDK entry named "1.6" containing the Java 1.6 SDK + - In `File` → `Project Structure` → `Project` → `Project SDK`, create an SDK entry named "1.8" containing the Java 1.8 SDK The project files are created by as copies of the `.SAMPLE` files, which are under version control. The actual IntelliJ project files are in `.gitignore` so that local changes are ignored. @@ -24,6 +24,15 @@ This is necessary whenever the dependencies in the sbt build change, for example Note that this command only patches the dependency lists, all other settings in the IntelliJ project definition are unchanged. To overwrite the project definition files by copying the `.SAMPLE` files again run `sbt intellijFromSample`. +## Switching Branches + +The 2.12.x branch contains IntelliJ module files for `actors` and `forkjoin` even though these modules only exist in 2.11.x. +This allows using the same IntelliJ project files when switching to the 2.11.x branch (without causing any issues while working on 2.12.x). + +When switching between 2.11.x and 2.12.x, make sure to run `sbt intellij`. +Note that the `Project SDK` is not updated in this process. +If you want to use the Java 1.6 SDK while working on 2.11.x you need to change it manually (`File` → `Project Structure` → `Project` → `Project SDK`). + ## Usage Compiling, running, JUnit tests and debugging should all work. diff --git a/src/intellij/scala.ipr.SAMPLE b/src/intellij/scala.ipr.SAMPLE index 06a154b7cb..8184b0e45b 100644 --- a/src/intellij/scala.ipr.SAMPLE +++ b/src/intellij/scala.ipr.SAMPLE @@ -57,7 +57,7 @@ - + @@ -75,8 +75,8 @@ - - + + @@ -87,8 +87,8 @@ - - + + @@ -98,10 +98,10 @@ - - + + - + @@ -112,7 +112,7 @@ - + @@ -124,10 +124,10 @@ - - + + - + @@ -146,8 +146,8 @@ - - + + @@ -157,8 +157,8 @@ - - + + @@ -200,7 +200,7 @@ - + @@ -260,9 +260,9 @@ - - - + + + @@ -274,8 +274,8 @@ - - + + @@ -284,12 +284,12 @@ @@ -301,10 +301,10 @@ - - + + - + -- cgit v1.2.3