[Opensrf-commits] r1052 - trunk/src/java

svn at svn.open-ils.org svn at svn.open-ils.org
Sat Jul 21 14:59:59 EDT 2007


Author: erickson
Date: 2007-07-21 14:59:31 -0400 (Sat, 21 Jul 2007)
New Revision: 1052

Modified:
   trunk/src/java/Makefile
Log:
Patch from Ed Summers:

Attached is a minor patch to OpenSRF/src/java/Makefile for creating a
opensrf.jar. I was thinking an opensrf.jar would make it easy to
deploy OpenSRF client in a Woodchip/OpenTaps instance. It's not yet
clear to me what the build environment is (or will be) for
Woodchip--but .jar files are used to across the board to manage
external dependencies in Javaland.

- - -

I've also given the depencies their own vars for easier handling and
made the dependency fetching smarter to prevent re-fetching existing deps



Modified: trunk/src/java/Makefile
===================================================================
--- trunk/src/java/Makefile	2007-07-20 12:58:59 UTC (rev 1051)
+++ trunk/src/java/Makefile	2007-07-21 18:59:31 UTC (rev 1052)
@@ -1,18 +1,42 @@
-#JAVA_LIBS = .:lib:ext/json-jdk1.5-2007-05-01.jar:ext/wstx-asl-3.2.1.jar:ext/stax-api-1.0.1.jar:ext/xercesImpl-1.4.4-2.jar
-JAVA_LIBDIR = .lib
+# dependencies
+STAX=stax-api-1.0.1.jar
+WSTX=wstx-lgpl-3.2.1.jar
+MEMCACHE=java_memcached-release_1.5.1.jar
+JSON=json.zip
+
+STAX_URL=http://woodstox.codehaus.org/$(STAX)
+WSTX_URL=http://woodstox.codehaus.org/3.2.1/$(WSTX)
+MEMCACHE_URL=http://img.whalin.com/memcached/jdk5/standard/$(MEMCACHE)
+JSON_URL=http://www.json.org/java/$(JSON)
+
+
 JAVAC=javac -J-Xmx256m
 JAVA=java -Xmx256m 
-JAVA_LIBS = .:$(JAVA_LIBDIR):ext/json-jdk1.5-2007-05-01.jar:ext/wstx-lgpl-3.2.1.jar:ext/stax-api-1.0.1.jar:ext/java_memcached-release_1.5.1.jar
+JAVA_LIBDIR = .lib
+JAVA_LIBS = .:$(JAVA_LIBDIR):ext/$(WSTX):ext/$(STAX):ext/$(MEMCACHE)
 JAVA_SRC = \
 	org/opensrf/net/xmpp/*.java \
 	org/opensrf/util/*.java \
 	org/opensrf/*.java \
 	org/opensrf/test/*.java 
 
-all:
+
+#------------------------------------------------------------------
+
+all:	jar
+
+
+dirs:
 	mkdir -p $(JAVA_LIBDIR)
+
+opensrf:	deps
 	$(JAVAC) -d $(JAVA_LIBDIR) -cp $(JAVA_LIBS) $(JAVA_SRC) 2>&1 
 
+jar:	opensrf
+	rm -f opensrf.jar
+	echo "creating opensrf.jar"
+	jar cvf opensrf.jar -C .lib org/opensrf/
+
 # only prints the first 30 lines of errors
 slim:
 	mkdir -p $(JAVA_LIBDIR)
@@ -29,10 +53,11 @@
 
 deps:
 	mkdir -p ext
-	wget 'http://woodstox.codehaus.org/stax-api-1.0.1.jar' -O ext/stax-api-1.0.1.jar
-	wget 'http://woodstox.codehaus.org/3.2.1/wstx-lgpl-3.2.1.jar' -O ext/wstx-lgpl-3.2.1.jar
-	wget 'http://img.whalin.com/memcached/jdk5/standard/java_memcached-release_1.5.1.jar' -O ext/java_memcached-release_1.5.1.jar
-	mkdir -p .tmp && cd .tmp && wget 'http://www.json.org/java/json.zip' && unzip json.zip
+	mkdir -p $(JAVA_LIBDIR)
+	if [ ! -f ext/$(STAX) ]; then wget '$(STAX_URL)' -O ext/$(STAX); fi 
+	if [ ! -f ext/wstx-lgpl-3.2.1.jar ]; then wget '$(WSTX_URL)' -O ext/$(WSTX); fi
+	if [ ! -f ext/java_memcached-release_1.5.1.jar ]; then wget '$(MEMCACHE_URL)' -O ext/$(MEMCACHE); fi
+	if [ ! -f .tmp/$(JSON) ]; then mkdir -p .tmp && cd .tmp && wget '$(JSON_URL)' && unzip $(JSON); fi
 	$(JAVAC) -d $(JAVA_LIBDIR) .tmp/org/json/*.java
 
 docs:
@@ -40,8 +65,10 @@
 	javadoc -classpath $(JAVA_LIBS) -d doc @files;
 	rm files;
 
-clean:
-	rm -r $(JAVA_LIBDIR)
-	
+clean:	
+	rm -rf $(JAVA_LIBDIR) opensrf.jar
 
+dep_clean:
+	rm -rf ext .tmp
 
+ 	



More information about the opensrf-commits mailing list