OK I have jarred up and deployed a tool rebel-readline-nrepl 0.1.5-SNAPSHOT and then installed it
clojure -Ttools install com.bhauman/rebel-readline-nrepl '{:mvn/version "0.1.5-SNAPSHOT"}' :as nrebel and deps.edn has the :tools/usage entry:
:tools/usage {:ns-default rebel-readline.nrepl}
yet when I go to execute it I'm getting an error indicated that the :tools/usage isn't really getting picked up.
clojure -Tnrebel connect :port 50668
Unqualified function can't be resolved: connect
And of course this works:
clojure -Tnrebel rebel-readline.nrepl/connect :port 50668Is there something that needs to happen during packaging that I'm missing?
And or is there documentation that I'm not finding?
I guess the first thing to check is if the latest snapshot is being downloaded from clojars.
Oh probably not that. I just tried and could reproduce it (I would not have had any of your snapshots in my local m2 repo). Now I actually have to READ what you asked. simple_smile
There is not currently a way to pick up tools/usage from mvn jars, only from git and local
Ahhhh, I was just starting to come to that conclusion
very nice to have it confirmed
considering the deps.edn isn't included in the package it makes sense
Ah. Right. <Lee stops poking around. simple_smile>
https://clojure.org/reference/deps_edn#tools implies this but I guess doesn’t say it explicitly
Kind of a tbd area
Yeah reading that, it's pretty explicit. I swear I'd read that 20 times but it didn't dent the assumptions, thanks!
The question is like where should you put it in the jar - what path, in the manifest, in a special classifier file in maven (ala .pom), etc
the easiest would be the "/src" ?
If you put it in file at root, they all collide in classpath so pretty gross
There is no src/ in the jar
oh Yeah
Maven has a convention for this stuff under meta-inf but I just couldn’t decide when I last looked at it
Is there some reason you want to distribute as jar vs github?
For tools, the latter is usually ok
It should be fine but I'm still having trouble doing even that:
clojure -Ttools install-latest :lib com.bhauman/rebel-readline :coord '{:git/url "" :deps/root "/rebel-readline"}' :as testrr it's looking for a deps.edn or pom.xml at https://github.com/bhauman/rebel-readline
I guess b/c you have it in subdir?
oh, no leading / in that :deps/root
and at latest tag (0.1.4), that deps.edn isn't there
install-latest of git deps only works off latest tag (assuming you don't specify a sha)
yep! thanks! It's working and I understand it much better now. Time to finish the readme
so like clojure -Ttools install io.github.bhauman/rebel-readline '{:deps/root "rebel-readline" :git/sha "8960ca7281d58e76a0c8a9253f581eed95019357"}' :as testrr works
Thanks! and it all makes perfect sense in hindsight.. I just haven't had to use the git coords or tools much before. I really appreciate the help with this.
np, happy to support people doing more with it and keep pushing the boundaries of it! I would like to figure out the maven tool thing
Does install-latest cache the latest tag?
it will install a file based on the tool name at ~/.clojure/tools/testrr.edn - if via install-latest, that should have both tag and sha
not sure if you mean "cache the tag name" or "cache the repo at the tag" - both are true in different ways
clojure -Ttools install :lib com.github.bhauman/rebel-readline :coord '{:deps/root "rebel-readline"}' :as testanotherMy concern is I pushed a tag v0.1.5-snapshot and it's not working perhaps there is a lag on the tag being seen via caching on the github end
you're using install there, which requires a :git/sha I think? did you mean install-latest?
sorry its install latest
clojure -Ttools install-latest :lib com.github.bhauman/rebel-readline :coord '{:deps/root "rebel-readline"}' :as testanother
Execution error (ExceptionInfo) at clojure.tools.deps.extensions/throw-bad-manifest (extensions.clj:158).
Manifest file not found for com.github.bhauman/rebel-readline in coordinate {:deps/root "rebel-readline", :git/tag "v0.1.4", :git/sha "9486d3a"}clojure -T:deps find-versions :lib com.github.bhauman/rebel-readline
seems to find the tagI wonder if the coord is being ignored here
but it's outputing {:deps/root "rebel-readline", :git/tag "v0.1.4", :git/sha "9486d3a"}
yeah, not sure what's happening there, give me a moment and I'll look at it in a repl
oh, it's filtering out the snapshot tag
uses similar logic to maven and ignores snapshot tags when finding "latest"
(defn- release-version?
"Release version does not contain any of:
a, alpha, b, beta, m, milestone, rc, cr, snapshot"of course I found another edge case
yeah, I forgot about that one :)
Well, gosh, I guess I'm just hitting all the walls. Now it's installing and I'm back to where I'm getting the unqualified function error:
clojure -Ttools install-latest :lib com.github.bhauman/rebel-readline :coord '{:deps/root "rebel-readline-nrepl"}' :as nrebel
nrebel: Installed com.github.bhauman/rebel-readline v0.1.4.1 {:deps/root "rebel-readline-nrepl", :git/tag "v0.1.4.1", :git/sha "8960ca7"}
bruce$ clojure -Tnrebel connect :port 50668
Unqualified function can't be resolved: connect
rebel-readline-nrepl/deps.edn
{:paths ["src"]
:deps {com.bhauman/rebel-readline {:mvn/version "0.1.5-SNAPSHOT"}
;; DEV for cider
;;com.bhauman/rebel-readline {:local/root "../rebel-readline"}
nrepl/nrepl {:mvn/version "1.3.1"}
org.clojure/tools.cli {:mvn/version "1.1.230"}}
:tools/usage {:ns-default rebel-readline.nrepl} <<<<<<<<<<<HERE
rebel-readline-nrepl/src/rebel-readline/nrepl.clj
(ns rebel-readline.nrepl
"This is the interface for clojure tools"
(:require [rebel-readline.nrepl.main :as main]))
(defn connect [config]
(main/start-repl (or config {})))
I'm betting it's the subdirectory...going to start threading so we're not spamming the channel...
the subdir makes it into the ~/.clojure/tools/nrebel.edn so that's good (we did actually fix some stuff in this area recently)
oh I should get the latest
does clojure -Tnrebel rebel-readline.nrepl/connect :port 50668 work as expected?
yes it does
I have the latest version of clojure so I should have the latest tools.deps
I'm looking, give me a few
thank you
this is exactly an area where I made significant changes about a month ago :)
you misspelled ":tools/useage" in your deps.edn, should be :tools/usage :)
seems to flow through as expected once I changed that in my local checkout
I am sorry. I thought that change was checked in. I owe you... Somehow I knew we'd end up here with the egg dripping off my nose.
No worries, happy to check through all this, has not seen that much use