简体   繁体   中英

How i can add github/local dependencies with Boot (clojure)

For instance i want to fork some existing clojar, extend it and use in my project.

How i can do this w/o pushing to clojars/maven?

Interested in both options: link to github and local path.

Thanks!

UPD

What i want is to include some existing Clojure project as dependency, similar like ruby gem allows. Is this possible with Boot? Or i always need to compile to java?

Here is how I have setup my fork of castra on the castra-simple example for hoplon.

https://github.com/hoplon/demos/tree/master/castra-simple

open shell

git clone castra:repo

in castra dir

file: build.boot

; ...
(def +version+ "3.0.0-SNAPSHOT")
; ...

boot watch build-jar

open new shell

git clone castra-simple:repo

in castra-simple

file: boot.build

(set-env!
 :dependencies
 '[
   ;; ...
   [hoplon/castra             "3.0.0-SNAPSHOT"] ;;forked repo
   ;; ...
   ]
 :source-paths   #{"src"}
 :resource-paths #{"assets"})

;; ...

(deftask dev
  "Build castra-simple for local development."
  []
  (comp
   (serve
    :handler 'app.handler/app
    :reload true
    :port 8000)
   (watch) (speak) (hoplon) (reload) (cljs-repl) (cljs)

   ;;forked repo
   (checkout :dependencies '[[hoplon/castra "3.0.0-SNAPSHOT"]])))

boot dev

As i figured out with Boot you can specify source-paths:

(set-env! :source-paths   #{"src", "../clj-mailgun/src"})

This is the only way to add other projects into your. (adding source-code, not .jar)

There is no way to specify github link - you should clone it manually and add to :source-paths path.

Please correct me if i am missing something.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM