Skip to content

Instantly share code, notes, and snippets.

@ato
Created November 11, 2009 02:14
Show Gist options
  • Save ato/231501 to your computer and use it in GitHub Desktop.
Save ato/231501 to your computer and use it in GitHub Desktop.
proposed changes to clojure dep specification
;; (based on http://github.com/technomancy/leiningen)
;;
;; Base changes:
;;
;; - defproject becomes defjar (allow multiple jars per project)
;;
;; - use group.id/jarname "1.0" instead of ["group.id" "jarname" "version"]
;; more clojureish and easier to type
;;
;; - drop :version keyword, version should always be required so it's
;; redundent to specify it as an option.
;;
(defjar clojars-web "0.1" ; group-id is optional here. Will default to something like
; org.clojars.username (should be settable in a per-user dot-file somewhere)
:description "Website frontend for clojars.org - easy open-source Clojure jar hosting"
:authors ["Alex Osborne"]
:homepage "http://clojars.org/"
:scm "git://github.com/ato/clojars-web.git"
:dependencies [org.clojure/clojure "1.0" ; always require group-id for deps?
org.compojure/compojure "3.0"
org.clojars.ato/ato-utils "0.1"])
(defjar clojars-cli "0.1"
:namespaces [clojars.cli] ; only these namespaces will be included
; in the jar.
:dependencies [org.clojure/clojure "1.0"])
;;
;; Here's an example of one project generating two jars
;;
(defjar org.clojure/clojure "1.0"
:description "A dynamic programming language that targets the JVM."
:authors ["Rich Hickey"]
:src "src/clj"
:javac "src/jvm")
(defjar org.clojure/clojure-slim "1.0"
:description "A non-AOT-compiled version of Clojure"
:aot-compile nil ; can be a vector of namespace to AOT compile. By default all
; namespaces to be incuded in the jar are AOT compiled.
:src "src/clj"
:javac "src/jvm")
;;
;; clojars.org tentative workflow:
;;
;; 1. Build jar using tool of choice.
;; 2. Make a project.clj or pom.xml (unless you already made one for your build tool)
;; 3. scp project.clj foobar-1.0.jar clojars@clojars.org:
;;
;; That's it!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment