views:

38

answers:

2

I have a dependency on clj-record in my CounterClockwise project. What's the best way to manage this? Copy the source code or compile to a JAR and add it as a referenced library?

+1  A: 

There are tools to help you:

nickik
These are all good tools, but they don't integrate with Eclipse. CounterClockwise gives you source level debugging etc. in Eclipse but there seems to be no pattern for specifying dependencies apart from hacking the code into your project or building a jar externally.
edoloughlin
I don't know of any tools that interact with CCW directly. Somebody would have to write a plugin but I don't think anybody done that jet (not sure since I use emacs). You can try maven or grandle the should have plugins for the IDEs.
nickik
A: 

there seems to be no pattern for specifying dependencies apart from hacking the code into your project or building a jar externally.

Of course you can, just as with any java project. While dependency resolution isn't tied into eclipse (yet), once you retrieve the deps (via one of the command line tools nickik listed), you can specify which jars are to be included in the java build path of your eclipse project:

  1. Retrieve the deps via cake, leiningen, etc.
  2. Refresh the eclipse project so you see the deps (usually in the lib directory)
  3. Highlight the jars you want eclipse to know about
  4. Right-click, select Build Path > Add to Build Path

That's it. You can fiddle with the build path by going to the Java Build Path section of the project's properties window.

Alex Taggart
This is what I ended up doing. I was hoping to be able to add Clojure source-level dependencies to help with debugging. However, it seems that debugging isn't quite there yet either, so I'm back to lien and the command line.
edoloughlin
Did you try adding the jar as the "Source attachment"?
Alex Taggart