Skip to content

Commit fc4602a

Browse files
committed
Merge pull request scala#3708 from lrytz/intellij
IntelliJ project files
2 parents ca9003e + f93fbef commit fc4602a

18 files changed

+188
-72
lines changed

build.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -368,12 +368,13 @@ TODO:
368368
<typedef resource="aQute/bnd/ant/taskdef.properties" classpathref="extra.tasks.classpath" />
369369

370370
<echo message="Using Scala ${starr.version} for STARR."/>
371-
<artifact:dependencies pathId="starr.compiler.path">
371+
<artifact:dependencies pathId="starr.compiler.path" filesetId="starr.fileset">
372372
<artifact:remoteRepository refid="extra-repo"/>
373373
<dependency groupId="org.scala-lang" artifactId="scala-library" version="${starr.version}"/>
374374
<dependency groupId="org.scala-lang" artifactId="scala-reflect" version="${starr.version}"/>
375375
<dependency groupId="org.scala-lang" artifactId="scala-compiler" version="${starr.version}"/>
376376
</artifact:dependencies>
377+
<copy-deps project="starr"/>
377378

378379
<property name="maven-deps-done" value="yep!"/>
379380
</then></if>

src/intellij/README

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
Use the latest IntelliJ IDEA release and install the Scala plugin from within the IDE.
22

3+
Compilation withing IDEA is performed in "-Dlocker.skip=1" mode: the sources are built
4+
directly using the STARR compiler.
5+
36
The following steps are required to use IntelliJ IDEA on Scala trunk
4-
- compile "locker" using "ant locker.done". This will also download some JARs from
5-
Maven to ./build/deps, which are included in IntelliJ's classpath.
7+
- Run "ant init". This will download some JARs from to ./build/deps, which are
8+
included in IntelliJ's classpath.
69
- Run src/intellij/setup.sh
710
- Open ./src/intellij/scala-lang.ipr in IntelliJ
8-
- File, Project Settings, Project, SDK. Create an SDK entry named "1.6" containing the java 1.6 SDK
11+
- File, Project Settings, Project, SDK. Create an SDK entry named "1.6" containing the
12+
java 1.6 SDK

src/intellij/actors.iml.SAMPLE

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
<facet type="scala" name="Scala">
55
<configuration>
66
<option name="compilerLibraryLevel" value="Project" />
7-
<option name="compilerLibraryName" value="compiler-locker" />
7+
<option name="compilerLibraryName" value="starr" />
8+
<option name="languageLevel" value="Scala 2.11" />
89
<option name="maximumHeapSize" value="1536" />
910
<option name="vmOptions" value="-Xms1536m -Xss1m -XX:MaxPermSize=512M -XX:ReservedCodeCacheSize=256m -XX:+CMSClassUnloadingEnabled -XX:+UseCompressedOops -XX:+UseParallelGC" />
1011
</configuration>

src/intellij/compiler.iml.SAMPLE

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
<facet type="scala" name="Scala">
55
<configuration>
66
<option name="compilerLibraryLevel" value="Project" />
7-
<option name="compilerLibraryName" value="compiler-locker" />
7+
<option name="compilerLibraryName" value="starr" />
8+
<option name="languageLevel" value="Scala 2.11" />
89
<option name="maximumHeapSize" value="1536" />
910
<option name="vmOptions" value="-Xms1536m -Xss1m -XX:MaxPermSize=512M -XX:ReservedCodeCacheSize=256m -XX:+CMSClassUnloadingEnabled -XX:+UseCompressedOops -XX:+UseParallelGC" />
1011
</configuration>
@@ -19,8 +20,8 @@
1920
<orderEntry type="sourceFolder" forTests="false" />
2021
<orderEntry type="module" module-name="library" />
2122
<orderEntry type="module" module-name="reflect" />
22-
<orderEntry type="module" module-name="asm" exported="" />
23-
<orderEntry type="library" exported="" name="ant" level="project" />
23+
<orderEntry type="module" module-name="asm" />
24+
<orderEntry type="library" name="ant" level="project" />
2425
</component>
2526
</module>
2627

