mfikes / depify

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Depify

What?

Creates or updates your deps.edn file, based on your project’s project.clj.

Usage

clj -Sdeps '{:deps {github-mfikes/depify {:git/url "https://github.com/mfikes/depify" :sha "823781f640507c489ed88bc87679216e95ffb3e1"}}}' -m depify.project

Surgeon General’s Warning

Running arbitrary Clojure code from an arbitrary URL on the internet is known to cause cancer. But hey, if it feels good, go ahead and do it.

About

Based on the initial concept in this gist by Sean Walker. Depify improves on it slightly:

Adds entries to existing deps.edn (replacing keys) rather than overwriting file

Handles variable unquoting in project.clj

project.clj

(def something "0.1.2")
(defproject foobar
  :dependencies [[something/gizmo ~something]])

deps.edn

{:deps #:something{gizmo #:mvn{:version "0.1.2"}}}

Handles extra fields, with an extension point so other keys can be added over time

project.clj

(defproject foobar
  :respositories [["dracular" "https//transy.edu"]]
  :dependencies [[something/gizmo "9.9.9"]
                 [org.apache/another-database "1.2.3" :exclusions [logging-nightmare]]]
  :jvm-opts ["-XX:+EnormousBiceps"])

deps.edn

{:deps
 {something/gizmo #:mvn{:version "9.9.9"},
  org.apache/another-database
  {:mvn/version "1.2.3", :exclusions [logging-nightmare]}},
 :jvm-opts ["-XX:+EnormousBiceps"]}

About


Languages

Language:Clojure 100.0%