Getting akka source code into Eclipse project using SBT?

269 views
Skip to first unread message

Markus Jais

unread,
Jun 1, 2011, 2:44:57 PM6/1/11
to akka...@googlegroups.com
Hello,

I am trying to get a deeper understanding of the Akka source code and for that I want to import the whole thing as an Eclipse project,
so I can play with the code, the tests and use Eclipse features like "F3" to go through the source code. Eclipse would be best as the
Scala plugin is now quite good and I know Eclipse very well from daily Java work.

I got the latest Akka source code with git and then I added the SBT Eclipse plugin to project/plugins/Plugins.scala
with:
lazy val eclipse = "de.element34" % "sbt-eclipsify" % "0.7.0"

and to:
project/build/AkkaProject.scala

with

import de.element34.sbteclipsify._
and addint the  Eclipsify trait to the AkkaParentProjekt.

when doing

sbt reload update and then sbt eclipse, I get this:

java.lang.ClassCastException: AkkaParentProject cannot be cast to sbt.BasicScalaPaths
at de.element34.sbteclipsify.ClasspathFile.writeFile(ClasspathFile.scala:67)
at de.element34.sbteclipsify.Eclipsify$class.writeClasspathFile(SbtEclipsify.scala:71)
at AkkaParentProject.writeClasspathFile(AkkaProject.scala:17)
at de.element34.sbteclipsify.Eclipsify$$anonfun$eclipse$1.apply(SbtEclipsify.scala:43)
at de.element34.sbteclipsify.Eclipsify$$anonfun$eclipse$1.apply(SbtEclipsify.scala:40)
at sbt.TaskManager$Task.invoke(TaskManager.scala:62)
at sbt.impl.RunTask.doRun$1(RunTask.scala:77)
at sbt.impl.RunTask.runTask(RunTask.scala:85)
at sbt.impl.RunTask.run(RunTask.scala:32)

I am relatively new to Scala, Akka and SBT, so maybe this is a stupid questions, but I've not been able to figure this one out.

Anyone successfully imported the Akka source code as an Eclipse project?

regards,

Markus









Patrik Nordwall

unread,
Jun 1, 2011, 10:10:25 PM6/1/11
to akka...@googlegroups.com
Eclipsify doesn't support multi module projects, as Akka.

I use Eclipse with Akka, but I have created the projects manually, not difficult since all dependencies are in lib_managed, but it's not a long term solution.

sbteclipse is probably the way to go, but I think we need to migrate to sbt 0.9 first.
--
You received this message because you are subscribed to the Google Groups "Akka User List" group.
To post to this group, send email to akka...@googlegroups.com.
To unsubscribe from this group, send email to akka-user+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/akka-user?hl=en.

Robert Risch

unread,
Jun 3, 2011, 9:49:20 AM6/3/11
to Akka User List
I have also tried to import the Akka source as Eclipse project.
Unfortunately there are no Eclipse Project files in the Akka source.
Is there a patch for the Akka source that add Eclipse project files
for easy importing? It would also great if the jars where Akka depend
on are referenced with attached sources. This would make the browsing
in the source easy.
For now each user make it's own not so perfect solution.
Hopefully sbt 0.10 will release shortly and Heiko Seebergers sbt
plugin will be able to create eclipse
projectfiles for Akka. I have not tested it.
By the way 12 hours ago the Copyright note for the plugin changed to
Typesafe Inc.
So I expect there will be a Typesafe stack with
Scala, Akka, Eclipse and sbt including the SbtEclipse Plugin.

/Robert

On 2 Jun., 04:10, Patrik Nordwall <patrik.nordw...@gmail.com> wrote:
> Eclipsify doesn't support multi module projects, as Akka.
>
> I use Eclipse with Akka, but I have created the projects manually, not difficult since all dependencies are in lib_managed, but it's not a long term solution.
>
> sbteclipse is probably the way to go, but I think we need to migrate to sbt 0.9 first.https://github.com/weiglewilczek/sbteclipse
>
> /Patrik
>
> 1 jun 2011 kl. 11:44 skrev Markus Jais <markus.j...@yahoo.de>:
>
>
>
> > Hello,
>
> > I am trying to get a deeper understanding of the Akka source code and for that I want to import the whole thing as an Eclipse project,
> > so I can play with the code, the tests and use Eclipse features like "F3" to go through the source code. Eclipse would be best as the
> > Scala plugin is now quite good and I know Eclipse very well from daily Java work.
>
> > I got the latest Akka source code with git and then I added the SBT Eclipse plugin to project/plugins/Plugins.scala
> > with:
> > lazy val eclipse = "de.element34" % "sbt-eclipsify" % "0.7.0"
>
> > and to:
> > project/build/AkkaProject.scala
>
> > with
>
> > import de.element34.sbteclipsify._
> > and addint the  Eclipsify trait to the AkkaParentProjekt.
>
> > when doing
>
> > sbt reload update and then sbt eclipse, I get this:
>
> > java.lang.ClassCastException: AkkaParentProject cannot be cast to sbt.BasicScalaPaths
> >    at de.element34.sbteclipsify.ClasspathFile.writeFile(ClasspathFile.scala:67)
> >    at de.element34.sbteclipsify.Eclipsify$class.writeClasspathFile(SbtEclipsify.s­cala:71)
> >    at AkkaParentProject.writeClasspathFile(AkkaProject.scala:17)
> >    at de.element34.sbteclipsify.Eclipsify$$anonfun$eclipse$1.apply(SbtEclipsify.s­cala:43)
> >    at de.element34.sbteclipsify.Eclipsify$$anonfun$eclipse$1.apply(SbtEclipsify.s­cala:40)

Robert Risch

unread,
Jun 3, 2011, 8:30:31 AM6/3/11
to Akka User List
I have also tried to import the Akka source as Eclipse project.
Unfortunately there are no Eclipse Project files in the Akka source.
Is there a patch for the Akka source that add Eclipse project files
for easy importing? It would also great if the jars where Akka depend
on are referenced with attached sources. This would make the browsing
in the source easy.
For now each user make it's own not so perfect solution.
Hopefully sbt 0.10 will release shortly and Heiko Seebergers sbt
plugin will be able to create eclipse
projectfiles for Akka. I have not tested it.
By the way 12 hours ago the Copyright note for the plugin changed to
Typesafe Inc.
So I expect there will be a Typesafe stack with
Scala, Akka, Eclipse and sbt including the SbtEclipse Plugin.

/Robert


On 2 Jun., 04:10, Patrik Nordwall <patrik.nordw...@gmail.com> wrote:
> Eclipsify doesn't support multi module projects, as Akka.
>
> I use Eclipse with Akka, but I have created the projects manually, not difficult since all dependencies are in lib_managed, but it's not a long term solution.
>
> sbteclipse is probably the way to go, but I think we need to migrate to sbt 0.9 first.https://github.com/weiglewilczek/sbteclipse
>
> /Patrik
>
> 1 jun 2011 kl. 11:44 skrev Markus Jais <markus.j...@yahoo.de>:
>
>
>
> > Hello,
>
> > I am trying to get a deeper understanding of the Akka source code and for that I want to import the whole thing as an Eclipse project,
> > so I can play with the code, the tests and use Eclipse features like "F3" to go through the source code. Eclipse would be best as the
> > Scala plugin is now quite good and I know Eclipse very well from daily Java work.
>
> > I got the latest Akka source code with git and then I added the SBT Eclipse plugin to project/plugins/Plugins.scala
> > with:
> > lazy val eclipse = "de.element34" % "sbt-eclipsify" % "0.7.0"
>
> > and to:
> > project/build/AkkaProject.scala
>
> > with
>
> > import de.element34.sbteclipsify._
> > and addint the  Eclipsify trait to the AkkaParentProjekt.
>
> > when doing
>
> > sbt reload update and then sbt eclipse, I get this:
>
> > java.lang.ClassCastException: AkkaParentProject cannot be cast to sbt.BasicScalaPaths
> >    at de.element34.sbteclipsify.ClasspathFile.writeFile(ClasspathFile.scala:67)
> >    at de.element34.sbteclipsify.Eclipsify$class.writeClasspathFile(SbtEclipsify.s­cala:71)
> >    at AkkaParentProject.writeClasspathFile(AkkaProject.scala:17)
> >    at de.element34.sbteclipsify.Eclipsify$$anonfun$eclipse$1.apply(SbtEclipsify.s­cala:43)
> >    at de.element34.sbteclipsify.Eclipsify$$anonfun$eclipse$1.apply(SbtEclipsify.s­cala:40)

Markus Jais