src/intellij/interactive.iml.SAMPLE

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
<facet type="scala" name="Scala">
55
<configuration>
66
<option name="compilerLibraryLevel" value="Project" />
7-
<option name="compilerLibraryName" value="compiler-locker" />
7+
<option name="compilerLibraryName" value="starr" />
8+
<option name="languageLevel" value="Scala 2.11" />
89
<option name="maximumHeapSize" value="1536" />
910
<option name="vmOptions" value="-Xms1536m -Xss1m -XX:MaxPermSize=512M -XX:ReservedCodeCacheSize=256m -XX:+CMSClassUnloadingEnabled -XX:+UseCompressedOops -XX:+UseParallelGC" />
1011
</configuration>
@@ -23,3 +24,4 @@
2324
<orderEntry type="module" module-name="scaladoc" />
2425
</component>
2526
</module>
27+

src/intellij/library.iml.SAMPLE

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
44
<facet type="scala" name="Scala">
55
<configuration>
66
<option name="compilerLibraryLevel" value="Project" />
7-
<option name="compilerLibraryName" value="compiler-locker" />
8-
<option name="compilerOptions" value="-sourcepath $BASE_DIR$/src/library" />
7+
<option name="compilerLibraryName" value="starr" />
8+
<option name="compilerOptions" value="-sourcepath $MODULE_DIR$/../library" />
9+
<option name="languageLevel" value="Scala 2.11" />
910
<option name="maximumHeapSize" value="1536" />
1011
<option name="vmOptions" value="-Xms1536m -Xss1m -XX:MaxPermSize=512M -XX:ReservedCodeCacheSize=256m -XX:+CMSClassUnloadingEnabled -XX:+UseCompressedOops -XX:+UseParallelGC" />
1112
</configuration>

src/intellij/manual.iml.SAMPLE

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
<facet type="scala" name="Scala">
55
<configuration>
66
<option name="compilerLibraryLevel" value="Project" />
7-
<option name="compilerLibraryName" value="compiler-locker" />
7+
<option name="compilerLibraryName" value="starr" />
8+
<option name="languageLevel" value="Scala 2.11" />
89
<option name="maximumHeapSize" value="1536" />
910
<option name="vmOptions" value="-Xms1536m -Xss1m -XX:MaxPermSize=512M -XX:ReservedCodeCacheSize=256m -XX:+CMSClassUnloadingEnabled -XX:+UseCompressedOops -XX:+UseParallelGC" />
1011
</configuration>
@@ -18,8 +19,8 @@
1819
<orderEntry type="inheritedJdk" />
1920
<orderEntry type="sourceFolder" forTests="false" />
2021
<orderEntry type="module" module-name="library" />
21-
<orderEntry type="module" module-name="xml" />
2222
<orderEntry type="library" name="ant" level="project" />
23+
<orderEntry type="library" name="scaladoc-deps" level="project" />
2324
</component>
2425
</module>
2526

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<module type="JAVA_MODULE" version="4">
3+
<component name="FacetManager">
4+
<facet type="scala" name="Scala">
5+
<configuration>
6+
<option name="compilerLibraryLevel" value="Project" />
7+
<option name="compilerLibraryName" value="starr" />
8+
<option name="languageLevel" value="Scala 2.11" />
9+
</configuration>
10+
</facet>
11+
</component>
12+
<component name="NewModuleRootManager" inherit-compiler-output="true">
13+
<exclude-output />
14+
<content url="file://$MODULE_DIR$/../partest-extras">
15+
<sourceFolder url="file://$MODULE_DIR$/../partest-extras" isTestSource="false" />
16+
</content>
17+
<orderEntry type="inheritedJdk" />
18+
<orderEntry type="sourceFolder" forTests="false" />
19+
<orderEntry type="module" module-name="asm" />
20+
<orderEntry type="module" module-name="library" />
21+
<orderEntry type="module" module-name="reflect" />
22+
<orderEntry type="module" module-name="compiler" />
23+
<orderEntry type="module" module-name="repl" />
24+
<orderEntry type="library" name="partest" level="project" />
25+
</component>
26+
</module>
27+
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<module type="JAVA_MODULE" version="4">
3+
<component name="NewModuleRootManager" inherit-compiler-output="true">
4+
<exclude-output />
5+
<content url="file://$MODULE_DIR$/../partest-javaagent">
6+
<sourceFolder url="file://$MODULE_DIR$/../partest-javaagent" isTestSource="false" />
7+
</content>
8+
<orderEntry type="inheritedJdk" />
9+
<orderEntry type="sourceFolder" forTests="false" />
10+
<orderEntry type="module" module-name="asm" />
11+
</component>
12+
</module>
13+

src/intellij/reflect.iml.SAMPLE

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
44
<facet type="scala" name="Scala">
55
<configuration>
66
<option name="compilerLibraryLevel" value="Project" />
7-
<option name="compilerLibraryName" value="compiler-locker" />
8-
<option name="compilerOptions" value="-sourcepath $BASE_DIR$/src/reflect" />
7+
<option name="compilerLibraryName" value="starr" />
8+
<option name="compilerOptions" value="-sourcepath $MODULE_DIR$/../reflect" />
9+
<option name="languageLevel" value="Scala 2.11" />
910
<option name="maximumHeapSize" value="1536" />
1011
<option name="vmOptions" value="-Xms1536m -Xss1m -XX:MaxPermSize=512M -XX:ReservedCodeCacheSize=256m -XX:+CMSClassUnloadingEnabled -XX:+UseCompressedOops -XX:+UseParallelGC" />
1112
</configuration>
@@ -19,7 +20,6 @@
1920
<orderEntry type="inheritedJdk" />
2021
<orderEntry type="sourceFolder" forTests="false" />
2122
<orderEntry type="module" module-name="library" />
22-
<orderEntry type="library" name="jline" level="project" />
2323
</component>
2424
</module>
2525

src/intellij/repl.iml.SAMPLE

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
<facet type="scala" name="Scala">
55
<configuration>
66
<option name="compilerLibraryLevel" value="Project" />
7-
<option name="compilerLibraryName" value="compiler-locker" />
7+
<option name="compilerLibraryName" value="starr" />
8+
<option name="languageLevel" value="Scala 2.11" />
89
<option name="maximumHeapSize" value="1536" />
910
<option name="vmOptions" value="-Xms1536m -Xss1m -XX:MaxPermSize=512M -XX:ReservedCodeCacheSize=256m -XX:+CMSClassUnloadingEnabled -XX:+UseCompressedOops -XX:+UseParallelGC" />
1011
</configuration>
@@ -23,3 +24,4 @@
2324
<orderEntry type="library" name="repl-deps" level="project" />
2425
</component>
2526
</module>
27+

src/intellij/scala-lang.ipr.SAMPLE

Lines changed: 40 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<project version="4">
3-
<component name="AntConfiguration">
4-
<defaultAnt bundledAnt="true" />
5-
</component>
63
<component name="CompilerConfiguration">
74
<option name="DEFAULT_COMPILER" value="Javac" />
85
<resourceExtensions>
@@ -21,11 +18,13 @@
2118
<entry name="?*.tld" />
2219
<entry name="?*.ftl" />
2320
</wildcardResourcePatterns>
24-
<annotationProcessing enabled="false" useClasspath="true" />
25-
</component>
26-
<component name="CopyrightManager" default="">
27-
<module2copyright />
21+
<annotationProcessing>
22+
<profile default="true" name="Default" enabled="false">
23+
<processorPath useClasspath="true" />
24+
</profile>
25+
</annotationProcessing>
2826
</component>
27+
<component name="CopyrightManager" default="" />
2928
<component name="DependencyValidationManager">
3029
<option name="SKIP_IMPORT_STATEMENTS" value="false" />
3130
</component>
@@ -41,19 +40,24 @@
4140
<profile version="1.0" is_locked="false">
4241
<option name="myName" value="Project Default" />
4342
<option name="myLocal" value="false" />
43+
<inspection_tool class="LoggerInitializedWithForeignClass" enabled="false" level="WARNING" enabled_by_default="false">
44+
<option name="loggerClassName" value="org.apache.log4j.Logger,org.slf4j.LoggerFactory,org.apache.commons.logging.LogFactory,java.util.logging.Logger" />
45+
<option name="loggerFactoryMethodName" value="getLogger,getLogger,getLog,getLogger" />
46+
</inspection_tool>
4447
<inspection_tool class="SpellCheckingInspection" enabled="false" level="TYPO" enabled_by_default="false">
4548
<option name="processCode" value="true" />
4649
<option name="processLiterals" value="true" />
4750
<option name="processComments" value="true" />
4851
</inspection_tool>
52+
<inspection_tool class="UnitMethodIsParameterless" enabled="false" level="WARNING" enabled_by_default="false" />
4953
</profile>
5054
</profiles>
5155
<option name="PROJECT_PROFILE" value="Project Default" />
5256
<option name="USE_PROJECT_PROFILE" value="true" />
5357
<version value="1.0" />
5458
</component>
5559
<component name="JavacSettings">
56-
<option name="ADDITIONAL_OPTIONS_STRING" value="-source 1.5 -target 1.5" />
60+
<option name="ADDITIONAL_OPTIONS_STRING" value="-source 1.6 -target 1.6" />
5761
</component>
5862
<component name="JavadocGenerationManager">
5963
<option name="OUTPUT_DIRECTORY" />
@@ -205,12 +209,15 @@
205209
<module fileurl="file://$PROJECT_DIR$/interactive.iml" filepath="$PROJECT_DIR$/interactive.iml" />
206210
<module fileurl="file://$PROJECT_DIR$/library.iml" filepath="$PROJECT_DIR$/library.iml" />
207211
<module fileurl="file://$PROJECT_DIR$/manual.iml" filepath="$PROJECT_DIR$/manual.iml" />
212+
<module fileurl="file://$PROJECT_DIR$/partest-extras.iml" filepath="$PROJECT_DIR$/partest-extras.iml" />
213+
<module fileurl="file://$PROJECT_DIR$/partest-javaagent.iml" filepath="$PROJECT_DIR$/partest-javaagent.iml" />
208214
<module fileurl="file://$PROJECT_DIR$/reflect.iml" filepath="$PROJECT_DIR$/reflect.iml" />
209215
<module fileurl="file://$PROJECT_DIR$/repl.iml" filepath="$PROJECT_DIR$/repl.iml" />
210216
<module fileurl="file://$PROJECT_DIR$/scala.iml" filepath="$PROJECT_DIR$/scala.iml" />
211217
<module fileurl="file://$PROJECT_DIR$/scaladoc.iml" filepath="$PROJECT_DIR$/scaladoc.iml" />
212218
<module fileurl="file://$PROJECT_DIR$/scalap.iml" filepath="$PROJECT_DIR$/scalap.iml" />
213219
<module fileurl="file://$PROJECT_DIR$/test.iml" filepath="$PROJECT_DIR$/test.iml" />
220+
<module fileurl="file://$PROJECT_DIR$/test-junit.iml" filepath="$PROJECT_DIR$/test-junit.iml" />
214221
</modules>
215222
</component>
216223
<component name="ProjectResources">
@@ -234,45 +241,46 @@
234241
<JAVADOC />
235242
<SOURCES />
236243
</library>
237-
<library name="compiler-locker">
238-
<CLASSES>
239-
<root url="file://$PROJECT_DIR$/../../build/locker/classes/library" />
240-
<root url="file://$PROJECT_DIR$/../../build/locker/classes/compiler" />
241-
<root url="file://$PROJECT_DIR$/../../build/locker/classes/reflect" />
242-
<root url="file://$PROJECT_DIR$/../../build/asm/classes" />
243-
</CLASSES>
244-
<JAVADOC />
245-
<SOURCES />
246-
</library>
247244
<library name="junit">
248245
<CLASSES>
249246
<root url="file://$PROJECT_DIR$/../../build/deps/junit" />
250247
</CLASSES>
251248
<JAVADOC />
252-
<SOURCES>
253-
<root url="file://$PROJECT_DIR$/../../build/deps/junit" />
254-
</SOURCES>
249+
<SOURCES />
255250
<jarDirectory url="file://$PROJECT_DIR$/../../build/deps/junit" recursive="false" />
256-
<jarDirectory url="file://$PROJECT_DIR$/../../build/deps/junit" recursive="false" type="SOURCES" />
257251
</library>
258-
<library name="partest-deps">
252+
<library name="partest">
259253
<CLASSES>
260254
<root url="file://$PROJECT_DIR$/../../build/deps/partest" />
261255
</CLASSES>
262256
<JAVADOC />
263-
<SOURCES>
264-
<root url="file://$PROJECT_DIR$/../../build/deps/junit" />
265-
</SOURCES>
257+
<SOURCES />
266258
<jarDirectory url="file://$PROJECT_DIR$/../../build/deps/partest" recursive="false" />
267-
<jarDirectory url="file://$PROJECT_DIR$/../../build/deps/junit" recursive="false" type="SOURCES" />
268259
</library>
269260
<library name="repl-deps">
270-
<CLASSES>
261+
<CLASSES>
271262
<root url="file://$PROJECT_DIR$/../../build/deps/repl" />
272-
</CLASSES>
273-
<JAVADOC />
274-
<SOURCES />
263+
</CLASSES>
264+
<JAVADOC />
265+
<SOURCES />
275266
<jarDirectory url="file://$PROJECT_DIR$/../../build/deps/repl" recursive="false" />
276-
</library>
267+
</library>
268+
<library name="scaladoc-deps">
269+
<CLASSES>
270+
<root url="file://$PROJECT_DIR$/../../build/deps/scaladoc" />
271+
</CLASSES>
272+
<JAVADOC />
273+
<SOURCES />
274+
<jarDirectory url="file://$PROJECT_DIR$/../../build/deps/scaladoc" recursive="false" />
275+
</library>
276+
<library name="starr">
277+
<CLASSES>
278+
<root url="file://$PROJECT_DIR$/../../build/deps/starr" />
279+
</CLASSES>
280+
<JAVADOC />
281+
<SOURCES />
282+
<jarDirectory url="file://$PROJECT_DIR$/../../build/deps/starr" recursive="false" />
283+
</library>
277284
</component>
278285
</project>
286+

