Skip to content

Launching projects with Leiningen

laurentpetit edited this page Apr 25, 2013 · 3 revisions

Issues to address

IPV6 localhost resolution issue

Replace "localhost" with "127.0.0.1" everywhere:

  • ccw (DONE),
  • leiningen (TODO),
  • nrepl (TODO)

Can also be fixed by adding -Djava.net.preferIPv4Stack=true to eclipse.ini on Juno (Kepler provides this by default)

Memory leak

When closing a REPLView, one java process is also killed (the one shown in the Console View), but one additional process remains.

Find a way to fix this. Hopefully, killing one should kill the other. Or find a way to not have 2 processes at once?

True "Leiningen" Launch configuration

What Tabs should it have ?

Status: brainstorming

Let's consider the tabs that are present in Clojure / Java launch configuration, and see if they should be adapted, taken as is, or removed:

"Main" Tab

Adapted

  • "Project" field : classic, choose the project (should filter on leiningen-enabled projects only ?)
  • "Task" field : checkbox "REPL (managed by Counterclockwise)" / "Specific" (when specific is checked, a TextArea for entering the task(s) would be enabled)

"Arguments" Tab

Removed. Everything should be driven by project.clj. And those arguments would be related to the JVM launching Leiningen anyway, not the subprocesses started by Leiningen.

"JRE" Tab

dunno.

It may not be clear that this would be the JRE starting leiningen, and not the JRE used by Leiningen for starting the project subprocess. But if we don't do so, then the choice of JRE for starting Leiningen itself would then be fixed to a default JRE.

"Classpath" Tab

removed.

This would anyway only be the class path used to start the leiningen process.

"Environment" Tab

Reuse existing one.

Setting environment variables as one would to by exporting them before calling lein

"Common" Tab

Reuse existing one

Working with multiple projects

Status: brainstorming

Current ideas:

Say that we're working with project A, which has a leiningen dependency on project B, and project B is also present as a project in Eclipse.

  • automatic detection of project B as a dependency of project A, by namee ( as soon as project B's artifactId == project B's Eclipse name => match)
  • project B must then be taken into accounts by 2 components:
    • CCW itself which must then add project B as a dependency project in the Leiningen classpath container of project A. This will be useful for features of CCW which search the JDT classpath (open file, etc.)
    • Leiningen when it is called via CCW: there should be a way to add project B's exported classpath entries to project's :dependencies dynamically (not really on the filesystem, but via Leiningen update-in task, for instance)

Debugging

  • Should work from Leiningen launched projects (may not be as easy as expected, since Leiningen launches a separate JVM)

  • Should accept to go into the source files of dependencies (java files, clojure files) => need to download source dependencies as well as jar dependencies, and reference them properly in the leiningen classpath container