From 9db13987b1095fddbc18c328b163332ed295dda9 Mon Sep 17 00:00:00 2001 From: Chris Riccomini Date: Fri, 26 Sep 2014 13:57:12 -0700 Subject: [PATCH 01/25] Update RocksDB's Java bindings to support multiple native RocksDB builds in the same Jar file. Cross build RocksDB for linux32 and linux64 using Vagrant. Build a cross-platform fat jar that contains osx, linux32, and linux64 RocksDB static builds. --- Makefile | 14 ++++++++++--- java/Makefile | 8 ++++++-- java/crossbuild/README.md | 0 java/crossbuild/Vagrantfile | 25 +++++++++++++++++++++++ java/crossbuild/build-linux.sh | 11 ++++++++++ java/org/rocksdb/NativeLibraryLoader.java | 6 +++--- java/org/rocksdb/util/Environment.java | 14 +++++++++++-- 7 files changed, 68 insertions(+), 10 deletions(-) create mode 100644 java/crossbuild/README.md create mode 100644 java/crossbuild/Vagrantfile create mode 100755 java/crossbuild/build-linux.sh diff --git a/Makefile b/Makefile index 9d626e17f..9fc1fe6de 100644 --- a/Makefile +++ b/Makefile @@ -270,6 +270,7 @@ clean: -rm -rf ios-x86/* ios-arm/* -find . -name "*.[oda]" -exec rm {} \; -find . -type f -regex ".*\.\(\(gcda\)\|\(gcno\)\)" -exec rm {} \; + -rm -rf bzip2* snappy* zlib* tags: ctags * -R cscope -b `find . -name '*.cc'` `find . -name '*.h'` @@ -510,11 +511,14 @@ ldb: tools/ldb.o $(LIBOBJECTS) JNI_NATIVE_SOURCES = ./java/rocksjni/*.cc JAVA_INCLUDE = -I$(JAVA_HOME)/include/ -I$(JAVA_HOME)/include/linux -ROCKSDBJNILIB = librocksdbjni.so -ROCKSDB_JAR = rocksdbjni.jar +ARCH := $(shell getconf LONG_BIT) +ROCKSDBJNILIB = librocksdbjni-linux$(ARCH).so +ROCKSDB_JAR = rocksdbjni-linux$(ARCH).jar +ROCKSDB_JAR_ALL = rocksdbjni-all.jar ifeq ($(PLATFORM), OS_MACOSX) -ROCKSDBJNILIB = librocksdbjni.jnilib +ROCKSDBJNILIB = librocksdbjni-osx.jnilib +ROCKSDB_JAR = rocksdbjni-osx.jar JAVA_INCLUDE = -I/System/Library/Frameworks/JavaVM.framework/Headers/ endif @@ -549,6 +553,10 @@ rocksdbjavastatic: libz.a libbz2.a libsnappy.a cd java;jar -cf $(ROCKSDB_JAR) org/rocksdb/*.class org/rocksdb/util/*.class HISTORY*.md $(ROCKSDBJNILIB) +rocksdbjavastaticrelease: rocksdbjavastatic + cd java/crossbuild && vagrant destroy -f && vagrant up + cd java;jar -cf $(ROCKSDB_JAR_ALL) org/rocksdb/*.class org/rocksdb/util/*.class HISTORY*.md librocksdbjni-*.so librocksdbjni-*.jnilib + rocksdbjava: OPT="-fPIC -DNDEBUG -O2" $(MAKE) $(LIBRARY) -j32 cd java;$(MAKE) java; diff --git a/java/Makefile b/java/Makefile index b2f3674f0..1b854755b 100644 --- a/java/Makefile +++ b/java/Makefile @@ -1,12 +1,16 @@ NATIVE_JAVA_CLASSES = org.rocksdb.RocksDB org.rocksdb.Options org.rocksdb.WriteBatch org.rocksdb.WriteBatchInternal org.rocksdb.WriteBatchTest org.rocksdb.WriteOptions org.rocksdb.BackupableDB org.rocksdb.BackupableDBOptions org.rocksdb.Statistics org.rocksdb.RocksIterator org.rocksdb.VectorMemTableConfig org.rocksdb.SkipListMemTableConfig org.rocksdb.HashLinkedListMemTableConfig org.rocksdb.HashSkipListMemTableConfig org.rocksdb.PlainTableConfig org.rocksdb.BlockBasedTableConfig org.rocksdb.ReadOptions org.rocksdb.Filter org.rocksdb.BloomFilter org.rocksdb.RestoreOptions org.rocksdb.RestoreBackupableDB org.rocksdb.RocksEnv org.rocksdb.GenericRateLimiterConfig NATIVE_INCLUDE = ./include -ROCKSDB_JAR = rocksdbjni.jar +ARCH := $(shell getconf LONG_BIT) +ROCKSDB_JAR = rocksdbjni-linux$(ARCH).jar + +ifeq ($(PLATFORM), OS_MACOSX) +ROCKSDB_JAR = rocksdbjni-osx.jar +endif clean: -find . -name "*.class" -exec rm {} \; -find . -name "hs*.log" -exec rm {} \; - rm -f $(ROCKSDB_JAR) java: javac org/rocksdb/util/*.java org/rocksdb/*.java diff --git a/java/crossbuild/README.md b/java/crossbuild/README.md new file mode 100644 index 000000000..e69de29bb diff --git a/java/crossbuild/Vagrantfile b/java/crossbuild/Vagrantfile new file mode 100644 index 000000000..47e76b7da --- /dev/null +++ b/java/crossbuild/Vagrantfile @@ -0,0 +1,25 @@ +# -*- mode: ruby -*- +# vi: set ft=ruby : + +# Vagrantfile API/syntax version. Don't touch unless you know what you're doing! +VAGRANTFILE_API_VERSION = "2" + +Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| + + config.vm.define "linux32" do |linux32| + linux32.vm.box = "ubuntu/trusty32" + linux32.vm.provision :shell, path: "build-linux.sh" + linux32.vm.synced_folder "../..", "/rocksdb" + end + + config.vm.define "linux64" do |linux64| + linux64.vm.box = "ubuntu/trusty64" + linux64.vm.provision :shell, path: "build-linux.sh" + linux64.vm.synced_folder "../..", "/rocksdb" + end + + config.vm.provider "virtualbox" do |v| + v.memory = 2048 + v.cpus = 4 + end +end diff --git a/java/crossbuild/build-linux.sh b/java/crossbuild/build-linux.sh new file mode 100755 index 000000000..37b808140 --- /dev/null +++ b/java/crossbuild/build-linux.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env bash +# install all required packages for rocksdb +sudo apt-get update +sudo apt-get -y install git make gcc g++ libgflags-dev libsnappy-dev zlib1g-dev libbz2-dev default-jdk + +# set java home so we can build rocksdb jars +export JAVA_HOME=$(echo /usr/lib/jvm/java-7-openjdk*) +cd /rocksdb +make jclean clean -j 4 rocksdbjavastatic +sudo shutdown -h now + diff --git a/java/org/rocksdb/NativeLibraryLoader.java b/java/org/rocksdb/NativeLibraryLoader.java index 440056582..367c4dc5b 100644 --- a/java/org/rocksdb/NativeLibraryLoader.java +++ b/java/org/rocksdb/NativeLibraryLoader.java @@ -1,16 +1,16 @@ package org.rocksdb; import java.io.*; - +import org.rocksdb.util.Environment; /** * This class is used to load the RocksDB shared library from within the jar. * The shared library is extracted to a temp folder and loaded from there. */ public class NativeLibraryLoader { - private static String sharedLibraryName = "librocksdbjni.so"; + private static String sharedLibraryName = Environment.getJniLibraryName("rockdsb"); private static String tempFilePrefix = "librocksdbjni"; - private static String tempFileSuffix = ".so"; + private static String tempFileSuffix = "." + Environment.getJniLibraryExtension(); public static void loadLibraryFromJar(String tmpDir) throws IOException { diff --git a/java/org/rocksdb/util/Environment.java b/java/org/rocksdb/util/Environment.java index c2e3bc088..1158908a2 100644 --- a/java/org/rocksdb/util/Environment.java +++ b/java/org/rocksdb/util/Environment.java @@ -2,6 +2,7 @@ package org.rocksdb.util; public class Environment { private static String OS = System.getProperty("os.name").toLowerCase(); + private static String ARCH = System.getProperty("os.arch").toLowerCase(); public static boolean isWindows() { return (OS.indexOf("win") >= 0); @@ -17,6 +18,10 @@ public class Environment { OS.indexOf("aix") >= 0); } + public static boolean is64Bit() { + return (ARCH.indexOf("64") > 0); + } + public static String getSharedLibraryName(String name) { if (isUnix()) { return String.format("lib%s.so", name); @@ -28,10 +33,15 @@ public class Environment { public static String getJniLibraryName(String name) { if (isUnix()) { - return String.format("lib%s.so", name); + String arch = (is64Bit()) ? "64" : "32"; + return String.format("lib%s-linux%s.so", name, arch); } else if (isMac()) { - return String.format("lib%s.jnilib", name); + return String.format("lib%s-osx.jnilib", name); } throw new UnsupportedOperationException(); } + + public static String getJniLibraryExtension() { + return (isMac()) ? ".jnilib" : ".so"; + } } From 82a8f43ccc99f47b351b9d8d13b69d40ab84f97c Mon Sep 17 00:00:00 2001 From: Chris Riccomini Date: Fri, 26 Sep 2014 14:58:33 -0700 Subject: [PATCH 02/25] Document RELEASE.mdgit status --- java/RELEASE.md | 29 +++++++++++++++++++++++++++++ java/crossbuild/README.md | 0 java/crossbuild/build-linux.sh | 3 ++- 3 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 java/RELEASE.md delete mode 100644 java/crossbuild/README.md diff --git a/java/RELEASE.md b/java/RELEASE.md new file mode 100644 index 000000000..5df6ad353 --- /dev/null +++ b/java/RELEASE.md @@ -0,0 +1,29 @@ +## Cross-building + +To build RocksDB as a single self contained cross-platform JAR. The cross-platform jar can be usd on any 64-bit OSX system, 32-bit Linux system, or 64-bit Linux system. + +Building a cross-platform JAR requires: + + * [Vagrant](https://www.vagrantup.com/) + * [Virtualbox](https://www.virtualbox.org/) + * A Mac OSX machine + +Once you have these items, run this make command from RocksDB's root source directory: + + make jclean clean rocksdbjavastaticrelease + +This command will build RocksDB natively on OSX, and will then spin up two Vagrant Virtualbox Ubuntu images to build RocksDB for both 32-bit and 64-bit Linux. + +You can find all native binaries and JARs in the java directory upon completion: + + librocksdbjni-linux32.so + librocksdbjni-linux64.so + librocksdbjni-osx.jnilib + rocksdbjni-all.jar + rocksdbjni-linux32.jar + rocksdbjni-linux64.jar + rocksdbjni-osx.jar + +## Maven publication + +TODO diff --git a/java/crossbuild/README.md b/java/crossbuild/README.md deleted file mode 100644 index e69de29bb..000000000 diff --git a/java/crossbuild/build-linux.sh b/java/crossbuild/build-linux.sh index 37b808140..7d5831510 100755 --- a/java/crossbuild/build-linux.sh +++ b/java/crossbuild/build-linux.sh @@ -6,6 +6,7 @@ sudo apt-get -y install git make gcc g++ libgflags-dev libsnappy-dev zlib1g-dev # set java home so we can build rocksdb jars export JAVA_HOME=$(echo /usr/lib/jvm/java-7-openjdk*) cd /rocksdb -make jclean clean -j 4 rocksdbjavastatic +make jclean clean +make -j 4 rocksdbjavastatic sudo shutdown -h now From 4e735bb7f970012a2b045511a216acd76b0f3df0 Mon Sep 17 00:00:00 2001 From: Chris Riccomini Date: Fri, 26 Sep 2014 15:41:28 -0700 Subject: [PATCH 03/25] Rsync files to VM rather than sync folders, since sync folders was causing clock skew and confusig make. --- .gitignore | 1 + java/crossbuild/Vagrantfile | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 99a7d61d6..e9fdf1368 100644 --- a/.gitignore +++ b/.gitignore @@ -33,3 +33,4 @@ tags java/*.log java/include/org_rocksdb_*.h unity.cc +java/crossbuild/.vagrant diff --git a/java/crossbuild/Vagrantfile b/java/crossbuild/Vagrantfile index 47e76b7da..634271dc3 100644 --- a/java/crossbuild/Vagrantfile +++ b/java/crossbuild/Vagrantfile @@ -9,17 +9,17 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| config.vm.define "linux32" do |linux32| linux32.vm.box = "ubuntu/trusty32" linux32.vm.provision :shell, path: "build-linux.sh" - linux32.vm.synced_folder "../..", "/rocksdb" end config.vm.define "linux64" do |linux64| linux64.vm.box = "ubuntu/trusty64" linux64.vm.provision :shell, path: "build-linux.sh" - linux64.vm.synced_folder "../..", "/rocksdb" end config.vm.provider "virtualbox" do |v| v.memory = 2048 v.cpus = 4 end + + config.vm.synced_folder "../..", "/rocksdb", type: "rsync" end From b8e26615aac81f85046380c3420cd823009d0941 Mon Sep 17 00:00:00 2001 From: Chris Riccomini Date: Fri, 26 Sep 2014 18:27:32 -0700 Subject: [PATCH 04/25] since we're not sharing folders with the vm, copy built .so files and jars back to host system. --- java/RELEASE.md | 4 ++-- java/crossbuild/Vagrantfile | 1 + java/crossbuild/build-linux.sh | 2 ++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/java/RELEASE.md b/java/RELEASE.md index 5df6ad353..6b5eaf5af 100644 --- a/java/RELEASE.md +++ b/java/RELEASE.md @@ -1,12 +1,12 @@ ## Cross-building -To build RocksDB as a single self contained cross-platform JAR. The cross-platform jar can be usd on any 64-bit OSX system, 32-bit Linux system, or 64-bit Linux system. +RocksDB can be built as a single self contained cross-platform JAR. The cross-platform jar can be usd on any 64-bit OSX system, 32-bit Linux system, or 64-bit Linux system. Building a cross-platform JAR requires: * [Vagrant](https://www.vagrantup.com/) * [Virtualbox](https://www.virtualbox.org/) - * A Mac OSX machine + * A Mac OSX machine that can compile RocksDB. Once you have these items, run this make command from RocksDB's root source directory: diff --git a/java/crossbuild/Vagrantfile b/java/crossbuild/Vagrantfile index 634271dc3..ed591be71 100644 --- a/java/crossbuild/Vagrantfile +++ b/java/crossbuild/Vagrantfile @@ -21,5 +21,6 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| v.cpus = 4 end + config.vm.synced_folder "../", "/rocksdb-build" config.vm.synced_folder "../..", "/rocksdb", type: "rsync" end diff --git a/java/crossbuild/build-linux.sh b/java/crossbuild/build-linux.sh index 7d5831510..75edac526 100755 --- a/java/crossbuild/build-linux.sh +++ b/java/crossbuild/build-linux.sh @@ -8,5 +8,7 @@ export JAVA_HOME=$(echo /usr/lib/jvm/java-7-openjdk*) cd /rocksdb make jclean clean make -j 4 rocksdbjavastatic +cp /rocksdb/java/librocksdbjni-* /rocksdb-build +cp /rocksdb/java/rocksdbjni-* /rocksdb-build sudo shutdown -h now From c4519c777f7dcd996c5bd8d726877bda3f0e65ac Mon Sep 17 00:00:00 2001 From: Chris Riccomini Date: Mon, 29 Sep 2014 10:42:00 -0700 Subject: [PATCH 05/25] fix mis-named jar in JNI loader --- java/org/rocksdb/NativeLibraryLoader.java | 2 +- java/org/rocksdb/util/Environment.java | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/java/org/rocksdb/NativeLibraryLoader.java b/java/org/rocksdb/NativeLibraryLoader.java index 367c4dc5b..26a26bbca 100644 --- a/java/org/rocksdb/NativeLibraryLoader.java +++ b/java/org/rocksdb/NativeLibraryLoader.java @@ -8,7 +8,7 @@ import org.rocksdb.util.Environment; * The shared library is extracted to a temp folder and loaded from there. */ public class NativeLibraryLoader { - private static String sharedLibraryName = Environment.getJniLibraryName("rockdsb"); + private static String sharedLibraryName = Environment.getJniLibraryName("rocksdb"); private static String tempFilePrefix = "librocksdbjni"; private static String tempFileSuffix = "." + Environment.getJniLibraryExtension(); diff --git a/java/org/rocksdb/util/Environment.java b/java/org/rocksdb/util/Environment.java index 1158908a2..7bb42ace7 100644 --- a/java/org/rocksdb/util/Environment.java +++ b/java/org/rocksdb/util/Environment.java @@ -24,9 +24,9 @@ public class Environment { public static String getSharedLibraryName(String name) { if (isUnix()) { - return String.format("lib%s.so", name); + return String.format("lib%sjni.so", name); } else if (isMac()) { - return String.format("lib%s.dylib", name); + return String.format("lib%sjni.dylib", name); } throw new UnsupportedOperationException(); } @@ -34,9 +34,9 @@ public class Environment { public static String getJniLibraryName(String name) { if (isUnix()) { String arch = (is64Bit()) ? "64" : "32"; - return String.format("lib%s-linux%s.so", name, arch); + return String.format("lib%sjni-linux%s.so", name, arch); } else if (isMac()) { - return String.format("lib%s-osx.jnilib", name); + return String.format("lib%sjni-osx.jnilib", name); } throw new UnsupportedOperationException(); } From 6a64ea6171518ff09dbbee5fb5e94a90b4e63471 Mon Sep 17 00:00:00 2001 From: Chris Riccomini Date: Mon, 29 Sep 2014 10:57:38 -0700 Subject: [PATCH 06/25] add note about java 7 --- java/RELEASE.md | 1 + 1 file changed, 1 insertion(+) diff --git a/java/RELEASE.md b/java/RELEASE.md index 6b5eaf5af..cc35dc33c 100644 --- a/java/RELEASE.md +++ b/java/RELEASE.md @@ -7,6 +7,7 @@ Building a cross-platform JAR requires: * [Vagrant](https://www.vagrantup.com/) * [Virtualbox](https://www.virtualbox.org/) * A Mac OSX machine that can compile RocksDB. + * Java 7 set as JAVA_HOME. Once you have these items, run this make command from RocksDB's root source directory: From 0b923f0f9aa385e2a60000631526b9397eff88ce Mon Sep 17 00:00:00 2001 From: Chris Riccomini Date: Mon, 29 Sep 2014 16:58:16 -0700 Subject: [PATCH 07/25] add centos 5.6 build instead of ubuntu. --- Makefile | 6 +++++- java/crossbuild/Vagrantfile | 7 +++---- java/crossbuild/build-linux-centos.sh | 23 +++++++++++++++++++++++ 3 files changed, 31 insertions(+), 5 deletions(-) create mode 100755 java/crossbuild/build-linux-centos.sh diff --git a/Makefile b/Makefile index 9fc1fe6de..e0c836ec1 100644 --- a/Makefile +++ b/Makefile @@ -554,7 +554,11 @@ rocksdbjavastatic: libz.a libbz2.a libsnappy.a rocksdbjavastaticrelease: rocksdbjavastatic - cd java/crossbuild && vagrant destroy -f && vagrant up + cd java/crossbuild && vagrant destroy -f + vagrant up linux32 + vagrant halt linux32 + vagrant up linux64 + vagrant halt linux64 cd java;jar -cf $(ROCKSDB_JAR_ALL) org/rocksdb/*.class org/rocksdb/util/*.class HISTORY*.md librocksdbjni-*.so librocksdbjni-*.jnilib rocksdbjava: diff --git a/java/crossbuild/Vagrantfile b/java/crossbuild/Vagrantfile index ed591be71..c4b1b1df2 100644 --- a/java/crossbuild/Vagrantfile +++ b/java/crossbuild/Vagrantfile @@ -7,13 +7,11 @@ VAGRANTFILE_API_VERSION = "2" Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| config.vm.define "linux32" do |linux32| - linux32.vm.box = "ubuntu/trusty32" - linux32.vm.provision :shell, path: "build-linux.sh" + linux32.vm.box = "hansode/centos-5.6-i386" end config.vm.define "linux64" do |linux64| - linux64.vm.box = "ubuntu/trusty64" - linux64.vm.provision :shell, path: "build-linux.sh" + linux64.vm.box = "hansode/centos-5.6-x86_64" end config.vm.provider "virtualbox" do |v| @@ -21,6 +19,7 @@ Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| v.cpus = 4 end + config.vm.provision :shell, path: "build-linux-centos.sh" config.vm.synced_folder "../", "/rocksdb-build" config.vm.synced_folder "../..", "/rocksdb", type: "rsync" end diff --git a/java/crossbuild/build-linux-centos.sh b/java/crossbuild/build-linux-centos.sh new file mode 100755 index 000000000..55f179b62 --- /dev/null +++ b/java/crossbuild/build-linux-centos.sh @@ -0,0 +1,23 @@ +#!/usr/bin/env bash +# install all required packages for rocksdb that are available through yum +ARCH=$(uname -i) +sudo yum -y install java-1.6.0-openjdk-devel.$ARCH zlib zlib-devel bzip2 bzip2-devel + +# install gcc/g++ 4.7 via CERN (http://linux.web.cern.ch/linux/devtoolset/) +sudo wget -O /etc/yum.repos.d/slc5-devtoolset.repo http://linuxsoft.cern.ch/cern/devtoolset/slc5-devtoolset.repo +sudo wget -O /etc/pki/rpm-gpg/RPM-GPG-KEY-cern http://ftp.mirrorservice.org/sites/ftp.scientificlinux.org/linux/scientific/51/i386/RPM-GPG-KEYs/RPM-GPG-KEY-cern +sudo yum -y install devtoolset-1.1 +wget http://gflags.googlecode.com/files/gflags-1.6.tar.gz +tar xvfz gflags-1.6.tar.gz; cd gflags-1.6; scl enable devtoolset-1.1 ./configure; scl enable devtoolset-1.1 make; sudo make install +export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib + +# set java home so we can build rocksdb jars +export JAVA_HOME=/usr/lib/jvm/java-1.6.0 + +# build rocksdb +cd /rocksdb +scl enable devtoolset-1.1 'make jclean clean' +scl enable devtoolset-1.1 'make -j 4 rocksdbjavastatic' +cp /rocksdb/java/librocksdbjni-* /rocksdb-build +cp /rocksdb/java/rocksdbjni-* /rocksdb-build + From a2f98ef618de4bc0fb626c55cbb102d10f047131 Mon Sep 17 00:00:00 2001 From: Chris Riccomini Date: Tue, 30 Sep 2014 11:59:18 -0700 Subject: [PATCH 08/25] fix tabs in Makefile --- Makefile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index e0c836ec1..c22da1e46 100644 --- a/Makefile +++ b/Makefile @@ -555,10 +555,10 @@ rocksdbjavastatic: libz.a libbz2.a libsnappy.a rocksdbjavastaticrelease: rocksdbjavastatic cd java/crossbuild && vagrant destroy -f - vagrant up linux32 - vagrant halt linux32 - vagrant up linux64 - vagrant halt linux64 + vagrant up linux32 + vagrant halt linux32 + vagrant up linux64 + vagrant halt linux64 cd java;jar -cf $(ROCKSDB_JAR_ALL) org/rocksdb/*.class org/rocksdb/util/*.class HISTORY*.md librocksdbjni-*.so librocksdbjni-*.jnilib rocksdbjava: From 726ac5bca8be2f743a4eb3b8de4a847fb6545f03 Mon Sep 17 00:00:00 2001 From: Chris Riccomini Date: Tue, 30 Sep 2014 12:03:32 -0700 Subject: [PATCH 09/25] shrink vagrant commands to single line --- Makefile | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/Makefile b/Makefile index c22da1e46..6248fefdc 100644 --- a/Makefile +++ b/Makefile @@ -554,11 +554,7 @@ rocksdbjavastatic: libz.a libbz2.a libsnappy.a rocksdbjavastaticrelease: rocksdbjavastatic - cd java/crossbuild && vagrant destroy -f - vagrant up linux32 - vagrant halt linux32 - vagrant up linux64 - vagrant halt linux64 + cd java/crossbuild && vagrant destroy -f && vagrant up linux32 && vagrant halt linux32 && vagrant up linux64 && vagrant halt linux64 cd java;jar -cf $(ROCKSDB_JAR_ALL) org/rocksdb/*.class org/rocksdb/util/*.class HISTORY*.md librocksdbjni-*.so librocksdbjni-*.jnilib rocksdbjava: From d0916f452f7564c2f7dfeeb202353e8b9e4d16cf Mon Sep 17 00:00:00 2001 From: Chris Riccomini Date: Thu, 2 Oct 2014 11:07:45 -0700 Subject: [PATCH 10/25] add major minor micro version to java jars --- Makefile | 11 ++++++----- java/Makefile | 8 ++++++-- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index ab920b592..2a1ae6735 100644 --- a/Makefile +++ b/Makefile @@ -164,8 +164,9 @@ endif LIBRARY = ${LIBNAME}.a MEMENVLIBRARY = libmemenv.a -ROCKSDB_MAJOR = 3 -ROCKSDB_MINOR = 4 +ROCKSDB_MAJOR = $(shell egrep "ROCKSDB_MAJOR.[0-9]" include/rocksdb/version.h | cut -d ' ' -f 3) +ROCKSDB_MINOR = $(shell egrep "ROCKSDB_MINOR.[0-9]" include/rocksdb/version.h | cut -d ' ' -f 3) +ROCKSDB_PATCH = $(shell egrep "ROCKSDB_PATCH.[0-9]" include/rocksdb/version.h | cut -d ' ' -f 3) default: all @@ -515,12 +516,12 @@ JNI_NATIVE_SOURCES = ./java/rocksjni/*.cc JAVA_INCLUDE = -I$(JAVA_HOME)/include/ -I$(JAVA_HOME)/include/linux ARCH := $(shell getconf LONG_BIT) ROCKSDBJNILIB = librocksdbjni-linux$(ARCH).so -ROCKSDB_JAR = rocksdbjni-linux$(ARCH).jar -ROCKSDB_JAR_ALL = rocksdbjni-all.jar +ROCKSDB_JAR = rocksdbjni-$(ROCKSDB_MAJOR).$(ROCKSDB_MINOR).$(ROCKSDB_PATCH)-linux$(ARCH).jar +ROCKSDB_JAR_ALL = rocksdbjni-$(ROCKSDB_MAJOR).$(ROCKSDB_MINOR).$(ROCKSDB_PATCH)-all.jar ifeq ($(PLATFORM), OS_MACOSX) ROCKSDBJNILIB = librocksdbjni-osx.jnilib -ROCKSDB_JAR = rocksdbjni-osx.jar +ROCKSDB_JAR = rocksdbjni-$(ROCKSDB_MAJOR).$(ROCKSDB_MINOR).$(ROCKSDB_PATCH)-osx.jar JAVA_INCLUDE = -I/System/Library/Frameworks/JavaVM.framework/Headers/ endif diff --git a/java/Makefile b/java/Makefile index 1b854755b..2741f36d3 100644 --- a/java/Makefile +++ b/java/Makefile @@ -1,11 +1,15 @@ NATIVE_JAVA_CLASSES = org.rocksdb.RocksDB org.rocksdb.Options org.rocksdb.WriteBatch org.rocksdb.WriteBatchInternal org.rocksdb.WriteBatchTest org.rocksdb.WriteOptions org.rocksdb.BackupableDB org.rocksdb.BackupableDBOptions org.rocksdb.Statistics org.rocksdb.RocksIterator org.rocksdb.VectorMemTableConfig org.rocksdb.SkipListMemTableConfig org.rocksdb.HashLinkedListMemTableConfig org.rocksdb.HashSkipListMemTableConfig org.rocksdb.PlainTableConfig org.rocksdb.BlockBasedTableConfig org.rocksdb.ReadOptions org.rocksdb.Filter org.rocksdb.BloomFilter org.rocksdb.RestoreOptions org.rocksdb.RestoreBackupableDB org.rocksdb.RocksEnv org.rocksdb.GenericRateLimiterConfig +ROCKSDB_MAJOR = $(shell egrep "ROCKSDB_MAJOR.[0-9]" include/rocksdb/version.h | cut -d ' ' -f 3) +ROCKSDB_MINOR = $(shell egrep "ROCKSDB_MINOR.[0-9]" include/rocksdb/version.h | cut -d ' ' -f 3) +ROCKSDB_PATCH = $(shell egrep "ROCKSDB_PATCH.[0-9]" include/rocksdb/version.h | cut -d ' ' -f 3) + NATIVE_INCLUDE = ./include ARCH := $(shell getconf LONG_BIT) -ROCKSDB_JAR = rocksdbjni-linux$(ARCH).jar +ROCKSDB_JAR = rocksdbjni-$(ROCKSDB_MAJOR).$(ROCKSDB_MINOR).$(ROCKSDB_PATCH)-linux$(ARCH).jar ifeq ($(PLATFORM), OS_MACOSX) -ROCKSDB_JAR = rocksdbjni-osx.jar +ROCKSDB_JAR = rocksdbjni-$(ROCKSDB_MAJOR).$(ROCKSDB_MINOR).$(ROCKSDB_PATCH)-osx.jar endif clean: From fd2545c80a60756387917683f3862cb1b086b294 Mon Sep 17 00:00:00 2001 From: Chris Riccomini Date: Thu, 2 Oct 2014 13:29:47 -0700 Subject: [PATCH 11/25] add maven publication target and instructions --- Makefile | 6 ++++++ java/RELEASE.md | 28 +++++++++++++++++++++++++++- 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 2a1ae6735..ec443df12 100644 --- a/Makefile +++ b/Makefile @@ -560,6 +560,12 @@ rocksdbjavastaticrelease: rocksdbjavastatic cd java/crossbuild && vagrant destroy -f && vagrant up linux32 && vagrant halt linux32 && vagrant up linux64 && vagrant halt linux64 cd java;jar -cf $(ROCKSDB_JAR_ALL) org/rocksdb/*.class org/rocksdb/util/*.class HISTORY*.md librocksdbjni-*.so librocksdbjni-*.jnilib +rocksdbjavastaticpublish: + mvn gpg:sign-and-deploy-file -Durl=https://oss.sonatype.org/service/local/staging/deploy/maven2/ -DrepositoryId=sonatype-nexus-staging -DpomFile=java/maven/rocksdbjni-3.5.0-linux64.pom -Dfile=java/rocksdbjni-3.5.0-linux64.jar -Dclassifier=linux64 + mvn gpg:sign-and-deploy-file -Durl=https://oss.sonatype.org/service/local/staging/deploy/maven2/ -DrepositoryId=sonatype-nexus-staging -DpomFile=java/maven/rocksdbjni-3.5.0-linux32.pom -Dfile=java/rocksdbjni-3.5.0-linux32.jar -Dclassifier=linux32 + mvn gpg:sign-and-deploy-file -Durl=https://oss.sonatype.org/service/local/staging/deploy/maven2/ -DrepositoryId=sonatype-nexus-staging -DpomFile=java/maven/rocksdbjni-3.5.0-osx.pom -Dfile=java/rocksdbjni-3.5.0-osx.jar -Dclassifier=osx + mvn gpg:sign-and-deploy-file -Durl=https://oss.sonatype.org/service/local/staging/deploy/maven2/ -DrepositoryId=sonatype-nexus-staging -DpomFile=java/maven/rocksdbjni-3.5.0-all.pom -Dfile=java/rocksdbjni-3.5.0-all.jar -Dclassifier=all + rocksdbjava: OPT="-fPIC -DNDEBUG -O2" $(MAKE) $(LIBRARY) -j32 cd java;$(MAKE) java; diff --git a/java/RELEASE.md b/java/RELEASE.md index cc35dc33c..c54cadffe 100644 --- a/java/RELEASE.md +++ b/java/RELEASE.md @@ -27,4 +27,30 @@ You can find all native binaries and JARs in the java directory upon completion: ## Maven publication -TODO +Set ~/.m2/settings.xml to contain: + + + + + sonatype-nexus-staging + your-sonatype-jira-username + your-sonatype-jira-password + + + + +From RocksDB's root directory, first build the Java static JARs: + + make jclean clean rocksdbjavastaticrelease + +Then publish the release to Sonatype: + + make rocksdbjavastaticpublish + +This command will [stage the JAR artifacts on the Sonatype staging repository](http://central.sonatype.org/pages/manual-staging-bundle-creation-and-deployment.html). To release the staged artifacts. + +1. Go to [https://oss.sonatype.org/#stagingRepositories](https://oss.sonatype.org/#stagingRepositories) and search for "rocksdb" in the upper right hand search box. +2. Select the rocksdb staging repository, and inspect its contents. +3. If all is well, follow [these steps](https://oss.sonatype.org/#stagingRepositories) to close the repository and release it. + +After the release has occurred, the artifacts will be synced to Maven central within 24-48 hours. From deefcf476dcfa7dc172803df5ca7ca8aa7834361 Mon Sep 17 00:00:00 2001 From: Chris Riccomini Date: Thu, 2 Oct 2014 13:46:43 -0700 Subject: [PATCH 12/25] make fat jar unclassified to satisfy sonatype --- .gitignore | 1 + Makefile | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index 363481755..638f236c7 100644 --- a/.gitignore +++ b/.gitignore @@ -36,3 +36,4 @@ java/include/org_rocksdb_*.h unity.cc java/crossbuild/.vagrant .vagrant/ +java/**.asc diff --git a/Makefile b/Makefile index ec443df12..01bb170a2 100644 --- a/Makefile +++ b/Makefile @@ -517,7 +517,7 @@ JAVA_INCLUDE = -I$(JAVA_HOME)/include/ -I$(JAVA_HOME)/include/linux ARCH := $(shell getconf LONG_BIT) ROCKSDBJNILIB = librocksdbjni-linux$(ARCH).so ROCKSDB_JAR = rocksdbjni-$(ROCKSDB_MAJOR).$(ROCKSDB_MINOR).$(ROCKSDB_PATCH)-linux$(ARCH).jar -ROCKSDB_JAR_ALL = rocksdbjni-$(ROCKSDB_MAJOR).$(ROCKSDB_MINOR).$(ROCKSDB_PATCH)-all.jar +ROCKSDB_JAR_ALL = rocksdbjni-$(ROCKSDB_MAJOR).$(ROCKSDB_MINOR).$(ROCKSDB_PATCH).jar ifeq ($(PLATFORM), OS_MACOSX) ROCKSDBJNILIB = librocksdbjni-osx.jnilib @@ -561,10 +561,10 @@ rocksdbjavastaticrelease: rocksdbjavastatic cd java;jar -cf $(ROCKSDB_JAR_ALL) org/rocksdb/*.class org/rocksdb/util/*.class HISTORY*.md librocksdbjni-*.so librocksdbjni-*.jnilib rocksdbjavastaticpublish: - mvn gpg:sign-and-deploy-file -Durl=https://oss.sonatype.org/service/local/staging/deploy/maven2/ -DrepositoryId=sonatype-nexus-staging -DpomFile=java/maven/rocksdbjni-3.5.0-linux64.pom -Dfile=java/rocksdbjni-3.5.0-linux64.jar -Dclassifier=linux64 - mvn gpg:sign-and-deploy-file -Durl=https://oss.sonatype.org/service/local/staging/deploy/maven2/ -DrepositoryId=sonatype-nexus-staging -DpomFile=java/maven/rocksdbjni-3.5.0-linux32.pom -Dfile=java/rocksdbjni-3.5.0-linux32.jar -Dclassifier=linux32 - mvn gpg:sign-and-deploy-file -Durl=https://oss.sonatype.org/service/local/staging/deploy/maven2/ -DrepositoryId=sonatype-nexus-staging -DpomFile=java/maven/rocksdbjni-3.5.0-osx.pom -Dfile=java/rocksdbjni-3.5.0-osx.jar -Dclassifier=osx - mvn gpg:sign-and-deploy-file -Durl=https://oss.sonatype.org/service/local/staging/deploy/maven2/ -DrepositoryId=sonatype-nexus-staging -DpomFile=java/maven/rocksdbjni-3.5.0-all.pom -Dfile=java/rocksdbjni-3.5.0-all.jar -Dclassifier=all + mvn gpg:sign-and-deploy-file -Durl=https://oss.sonatype.org/service/local/staging/deploy/maven2/ -DrepositoryId=sonatype-nexus-staging -DpomFile=java/rocksdbjni-3.5.0.pom -Dfile=java/rocksdbjni-3.5.0-linux64.jar -Dclassifier=linux64 + mvn gpg:sign-and-deploy-file -Durl=https://oss.sonatype.org/service/local/staging/deploy/maven2/ -DrepositoryId=sonatype-nexus-staging -DpomFile=java/rocksdbjni-3.5.0.pom -Dfile=java/rocksdbjni-3.5.0-linux32.jar -Dclassifier=linux32 + mvn gpg:sign-and-deploy-file -Durl=https://oss.sonatype.org/service/local/staging/deploy/maven2/ -DrepositoryId=sonatype-nexus-staging -DpomFile=java/rocksdbjni-3.5.0.pom -Dfile=java/rocksdbjni-3.5.0-osx.jar -Dclassifier=osx + mvn gpg:sign-and-deploy-file -Durl=https://oss.sonatype.org/service/local/staging/deploy/maven2/ -DrepositoryId=sonatype-nexus-staging -DpomFile=java/rocksdbjni-3.5.0.pom -Dfile=java/rocksdbjni-3.5.0.jar rocksdbjava: OPT="-fPIC -DNDEBUG -O2" $(MAKE) $(LIBRARY) -j32 From df08a2d03c94d38da89672d45b28e30182349ac7 Mon Sep 17 00:00:00 2001 From: Chris Riccomini Date: Thu, 2 Oct 2014 13:47:07 -0700 Subject: [PATCH 13/25] add single rocksdbjni pom --- java/rocksdbjni-3.5.0.pom | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 java/rocksdbjni-3.5.0.pom diff --git a/java/rocksdbjni-3.5.0.pom b/java/rocksdbjni-3.5.0.pom new file mode 100644 index 000000000..109ae7b11 --- /dev/null +++ b/java/rocksdbjni-3.5.0.pom @@ -0,0 +1,34 @@ + + + 4.0.0 + RocksDB JNI + http://rocksdb.org/ + org.rocksdb + rocksdbjni + 3.5.0 + RocksDB fat jar that contains .so files for linux32 and linux64, and jnilib files for Mac OSX. + + + Apache License 2.0 + http://www.apache.org/licenses/LICENSE-2.0.html + repo + + + + scm:git:git://github.com/dropwizard/metrics.git + scm:git:git@github.com:dropwizard/metrics.git + http://github.com/dropwizard/metrics/ + HEAD + + + + Facebook + help@facebook.com + America/New_York + + architect + + + + From 2e80124982567cd0c9d1a23f6e2ca6ee2551741d Mon Sep 17 00:00:00 2001 From: Chris Riccomini Date: Thu, 2 Oct 2014 13:57:54 -0700 Subject: [PATCH 14/25] add javadoc and sources targets for sonatype --- Makefile | 7 ++++++- java/Makefile | 6 +++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 01bb170a2..8341e9772 100644 --- a/Makefile +++ b/Makefile @@ -518,6 +518,8 @@ ARCH := $(shell getconf LONG_BIT) ROCKSDBJNILIB = librocksdbjni-linux$(ARCH).so ROCKSDB_JAR = rocksdbjni-$(ROCKSDB_MAJOR).$(ROCKSDB_MINOR).$(ROCKSDB_PATCH)-linux$(ARCH).jar ROCKSDB_JAR_ALL = rocksdbjni-$(ROCKSDB_MAJOR).$(ROCKSDB_MINOR).$(ROCKSDB_PATCH).jar +ROCKSDB_JAVADOCS_JAR = rocksdbjni-$(ROCKSDB_MAJOR).$(ROCKSDB_MINOR).$(ROCKSDB_PATCH)-javadocs.jar +ROCKSDB_SOURCES_JAR = rocksdbjni-$(ROCKSDB_MAJOR).$(ROCKSDB_MINOR).$(ROCKSDB_PATCH)-sources.jar ifeq ($(PLATFORM), OS_MACOSX) ROCKSDBJNILIB = librocksdbjni-osx.jnilib @@ -554,13 +556,16 @@ rocksdbjavastatic: libz.a libbz2.a libsnappy.a 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) - + cd java/javadocs;jar -cf ../$(ROCKSDB_JAVADOCS_JAR) * + cd java;jar -cf $(ROCKSDB_SOURCES_JAR) org rocksdbjavastaticrelease: rocksdbjavastatic cd java/crossbuild && vagrant destroy -f && vagrant up linux32 && vagrant halt linux32 && vagrant up linux64 && vagrant halt linux64 cd java;jar -cf $(ROCKSDB_JAR_ALL) org/rocksdb/*.class org/rocksdb/util/*.class HISTORY*.md librocksdbjni-*.so librocksdbjni-*.jnilib rocksdbjavastaticpublish: + mvn gpg:sign-and-deploy-file -Durl=https://oss.sonatype.org/service/local/staging/deploy/maven2/ -DrepositoryId=sonatype-nexus-staging -DpomFile=java/rocksdbjni-3.5.0.pom -Dfile=java/rocksdbjni-3.5.0-javadocs.jar -Dclassifier=javadocs + mvn gpg:sign-and-deploy-file -Durl=https://oss.sonatype.org/service/local/staging/deploy/maven2/ -DrepositoryId=sonatype-nexus-staging -DpomFile=java/rocksdbjni-3.5.0.pom -Dfile=java/rocksdbjni-3.5.0-sources.jar -Dclassifier=sources mvn gpg:sign-and-deploy-file -Durl=https://oss.sonatype.org/service/local/staging/deploy/maven2/ -DrepositoryId=sonatype-nexus-staging -DpomFile=java/rocksdbjni-3.5.0.pom -Dfile=java/rocksdbjni-3.5.0-linux64.jar -Dclassifier=linux64 mvn gpg:sign-and-deploy-file -Durl=https://oss.sonatype.org/service/local/staging/deploy/maven2/ -DrepositoryId=sonatype-nexus-staging -DpomFile=java/rocksdbjni-3.5.0.pom -Dfile=java/rocksdbjni-3.5.0-linux32.jar -Dclassifier=linux32 mvn gpg:sign-and-deploy-file -Durl=https://oss.sonatype.org/service/local/staging/deploy/maven2/ -DrepositoryId=sonatype-nexus-staging -DpomFile=java/rocksdbjni-3.5.0.pom -Dfile=java/rocksdbjni-3.5.0-osx.jar -Dclassifier=osx diff --git a/java/Makefile b/java/Makefile index 2741f36d3..dec0480dc 100644 --- a/java/Makefile +++ b/java/Makefile @@ -15,8 +15,12 @@ endif clean: -find . -name "*.class" -exec rm {} \; -find . -name "hs*.log" -exec rm {} \; + rm -rf javadocs/* -java: +javadocs: + mkdir -p javadocs; javadoc -d javadocs -sourcepath . -subpackages org + +java: javadocs javac org/rocksdb/util/*.java org/rocksdb/*.java @cp ../HISTORY.md ./HISTORY-CPP.md @rm -f ./HISTORY-CPP.md From 8322cf000619872e36501681369e54f5dce5a6ec Mon Sep 17 00:00:00 2001 From: Chris Riccomini Date: Thu, 2 Oct 2014 14:13:09 -0700 Subject: [PATCH 15/25] use javadoc instead of javadocs --- .gitignore | 1 + Makefile | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 638f236c7..0e53ea35b 100644 --- a/.gitignore +++ b/.gitignore @@ -37,3 +37,4 @@ unity.cc java/crossbuild/.vagrant .vagrant/ java/**.asc +java/javadocs diff --git a/Makefile b/Makefile index 8341e9772..6fd3fa802 100644 --- a/Makefile +++ b/Makefile @@ -518,7 +518,7 @@ ARCH := $(shell getconf LONG_BIT) ROCKSDBJNILIB = librocksdbjni-linux$(ARCH).so ROCKSDB_JAR = rocksdbjni-$(ROCKSDB_MAJOR).$(ROCKSDB_MINOR).$(ROCKSDB_PATCH)-linux$(ARCH).jar ROCKSDB_JAR_ALL = rocksdbjni-$(ROCKSDB_MAJOR).$(ROCKSDB_MINOR).$(ROCKSDB_PATCH).jar -ROCKSDB_JAVADOCS_JAR = rocksdbjni-$(ROCKSDB_MAJOR).$(ROCKSDB_MINOR).$(ROCKSDB_PATCH)-javadocs.jar +ROCKSDB_JAVADOCS_JAR = rocksdbjni-$(ROCKSDB_MAJOR).$(ROCKSDB_MINOR).$(ROCKSDB_PATCH)-javadoc.jar ROCKSDB_SOURCES_JAR = rocksdbjni-$(ROCKSDB_MAJOR).$(ROCKSDB_MINOR).$(ROCKSDB_PATCH)-sources.jar ifeq ($(PLATFORM), OS_MACOSX) @@ -564,7 +564,7 @@ rocksdbjavastaticrelease: rocksdbjavastatic cd java;jar -cf $(ROCKSDB_JAR_ALL) org/rocksdb/*.class org/rocksdb/util/*.class HISTORY*.md librocksdbjni-*.so librocksdbjni-*.jnilib rocksdbjavastaticpublish: - mvn gpg:sign-and-deploy-file -Durl=https://oss.sonatype.org/service/local/staging/deploy/maven2/ -DrepositoryId=sonatype-nexus-staging -DpomFile=java/rocksdbjni-3.5.0.pom -Dfile=java/rocksdbjni-3.5.0-javadocs.jar -Dclassifier=javadocs + mvn gpg:sign-and-deploy-file -Durl=https://oss.sonatype.org/service/local/staging/deploy/maven2/ -DrepositoryId=sonatype-nexus-staging -DpomFile=java/rocksdbjni-3.5.0.pom -Dfile=java/rocksdbjni-3.5.0-javadoc.jar -Dclassifier=javadoc mvn gpg:sign-and-deploy-file -Durl=https://oss.sonatype.org/service/local/staging/deploy/maven2/ -DrepositoryId=sonatype-nexus-staging -DpomFile=java/rocksdbjni-3.5.0.pom -Dfile=java/rocksdbjni-3.5.0-sources.jar -Dclassifier=sources mvn gpg:sign-and-deploy-file -Durl=https://oss.sonatype.org/service/local/staging/deploy/maven2/ -DrepositoryId=sonatype-nexus-staging -DpomFile=java/rocksdbjni-3.5.0.pom -Dfile=java/rocksdbjni-3.5.0-linux64.jar -Dclassifier=linux64 mvn gpg:sign-and-deploy-file -Durl=https://oss.sonatype.org/service/local/staging/deploy/maven2/ -DrepositoryId=sonatype-nexus-staging -DpomFile=java/rocksdbjni-3.5.0.pom -Dfile=java/rocksdbjni-3.5.0-linux32.jar -Dclassifier=linux32 From 2d72f7807f432ce12d2aac3f7509b6ad3a359d32 Mon Sep 17 00:00:00 2001 From: Chris Riccomini Date: Thu, 2 Oct 2014 14:26:52 -0700 Subject: [PATCH 16/25] update release docs in java --- java/RELEASE.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/java/RELEASE.md b/java/RELEASE.md index c54cadffe..6792c0004 100644 --- a/java/RELEASE.md +++ b/java/RELEASE.md @@ -20,10 +20,12 @@ You can find all native binaries and JARs in the java directory upon completion: librocksdbjni-linux32.so librocksdbjni-linux64.so librocksdbjni-osx.jnilib - rocksdbjni-all.jar - rocksdbjni-linux32.jar - rocksdbjni-linux64.jar - rocksdbjni-osx.jar + rocksdbjni-3.5.0-javadoc.jar + rocksdbjni-3.5.0-linux32.jar + rocksdbjni-3.5.0-linux64.jar + rocksdbjni-3.5.0-osx.jar + rocksdbjni-3.5.0-sources.jar + rocksdbjni-3.5.0.jar ## Maven publication From 2a1add6731dca246f97a4c86a52240aec224cfbd Mon Sep 17 00:00:00 2001 From: Chris Riccomini Date: Thu, 2 Oct 2014 14:31:14 -0700 Subject: [PATCH 17/25] use proper major/minor/micro version rather than hard coding 3.5.0 --- Makefile | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 6fd3fa802..5d6b1d7bf 100644 --- a/Makefile +++ b/Makefile @@ -564,12 +564,12 @@ rocksdbjavastaticrelease: rocksdbjavastatic cd java;jar -cf $(ROCKSDB_JAR_ALL) org/rocksdb/*.class org/rocksdb/util/*.class HISTORY*.md librocksdbjni-*.so librocksdbjni-*.jnilib rocksdbjavastaticpublish: - mvn gpg:sign-and-deploy-file -Durl=https://oss.sonatype.org/service/local/staging/deploy/maven2/ -DrepositoryId=sonatype-nexus-staging -DpomFile=java/rocksdbjni-3.5.0.pom -Dfile=java/rocksdbjni-3.5.0-javadoc.jar -Dclassifier=javadoc - mvn gpg:sign-and-deploy-file -Durl=https://oss.sonatype.org/service/local/staging/deploy/maven2/ -DrepositoryId=sonatype-nexus-staging -DpomFile=java/rocksdbjni-3.5.0.pom -Dfile=java/rocksdbjni-3.5.0-sources.jar -Dclassifier=sources - mvn gpg:sign-and-deploy-file -Durl=https://oss.sonatype.org/service/local/staging/deploy/maven2/ -DrepositoryId=sonatype-nexus-staging -DpomFile=java/rocksdbjni-3.5.0.pom -Dfile=java/rocksdbjni-3.5.0-linux64.jar -Dclassifier=linux64 - mvn gpg:sign-and-deploy-file -Durl=https://oss.sonatype.org/service/local/staging/deploy/maven2/ -DrepositoryId=sonatype-nexus-staging -DpomFile=java/rocksdbjni-3.5.0.pom -Dfile=java/rocksdbjni-3.5.0-linux32.jar -Dclassifier=linux32 - mvn gpg:sign-and-deploy-file -Durl=https://oss.sonatype.org/service/local/staging/deploy/maven2/ -DrepositoryId=sonatype-nexus-staging -DpomFile=java/rocksdbjni-3.5.0.pom -Dfile=java/rocksdbjni-3.5.0-osx.jar -Dclassifier=osx - mvn gpg:sign-and-deploy-file -Durl=https://oss.sonatype.org/service/local/staging/deploy/maven2/ -DrepositoryId=sonatype-nexus-staging -DpomFile=java/rocksdbjni-3.5.0.pom -Dfile=java/rocksdbjni-3.5.0.jar + mvn gpg:sign-and-deploy-file -Durl=https://oss.sonatype.org/service/local/staging/deploy/maven2/ -DrepositoryId=sonatype-nexus-staging -DpomFile=java/rocksdbjni-$(ROCKSDB_MAJOR).$(ROCKSDB_MINOR).$(ROCKSDB_PATCH).pom -Dfile=java/rocksdbjni-$(ROCKSDB_MAJOR).$(ROCKSDB_MINOR).$(ROCKSDB_PATCH)-javadoc.jar -Dclassifier=javadoc + mvn gpg:sign-and-deploy-file -Durl=https://oss.sonatype.org/service/local/staging/deploy/maven2/ -DrepositoryId=sonatype-nexus-staging -DpomFile=java/rocksdbjni-$(ROCKSDB_MAJOR).$(ROCKSDB_MINOR).$(ROCKSDB_PATCH).pom -Dfile=java/rocksdbjni-$(ROCKSDB_MAJOR).$(ROCKSDB_MINOR).$(ROCKSDB_PATCH)-sources.jar -Dclassifier=sources + mvn gpg:sign-and-deploy-file -Durl=https://oss.sonatype.org/service/local/staging/deploy/maven2/ -DrepositoryId=sonatype-nexus-staging -DpomFile=java/rocksdbjni-$(ROCKSDB_MAJOR).$(ROCKSDB_MINOR).$(ROCKSDB_PATCH).pom -Dfile=java/rocksdbjni-$(ROCKSDB_MAJOR).$(ROCKSDB_MINOR).$(ROCKSDB_PATCH)-linux64.jar -Dclassifier=linux64 + mvn gpg:sign-and-deploy-file -Durl=https://oss.sonatype.org/service/local/staging/deploy/maven2/ -DrepositoryId=sonatype-nexus-staging -DpomFile=java/rocksdbjni-$(ROCKSDB_MAJOR).$(ROCKSDB_MINOR).$(ROCKSDB_PATCH).pom -Dfile=java/rocksdbjni-$(ROCKSDB_MAJOR).$(ROCKSDB_MINOR).$(ROCKSDB_PATCH)-linux32.jar -Dclassifier=linux32 + mvn gpg:sign-and-deploy-file -Durl=https://oss.sonatype.org/service/local/staging/deploy/maven2/ -DrepositoryId=sonatype-nexus-staging -DpomFile=java/rocksdbjni-$(ROCKSDB_MAJOR).$(ROCKSDB_MINOR).$(ROCKSDB_PATCH).pom -Dfile=java/rocksdbjni-$(ROCKSDB_MAJOR).$(ROCKSDB_MINOR).$(ROCKSDB_PATCH)-osx.jar -Dclassifier=osx + mvn gpg:sign-and-deploy-file -Durl=https://oss.sonatype.org/service/local/staging/deploy/maven2/ -DrepositoryId=sonatype-nexus-staging -DpomFile=java/rocksdbjni-$(ROCKSDB_MAJOR).$(ROCKSDB_MINOR).$(ROCKSDB_PATCH).pom -Dfile=java/rocksdbjni-$(ROCKSDB_MAJOR).$(ROCKSDB_MINOR).$(ROCKSDB_PATCH).jar rocksdbjava: OPT="-fPIC -DNDEBUG -O2" $(MAKE) $(LIBRARY) -j32 From c832f1644af7f9536c7a3dd09671f3b36b1e494c Mon Sep 17 00:00:00 2001 From: Chris Riccomini Date: Thu, 2 Oct 2014 14:42:49 -0700 Subject: [PATCH 18/25] add not about updating pom version and rename pom to be unversioned --- Makefile | 12 ++++++------ java/RELEASE.md | 2 ++ java/{rocksdbjni-3.5.0.pom => rocksjni.pom} | 0 3 files changed, 8 insertions(+), 6 deletions(-) rename java/{rocksdbjni-3.5.0.pom => rocksjni.pom} (100%) diff --git a/Makefile b/Makefile index 5d6b1d7bf..d03ceddc1 100644 --- a/Makefile +++ b/Makefile @@ -564,12 +564,12 @@ rocksdbjavastaticrelease: rocksdbjavastatic cd java;jar -cf $(ROCKSDB_JAR_ALL) org/rocksdb/*.class org/rocksdb/util/*.class HISTORY*.md librocksdbjni-*.so librocksdbjni-*.jnilib rocksdbjavastaticpublish: - mvn gpg:sign-and-deploy-file -Durl=https://oss.sonatype.org/service/local/staging/deploy/maven2/ -DrepositoryId=sonatype-nexus-staging -DpomFile=java/rocksdbjni-$(ROCKSDB_MAJOR).$(ROCKSDB_MINOR).$(ROCKSDB_PATCH).pom -Dfile=java/rocksdbjni-$(ROCKSDB_MAJOR).$(ROCKSDB_MINOR).$(ROCKSDB_PATCH)-javadoc.jar -Dclassifier=javadoc - mvn gpg:sign-and-deploy-file -Durl=https://oss.sonatype.org/service/local/staging/deploy/maven2/ -DrepositoryId=sonatype-nexus-staging -DpomFile=java/rocksdbjni-$(ROCKSDB_MAJOR).$(ROCKSDB_MINOR).$(ROCKSDB_PATCH).pom -Dfile=java/rocksdbjni-$(ROCKSDB_MAJOR).$(ROCKSDB_MINOR).$(ROCKSDB_PATCH)-sources.jar -Dclassifier=sources - mvn gpg:sign-and-deploy-file -Durl=https://oss.sonatype.org/service/local/staging/deploy/maven2/ -DrepositoryId=sonatype-nexus-staging -DpomFile=java/rocksdbjni-$(ROCKSDB_MAJOR).$(ROCKSDB_MINOR).$(ROCKSDB_PATCH).pom -Dfile=java/rocksdbjni-$(ROCKSDB_MAJOR).$(ROCKSDB_MINOR).$(ROCKSDB_PATCH)-linux64.jar -Dclassifier=linux64 - mvn gpg:sign-and-deploy-file -Durl=https://oss.sonatype.org/service/local/staging/deploy/maven2/ -DrepositoryId=sonatype-nexus-staging -DpomFile=java/rocksdbjni-$(ROCKSDB_MAJOR).$(ROCKSDB_MINOR).$(ROCKSDB_PATCH).pom -Dfile=java/rocksdbjni-$(ROCKSDB_MAJOR).$(ROCKSDB_MINOR).$(ROCKSDB_PATCH)-linux32.jar -Dclassifier=linux32 - mvn gpg:sign-and-deploy-file -Durl=https://oss.sonatype.org/service/local/staging/deploy/maven2/ -DrepositoryId=sonatype-nexus-staging -DpomFile=java/rocksdbjni-$(ROCKSDB_MAJOR).$(ROCKSDB_MINOR).$(ROCKSDB_PATCH).pom -Dfile=java/rocksdbjni-$(ROCKSDB_MAJOR).$(ROCKSDB_MINOR).$(ROCKSDB_PATCH)-osx.jar -Dclassifier=osx - mvn gpg:sign-and-deploy-file -Durl=https://oss.sonatype.org/service/local/staging/deploy/maven2/ -DrepositoryId=sonatype-nexus-staging -DpomFile=java/rocksdbjni-$(ROCKSDB_MAJOR).$(ROCKSDB_MINOR).$(ROCKSDB_PATCH).pom -Dfile=java/rocksdbjni-$(ROCKSDB_MAJOR).$(ROCKSDB_MINOR).$(ROCKSDB_PATCH).jar + mvn gpg:sign-and-deploy-file -Durl=https://oss.sonatype.org/service/local/staging/deploy/maven2/ -DrepositoryId=sonatype-nexus-staging -DpomFile=java/rocksjni.pom -Dfile=java/rocksdbjni-$(ROCKSDB_MAJOR).$(ROCKSDB_MINOR).$(ROCKSDB_PATCH)-javadoc.jar -Dclassifier=javadoc + mvn gpg:sign-and-deploy-file -Durl=https://oss.sonatype.org/service/local/staging/deploy/maven2/ -DrepositoryId=sonatype-nexus-staging -DpomFile=java/rocksjni.pom -Dfile=java/rocksdbjni-$(ROCKSDB_MAJOR).$(ROCKSDB_MINOR).$(ROCKSDB_PATCH)-sources.jar -Dclassifier=sources + mvn gpg:sign-and-deploy-file -Durl=https://oss.sonatype.org/service/local/staging/deploy/maven2/ -DrepositoryId=sonatype-nexus-staging -DpomFile=java/rocksjni.pom -Dfile=java/rocksdbjni-$(ROCKSDB_MAJOR).$(ROCKSDB_MINOR).$(ROCKSDB_PATCH)-linux64.jar -Dclassifier=linux64 + mvn gpg:sign-and-deploy-file -Durl=https://oss.sonatype.org/service/local/staging/deploy/maven2/ -DrepositoryId=sonatype-nexus-staging -DpomFile=java/rocksjni.pom -Dfile=java/rocksdbjni-$(ROCKSDB_MAJOR).$(ROCKSDB_MINOR).$(ROCKSDB_PATCH)-linux32.jar -Dclassifier=linux32 + mvn gpg:sign-and-deploy-file -Durl=https://oss.sonatype.org/service/local/staging/deploy/maven2/ -DrepositoryId=sonatype-nexus-staging -DpomFile=java/rocksjni.pom -Dfile=java/rocksdbjni-$(ROCKSDB_MAJOR).$(ROCKSDB_MINOR).$(ROCKSDB_PATCH)-osx.jar -Dclassifier=osx + mvn gpg:sign-and-deploy-file -Durl=https://oss.sonatype.org/service/local/staging/deploy/maven2/ -DrepositoryId=sonatype-nexus-staging -DpomFile=java/rocksjni.pom -Dfile=java/rocksdbjni-$(ROCKSDB_MAJOR).$(ROCKSDB_MINOR).$(ROCKSDB_PATCH).jar rocksdbjava: OPT="-fPIC -DNDEBUG -O2" $(MAKE) $(LIBRARY) -j32 diff --git a/java/RELEASE.md b/java/RELEASE.md index 6792c0004..d2028073c 100644 --- a/java/RELEASE.md +++ b/java/RELEASE.md @@ -41,6 +41,8 @@ Set ~/.m2/settings.xml to contain: +Then update rocksjni.pom's version tag to reflect the release version. + From RocksDB's root directory, first build the Java static JARs: make jclean clean rocksdbjavastaticrelease diff --git a/java/rocksdbjni-3.5.0.pom b/java/rocksjni.pom similarity index 100% rename from java/rocksdbjni-3.5.0.pom rename to java/rocksjni.pom From a1d3f0d2b23b533320ade5344c9afe34f77924e3 Mon Sep 17 00:00:00 2001 From: Chris Riccomini Date: Thu, 2 Oct 2014 14:49:46 -0700 Subject: [PATCH 19/25] don't fail if javadocs diretory doesn't exist --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index d03ceddc1..c6b5404da 100644 --- a/Makefile +++ b/Makefile @@ -556,7 +556,7 @@ rocksdbjavastatic: libz.a libbz2.a libsnappy.a 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) - cd java/javadocs;jar -cf ../$(ROCKSDB_JAVADOCS_JAR) * + mkdir -p java/javadocs;cd java/javadocs;jar -cf ../$(ROCKSDB_JAVADOCS_JAR) * cd java;jar -cf $(ROCKSDB_SOURCES_JAR) org rocksdbjavastaticrelease: rocksdbjavastatic From 45d526e226dd99a6a25bffbfbbc2ea1a3a63b7e2 Mon Sep 17 00:00:00 2001 From: Chris Riccomini Date: Thu, 2 Oct 2014 14:57:18 -0700 Subject: [PATCH 20/25] singular javadoc directory --- Makefile | 2 +- java/Makefile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 8abcfee18..5d3f954de 100644 --- a/Makefile +++ b/Makefile @@ -560,7 +560,7 @@ rocksdbjavastatic: libz.a libbz2.a libsnappy.a 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) - mkdir -p java/javadocs;cd java/javadocs;jar -cf ../$(ROCKSDB_JAVADOCS_JAR) * + cd java/javadoc;jar -cf ../$(ROCKSDB_JAVADOCS_JAR) * cd java;jar -cf $(ROCKSDB_SOURCES_JAR) org rocksdbjavastaticrelease: rocksdbjavastatic diff --git a/java/Makefile b/java/Makefile index 4ee73daf9..a500e599e 100644 --- a/java/Makefile +++ b/java/Makefile @@ -18,7 +18,7 @@ clean: rm -rf javadocs/* javadocs: - mkdir -p javadocs; javadoc -d javadocs -sourcepath . -subpackages org + mkdir -p javadoc; javadoc -d javadoc -sourcepath . -subpackages org java: javadocs javac org/rocksdb/util/*.java org/rocksdb/*.java From 99744e0c4b5fe2e20c59908cb7ca8317edf19cb0 Mon Sep 17 00:00:00 2001 From: Chris Riccomini Date: Thu, 2 Oct 2014 14:59:20 -0700 Subject: [PATCH 21/25] bump version to 3.6 --- java/rocksjni.pom | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java/rocksjni.pom b/java/rocksjni.pom index 109ae7b11..554357031 100644 --- a/java/rocksjni.pom +++ b/java/rocksjni.pom @@ -6,7 +6,7 @@ http://rocksdb.org/ org.rocksdb rocksdbjni - 3.5.0 + 3.6.0 RocksDB fat jar that contains .so files for linux32 and linux64, and jnilib files for Mac OSX. From e869fc6a887c6f176df8062a08e1931daf1db308 Mon Sep 17 00:00:00 2001 From: Chris Riccomini Date: Thu, 2 Oct 2014 15:46:49 -0700 Subject: [PATCH 22/25] remove proper javadoc directory --- java/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java/Makefile b/java/Makefile index a500e599e..b2038355c 100644 --- a/java/Makefile +++ b/java/Makefile @@ -15,7 +15,7 @@ endif clean: -find . -name "*.class" -exec rm {} \; -find . -name "hs*.log" -exec rm {} \; - rm -rf javadocs/* + rm -rf javadoc/* javadocs: mkdir -p javadoc; javadoc -d javadoc -sourcepath . -subpackages org From 6b2c1d962052cf1b5e6ebd24d74db22bf827ba05 Mon Sep 17 00:00:00 2001 From: Chris Riccomini Date: Mon, 6 Oct 2014 08:20:56 -0700 Subject: [PATCH 23/25] make publish jni jars depend on release jni jars --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 5d3f954de..9877eca04 100644 --- a/Makefile +++ b/Makefile @@ -567,7 +567,7 @@ rocksdbjavastaticrelease: rocksdbjavastatic cd java/crossbuild && vagrant destroy -f && vagrant up linux32 && vagrant halt linux32 && vagrant up linux64 && vagrant halt linux64 cd java;jar -cf $(ROCKSDB_JAR_ALL) org/rocksdb/*.class org/rocksdb/util/*.class HISTORY*.md librocksdbjni-*.so librocksdbjni-*.jnilib -rocksdbjavastaticpublish: +rocksdbjavastaticpublish: rocksdbjavastaticrelease mvn gpg:sign-and-deploy-file -Durl=https://oss.sonatype.org/service/local/staging/deploy/maven2/ -DrepositoryId=sonatype-nexus-staging -DpomFile=java/rocksjni.pom -Dfile=java/rocksdbjni-$(ROCKSDB_MAJOR).$(ROCKSDB_MINOR).$(ROCKSDB_PATCH)-javadoc.jar -Dclassifier=javadoc mvn gpg:sign-and-deploy-file -Durl=https://oss.sonatype.org/service/local/staging/deploy/maven2/ -DrepositoryId=sonatype-nexus-staging -DpomFile=java/rocksjni.pom -Dfile=java/rocksdbjni-$(ROCKSDB_MAJOR).$(ROCKSDB_MINOR).$(ROCKSDB_PATCH)-sources.jar -Dclassifier=sources mvn gpg:sign-and-deploy-file -Durl=https://oss.sonatype.org/service/local/staging/deploy/maven2/ -DrepositoryId=sonatype-nexus-staging -DpomFile=java/rocksjni.pom -Dfile=java/rocksdbjni-$(ROCKSDB_MAJOR).$(ROCKSDB_MINOR).$(ROCKSDB_PATCH)-linux64.jar -Dclassifier=linux64 From d44871e80f6aef63b5fa5f50155d8fc1f47a6b09 Mon Sep 17 00:00:00 2001 From: Chris Riccomini Date: Mon, 6 Oct 2014 08:23:31 -0700 Subject: [PATCH 24/25] fix java doc directory in git ignore --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 0e53ea35b..4ed05c5e3 100644 --- a/.gitignore +++ b/.gitignore @@ -37,4 +37,4 @@ unity.cc java/crossbuild/.vagrant .vagrant/ java/**.asc -java/javadocs +java/javadoc From 1e5a52815be9b4c84e3c3e2b6c3ab615bd4a907f Mon Sep 17 00:00:00 2001 From: Chris Riccomini Date: Mon, 6 Oct 2014 08:24:51 -0700 Subject: [PATCH 25/25] update release readme --- java/RELEASE.md | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/java/RELEASE.md b/java/RELEASE.md index d2028073c..16feae6ee 100644 --- a/java/RELEASE.md +++ b/java/RELEASE.md @@ -45,11 +45,7 @@ Then update rocksjni.pom's version tag to reflect the release version. From RocksDB's root directory, first build the Java static JARs: - make jclean clean rocksdbjavastaticrelease - -Then publish the release to Sonatype: - - make rocksdbjavastaticpublish + make jclean clean rocksdbjavastaticpublish This command will [stage the JAR artifacts on the Sonatype staging repository](http://central.sonatype.org/pages/manual-staging-bundle-creation-and-deployment.html). To release the staged artifacts.