src/intellij/scaladoc.iml.SAMPLE

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
<facet type="scala" name="Scala">
55
<configuration>
66
<option name="compilerLibraryLevel" value="Project" />
7-
<option name="compilerLibraryName" value="compiler-locker" />
7+
<option name="compilerLibraryName" value="starr" />
8+
<option name="languageLevel" value="Scala 2.11" />
89
<option name="maximumHeapSize" value="1536" />
910
<option name="vmOptions" value="-Xms1536m -Xss1m -XX:MaxPermSize=512M -XX:ReservedCodeCacheSize=256m -XX:+CMSClassUnloadingEnabled -XX:+UseCompressedOops -XX:+UseParallelGC" />
1011
</configuration>
@@ -20,8 +21,8 @@
2021
<orderEntry type="module" module-name="library" />
2122
<orderEntry type="module" module-name="reflect" />
2223
<orderEntry type="module" module-name="compiler" />
23-
<orderEntry type="module" module-name="xml" />
24-
<orderEntry type="module" module-name="parser-combinators" />
25-
<orderEntry type="module" module-name="partest" />
24+
<orderEntry type="library" name="partest" level="project" />
25+
<orderEntry type="library" name="scaladoc-deps" level="project" />
2626
</component>
2727
</module>
28+

src/intellij/scalap.iml.SAMPLE

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
<facet type="scala" name="Scala">
55
<configuration>
66
<option name="compilerLibraryLevel" value="Project" />
7-
<option name="compilerLibraryName" value="compiler-locker" />
7+
<option name="compilerLibraryName" value="starr" />
8+
<option name="languageLevel" value="Scala 2.11" />
89
<option name="maximumHeapSize" value="1536" />
910
<option name="vmOptions" value="-Xms1536m -Xss1m -XX:MaxPermSize=512M -XX:ReservedCodeCacheSize=256m -XX:+CMSClassUnloadingEnabled -XX:+UseCompressedOops -XX:+UseParallelGC" />
1011
</configuration>

src/intellij/setup.sh

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,10 @@
55

66
set -e
77
export SCRIPT_DIR="$( cd "$( dirname "$0" )" && pwd )"
8-
export BASE="$( cd "$( dirname "$0" )"/../.. && pwd )"
98
echo "About to delete .ipr and .iml files and replace with the .SAMPLE files. Press enter to continue or CTRL-C to cancel."
109
read
1110

12-
(rm -f *.ipr *.iml 2>/dev/null)
13-
for f in $(ls "$SCRIPT_DIR"/*.SAMPLE); do
14-
NEW_FILE=`echo $f | perl -pe 's/.SAMPLE//'`;
15-
16-
cp $f $NEW_FILE
17-
18-
# IntelliJ doesn't process the "compilerOptions" setting for variable
19-
# replacement. If it did, we would just use "$PROJECT_DIR$". Instead,
20-
# we do this replacement ourselves.
21-
perl -pi -e 's/\$BASE_DIR\$/$ENV{"BASE"}/g' $NEW_FILE
22-
echo "Created $NEW_FILE"
11+
for f in "$SCRIPT_DIR"/*.SAMPLE; do
12+
g=${f%.SAMPLE}
13+
cp $f $g
2314
done

0 commit comments

Comments
 (0)