Permalink
Browse files

jarjar almost working, doesn't seem to work on clojure code

  • Loading branch information...
nathanmarz committed Mar 6, 2012
1 parent 93e731d commit 6406cdfac065c8c5a4849d37dcde210682f6a88e
Showing with 96 additions and 24 deletions.
  1. +9 −0 bin/build_jar.sh
  2. +2 −7 bin/build_release.sh
  3. +31 −0 bin/make_jarjar_rules.py
  4. +38 −0 bin/release-pom.xml
  5. +14 −16 bin/to_maven.sh
  6. +2 −1 project.clj
View
@@ -0,0 +1,9 @@
+#!/bin/bash
+
+RELEASE=`head -1 project.clj | awk '{print $3}' | sed -e 's/\"//' | sed -e 's/\"//'`
+
+rm *jar
+rm -rf classes
+rm -rf lib
+lein uberjar
+java -jar lib/dev/jarjar-1.2.jar process bin/jarjar.rules storm-$RELEASE-standalone.jar storm-$RELEASE-release.jar
View
@@ -9,15 +9,10 @@ DIR=_release/storm-$RELEASE
rm -rf _release
export LEIN_ROOT=1
rm *.zip
-rm *jar
-lein clean
-lein deps
-lein compile
-lein jar
mkdir -p $DIR
mkdir $DIR/lib
-cp storm*jar $DIR/
-cp lib/*.jar $DIR/lib
+sh bin/build_jar.sh
+mv storm-$RELEASE-release.jar $DIR/storm-$RELEASE-release.jar
echo $RELEASE > $DIR/RELEASE
View
@@ -0,0 +1,31 @@
+# rule java.** @0
+# rule javax.** @0
+# rule backtype.** @0
+# rule zilch.** @0
+# rule src.jvm.** @0
+# rule clojure.** @0
+# rule *.** backtype.storm.dep.@0
+
+import sys
+
+alltoks = list()
+
+for line in sys.stdin.readlines():
+ tokens = tuple(line.split("/")[0:-1][0:2])
+ if(len(tokens) > 0):
+ alltoks.append(tokens)
+
+alltoks = sorted(alltoks, key=len)
+
+tochange = set()
+
+for toks in alltoks:
+ if(not tuple([toks[0]]) in tochange):
+ tochange.add(toks)
+
+for toks in set(tochange):
+ if(toks[0] in set(["clojure", "javax", "backtype", "zilch", "java"])):
+ tochange.remove(toks)
+
+for toks in tochange:
+ print "rule " + ".".join(toks) + ".** backtype.storm.dep.@0"
View
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>storm</groupId>
+ <artifactId>storm</artifactId>
+ <version>RELEASE</version>
+ <name>storm</name>
+ <build>
+ <sourceDirectory>src</sourceDirectory>
+ <testSourceDirectory>test</testSourceDirectory>
+ <resources>
+ <resource>
+ <directory>resources</directory>
+ </resource>
+ </resources>
+ <testResources>
+ <testResource>
+ <directory>test-resources</directory>
+ </testResource>
+ </testResources>
+ </build>
+ <repositories>
+ <repository>
+ <id>central</id>
+ <url>http://repo1.maven.org/maven2</url>
+ </repository>
+ <repository>
+ <id>clojars</id>
+ <url>http://clojars.org/repo/</url>
+ </repository>
+ </repositories>
+</project>
+
+<!-- This file was autogenerated by Leiningen.
+ Please do not edit it directly; instead edit project.clj and regenerate it.
+ It should not be considered canonical data. For more information see
+ https://github.com/technomancy/leiningen -->
View
@@ -2,21 +2,19 @@
RELEASE=`head -1 project.clj | awk '{print $3}' | sed -e 's/\"//' | sed -e 's/\"//'`
-rm -rf classes
-rm *jar
rm *xml
-lein jar
-lein pom
-scp storm*jar pom.xml clojars@clojars.org:
+sh bin/build_jar.sh
+rm storm-$RELEASE.jar
+mv storm-$RELEASE-release.jar storm-$RELEASE.jar
+sed s/RELEASE/$RELEASE/g bin/release-pom.xml > pom.xml
+# scp storm-$RELEASE.jar pom.xml clojars@clojars.org:
-rm *jar
-rm -rf classes
-rm conf/log4j.properties
-lein jar
-mv pom.xml old-pom.xml
-sed 's/artifactId\>storm/artifactId\>storm-lib/g' old-pom.xml > pom.xml
-mv storm-$RELEASE.jar storm-lib-$RELEASE.jar
-scp storm*jar pom.xml clojars@clojars.org:
-rm *xml
-rm *jar
-git checkout conf/log4j.properties
+# rm conf/log4j.properties
+# sh bin/build_jar.sh
+# mv storm-$RELEASE-release.jar storm-lib-$RELEASE.jar
+# mv pom.xml old-pom.xml
+# sed 's/artifactId\>storm/artifactId\>storm-lib/g' old-pom.xml > pom.xml
+# scp storm*jar pom.xml clojars@clojars.org:
+# rm *xml
+# rm *jar
+# git checkout conf/log4j.properties
View
@@ -29,7 +29,8 @@
:dev-dependencies [
[swank-clojure "1.2.1"]
[lein-ring "0.4.5"]
- ]
+ [jarjar "1.2"]
+ ]
:jvm-opts ["-Djava.library.path=/usr/local/lib:/opt/local/lib:/usr/lib"]
:ring {:handler backtype.storm.ui.core/app}
:extra-classpath-dirs ["src/ui"]

0 comments on commit 6406cdf

Please sign in to comment.