Fork me on GitHub
#tools-deps
<
2018-04-09
>
tianshu00:04:15

thanks very much!

Drew Verlee16:04:47

I think it would be really cool to write/blog/livecast someone translating a project.clj to a deps.edn. I mainly think this is cool because im having to do it right now and its very education, by which i mean, i have lots of things I dont yet understand 🙂

dominicm16:04:40

Oh, I did it by regex

dominicm16:04:05

:%s/\[\(\S\+\) \(".*"\)\]/\1 {:mvn\/version \2} is how I did it in vim.

dominicm16:04:22

Then I also ran :%s/\[\(\S\+\) \(".*"\)\ \(:exclusions \[.*\]\)]/\1 {:mvn\/version \2\r\3}

Drew Verlee16:04:52

is it that mechanical of a process? Its possible this hinges on my understanding of what deps.edn does vs what lein project.cljs do

dominicm16:04:17

@drewverlee deps.edn only specifies dependencies. So that's the only part that really converts over from project.clj.

Drew Verlee16:04:21

I guess your right, the only thing i have to transfer is the deps

Drew Verlee16:04:42

@dominicm out of curiosity, for those trying to use deps.edn, what are they using for 1) profiles 2) build stuff 3) deployment I’m guessing boot can still handle these responsibilities

dominicm16:04:58

There are tools, like pack.alpha which add uberjars on top.

dominicm16:04:07

https://github.com/juxt/edge has an example of doing most of this.

dominicm16:04:26

Edge doesn't have a pack example yet, bridge does: https://github.com/robert-stuttaford/bridge/

dominicm16:04:54

(although it's out of date, see the pack readme!)

Alex Miller (Clojure team)16:04:05

aliases can serve some of the same purposes as profiles. pack.alpha and depstar are two build options.

Alex Miller (Clojure team)16:04:35

if you have consumers use git deps, you can skip build and deploy altogether :) (I am somewhat joking - this is not feasible for a number of cases)

dominicm17:04:48

@alexmiller I've been thinking about krei, there's an API for performing java complication in the jdk, so in theory if I search for an edn file describing how to build from source, it could be feasible.

dominicm17:04:15

Having git dependencies is a lot like working on a mono repo, which is the pain point krei was designed to solve.

dominicm17:04:07

I think it could work, in theory. Haven't tried that hard yet though.

dominicm17:04:53

@alexmiller Krei is a in-repl build tool. It scans the classpath for krei-file.edn files, and then builds sources on the classpath from that. Currently it supports cljs and sass, because that's what I need for the itch I'm scratching. But I think it could work for java too. Protobuf is probably important to target also.

dominicm17:04:22

Maybe I should split into manifests and try to parse information from pom files? Dunno.

Alex Miller (Clojure team)17:04:34

well I can tell you that parsing info from pom files suuuuucks

dominicm17:04:50

Only using edn it is!

seancorfield19:04:12

@drewverlee Take a look at this commit where I converted core.cache from using Leiningen to clj/`deps.edn`: https://github.com/clojure/core.cache/commit/1f76bdf7321bce7c5d8c1424943afeccff0fb6d5

seancorfield19:04:30

And here's a slightly more comprehensive example from java.jdbc being switched over https://github.com/clojure/java.jdbc/commit/e8040925beddab6048873625cfe791341082290d

seancorfield19:04:20

So :profiles => various :aliases, "build" can either use tooling built on top of deps.edn (for example, I use boot-tools-deps with Boot on top of deps.edn and there's a Leiningen plugin, which is very much a work-in-progress), or it can use the JAR builders that are listed on that wiki page...