How to configure external build with scala Follow
I was able to configure External Build with scala plugin (v.0.7.41). Here are my steps:
1. Open Settings -> Compiler and select "Use external build". Close the dialog
2. Open Project Structure -> Global Libraries and create a library with scala-library.jar and scala-compiler.jar files. Right now scala plugin has these names hardcoded and will fail if you use different names.
3. Open Project Structure -> Facets and in every scala facet select the library created in step #2 as Compiler Library.
4. Stop FSC if you have it running. There is and icon in the status bar. Click and select Stop.
5. Build -> Make
Please sign in to leave a comment.
Not for me. When I try to compile anything I get Unknown source file errors. eg:
: Error: Unknown source file: /mnt/ssd/si/vimana.dev/servers/si-infra/src/main/scala/com/mongodb/ErrorInterceptingDB.scala
java.lang.RuntimeException: Unknown source file: /mnt/ssd/si/vimana.dev/servers/si-infra/src/main/scala/com/mongodb/ErrorInterceptingDB.scala
Is that from an external hard drive?
No, its my SSD. Its internal. However the directory containing the idea project is soft linked to the SSD (on lunix).
step #2 is not required if you use plugin >= 0.7.49
does it work when you don't have soft links in your project?
FSC vs External build & Zinc
I just run full rebuild several times on a project that consits of 28 modules. Production code is mostly java with several scala files. Tests written in scala and java.
cold 2 min 46 sec
warm 2 min 21 sec
warm 2 min 16 sec
External build & Zinc
cold 2 min 2 sec
warm 1 min 27 sec
warm 1 min 25 sec
Warm external builder with zinc is 50 sec faster than warm FSC on one of our projects.
1 min 25 sec (zinc) vs 2 min 16 sec (FSC)
The first process in the list is external compiler with zinc
Interesting results on a single module 100% scala liftweb 2.4 project
Leda IU-123.95, plugin 0.7.61, java 6, scala 2.9.1, macosx 10.8.2
I did Build -> Rebuild Project several times. The first run is cold, 2nd and 3rd could be considered warm runs (VM should optimize/compile some compiler code already).
cold 1m 50 sec
warm 1m 7 sec
warm 1m 3 sec
External build & Zinc
cold 2 min 12 sec
warm 1 min 33 sec
warm 1 min 28 sec
warm 1 min 26 sec
Looks like on as single module project (only scala code) doing Rebuild is faster with FSC in IDEA.
The problem with links is fixed in the latest plugin builds.
Probably you are using "compile independent modules in parallel" option?
No, I don't use "compile independent modules in parallel" option. It doesn't work in my case. When I open a project with ~ 20 java modules with tests written in scala IDEA fails to resolve dependencies between these modules correctly.
More info is here: http://blog.jetbrains.com/scala/2012/12/28/a-new-way-to-compile/
I have a single module proejct consisting of Scala and some Java files and I discovered the same. FSC seems to be much faster than the new compiler system (around factor 2-3), especially when you have only minor changes in your code. To get sure about this I made a small test. I compiled by project with both compilers. Here are the results:
New compiler: 3:35
Warm run when only a single line of code has changed (the for test I used exactly the same line of code and made the same change):
New compiler: 21s
I don't really care about the cold run, since I do it only once in a month. But what I care about are warm runs, because they are executed more than 100 times a day and they majorly influence the time to test and debug code.
Is this difference between FSC and the new compiler supposed to be?
Did I have to set certain compiler options to increase the speed?
I already set the same parameters for both compilers (Xmx, max heap size) but it didn't change anything.
The option "Run compiler server (in external build mode)" is checked. Does this mean IDEA uses nailgun to compile the project?
Hi Stefan, we'll check that soon.