unread,
Jun 3, 2011, 11:58:36 AM6/3/11
to akka...@googlegroups.com
Thanks for the information.
I did it manually and it works. Wasn't hard. Hopefully in the future this will be even easier using sbt.

regards,

Markus


Von: Patrik Nordwall <patrik....@gmail.com>
An: "akka...@googlegroups.com" <akka...@googlegroups.com>
Gesendet: 4:10 Donnerstag, 2.Juni 2011
Betreff: Re: [akka-user] Getting akka source code into Eclipse project using SBT?

Heiko Seeberger

unread,
Jun 3, 2011, 7:25:29 PM6/3/11
to akka...@googlegroups.com
As soon as Akka switches to SBT 0.10, you can use sbteclipse to create your Eclipse project files (also for sub-projects).

Heiko
Heiko Seeberger
Twitter: hseeberger
Blog: heikoseeberger.name


Markus Jais

unread,
Jun 4, 2011, 6:23:57 AM6/4/11
to akka...@googlegroups.com
Cool, looking forward to it. Thanks for your work!!

Markus


Von: Heiko Seeberger <heiko.s...@googlemail.com>
An: akka...@googlegroups.com
Gesendet: 1:25 Samstag, 4.Juni 2011

RippleK

unread,
Jul 1, 2011, 1:38:35 PM7/1/11
to Akka User List
Can you please share how you did it manually? Did you just import from
file system and add Scala nature? If imported from file system, did
you import from the akka folder or a sub directory? A quick listing of
steps would be really helpful.

Thanks!
-Ripple

On Jun 3, 8:58 am, Markus Jais <markus.j...@yahoo.de> wrote:
> Thanks for the information.
> I did it manually and it works. Wasn't hard. Hopefully in the future this will be even easier using sbt.
>
> regards,
>
> Markus
>
> ________________________________
> Von: Patrik Nordwall <patrik.nordw...@gmail.com>
> An: "akka...@googlegroups.com" <akka...@googlegroups.com>
> Gesendet: 4:10 Donnerstag, 2.Juni 2011
> Betreff: Re: [akka-user] Getting akka source code into Eclipse project using SBT?
>
> Eclipsify doesn't support multi module projects, as Akka.
>
> I use Eclipse with Akka, but I have created the projects manually, not difficult since all dependencies are in lib_managed, but it's not a long term solution.
>
> sbteclipse is probably the way to go, but I think we need to migrate to sbt 0.9 first.https://github.com/weiglewilczek/sbteclipse
>
> /Patrik
>
> 1 jun 2011 kl. 11:44 skrev Markus Jais <markus.j...@yahoo.de>:
>
> Hello,
>
>
>
>
>
>
>
>
>
> >I am trying to get a deeper understanding of the Akka source code and for that I want to import the whole thing as an Eclipse project,
> >so I can play with the code, the tests and use Eclipse features like "F3" to go through the source code. Eclipse would be best as the
> >Scala plugin is now quite good and I know Eclipse very well from daily Java work.
>
> >I got the latest Akka source code with git and then I added the SBT Eclipse plugin to project/plugins/Plugins.scala
> >with:
> >lazy val eclipse = "de.element34" % "sbt-eclipsify" % "0.7.0"
>
> >and to:
> >project/build/AkkaProject.scala
>
> >with
>
> >import de.element34.sbteclipsify._
> >and addint the  Eclipsify trait to the AkkaParentProjekt.
>
> >when doing
>
> >sbt reload update and then sbt eclipse, I get this:
>
> >java.lang.ClassCastException: AkkaParentProject cannot be cast to sbt.BasicScalaPaths
> >at de.element34.sbteclipsify.ClasspathFile.writeFile(ClasspathFile.scala:67)
> >at de.element34.sbteclipsify.Eclipsify$class.writeClasspathFile(SbtEclipsify.s cala:71)
> >at AkkaParentProject.writeClasspathFile(AkkaProject.scala:17)
> >at de.element34.sbteclipsify.Eclipsify$$anonfun$eclipse$1.apply(SbtEclipsify.s cala:43)
> >at de.element34.sbteclipsify.Eclipsify$$anonfun$eclipse$1.apply(SbtEclipsify.s cala:40)
> >at sbt.TaskManager$Task.invoke(TaskManager.scala:62)
> >at sbt.impl.RunTask.doRun$1(RunTask.scala:77)
> >at sbt.impl.RunTask.runTask(RunTask.scala:85)
> >at sbt.impl.RunTask.run(RunTask.scala:32)
>
> >I am relatively new to Scala, Akka and SBT, so maybe this is a stupid questions, but I've not been able to figure this one out.
>
> >Anyone successfully imported the Akka source code as an Eclipse project?
>
> >regards,
>
> >Markus
>
> --
> >You received this message because you are subscribed to the Google Groups "Akka User List" group.
> >To post to this group, send email to akka...@googlegroups.com.
> >To unsubscribe from this group, send email to akka-user+...@googlegroups.com.
> >For more options, visit this group athttp://groups.google.com/group/akka-user?hl=en.

