From 02df8f3f9f16d67ba475829ed57b0d858b513031 Mon Sep 17 00:00:00 2001 From: Jason Zaugg Date: Tue, 16 Jul 2013 15:04:47 +1000 Subject: Scrubbing up the IntelliJ Config - Add recently sprouted modules (xml and parser-combinators) - Replace some of the documentation with a setup script - Update Ant build to copy Maven sourced JARs to ./build/deps. These are included in the IntelliJ classpath. - Define the library for Ant at the project level based on ./lib, rather than asking the user to define global library. - Disable Type Aware Highlighting by default. IntelliJ now can build everything within the IDE with CTRL-F9. --- src/intellij/README | 15 ++++------- src/intellij/compiler.iml.SAMPLE | 5 ++-- src/intellij/diff.sh | 8 ++++++ src/intellij/library.iml.SAMPLE | 2 +- src/intellij/manual.iml.SAMPLE | 3 ++- src/intellij/parser-combinators.iml.SAMPLE | 22 ++++++++++++++++ src/intellij/partest.iml.SAMPLE | 4 ++- src/intellij/reflect.iml.SAMPLE | 2 +- src/intellij/repl.iml.SAMPLE | 2 +- src/intellij/scala-lang.ipr.SAMPLE | 42 +++++++++++++++++++++++++++--- src/intellij/scala.iml.SAMPLE | 4 ++- src/intellij/scaladoc.iml.SAMPLE | 3 +++ src/intellij/setup.sh | 23 ++++++++++++++++ src/intellij/test.iml.SAMPLE | 3 +++ src/intellij/xml.iml.SAMPLE | 22 ++++++++++++++++ 15 files changed, 137 insertions(+), 23 deletions(-) create mode 100755 src/intellij/diff.sh create mode 100644 src/intellij/parser-combinators.iml.SAMPLE create mode 100755 src/intellij/setup.sh create mode 100644 src/intellij/xml.iml.SAMPLE (limited to 'src/intellij') diff --git a/src/intellij/README b/src/intellij/README index 9ef612bd0a..ade87749cd 100644 --- a/src/intellij/README +++ b/src/intellij/README @@ -1,13 +1,8 @@ Use the latest IntelliJ IDEA release and install the Scala plugin from within the IDE. The following steps are required to use IntelliJ IDEA on Scala trunk - - compile "locker" using "ant locker.done" - - Copy the *.iml.SAMPLE / *.ipr.SAMPLE files to *.iml / *.ipr - - In IDEA, create a global library named "ant" which contains "ant.jar" - - Also create an SDK entry named "1.6" containing the java 1.6 SDK - - In the Scala Facet of the "library" and "reflect" modules, update the path in the - command-line argument for "-sourcepath" - - In the Project Settings, update the "Version Control" to match your checkout - -Known problems - - Due to SI-4365, the "library" module has to be built using "-Yno-generic-signatures" + - compile "locker" using "ant locker.done". This will also download some JARs from + Maven to ./build/deps, which are included in IntelliJ's classpath. + - Run src/intellij/setup.sh + - Open ./src/intellij/scala-lang.ipr in IntelliJ + - File, Project Settings, Project, SDK. Create an SDK entry named "1.6" containing the java 1.6 SDK diff --git a/src/intellij/compiler.iml.SAMPLE b/src/intellij/compiler.iml.SAMPLE index f8b1f31327..9fb9cd55eb 100644 --- a/src/intellij/compiler.iml.SAMPLE +++ b/src/intellij/compiler.iml.SAMPLE @@ -19,9 +19,8 @@ - - - + + diff --git a/src/intellij/diff.sh b/src/intellij/diff.sh new file mode 100755 index 0000000000..54f9248608 --- /dev/null +++ b/src/intellij/diff.sh @@ -0,0 +1,8 @@ +#!/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/library.iml.SAMPLE b/src/intellij/library.iml.SAMPLE index 9c1b7ec185..cac53dff15 100644 --- a/src/intellij/library.iml.SAMPLE +++ b/src/intellij/library.iml.SAMPLE @@ -5,7 +5,7 @@ diff --git a/src/intellij/manual.iml.SAMPLE b/src/intellij/manual.iml.SAMPLE index 62810e0cba..3295a4a877 100644 --- a/src/intellij/manual.iml.SAMPLE +++ b/src/intellij/manual.iml.SAMPLE @@ -18,7 +18,8 @@ - + + diff --git a/src/intellij/parser-combinators.iml.SAMPLE b/src/intellij/parser-combinators.iml.SAMPLE new file mode 100644 index 0000000000..1ef913dbe4 --- /dev/null +++ b/src/intellij/parser-combinators.iml.SAMPLE @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + diff --git a/src/intellij/partest.iml.SAMPLE b/src/intellij/partest.iml.SAMPLE index ab4a32a9b3..5b8cfa3f38 100644 --- a/src/intellij/partest.iml.SAMPLE +++ b/src/intellij/partest.iml.SAMPLE @@ -18,11 +18,13 @@ + - + + diff --git a/src/intellij/reflect.iml.SAMPLE b/src/intellij/reflect.iml.SAMPLE index 10973c503f..7d10522826 100644 --- a/src/intellij/reflect.iml.SAMPLE +++ b/src/intellij/reflect.iml.SAMPLE @@ -5,7 +5,7 @@ diff --git a/src/intellij/repl.iml.SAMPLE b/src/intellij/repl.iml.SAMPLE index 5e11ff1cf6..fc78ffe8c2 100644 --- a/src/intellij/repl.iml.SAMPLE +++ b/src/intellij/repl.iml.SAMPLE @@ -20,6 +20,6 @@ + - diff --git a/src/intellij/scala-lang.ipr.SAMPLE b/src/intellij/scala-lang.ipr.SAMPLE index 61c813df01..f91a346b75 100644 --- a/src/intellij/scala-lang.ipr.SAMPLE +++ b/src/intellij/scala-lang.ipr.SAMPLE @@ -33,6 +33,9 @@ + + @@ -204,6 +207,7 @@ + @@ -212,6 +216,7 @@ + @@ -228,6 +233,13 @@ + + + + + + + @@ -238,13 +250,35 @@ - + - + - + + + + + + + + + + + + + + + + + + + + + + + + - diff --git a/src/intellij/scala.iml.SAMPLE b/src/intellij/scala.iml.SAMPLE index 8ea9d0dd71..a4d863800b 100644 --- a/src/intellij/scala.iml.SAMPLE +++ b/src/intellij/scala.iml.SAMPLE @@ -2,7 +2,9 @@ - + + + diff --git a/src/intellij/scaladoc.iml.SAMPLE b/src/intellij/scaladoc.iml.SAMPLE index 6cc609919c..07bea5bf5d 100644 --- a/src/intellij/scaladoc.iml.SAMPLE +++ b/src/intellij/scaladoc.iml.SAMPLE @@ -20,5 +20,8 @@ + + + diff --git a/src/intellij/setup.sh b/src/intellij/setup.sh new file mode 100755 index 0000000000..d0e1abeb96 --- /dev/null +++ b/src/intellij/setup.sh @@ -0,0 +1,23 @@ +#!/usr/bin/env bash +# +# Generates IntelliJ IDEA project files based on the checked-in samples. +# + +set -e +export SCRIPT_DIR="$( cd "$( dirname "$0" )" && pwd )" +export BASE="$( 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 + +(rm *.ipr *.iml 2>/dev/null) +for f in $(ls "$SCRIPT_DIR"/*.SAMPLE); do + NEW_FILE=`echo $f | perl -pe 's/.SAMPLE//'`; + + cp $f $NEW_FILE + + # IntelliJ doesn't process the "compilerOptions" setting for variable + # replacement. If it did, we would just use "$PROJECT_DIR$". Instead, + # we do this replacement ourselves. + perl -pi -e 's/\$BASE_DIR\$/$ENV{"BASE"}/g' $NEW_FILE + echo "Created $NEW_FILE" +done diff --git a/src/intellij/test.iml.SAMPLE b/src/intellij/test.iml.SAMPLE index 3ce369be05..423be2062c 100644 --- a/src/intellij/test.iml.SAMPLE +++ b/src/intellij/test.iml.SAMPLE @@ -6,6 +6,8 @@ + + @@ -13,6 +15,7 @@ + diff --git a/src/intellij/xml.iml.SAMPLE b/src/intellij/xml.iml.SAMPLE new file mode 100644 index 0000000000..b721f4e7f2 --- /dev/null +++ b/src/intellij/xml.iml.SAMPLE @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + -- cgit v1.2.3