bltool icon indicating copy to clipboard operation
bltool copied to clipboard

Create importable `bltool-sources.jar`

Open Stevoisiak opened this issue 8 years ago • 3 comments

When importing bltool.jar into Eclipse, there's no available source attachment that can be used for code debugging. This along with the lack of an available JavaDoc makes knowing the callable functions for bltool confusing.

image

Stevoisiak avatar Apr 20 '17 15:04 Stevoisiak

I've never used Eclipse, but all of the source code is in the jar:

$ unzip -l bltool-0.2.2-standalone.jar | grep bltool | grep clj
   1021  12-12-2015 13:19   META-INF/leiningen/bltool/bltool/project.clj
  12327  02-10-2015 10:04   bltool/data/backloggery.clj
   1374  02-10-2015 10:03   bltool/data/default.clj
    373  05-25-2014 21:14   bltool/data/edn.clj
      0  11-07-2013 21:53   bltool/data/html.clj
   1677  02-10-2015 10:04   bltool/data/steam.clj
    678  02-10-2015 09:58   bltool/data/text.clj
   3210  02-10-2015 10:04   bltool/data/xboxlive.clj
    420  12-12-2015 13:08   bltool/data/json.clj
    413  02-10-2015 10:03   bltool/flags.clj
    247  12-12-2015 13:08   bltool/data.clj
   4812  12-12-2015 13:08   bltool/core.clj

Does Eclipse need some sort of additional plugins for Clojure code or something? Or do I need to add something to META-INF so that it can find the source?

ToxicFrog avatar Apr 21 '17 21:04 ToxicFrog

I'm not exactly sure how source attachments would would work for Clojure projects, as I'm more familiar with Java libraries.

I'm personally looking to use bltool for a game tracking program built in Java. Unfortunately, I'm unfamiliar with Clojure, and haven't been able to figure out how to properly call bltool's functions from a Java application.

Stevoisiak avatar Apr 23 '17 15:04 Stevoisiak

I've never really worked on calling Clojure from Java, but this section of the Clojure/Java Interop manual may be helpful -- it looks like you can just load the jar, then get an IFn representing a clojure function and call it from Java.

It's possible to make a Clojure library expose more "java-like" interfaces with normal Java classes and suchlike, but this requires extra work on the Clojure side and it's something I haven't done with bltool.

ToxicFrog avatar Apr 24 '17 15:04 ToxicFrog