tools-deps

Discuss tools.deps.alpha, tools.build, and the clj/clojure command-line scripts! See also #depstar #clj-new
roklenarcic 2021-03-06T15:34:15.168800Z

Are key values for -X not automatically strings? I’m doing the call:

clj -X:deploy :artifact "cljc-shuffle.jar"
And I’ve noticed that slipset/deps-deploy i am running is explicitly converting :artifact value to string, via (str artifact)

borkdude 2021-03-06T15:39:01.169200Z

No, this is very annoying, you have to write '"foo"'

roklenarcic 2021-03-06T16:49:19.170900Z

so what does foo produce in the program? A symbol foo?

alexmiller 2021-03-06T17:08:16.172200Z

yes

alexmiller 2021-03-06T17:08:33.172900Z

all args are read as edn strings

roklenarcic 2021-03-06T17:09:30.173700Z

How do cmd line args and :exec-args combine? I’ve had this:

:deploy {:extra-deps {slipset/deps-deploy {:mvn/version "0.1.5"}}
           :exec-fn deps-deploy.deps-deploy/deploy
           :exec-args {:installer :remote :artifact "cljc-shuffle.jar"
                       :sign-releases? true}}
If I run, clj -X:deploy it worked. Then I tried to specify artifact on cmd. So I removed it from deps and ran: clj -X:deploy :artifact "'cljc-shuffle.jar'" and then I get
Execution error (IllegalArgumentException) at java.lang.reflect.Array/set (Array.java:-2).
array element type mismatch

roklenarcic 2021-03-06T17:09:44.174100Z

do command line arguments replace :exec-args in full?

seancorfield 2021-03-06T17:43:35.174700Z

No they are additive. I would have expected that to work

seancorfield 2021-03-06T17:44:32.175300Z

Oh wait, no. Your arg is wrong.

seancorfield 2021-03-06T17:44:54.175900Z

Use '"string"'

seancorfield 2021-03-06T17:45:51.177Z

Strings require double quotes. Then you need single quotes around that for the shell

seancorfield 2021-03-06T17:46:10.177300Z

@roklenarcic ^

seancorfield 2021-03-06T18:09:31.180400Z

FYI to tool authors, such as @slipset since deps-deploy was mentioned, for convenience of use I have been allowing symbols where strings are expected so that if users could write the argument without quotes, they are able to do so. For a local JAR file such as cljc-shuffle.jar you could just pass a symbol in and the code could convert the symbol to a string. Obviously, if you're passing in a path, that's generally not going to be a legal symbol and you are going to have to quote ' and double-quote " it.

roklenarcic 2021-03-06T19:53:56.181200Z

Ah yes, the symbol fix isn’t released yet for deps-deploy