Skip to content

Instantly share code, notes, and snippets.

@ashnur

ashnur/build.boot Secret

Last active Dec 13, 2016
Embed
What would you like to do?
(set-env!
:resource-paths #{"resources"}
:dependencies '[[cljsjs/boot-cljsjs "0.5.2" :scope "test"]])
(require '[cljsjs.boot-cljsjs.packaging :refer :all]
'[boot.core :as boot]
'[boot.tmpdir :as tmpd]
'[clojure.java.io :as io]
'[boot.util :refer [sh]])
(def +lib-version+ "0.3.4")
(def +version+ (str +lib-version+ "-0"))
(task-options!
pom {:project 'cljsjs/jsnetworkx
:version +version+
:description "Interface to the Ethereum blockchain providing contract creation and transactions, state inspection, and dApp registration and management"
:url "https://github.com/ashnur/jsnetworkx/"
:scm {:url "https://github.com/cljsjs/packages"}
:license {"MIT" "https://opensource.org/licenses/MIT"}})
(deftask build-blockapps []
(let [tmp (boot/tmp-dir!)]
(with-pre-wrap
fileset
;; Copy all files in fileset to temp directory
(doseq [f (->> fileset boot/input-files)
:let [target (io/file tmp (tmpd/path f))]]
(io/make-parents target)
(io/copy (tmpd/file f) target))
(binding [boot.util/*sh-dir* (str (io/file tmp (format "JSNetworkX-%s" +lib-version+)))]
(sh "ls" "-la")
;; ((sh "npm" "run" "build:browser"))
)
(-> fileset (boot/add-resource tmp) boot/commit!))))
(deftask package []
(comp
(download :url (format "https://github.com/ashnur/jsnetworkx/archive/v%s.zip" +lib-version+)
:checksum "EC7308FFCC1509B5BAC91C54FBFA22F2"
:unzip true)
(build-blockapps)
(sift :move {#".*jsnetworkx\.js$" "cljsjs/jsnetworkx/cljsjs/jsnetworkx.inc.js"})
(sift :include #{#"^cljsjs"})
(deps-cljs :name "cljsjs.blockapps")
(pom)
(jar)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.