How to build this plugin [!] Follow
I'd like to do some development work for this plugin (intellij-scala).
However, I find myself unable to get it into a state that will compile.
So, what I want:
to build intellij-scala (branch "master") against IntelliJ Community Edition v14 (I have a clone on branch "master")
Path Variables that I have set:
- CARDEA_HOME: <path to clone of intellij-community>
- IDEA-14_HOME: <path to clone of intellij-community>
- MAVEN_REPOSITORY: <home directory>/.m2/repository
- SCALA_PLUGIN_HOME: <path to clone of intellij-scala>
- SCALA_PLUGIN_LEDA: <path to clone of intellij-scala>
Step 1. Building IntelliJ Community Edition
I realize that building IntelliJ itself is not within the scope of this particular forum (or whether it's even required for building the Scala plugin), but I'm including it here for completeness.
I followed the steps at Check Out and Build Community Edition (checked out branch "master" which I believe points to version 14 of IntelliJ) and am trying to build it using Java 1.6.0_45 (on Windows)
I've tried building it from IDEA by issuing "Build >> Make Project". Issues with building this (if relevant):
- I can't compile project "plugins/gradle" because there are refererences (all of which in plugins\gradle\src\org\jetbrains\plugins\gradle\service\project\data\ExternalProjectSerializer.java) to classes inside a package "com.esotericsoftware" which cannot be found, and doesn't seem to be in the module's dependencies. I noticed that the module ("community > plugins > gradle > gradle" in IDEA's project structure) has a dependency named "Kryo" that is undefined.
- everything else seems fine
Step 2. Building the Scala plugin
Relevant pages on the wiki:
- Setting up Scala plugin project in IntelliJ IDEA
- there's also this other page but it hasn't been updated in 2 years! None of the instructions there really apply - the project no longer uses ant, and the comments are even older (4 years ago last one).
- I'm on the "master" git branch
- am using a 1.7.0_45 JDK and I've added "lib/tools.jar" to its classpath, as I'm on Windows
I followed the instructions from the former wiki page, and I'm getting some compilation errors:
Error:(3, 38) object messages is not a member of package org.jetbrains.jps.incremental
Error:(10, 21) not found: type Kind
def message(kind: Kind, text: String, source: Option[File] = None, line: Option[Long] = None, column: Option[Long] = None)
Error:(13, 13) not found: value Kind
message(Kind.ERROR, text, source, line, column)
Error:(17, 13) not found: value Kind
message(Kind.WARNING, text, source, line, column)
Error:(21, 13) not found: value Kind
message(Kind.INFO, text, source, line, column)
Error:(5, 38) object messages is not a member of package org.jetbrains.jps.incremental
Error:(35, 31) not found: type Kind
case class MessageEvent(kind: Kind, text: String, source: Option[File], line: Option[Long], column: Option[Long]) extends Event
Error:(6, 12) object intellij is not a member of package com
Error:(27, 20) not found: value FileUtil
val excess = FileUtil.loadTextAndClose(stream)
Error:(7, 12) object intellij is not a member of package com
Error:(8, 38) object messages is not a member of package org.jetbrains.jps.incremental
Error:(50, 41) not found: value Base64Converter
val event = Event.fromBytes(Base64Converter.decode(data))
Can anyone help figure this out for me? :)
Please sign in to leave a comment.
master branch is for IDEA 13 yet, so if you want to build against IDEA, right now you need to use IDEA 13 (or you can checkour IDEA-14 branch). We will move it to IDEA 14 really soon.
As for compilation error, it looks a bit weird for me. Probably if you build IDEA from sources, something wasn't compiled succesfully (I mean JPS in IntelliJ IDEA). Try out for the beginning with raw IDEA installation.
Thanks! I've managed to compile the IDEA-14 branch in the end.
The issue was that
should have been pointing at a intellij-community installation, not at the source code.
We are going to move to SBT. And we have plans to implement one-click installation, when IntelliJ IDEA will be downloaded automatically. We still have a lot of problems with SBT, but I think we will workaround all of them, so things will be improved a lot.
I'm getting the same error messages.
One particular issue, I'm what's the path suppose to be?
export "IDEA-14_HOME"=/Applications/IntelliJ\ IDEA\ 14\ CE.app
-bash: export: `IDEA-14_HOME=/Applications/IntelliJ IDEA 14 CE.app': not a valid identifier
is it really suppose to have a hyphen in the environment variable?
EDIT: Looks like I forgot to do a $ sbt downloadIdea
But now I'm still getting an error:
Error:(6, 8) object ScalaCompilerSettings is not a member of package org.jetbrains.plugins.scala.project
Error:(31, 48) not found: value ScalaCompilerSettings
private def needQQEmulation(e: PsiElement) = ScalaCompilerSettings.instanceIn(e.getProject).plugins.exists(_.contains("paradise_2.10"))
EDIT 2: Looks like this was broken in a recent patch, I pseudo fixed it: https://github.com/JetBrains/intellij-scala/pull/119