From a65428d466a4e6cb44299fde9337bbf3410e6e4d Mon Sep 17 00:00:00 2001 From: Hiram Chirino Date: Thu, 23 Aug 2012 18:16:41 -0400 Subject: [PATCH] Make the build procedure on unix and windows more consistent. --- leveldbjni-linux32/pom.xml | 4 ++-- leveldbjni-linux64/pom.xml | 4 ++-- leveldbjni-osx/pom.xml | 6 ++---- .../java/org/fusesource/leveldbjni/test/DBTest.java | 10 ++++++---- pom.xml | 5 +---- readme.md | 8 ++++++-- 6 files changed, 19 insertions(+), 18 deletions(-) diff --git a/leveldbjni-linux32/pom.xml b/leveldbjni-linux32/pom.xml index 6c99594..366cf69 100755 --- a/leveldbjni-linux32/pom.xml +++ b/leveldbjni-linux32/pom.xml @@ -89,8 +89,8 @@ zip - --with-leveldb=${leveldb} - --with-snappy=${snappy} + --with-leveldb=${env.LEVELDB_HOME} + --with-snappy=${env.SNAPPY_HOME} diff --git a/leveldbjni-linux64/pom.xml b/leveldbjni-linux64/pom.xml index 8d9520f..e63d6f8 100755 --- a/leveldbjni-linux64/pom.xml +++ b/leveldbjni-linux64/pom.xml @@ -88,8 +88,8 @@ zip - --with-leveldb=${leveldb} - --with-snappy=${snappy} + --with-leveldb=${env.LEVELDB_HOME} + --with-snappy=${env.SNAPPY_HOME} diff --git a/leveldbjni-osx/pom.xml b/leveldbjni-osx/pom.xml index e281c05..cf31b8b 100755 --- a/leveldbjni-osx/pom.xml +++ b/leveldbjni-osx/pom.xml @@ -98,11 +98,9 @@ osx - --with-leveldb=${leveldb} - --with-snappy=${snappy} + --with-leveldb=${env.LEVELDB_HOME} + --with-snappy=${env.SNAPPY_HOME} --with-universal - --with-leveldb=${leveldb} - --with-snappy=${snappy} diff --git a/leveldbjni/src/test/java/org/fusesource/leveldbjni/test/DBTest.java b/leveldbjni/src/test/java/org/fusesource/leveldbjni/test/DBTest.java index d3e4862..726b216 100644 --- a/leveldbjni/src/test/java/org/fusesource/leveldbjni/test/DBTest.java +++ b/leveldbjni/src/test/java/org/fusesource/leveldbjni/test/DBTest.java @@ -396,19 +396,21 @@ public void testCompactRanges() throws IOException, InterruptedException, DBExce } String stats = db.getProperty("leveldb.stats"); + System.out.println(stats); // Compactions // Level Files Size(MB) Time(sec) Read(MB) Write(MB) // -------------------------------------------------- - assertTrue(stats.contains("1 2 2 0 0 2")); - assertTrue(stats.contains("2 1 1 0 0 1")); + assertTrue(stats.contains("1 2 8 0 0 8")); + assertTrue(stats.contains("2 1 4 0 0 4")); // After the compaction, level 1 and 2 should not have any files in it.. ((JniDB) db).compactRange(null, null); stats = db.getProperty("leveldb.stats"); - assertTrue(stats.contains("1 0 0 0 3 2")); - assertTrue(stats.contains("2 0 0 0 1 1")); + System.out.println(stats); + assertTrue(stats.contains("1 0 0 0 11 8")); + assertTrue(stats.contains("2 0 0 0 4 4")); } db.close(); diff --git a/pom.xml b/pom.xml index c007369..a88f3c5 100755 --- a/pom.xml +++ b/pom.xml @@ -259,10 +259,7 @@ - mac - + osx leveldbjni-osx diff --git a/readme.md b/readme.md index 296c1cb..d561c2f 100644 --- a/readme.md +++ b/readme.md @@ -216,13 +216,17 @@ Patch and Compile the leveldb project. This produces a static library. Now use maven to build the leveldbjni project. cd ../leveldbjni - mvn clean install -Dleveldb=`cd ../leveldb; pwd` -Dsnappy=`cd ../snappy-1.0.5; pwd` -P download -P ${platform} + export LEVELDB_HOME=`cd ../leveldb; pwd` + export SNAPPY_HOME=`cd ../snappy-1.0.5; pwd` + mvn clean install -P download -P ${platform} Replace ${platform} with one of the following platform identifiers (depending on the platform your building on): +* osx * linux32 * linux64 -* mac +* win32 +* win64 If your platform does not have the right auto-tools levels available just copy the `leveldbjni-${version}-SNAPSHOT-native-src.zip` artifact