Bond is a cross-platform framework for working with schematized data. It supports cross-language de/serialization and powerful generic mechanisms for efficiently manipulating data. Bond is broadly used at Microsoft in high scale services.
Перейти к файлу
Chad Walters 9e4c9e4241 [gbc] Update SchemaDef struct full name in Java
Make the full name use the IDL namespace (as in C++ and C#).
2017-08-21 15:00:21 -07:00
cmake [Java] Addressed PR feedback on CMake 2017-08-01 16:58:56 -07:00
compiler [gbc] Update SchemaDef struct full name in Java 2017-08-21 15:00:21 -07:00
cpp c++ core: Add documentation for untagged bonded. 2017-08-14 10:29:17 -07:00
cs Add Java codegen filter to compiler project 2017-08-21 15:00:21 -07:00
doc [C#] Remove support for .NET 4.0 2017-06-29 13:24:14 -07:00
examples java core: Change all constructor version args to int. 2017-08-21 14:50:41 -07:00
idl/bond [comm] Remove duplicate transport .bond files 2016-11-16 16:51:58 -08:00
interop java: Add missing copyright notices. 2017-05-22 14:21:45 -07:00
java [gbc] Update SchemaDef struct full name in Java 2017-08-21 15:00:21 -07:00
python [c++] Remove bond::customize<protocols> 2017-06-12 17:59:44 -07:00
test/compat [grpc] Add events to gRPC compat tests 2017-06-05 17:08:23 -07:00
thirdparty [c++] Upgrade rapidjson to v1.1 2017-06-13 19:04:04 -07:00
tools [travis] Refine boost-builder README 2017-05-26 17:12:41 -07:00
.gitattributes Add .gitattributes to help with newline issues 2016-04-18 16:11:57 -07:00
.gitignore [C++ Comm] Initial commit of C++ Comm. 2016-10-31 14:47:20 -07:00
.gitmodules [c++ grpc] Add gRPC to CMake-based build 2017-04-27 17:58:54 -07:00
.travis.yml [c++] Don't build Comm by default 2017-07-12 14:28:44 -07:00
CHANGELOG.md [c++] Fix SimpleJSON map deserializtion 2017-07-12 14:36:28 -07:00
CMakeLists.txt [C++ gRPC] Update cmake flags in scripts/configs 2017-05-19 13:15:03 -07:00
CONTRIBUTING.md Indent sub-lists by 4 spaces for Pandoc 2016-11-14 14:35:10 -08:00
LICENSE Initial commit 2015-01-09 11:21:05 -08:00
README.md [c++] Don't build Comm by default 2017-07-12 14:28:44 -07:00
ThirdPartyNotices.txt Add third-party notices file 2017-05-12 14:48:26 -07:00
appveyor.yml [c++] Don't build Comm by default 2017-07-12 14:28:44 -07:00

README.md

The Bond logo: a stylized glue gun


Build Status Bond.CSharp NuGet package

Bond

Bond is an open source, cross-platform framework for working with schematized data. It supports cross-language serialization/deserialization and powerful generic mechanisms for efficiently manipulating data. Bond is broadly used at Microsoft in high scale services.

IMPORTANT NOTE: The Bond Communications framework -- known as Bond Comm -- is deprecated. We recommend using Bond-over-gRPC for communication. The Bond Comm C# manual and the Bond Comm C++ manual are preserved for transition purposes.

Bond is published on GitHub at https://github.com/Microsoft/bond/.

For details, see the User's Manuals:

For a discussion how Bond compares to similar frameworks see Why Bond.

Dependencies

The Bond repository uses Git submodules and should be cloned with the --recursive flag:

git clone --recursive https://github.com/Microsoft/bond.git

In order to build Bond you will need CMake (3.1+), Haskell Stack and Boost (1.58+). Bond's C++ library requires some C++11 features (currently limited to those supported bv Visual C++ 2013). (Note: Boost 1.59 may not work with Bond Comm due to some bugs in that version of the Boost ASIO library).

Following are specific instructions for building on various platforms.

Linux

Bond can be built with Clang (3.4+) or GNU C++ (4.7+). We recommend the latest version of Clang as it's much faster with template-heavy code like Bond.

Run the following commands to install the minimal set of packages needed to build the core Bond library on Ubuntu 14.04:

sudo apt-get install \
    clang \
    cmake \
    zlib1g-dev \
    libboost-dev \
    libboost-thread-dev

In the root bond directory run:

mkdir build
cd build
cmake .. -DBOND_ENABLE_GRPC=FALSE
make
sudo make install

The build directory is just an example. Any directory can be used as the build destination.

In order to build all the C++ and Python tests and examples, as well as Bond-over-gRPC, a few more packages are needed, and CMake needs to be run with different options:

sudo apt-get install \
    autoconf \
    build-essential \
    libboost-date-time-dev \
    libboost-python-dev \
    libboost-test-dev \
    libtool \
    python2.7-dev

cd build # or wherever you ran CMake before
cmake .. -DBOND_ENABLE_GRPC=TRUE -DgRPC_ZLIB_PROVIDER=package

Running the following command in the build directory will build and execute all the tests and examples:

make --jobs 8 check

(The unit tests are large so you may want to run 4-8 build jobs in parallel, assuming you have enough memory.)

OS X

Install Xcode and then run the following command to install the required packages using Homebrew (http://brew.sh/):

brew install \
    cmake \
    haskell-stack \
    boost \
    boost-python

(boost-python is optional and only needed for Python support.)

Bond can be built on OS X using either standard *nix makefiles or Xcode. In order to generate and build from makefiles, in the root bond directory run:

mkdir build
cd build
cmake ..
make
sudo make install

Alternatively, you can generate Xcode projects by passing the -G Xcode option to cmake:

cmake -G Xcode ..

You can build and run unit tests by building the check target in Xcode or by running make in the build directory:

make --jobs 8 check

Note that if you are using Homebrew's Python, you'll need to build boost-python from source:

brew install --build-from-source boost-python

and tell cmake the location of Homebrew's libpython by setting the PYTHON_LIBRARY variable, e.g.:

cmake .. \
    -DPYTHON_LIBRARY=/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/libpython2.7.dylib

Windows

Build Status

Install the following tools:

If you are building on a network behind a proxy, set the environment variable HTTP_PROXY, e.g.:

set HTTP_PROXY=http://your-proxy-name:80

Now you are ready to build the C# 4.0/4.5 version of Bond. Open the solution file cs\cs.sln in Visual Studio and build as usual. The C# unit tests can also be run from within the solution.

To build the .NET Core version of Bond, run the build script. The -Test switch is used to run the unit tests as well.

.\cs\dnc\build -Test

The C++ and Python versions of Bond additionally require:

You may need to set the environment variables BOOST_ROOT and BOOST_LIBRARYDIR to specify where Boost and its pre-built libraries for your environment (MSVC 12 or MSVC 14) can be found, e.g.:

set BOOST_ROOT=D:\boost_1_58_0
set BOOST_LIBRARYDIR=D:\boost_1_58_0\lib64-msvc-14.0

The core Bond library and most examples only require Boost headers. The pre-built libraries are only needed for unit tests, Python, gRPC, and Comm support. If Boost or Python libraries are not found on the system, then some tests and examples will not be built.

In order to generate a solution to build the Bond Core C++ and Python with Visual Studio 2015 run the following commands from the root bond directory:

mkdir build
cd build
set PreferredToolArchitecture=x64
cmake -DBOND_ENABLE_GRPC=FALSE -G "Visual Studio 14 2015 Win64" ..

Setting PreferredToolArchitecture=x64 selects the 64-bit toolchain which dramatically improves build speed. (The Bond unit tests are too big to build with 32-bit tools.)

Instead of cmake you can also use cmake-gui and specify configuration settings in the UI. This configuration step has to be performed only once. From then on you can use the generated solution build\bond.sln from Visual Studio or build from command line using cmake:

cmake --build . --target
cmake --build . --target INSTALL

In order to build and execute the unit tests and examples run:

cmake --build . --target check -- /maxcpucount:8

To build Bond's gRPC++ integration from source, some of gRPC's prerequisites are also needed:

choco install activeperl golang ninja yasm

You will also need to enable gRPC in the cmake configuration step by running the following in the build directory from above and then following the other cmake commands above:

cmake -DBOND_ENABLE_GRPC=TRUE -G "Visual Studio 14 2015 Win64" ..

Contributing

Interested in contributing to Bond? Take a look at our contribution guidelines to get started.