From 2cd1794e4f400eeb47240533f73d58654e72bcc6 Mon Sep 17 00:00:00 2001 From: fyrz Date: Wed, 19 Nov 2014 21:15:01 +0100 Subject: [PATCH 1/3] [RocksJava] Make cleanup - Clean Target - Remove JNI includes on clean - Remove target folder generated by Maven - Remove shared object - Remove jar --- java/Makefile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/java/Makefile b/java/Makefile index f0ab4c12ef..c9e6ce80fb 100644 --- a/java/Makefile +++ b/java/Makefile @@ -86,8 +86,13 @@ JAVA_TESTCLASSPATH = $(ROCKSDB_JAR):$(JAVA_JUNIT_JAR):$(JAVA_HAMCR_JAR):$(JAVA_M clean: -find . -name "*.class" -exec rm {} \; -find . -name "hs*.log" -exec rm {} \; + rm -rf include/* rm -rf javadoc/* rm -rf test-libs/ + rm -rf target + rm librocksdbjni* + rm rocksdbjni* + javadocs: mkdir -p javadoc; javadoc -d javadoc -sourcepath . -subpackages org -exclude org.rocksdb.test From e7fcaa4d9297850780ff4023d44443c2beb48acc Mon Sep 17 00:00:00 2001 From: fyrz Date: Wed, 19 Nov 2014 21:21:21 +0100 Subject: [PATCH 2/3] [RocksJava] JavaDoc is executed too often Previous to this commit too much targets got dependencies on javadocs target. Introduced one additional target "javalib" which resolves that situation. JavaDoc will now be generated once while executing a task with prefix "rocksdbjava". --- Makefile | 4 ++-- java/Makefile | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index fc80fa3771..ad79d05891 100644 --- a/Makefile +++ b/Makefile @@ -594,7 +594,7 @@ libsnappy.a: rocksdbjavastatic: libz.a libbz2.a libsnappy.a OPT="-fPIC -DNDEBUG -O2" $(MAKE) $(LIBRARY) -j - cd java;$(MAKE) java; + cd java;$(MAKE) javalib; rm -f ./java/$(ROCKSDBJNILIB) $(CXX) $(CXXFLAGS) -I./java/. $(JAVA_INCLUDE) -shared -fPIC -o ./java/$(ROCKSDBJNILIB) $(JNI_NATIVE_SOURCES) $(LIBOBJECTS) $(COVERAGEFLAGS) libz.a libbz2.a libsnappy.a cd java;jar -cf $(ROCKSDB_JAR) org/rocksdb/*.class org/rocksdb/util/*.class HISTORY*.md $(ROCKSDBJNILIB) @@ -615,7 +615,7 @@ rocksdbjavastaticpublish: rocksdbjavastaticrelease rocksdbjava: OPT="-fPIC -DNDEBUG -O2" $(MAKE) $(LIBRARY) -j32 - cd java;$(MAKE) java; + cd java;$(MAKE) javalib; rm -f ./java/$(ROCKSDBJNILIB) $(CXX) $(CXXFLAGS) -I./java/. $(JAVA_INCLUDE) -shared -fPIC -o ./java/$(ROCKSDBJNILIB) $(JNI_NATIVE_SOURCES) $(LIBOBJECTS) $(JAVA_LDFLAGS) $(COVERAGEFLAGS) cd java;jar -cf $(ROCKSDB_JAR) org/rocksdb/*.class org/rocksdb/util/*.class HISTORY*.md $(ROCKSDBJNILIB) diff --git a/java/Makefile b/java/Makefile index c9e6ce80fb..e8dc5cb471 100644 --- a/java/Makefile +++ b/java/Makefile @@ -97,7 +97,9 @@ clean: javadocs: mkdir -p javadoc; javadoc -d javadoc -sourcepath . -subpackages org -exclude org.rocksdb.test -java: javadocs resolve_test_deps +javalib: java javadocs + +java: resolve_test_deps javac org/rocksdb/util/*.java org/rocksdb/*.java javac -cp $(JAVA_TESTCLASSPATH) org/rocksdb/test/*.java @cp ../HISTORY.md ./HISTORY-CPP.md From 91c8dcefc3de66956ce6d1c7d3d7cff97f4a8eb9 Mon Sep 17 00:00:00 2001 From: fyrz Date: Wed, 19 Nov 2014 21:31:46 +0100 Subject: [PATCH 3/3] [RocksJava] Strip library in publish Currently maven publishing uses the library with debug symbols. What leads to unnecessary big library sizes. Included strip to remove unnecessary stuff. 40M -> 2.7M --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index ad79d05891..676be348b8 100644 --- a/Makefile +++ b/Makefile @@ -597,6 +597,7 @@ rocksdbjavastatic: libz.a libbz2.a libsnappy.a cd java;$(MAKE) javalib; rm -f ./java/$(ROCKSDBJNILIB) $(CXX) $(CXXFLAGS) -I./java/. $(JAVA_INCLUDE) -shared -fPIC -o ./java/$(ROCKSDBJNILIB) $(JNI_NATIVE_SOURCES) $(LIBOBJECTS) $(COVERAGEFLAGS) libz.a libbz2.a libsnappy.a + cd java;strip $(ROCKSDBJNILIB) cd java;jar -cf $(ROCKSDB_JAR) org/rocksdb/*.class org/rocksdb/util/*.class HISTORY*.md $(ROCKSDBJNILIB) cd java/javadoc;jar -cf ../$(ROCKSDB_JAVADOCS_JAR) * cd java;jar -cf $(ROCKSDB_SOURCES_JAR) org