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 +++++-- src/intellij/actors.iml.SAMPLE | 4 +- src/intellij/asm.iml.SAMPLE | 11 -- src/intellij/compiler.iml.SAMPLE | 8 +- src/intellij/diff.sh | 8 -- src/intellij/forkjoin.iml.SAMPLE | 4 +- src/intellij/interactive.iml.SAMPLE | 8 +- src/intellij/junit.iml.SAMPLE | 24 ++++ src/intellij/library.iml.SAMPLE | 5 +- src/intellij/manual.iml.SAMPLE | 3 +- src/intellij/partest-extras.iml.SAMPLE | 9 +- src/intellij/partest-javaagent.iml.SAMPLE | 6 +- src/intellij/reflect.iml.SAMPLE | 4 +- src/intellij/repl-jline.iml.SAMPLE | 20 +++ src/intellij/repl.iml.SAMPLE | 9 +- src/intellij/scala-build.iml.SAMPLE | 109 ++------------ src/intellij/scala.iml.SAMPLE | 3 +- src/intellij/scala.ipr.SAMPLE | 228 +++++++++++++++++++++++++++--- src/intellij/scaladoc.iml.SAMPLE | 11 +- src/intellij/scalap.iml.SAMPLE | 5 +- src/intellij/setup.sh | 17 --- src/intellij/test-junit.iml.SAMPLE | 23 --- src/intellij/test.iml.SAMPLE | 13 +- src/intellij/update.sh | 22 --- 24 files changed, 352 insertions(+), 250 deletions(-) delete mode 100644 src/intellij/asm.iml.SAMPLE delete mode 100755 src/intellij/diff.sh create mode 100644 src/intellij/junit.iml.SAMPLE create mode 100644 src/intellij/repl-jline.iml.SAMPLE delete mode 100755 src/intellij/setup.sh delete mode 100644 src/intellij/test-junit.iml.SAMPLE delete mode 100755 src/intellij/update.sh (limited to 'src') 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. diff --git a/src/intellij/actors.iml.SAMPLE b/src/intellij/actors.iml.SAMPLE index dfdf396c46..f012ee7b0f 100644 --- a/src/intellij/actors.iml.SAMPLE +++ b/src/intellij/actors.iml.SAMPLE @@ -1,6 +1,8 @@ - + + + diff --git a/src/intellij/asm.iml.SAMPLE b/src/intellij/asm.iml.SAMPLE deleted file mode 100644 index 9886154bdf..0000000000 --- a/src/intellij/asm.iml.SAMPLE +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/src/intellij/compiler.iml.SAMPLE b/src/intellij/compiler.iml.SAMPLE index 0e121925e6..1ebf409c1b 100644 --- a/src/intellij/compiler.iml.SAMPLE +++ b/src/intellij/compiler.iml.SAMPLE @@ -1,17 +1,17 @@ - + + + - + - - \ No newline at end of file diff --git a/src/intellij/diff.sh b/src/intellij/diff.sh deleted file mode 100755 index 54f9248608..0000000000 --- a/src/intellij/diff.sh +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/env bash -# -# Diffs the SAMPLE files against the working project config. -# -export SCRIPT_DIR="$( cd "$( dirname "$0" )" && pwd )" -for f in "$SCRIPT_DIR"/*.{iml,ipr}; do - echo $f; diff -u $f.SAMPLE $f; -done diff --git a/src/intellij/forkjoin.iml.SAMPLE b/src/intellij/forkjoin.iml.SAMPLE index 42507b2911..aa3f83e56e 100644 --- a/src/intellij/forkjoin.iml.SAMPLE +++ b/src/intellij/forkjoin.iml.SAMPLE @@ -1,6 +1,8 @@ - + + + diff --git a/src/intellij/interactive.iml.SAMPLE b/src/intellij/interactive.iml.SAMPLE index 267bd3f12b..05b4e162db 100644 --- a/src/intellij/interactive.iml.SAMPLE +++ b/src/intellij/interactive.iml.SAMPLE @@ -1,16 +1,18 @@ - + + + - + + - \ No newline at end of file diff --git a/src/intellij/junit.iml.SAMPLE b/src/intellij/junit.iml.SAMPLE new file mode 100644 index 0000000000..e0f52aa42a --- /dev/null +++ b/src/intellij/junit.iml.SAMPLE @@ -0,0 +1,24 @@ + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/intellij/library.iml.SAMPLE b/src/intellij/library.iml.SAMPLE index b03fef9414..ce61c097bd 100644 --- a/src/intellij/library.iml.SAMPLE +++ b/src/intellij/library.iml.SAMPLE @@ -1,9 +1,10 @@ - + + + - diff --git a/src/intellij/manual.iml.SAMPLE b/src/intellij/manual.iml.SAMPLE index 97bfb5940a..a2ef6e4625 100644 --- a/src/intellij/manual.iml.SAMPLE +++ b/src/intellij/manual.iml.SAMPLE @@ -8,8 +8,7 @@ - - + \ No newline at end of file diff --git a/src/intellij/partest-extras.iml.SAMPLE b/src/intellij/partest-extras.iml.SAMPLE index 1cd712184b..79c736f7da 100644 --- a/src/intellij/partest-extras.iml.SAMPLE +++ b/src/intellij/partest-extras.iml.SAMPLE @@ -1,18 +1,19 @@ - + + + - + - + - \ No newline at end of file diff --git a/src/intellij/partest-javaagent.iml.SAMPLE b/src/intellij/partest-javaagent.iml.SAMPLE index ffc540cdb9..22c2cbf1bc 100644 --- a/src/intellij/partest-javaagent.iml.SAMPLE +++ b/src/intellij/partest-javaagent.iml.SAMPLE @@ -1,12 +1,14 @@ - + + + - + \ No newline at end of file diff --git a/src/intellij/reflect.iml.SAMPLE b/src/intellij/reflect.iml.SAMPLE index c9b7130aef..d0aba81f0b 100644 --- a/src/intellij/reflect.iml.SAMPLE +++ b/src/intellij/reflect.iml.SAMPLE @@ -1,6 +1,8 @@ - + + + diff --git a/src/intellij/repl-jline.iml.SAMPLE b/src/intellij/repl-jline.iml.SAMPLE new file mode 100644 index 0000000000..b765a58d96 --- /dev/null +++ b/src/intellij/repl-jline.iml.SAMPLE @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/intellij/repl.iml.SAMPLE b/src/intellij/repl.iml.SAMPLE index e827a2c6d7..07e2923726 100644 --- a/src/intellij/repl.iml.SAMPLE +++ b/src/intellij/repl.iml.SAMPLE @@ -1,18 +1,19 @@ - + + + - + - - + \ No newline at end of file diff --git a/src/intellij/scala-build.iml.SAMPLE b/src/intellij/scala-build.iml.SAMPLE index 0232e9e576..b8f066a2ef 100644 --- a/src/intellij/scala-build.iml.SAMPLE +++ b/src/intellij/scala-build.iml.SAMPLE @@ -1,109 +1,20 @@ - - - - + + + + - + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + diff --git a/src/intellij/scala.iml.SAMPLE b/src/intellij/scala.iml.SAMPLE index 9e8718dd45..f1b2938016 100644 --- a/src/intellij/scala.iml.SAMPLE +++ b/src/intellij/scala.iml.SAMPLE @@ -1,9 +1,10 @@ - + + diff --git a/src/intellij/scala.ipr.SAMPLE b/src/intellij/scala.ipr.SAMPLE index 420f559097..06a154b7cb 100644 --- a/src/intellij/scala.ipr.SAMPLE +++ b/src/intellij/scala.ipr.SAMPLE @@ -20,6 +20,9 @@ + + + @@ -39,21 +42,22 @@ + + - - + @@ -66,64 +70,246 @@ - + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + - + - + + + - - + - + + + + + + + + + - - + - + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + - + \ No newline at end of file diff --git a/src/intellij/scaladoc.iml.SAMPLE b/src/intellij/scaladoc.iml.SAMPLE index 6e6d98b396..9ab94c1bbb 100644 --- a/src/intellij/scaladoc.iml.SAMPLE +++ b/src/intellij/scaladoc.iml.SAMPLE @@ -1,19 +1,18 @@ - + + + - - + - - - + \ No newline at end of file diff --git a/src/intellij/scalap.iml.SAMPLE b/src/intellij/scalap.iml.SAMPLE index 665aac07f8..dfe6892bd3 100644 --- a/src/intellij/scalap.iml.SAMPLE +++ b/src/intellij/scalap.iml.SAMPLE @@ -1,6 +1,8 @@ - + + + @@ -10,6 +12,7 @@ + \ No newline at end of file diff --git a/src/intellij/setup.sh b/src/intellij/setup.sh deleted file mode 100755 index 251f717829..0000000000 --- a/src/intellij/setup.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/usr/bin/env bash -# -# Generates IntelliJ IDEA project files based on the checked-in samples. -# - -set -e -export SCRIPT_DIR="$( cd "$( dirname "$0" )" && pwd )" -echo "About to delete .ipr and .iml files and replace with the .SAMPLE files. Press enter to continue or CTRL-C to cancel." -read - -for f in "$SCRIPT_DIR"/*.SAMPLE; do - g=${f%.SAMPLE} - cp $f $g -done - -STARR_VERSION="`cat $SCRIPT_DIR/../../versions.properties | grep 'starr.version' | awk '{split($0,a,"="); print a[2]}'`" -sed "s/#starr-version#/$STARR_VERSION/g" $SCRIPT_DIR/scala.ipr.SAMPLE > $SCRIPT_DIR/scala.ipr diff --git a/src/intellij/test-junit.iml.SAMPLE b/src/intellij/test-junit.iml.SAMPLE deleted file mode 100644 index 86dc39c175..0000000000 --- a/src/intellij/test-junit.iml.SAMPLE +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/intellij/test.iml.SAMPLE b/src/intellij/test.iml.SAMPLE index 5047967721..0253b539e7 100644 --- a/src/intellij/test.iml.SAMPLE +++ b/src/intellij/test.iml.SAMPLE @@ -7,16 +7,15 @@ - - - - + + - - - + + + + \ No newline at end of file diff --git a/src/intellij/update.sh b/src/intellij/update.sh deleted file mode 100755 index eb6fea782f..0000000000 --- a/src/intellij/update.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/env bash -# -# Updates the .SAMPLE files with the current project files. -# - -set -e -export SCRIPT_DIR="$( cd "$( dirname "$0" )" && pwd )" - -echo "About to create overwrite the .ipr.SAMPLE and .iml.SAMPLE files with the current project files. Press enter to continue or CTRL-C to cancel." -read - -for f in "$SCRIPT_DIR"/*.{iml,ipr}; do - cp $f $f.SAMPLE -done - -for f in "$SCRIPT_DIR"/*.SAMPLE; do - g=${f%.SAMPLE} - if [[ ! -f $g ]]; then - echo "Stale sample file, deleting $f" - rm $f - fi -done -- cgit v1.2.3