Skip to content

Commit

Permalink
upgrade to leiningen 2
Browse files Browse the repository at this point in the history
  • Loading branch information
Jason Jackson committed Aug 16, 2012
1 parent 5b3bec2 commit 5535d10
Show file tree
Hide file tree
Showing 7 changed files with 69 additions and 56 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,5 @@ _release
.lein-deps-sum
*.iml

/.project/
/.lein-plugins/
32 changes: 19 additions & 13 deletions bin/build_release.sh
Original file line number Diff line number Diff line change
@@ -1,29 +1,35 @@
#!/bin/bash
function quit {
exit 1
}
trap quit 1 2 3 15 #Ctrl+C exits.

RELEASE=`head -1 project.clj | awk '{print $3}' | sed -e 's/\"//' | sed -e 's/\"//'`
LEIN=`which lein2 || which lein`
export LEIN_ROOT=1

echo Making release $RELEASE

DIR=_release/storm-$RELEASE

rm -rf _release
export LEIN_ROOT=1
rm *.zip
rm *jar
rm -rf lib
rm -rf classes
lein deps
lein jar
mkdir -p $DIR
mkdir $DIR/lib
cp storm*jar $DIR/
cp lib/*.jar $DIR/lib
rm -f *.zip
$LEIN with-profile release clean
$LEIN with-profile release deps
$LEIN with-profile release jar
$LEIN with-profile release pom
mvn dependency:copy-dependencies

mkdir -p $DIR/lib
cp target/storm-*.jar $DIR/storm-${RELEASE}.jar
cp target/dependency/*.jar $DIR/lib
cp CHANGELOG.md $DIR/

echo $RELEASE > $DIR/RELEASE

cp -R logback $DIR/
mkdir $DIR/logs
mkdir -p $DIR/logback
mkdir -p $DIR/logs
cp -R logback/cluster.xml $DIR/logback/cluster.xml

mkdir $DIR/conf
cp conf/storm.yaml.example $DIR/conf/storm.yaml
Expand Down
8 changes: 4 additions & 4 deletions bin/storm
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ def nimbus(klass="backtype.storm.daemon.nimbus"):
cppaths = [STORM_DIR + "/conf"]
jvmopts = parse_args(confvalue("nimbus.childopts", cppaths)) + [
"-Dlogfile.name=nimbus",
"-Dlogback.configurationFile=" + STORM_DIR + "/logback/production.xml",
"-Dlogback.configurationFile=" + STORM_DIR + "/logback/cluster.xml",
]
exec_storm_class(
klass,
Expand All @@ -262,7 +262,7 @@ def supervisor(klass="backtype.storm.daemon.supervisor"):
cppaths = [STORM_DIR + "/conf"]
jvmopts = parse_args(confvalue("supervisor.childopts", cppaths)) + [
"-Dlogfile.name=supervisor",
"-Dlogback.configurationFile=" + STORM_DIR + "/logback/production.xml",
"-Dlogback.configurationFile=" + STORM_DIR + "/logback/cluster.xml",
]
exec_storm_class(
klass,
Expand All @@ -283,7 +283,7 @@ def ui():
cppaths = [STORM_DIR + "/conf"]
jvmopts = parse_args(confvalue("ui.childopts", cppaths)) + [
"-Dlogfile.name=ui",
"-Dlogback.configurationFile=" + STORM_DIR + "/logback/production.xml",
"-Dlogback.configurationFile=" + STORM_DIR + "/logback/cluster.xml",
]
exec_storm_class(
"backtype.storm.ui.core",
Expand All @@ -302,7 +302,7 @@ def drpc():
"""
jvmopts = ["-Xmx768m",
"-Dlogfile.name=drpc",
"-Dlogback.configurationFile=" + STORM_DIR + "/logback/production.xml"
"-Dlogback.configurationFile=" + STORM_DIR + "/logback/cluster.xml"
]
exec_storm_class(
"backtype.storm.daemon.drpc",
Expand Down
34 changes: 14 additions & 20 deletions bin/to_maven.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,32 +5,26 @@ function quit {
trap quit 1 2 3 15 #Ctrl+C exits.

RELEASE=`head -1 project.clj | awk '{print $3}' | sed -e 's/\"//' | sed -e 's/\"//'`
LEIN=`which lein2 || which lein`

rm -rf classes
rm -f *jar
rm -f *xml
lein jar
lein pom
echo ==== Storm Jar ====
$LEIN with-profile release clean
$LEIN with-profile release jar
$LEIN with-profile release pom
scp storm*jar pom.xml clojars@clojars.org:
rm -f *.jar *.xml

rm *jar
rm -rf classes
echo ==== Storm-Lib Jar ====
rm conf/logback.xml
lein jar

cp project.clj orig-project.clj
sed -i '' -e 's/\[.*logback[^]]*\]//g' project.clj
sed -i '' -e 's/\[.*log4j-over-slf4j[^]]*\]//g' project.clj

lein pom
mv orig-project.clj project.clj

mv pom.xml old-pom.xml
sed 's/artifactId\>storm/artifactId\>storm-lib/g' old-pom.xml > pom.xml
$LEIN with-profile lib clean
$LEIN with-profile lib jar
$LEIN with-profile lib pom
sed -i '' -e 's/artifactId\>storm/artifactId\>storm-lib/g' pom.xml
mv storm-$RELEASE.jar storm-lib-$RELEASE.jar
scp storm*jar pom.xml clojars@clojars.org:
rm *xml
rm *jar
rm -f *.jar *.xml

git checkout conf/logback.xml



File renamed without changes.
47 changes: 29 additions & 18 deletions project.clj
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
(defproject storm "0.8.1-wip2-SNAPSHOT"
:source-path "src/clj"
:test-path "test/clj"
:java-source-path "src/jvm"
:javac-options {:debug "true" :fork "true"}
:resources-path "conf"
:dev-resources-path "src/dev"
:repositories {"sonatype" "http://oss.sonatype.org/content/groups/public/"}
(defproject storm/storm "0.8.1-wip2-SNAPSHOT"
:url "http://storm-project.clj"
:description "Distributed and fault-tolerant realtime computation"
:license {:name "Eclipse Public License - Version 1.0" :url "https://github.com/nathanmarz/storm/blob/master/LICENSE.html"}

:dependencies [[org.clojure/clojure "1.4.0"]
[commons-io "1.4"]
[org.apache.commons/commons-exec "1.1"]
[storm/libthrift7 "0.7.0"
:exclusions [org.slf4j/slf4j-api]]
:exclusions [org.slf4j/slf4j-api]]
[clj-time "0.4.1"]
[com.netflix.curator/curator-framework "1.0.1"
:exclusions [log4j/log4j]]
:exclusions [log4j/log4j]]
[backtype/jzmq "2.1.0"]
[com.googlecode.json-simple/json-simple "1.1"]
[compojure "0.6.4"]
Expand All @@ -27,14 +24,28 @@
[storm/tools.cli "0.2.2"]
[com.googlecode.disruptor/disruptor "2.10.1"]
[storm/jgrapht "0.8.3"]
[com.google.guava/guava "13.0"]
[com.google.guava/guava "13.0"]]

:source-paths ["src/clj"]
:java-source-paths ["src/jvm"]
:test-paths ["test/clj"]
:resource-paths ["conf"]

:profiles {:dev {:resource-paths ["src/dev"]
:dependencies [[ch.qos.logback/logback-classic "1.0.6"]
[org.slf4j/log4j-over-slf4j "1.6.6"]]}
:release {:dependencies [[ch.qos.logback/logback-classic "1.0.6"]
[org.slf4j/log4j-over-slf4j "1.6.6"]]}
:lib {:dependencies [[ch.qos.logback/logback-classic "1.0.6"]
[org.slf4j/log4j-over-slf4j "1.6.6"]]}}

[ch.qos.logback/logback-classic "1.0.6"]
[org.slf4j/log4j-over-slf4j "1.6.6"]]
:dev-dependencies [
[swank-clojure "1.4.0-SNAPSHOT" :exclusions [org.clojure/clojure]]
]
:plugins [[lein-swank "1.4.4"]]

:repositories {"sonatype"
"http://oss.sonatype.org/content/groups/public/"}

:javac-options {:debug true}
:jvm-opts ["-Djava.library.path=/usr/local/lib:/opt/local/lib:/usr/lib"]
:extra-classpath-dirs ["src/ui"]

:aot :all
)
:min-lein-version "2.0.0")
2 changes: 1 addition & 1 deletion src/clj/backtype/storm/daemon/supervisor.clj
Original file line number Diff line number Diff line change
Expand Up @@ -411,7 +411,7 @@
" -Djava.library.path=" (conf JAVA-LIBRARY-PATH)
" -Dlogfile.name=" logfilename
" -Dstorm.home=" (System/getProperty "storm.home")
" -Dlogback.configurationFile=logback/production.xml"
" -Dlogback.configurationFile=logback/cluster.xml"
" -cp " classpath " backtype.storm.daemon.worker "
(java.net.URLEncoder/encode storm-id) " " (:supervisor-id supervisor)
" " port " " worker-id)]
Expand Down

0 comments on commit 5535d10

Please sign in to comment.