Fork me on GitHub
#depstar
<
2021-08-11
>
Jacob Emcken21:08:46

Created a ~/.config/clojure/deps.edn file and copied the content from the README.md inside. Running clojure -X:jar :jar MyLib.jar apparently finds the :jar alias because it does not complaining about WARNING: Specified aliases are undeclared: [:jar] anymore 😄 It does however print No function found on command line or in :exec-fn and exit with the error code 1... I don't understand why :thinking_face:

seancorfield21:08:06

@jacob429 Just used the commands I posted in #tools-deps -- no need to install depstar or set up an alias.

Jacob Emcken21:08:26

This is probably not going to be my last rodeo... might as well get things working

seancorfield21:08:53

OK, well, you are missing :exec-fn from the alias.

seancorfield21:08:25

The readme for depstar has:

;; build a jar (library):
  :jar {:replace-deps {com.github.seancorfield/depstar {:mvn/version "2.1.278"}}
        :exec-fn hf.depstar/jar
        :exec-args {}}

seancorfield21:08:32

Also, per Getting Started, make sure your CLI is up-to-date: > Note: you must have at least version 1.10.1.727 of the Clojure CLI installed! Version 1.10.3.933 is the latest stable version as of depstar 2.1.278. See Clojure Tools Releases for details about the functionality in recent CLI releases.

Jacob Emcken21:08:04

clojure --version
Clojure CLI version 1.10.3.822

Jacob Emcken21:08:16

cat ~/.config/clojure/deps.edn 
{
 :aliases {
  ;; build an uberjar (application) with AOT compilation by default:
  :uberjar {:replace-deps {com.github.seancorfield/depstar {:mvn/version "2.1.278"}}
            :exec-fn hf.depstar/uberjar
            :exec-args {:aot true}}
  ;; build a jar (library):
  :jar {:replace-deps {com.github.seancorfield/depstar {:mvn/version "2.1.278"}}
        :exec-fn hf.depstar/jar
        :exec-args {}}
 }
}

Jacob Emcken21:08:15

As far as I understand I am not missing exec-fn from the alias... :thinking_face:

seancorfield21:08:44

Hmm, that looks right, and it's typically what I have in projects...

ghadi21:08:37

isn't :replace-deps supposed to be :deps now?

seancorfield21:08:43

They're synonyms.

seancorfield21:08:19

:deps is actually the old name (and t.d.a's code says it is supposed to be removed but I doubt it will be now that it's been documented for use with tools).

seancorfield21:08:56

(same as :tag and :git/tag I think... pretty sure the t.d.a code has a similar comment about that)

seancorfield21:08:26

Does your project have deps.edn with a different :jar alias perhaps?

Jacob Emcken21:08:00

I remember seeing a warning from the CLI tool output telling me that I should use replace-deps over deps when I was playing around with things

Jacob Emcken21:08:33

Nope no :jar alias... it only contains what "beholder" has.

Jacob Emcken21:08:22

I also checked the ~/.clojure/deps.edn file which was empty (and now deleted)

Jacob Emcken21:08:36

still the same error

Jacob Emcken21:08:42

Ahh well I am going to call it for today... I guess for me these new fancy tools still doesn't want to cooperate with me. Maybe some other time. Thanks @seancorfield