Patrik Nordwall

unread,
Jul 4, 2011, 2:02:53 AM7/4/11
to akka...@googlegroups.com
Well, I simply created new Scala projects with File > New. Selected Location to for example akka-actor.
Verified that src locations are correct (src/main/scala, src/main/java, src/test/scala, src/test/java).
Libraries, add all jars in lib_managed/complile
Added project dependencies between akka modules as necessary.

We are working on migrating akka to sbt 0.10. Then this will be much easier, since we can use sbteclipse, https://github.com/typesafehub/sbteclipse

Patrik Nordwall
Typesafe - Enterprise-Grade Scala from the Experts
Twitter: @patriknw


RippleK

unread,
Jul 6, 2011, 1:27:27 PM7/6/11
to Akka User List
I just wanted to update this thread because I wasn't able to find
information on this anywhere else. All this while I've been wondering
what tools the akka contributors use to develop. If anyone knows, I
will be interested to know.

Anyway, I was able to import the Akka source into IntelliJ with much
less manual work. The sbt idea plugin supports multi module projects.
I modified the Plugins.scala and AkkaProject.scala files to specify
which projects I want to imported into IntelliJ. I had some issues
with the akka-sbt-plugin project, so I removed it from the project.

Hopefully this helps others. I can provide specific steps if needed.



On Jul 3, 11:02 pm, Patrik Nordwall <patrik.nordw...@gmail.com> wrote:
> Well, I simply created new Scala projects with File > New. Selected Location
> to for example akka-actor.
> Verified that src locations are correct (src/main/scala, src/main/java,
> src/test/scala, src/test/java).
> Libraries, add all jars in lib_managed/complile
> Added project dependencies between akka modules as necessary.
>
> We are working on migrating akka to sbt 0.10. Then this will be much easier,
> since we can use sbteclipse,https://github.com/typesafehub/sbteclipse
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Akka User List" group.
> > To post to this group, send email to akka...@googlegroups.com.
> > To unsubscribe from this group, send email to
> > akka-user+...@googlegroups.com.
> > For more options, visit this group at
> >http://groups.google.com/group/akka-user?hl=en.
>
> --
>
> Patrik Nordwall
> Typesafe <http://typesafe.com/> - Enterprise-Grade Scala from the Experts
> Twitter: @patriknw

Jonas Bonér

unread,
Jul 6, 2011, 1:56:38 PM7/6/11
to akka...@googlegroups.com

I use Sublime Editor, with a patched Textmate Scala bundle. Building from command line with SBT.

--
Jonas Bonér
CTO
Typesafe - Enterprise-Grade Scala from the Experts
Phone: +46 733 777 123
Twitter: @jboner

On Jul 6, 2011 7:44 PM, "RippleK" <rippl...@gmail.com> wrote:

Peter Vlugter

unread,
Jul 6, 2011, 6:46:51 PM7/6/11
to akka...@googlegroups.com

On 7/07/2011, at 5:27 AM, RippleK wrote:

> Anyway, I was able to import the Akka source into IntelliJ with much
> less manual work. The sbt idea plugin supports multi module projects.
> I modified the Plugins.scala and AkkaProject.scala files to specify
> which projects I want to imported into IntelliJ.

You can also use sbt idea as a processor (so no need to modify the project files).

> I had some issues
> with the akka-sbt-plugin project, so I removed it from the project.

The sbt plugin has some of its sources automatically generated from AkkaProject and as an sbt 0.7 plugin it uses scala 2.7, both of which could cause problems in a general import.

Roland Kuhn

unread,
Jul 7, 2011, 2:29:52 AM7/7/11
to akka...@googlegroups.com
I’m that old-school vim guy … SBT does an awesome job of handling the rest for me.

Reply all
Reply to author
Forward
0 new messages