Skip to content

Commit

Permalink
Use lein as the build tool and deploy to clojars
Browse files Browse the repository at this point in the history
Deploys with the com.palletops group id.
  • Loading branch information
hugoduncan committed Mar 13, 2013
1 parent 7cbfe2b commit 5f46f01
Show file tree
Hide file tree
Showing 8 changed files with 107 additions and 159 deletions.
24 changes: 16 additions & 8 deletions .gitignore
@@ -1,8 +1,16 @@
*jar
lib
logs
classes
target
snippets
doc/**
notes.txt
/target
/lib
/classes
/checkouts
/logs
/doc
doc-src/VERSIONS.md
doc-src/INTRO.md
pom.xml
pom.xml.asc
*.jar
*.class
.lein-deps-sum
.lein-failures
.lein-plugins
.lein-repl-history
29 changes: 17 additions & 12 deletions README.md
Expand Up @@ -2,14 +2,17 @@

A library containing macros for use in clojure threading expressions (using ->).

See [reference documentation](http://pallet.github.com/thread-expr/autodoc/index.html)
and [annotated source](http://pallet.github.com/thread-expr/marginalia/uberdoc.html).
See
[reference documentation](http://pallet.github.com/thread-expr/autodoc/index.html)
and
[annotated source](http://pallet.github.com/thread-expr/marginalia/uberdoc.html).

## Examples

**Threaded arg exposure:**

`arg->` exposes the threaded arg, binding it to the supplied variable. For example:
`arg->` exposes the threaded arg, binding it to the supplied variable. For
example:

```clojure
(-> 2
Expand All @@ -27,7 +30,10 @@ Expands to:

;=> 6
```
Note the extra set of parens in the expansion; the threading macro feeds the current argument in as `arg`, binds it to the supplied var using `let`, and resumes threading for all forms inside of `arg->`.

Note the extra set of parens in the expansion; the threading macro feeds the
current argument in as `arg`, binds it to the supplied var using `let`, and
resumes threading for all forms inside of `arg->`.

**Threaded list comprehension:**

Expand Down Expand Up @@ -55,15 +61,14 @@ Expands to:
## Installation

thread-expr is distributed as a jar, and is available in the
[sonatype repository](http://oss.sonatype.org/content/repositories/releases/org/cloudhoist).
[clojars repository](http://clojars.org/com.palletops/thread-expr).

Installation is with maven or your favourite maven repository aware build tool.
Installation is with leiningen or your favourite maven repository aware build
tool.

### lein/cake project.clj

:dependencies [[org.cloudhoist/thread-expr "1.2.0"]]
:repositories {"sonatype"
"http://oss.sonatype.org/content/repositories/releases"}
:dependencies [[com.palletops/thread-expr "1.2.0"]]

### maven pom.xml

Expand All @@ -77,13 +82,13 @@ Installation is with maven or your favourite maven repository aware build tool.

<repositories>
<repository>
<id>sonatype</id>
<url>http://oss.sonatype.org/content/repositories/releases</url>
<id>clojars</id>
<url>http://clojars.org/repo</url>
</repository>
</repositories>

## License

Licensed under [EPL](http://www.eclipse.org/legal/epl-v10.html)

Copyright 2011, 2012 Hugo Duncan.
Copyright 2011, 2012, 2013 Hugo Duncan.
24 changes: 0 additions & 24 deletions finish-release.sh

This file was deleted.

86 changes: 0 additions & 86 deletions pom.xml

This file was deleted.

18 changes: 18 additions & 0 deletions profiles.clj
@@ -0,0 +1,18 @@
{:dev {:dependencies [[ch.qos.logback/logback-classic "1.0.9"]]
:plugins [[lein-set-version "0.3.0"]]}
:doc {:dependencies [[com.palletops/pallet-codox "0.1.0-SNAPSHOT"]]
:plugins [[codox/codox.leiningen "0.6.4"]
[lein-marginalia "0.7.1"]]
:codox {:writer codox-md.writer/write-docs
:output-dir "doc/1.3/api"
:src-dir-uri "https://github.com/pallet/pallet-common/blob/develop"
:src-linenum-anchor-prefix "L"}
:aliases {"marg" ["marg" "-d" "doc/1.3/annotated"]
"codox" ["doc"]
"doc" ["do" "codox," "marg"]}}
:1.3 {:dependencies [[org.clojure/clojure "1.3.0"]]}
:1.4 {:dependencies [[org.clojure/clojure "1.4.0"]]}
:1.5 {:dependencies [[org.clojure/clojure "1.5.1"]]}
:release
{:set-version
{:updates [{:path "README.md" :no-snapshot true}]}}}
8 changes: 8 additions & 0 deletions project.clj
@@ -0,0 +1,8 @@
(defproject com.palletops/thread-expr "1.3.0-SNAPSHOT"
:description "Thread-expr provides macros for use within a clojure threaded
argument expressions (-> and ->>)."
:url "http://palletops.com"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure/clojure "1.2.1"]
[org.clojure/tools.macro "0.1.1"]])
48 changes: 48 additions & 0 deletions release.sh
@@ -0,0 +1,48 @@
#!/bin/bash

# release thread-expr

if [[ $# -lt 3 ]]; then
echo "usage: $(basename $0) previous-version new-version next-version" >&2
exit 1
fi

previous_version=$1
version=$2
next_version=$3

echo ""
echo "Start release of $version, previous version is $previous_version"
echo ""
echo ""

lein do clean, with-profile default:1.3:1.4:1.5 test && \
git flow release start $version || exit 1

lein with-profile +release set-version ${version} :previous-version ${previous_version} \
|| { echo "set version failed" >2 ; exit 1; }

echo ""
echo ""
echo "Changes since $previous_version"
git --no-pager log --pretty=changelog thread-expr-$previous_version..
echo ""
echo ""
echo "Now edit project.clj, ReleaseNotes and README"

$EDITOR project.clj
$EDITOR ReleaseNotes.md
$EDITOR README.md

echo -n "commiting project.clj, release notes and readme. enter to continue:" \
&& read x \
&& git add project.clj ReleaseNotes.md README.md \
&& git commit -m "Updated project.clj, release notes and readme for $version" \
&& echo -n "Peform release. enter to continue:" && read x \
&& lein do clean, install, test, deploy clojars \
&& git flow release finish $version \
&& echo "Now push to github. Don't forget the tags!" \
&& lein with-profile +doc doc \
&& lein with-profile +release set-version ${next_version} \
&& git add project.clj \
&& git commit -m "Updated version for next release cycle"
29 changes: 0 additions & 29 deletions start-release.sh

This file was deleted.

0 comments on commit 5f46f01

Please sign in to comment.