This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-05-20
Channels
- # announcements (16)
- # babashka (104)
- # beginners (77)
- # bristol-clojurians (1)
- # calva (3)
- # chlorine-clover (50)
- # cider (19)
- # clojure (73)
- # clojure-australia (1)
- # clojure-europe (37)
- # clojure-france (3)
- # clojure-nl (3)
- # clojure-norway (13)
- # clojure-spec (21)
- # clojure-uk (79)
- # clojurescript (225)
- # conjure (102)
- # cursive (11)
- # datascript (1)
- # datomic (1)
- # defnpodcast (1)
- # events (3)
- # figwheel-main (2)
- # fulcro (49)
- # ghostwheel (10)
- # helix (1)
- # kaocha (17)
- # leiningen (10)
- # meander (1)
- # off-topic (26)
- # other-lisps (3)
- # pathom (5)
- # re-frame (40)
- # reagent (6)
- # reitit (33)
- # shadow-cljs (107)
- # testing (3)
- # tools-deps (68)
- # xtdb (16)
- # yada (3)
is it necessary to include clojure as a dep in the deps.edn? I've seen a few projects with it included.
Yes, but it is included by default
So I guess no :)
My personal thoughts are that you should mark your minimum required version. Because if you don't update your computer (for some reason) and then rock up on a project using Clojure 1.22 features, and you've got 1.15 you'll be scratching your head for a while. One less thing to manage externally.
It's more to do with docker containers. If I can remove the dependency (as it's already there as part of openjdk-11-tools-deps-slim-buster
), then I can remove it from the deps.edn file, thus making the binary ever so slightly smaller.
you need to have it, and you will via the install deps.edn, it's just a question of version
Hello, I've seen examples of installing dependencies using clj -Sdeps '{:deps {bidi {:mvn/version "2.1.6"}}}'
but I was wondering if it's possible to instruct clj
to install dependencies listed in deps.edn
without doing anything else? Similar to lein deps
I suppose.
clj -Spath
as an option. it will download dependencies and print out calculated class-path
Thanks for the suggestions, that's really helpful. My use case is also for building Docker images.
I apologize for the probably FAQ, but I have searched for this⦠when I specify a gitlib as a dependency, is there a way to specify the path within the gitlib to the source code? e.g. thereās a dep Iād like to use which has its Clojure code in src/clj/
https://github.com/roman01la/uix see an example in UIx
š Hi Dominic, thanks!
I saw :deps/root
in the docs, but the description therein says:
> Specifies the relative path within the root to search for the manifest file.
In the case of this particular dep, the manifest file doesnāt even really exist⦠Iām faking it by manually setting :deps/manifest
to :deps
, to finagle tools.deps
into treating this dep as if it has an empty deps.edn
, which works in this case because the dep has no dependencies itself.
Anyway, thatās why I didnāt try it, but it makes sense that it would also change how the lib is added to the classpath. Iāll try it. Thanks!
Hmm thatās not quite working. I set :deps/root
to src/clj
but the path added to the classpath is /src/clj/src
š
Oh I see "to the source code". Yeah, that makes sense. I'm not sure you can get away with that.
I figured. I kinda wish there was a way to override that src
segment that tools.deps adds to the end of the root. Something like :deps/code-path
or something.
Thanks for the link, but Iām not really understanding that function. I think youāre pointing out that there isnāt currently a way to do this?
I was thinking maybe :deps/paths
but Iām not sure about the plural part. Iām not sure it makes sense to add multiple entries to the classpath for a dep.
I think this already does what you want
or rather let me back up...
what kind of project is the git dep?
what kind of manifest file (pom, lein, deps)
that should just work - what doesn't work?
I tried settingĀ `:deps/root`Ā toĀ `src/clj`Ā but the path added to the classpath was thenĀ `/src/clj/src`
yeah, there is no way right now to externally set a git dep's paths
you coudl fork it and add a deps.edn though
or clone and do the same with a local project
I was thinking maybe Iāll open a PR to contribute the deps.edn
to the main project; Iād rather not use a fork indefinitely
I posted the request as a question to ask as that seems to be the preferred way to suggest an issue these days: https://ask.clojure.org/index.php/9314/is-it-possible-to-override-the-paths-of-a-git-dep
I think the question presupposes the need to do this, but maybe the broader request is about supporting lein projects
or even more broader, supporting extensible project types, one of which could be lein
tools.deps is actually written to support this but clj does not expose that capability currently (b/c there are a lot of questions about how to do it well)