From f8fedb1f99fa941ca64fd9ea82e615ad3c47fb9f Mon Sep 17 00:00:00 2001 From: Anil Kumar Date: Wed, 11 Feb 2015 15:37:46 -0500 Subject: [PATCH 1/4] Use bson-cxx as a submodule to have automatic fetch within bsontools --- .gitmodules | 3 +++ SConstruct | 10 +++++----- src/bsontools/bsonmain.cpp | 6 +++--- src/bsontools/cmdline.h | 2 +- src/bsontools/fromcsv.cpp | 4 ++-- src/bsontools/fromjson.cpp | 4 ++-- src/bsontools/fromxml.cpp | 6 +++--- src/bsontools/hex.cpp | 4 ++-- 8 files changed, 21 insertions(+), 18 deletions(-) create mode 100644 .gitmodules diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..190c457 --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "bson-cxx"] + path = bson-cxx + url = git@github.com:dwight/bson-cxx diff --git a/SConstruct b/SConstruct index f0c864c..69333cb 100644 --- a/SConstruct +++ b/SConstruct @@ -7,13 +7,13 @@ env.Append(CCFLAGS='-std=c++0x') env.Program(target = 'hex', source = ["src/bsontools/hex.cpp"]) dep1 = [ - "../bson-cxx/src/bson/time_support.cpp", - "../bson-cxx/src/bson/bson.cpp", - "../bson-cxx/src/bson/parse_number.cpp" ] + "bson-cxx/src/bson/time_support.cpp", + "bson-cxx/src/bson/bson.cpp", + "bson-cxx/src/bson/parse_number.cpp" ] dep2 = [ - "../bson-cxx/src/bson/json.cpp", - "../bson-cxx/src/bson/base64.cpp" + "bson-cxx/src/bson/json.cpp", + "bson-cxx/src/bson/base64.cpp" ] env.Program(target = 'fromcsv', source = ["src/bsontools/fromcsv.cpp"] + dep1) diff --git a/src/bsontools/bsonmain.cpp b/src/bsontools/bsonmain.cpp index 6549344..2dd9a18 100755 --- a/src/bsontools/bsonmain.cpp +++ b/src/bsontools/bsonmain.cpp @@ -1,9 +1,9 @@ #include #include #include "binary.h" -#include "../../../bson-cxx/src/bson/bsonobj.h" -#include "../../../bson-cxx/src/bson/bsonobjiterator.h" -#include "../../../bson-cxx/src/bson/bsonobjbuilder.h" +#include "../../bson-cxx/src/bson/bsonobj.h" +#include "../../bson-cxx/src/bson/bsonobjiterator.h" +#include "../../bson-cxx/src/bson/bsonobjbuilder.h" #include "cmdline.h" #include #include diff --git a/src/bsontools/cmdline.h b/src/bsontools/cmdline.h index c753d45..050f93f 100755 --- a/src/bsontools/cmdline.h +++ b/src/bsontools/cmdline.h @@ -2,7 +2,7 @@ #include #include -#include "../../../bson-cxx/src/bson/parse_number.h" +#include "../../bson-cxx/src/bson/parse_number.h" using namespace _bson; using namespace std; diff --git a/src/bsontools/fromcsv.cpp b/src/bsontools/fromcsv.cpp index 0f8bc16..90461d5 100755 --- a/src/bsontools/fromcsv.cpp +++ b/src/bsontools/fromcsv.cpp @@ -2,8 +2,8 @@ #include "binary.h" #include #include -#include "../../../bson-cxx/src/bson/json.h" -#include "../../../bson-cxx/src/bson/bsonobjbuilder.h" +#include "../../bson-cxx/src/bson/json.h" +#include "../../bson-cxx/src/bson/bsonobjbuilder.h" #include "cmdline.h" #include "parse_types.h" diff --git a/src/bsontools/fromjson.cpp b/src/bsontools/fromjson.cpp index 6623cda..97a8672 100755 --- a/src/bsontools/fromjson.cpp +++ b/src/bsontools/fromjson.cpp @@ -5,8 +5,8 @@ #include #include #include "binary.h" -#include "../../../bson-cxx/src/bson/json.h" -#include "../../../bson-cxx/src/bson/bsonobjbuilder.h" +#include "../../bson-cxx/src/bson/json.h" +#include "../../bson-cxx/src/bson/bsonobjbuilder.h" #include "cmdline.h" using namespace std; diff --git a/src/bsontools/fromxml.cpp b/src/bsontools/fromxml.cpp index dd100c3..a28aab5 100755 --- a/src/bsontools/fromxml.cpp +++ b/src/bsontools/fromxml.cpp @@ -5,9 +5,9 @@ #include #include #include "binary.h" -#include "../../../bson-cxx/src/bson/json.h" -#include "../../../bson-cxx/src/bson/bsonobjbuilder.h" -#include "../../../bson-cxx/src/bson/bsonobjiterator.h" +#include "../../bson-cxx/src/bson/json.h" +#include "../../bson-cxx/src/bson/bsonobjbuilder.h" +#include "../../bson-cxx/src/bson/bsonobjiterator.h" #include "cmdline.h" #include "parse_types.h" #include "../util/str.h" diff --git a/src/bsontools/hex.cpp b/src/bsontools/hex.cpp index 611b7a4..12f2083 100755 --- a/src/bsontools/hex.cpp +++ b/src/bsontools/hex.cpp @@ -2,8 +2,8 @@ #include #include "stdio.h" #include "binary.h" -#include "../../../bson-cxx/src/bson/hex.h" -#include "../../../bson-cxx/src/bson/endian.h" +#include "../../bson-cxx/src/bson/hex.h" +#include "../../bson-cxx/src/bson/endian.h" #include "cmdline.h" using namespace std; From bb89b400bcde522f682186036f7411c628c8eaec Mon Sep 17 00:00:00 2001 From: Anil Kumar Date: Wed, 11 Feb 2015 18:08:28 -0500 Subject: [PATCH 2/4] adding bson-cxx link --- bson-cxx | 1 + 1 file changed, 1 insertion(+) create mode 160000 bson-cxx diff --git a/bson-cxx b/bson-cxx new file mode 160000 index 0000000..99e3d06 --- /dev/null +++ b/bson-cxx @@ -0,0 +1 @@ +Subproject commit 99e3d069228039021281ec1bf0b0eefc085cb16d From 79d51ded95f7e6dcc8d57bc811203b15c828ea38 Mon Sep 17 00:00:00 2001 From: Anil Kumar Date: Wed, 11 Feb 2015 18:08:47 -0500 Subject: [PATCH 3/4] adding bson-cxx link --- .gitmodules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitmodules b/.gitmodules index 190c457..0254c39 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ [submodule "bson-cxx"] path = bson-cxx - url = git@github.com:dwight/bson-cxx + url = git://github.com/dwight/bson-cxx.git From 3744bd0b2904dd7dc54e38ff0101340e9a73205c Mon Sep 17 00:00:00 2001 From: Anil Kumar Date: Thu, 12 Feb 2015 08:04:07 -0500 Subject: [PATCH 4/4] Changes for submodule --- README.md | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 1943ac9..8553175 100755 --- a/README.md +++ b/README.md @@ -15,9 +15,8 @@ See the [doc/](doc) folder. ## Building -You will need the [bson-cxx](https://github.com/dwight/bson-cxx) library (a dependancy) to build the tools. It is available on github. - -Place it as a peer level directory on disk with bsontools. (That is you will see lines such as `#include "../../../bson-cxx/"` in the source code of these tools...) +The [bson-cxx](https://github.com/dwight/bson-cxx) library (a dependancy) is added as a submodule to this project and should be availble when building the tools. +Initially cloning a repository with --recursive will clone the submodule as well. To build with scons, assuming it is installed, just type "scons". @@ -43,7 +42,3 @@ Some automated tests would be real helpful for example... ## Support For help try posting to the [BSON Google Groups forum](https://groups.google.com/forum/#!forum/bson). - - - -