{"id":13431662,"url":"https://github.com/Microsoft/bond","last_synced_at":"2025-03-16T12:31:03.691Z","repository":{"id":24605889,"uuid":"28014525","full_name":"microsoft/bond","owner":"microsoft","description":"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. ","archived":false,"fork":false,"pushed_at":"2024-06-27T07:41:20.000Z","size":17606,"stargazers_count":2605,"open_issues_count":142,"forks_count":322,"subscribers_count":196,"default_branch":"master","last_synced_at":"2024-09-21T09:13:58.767Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/microsoft.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2014-12-15T01:05:31.000Z","updated_at":"2024-09-20T23:47:02.000Z","dependencies_parsed_at":"2024-09-24T22:51:43.452Z","dependency_job_id":"98d43262-4e2b-4697-bf54-e9e368561b2d","html_url":"https://github.com/microsoft/bond","commit_stats":{"total_commits":1347,"total_committers":68,"mean_commits":"19.808823529411764","dds":0.6718634001484781,"last_synced_commit":"b13fee1b760119a79d038e43fb05d88e800fc7e5"},"previous_names":[],"tags_count":37,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microsoft%2Fbond","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microsoft%2Fbond/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microsoft%2Fbond/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microsoft%2Fbond/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/microsoft","download_url":"https://codeload.github.com/microsoft/bond/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221663621,"owners_count":16859867,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-31T02:01:04.883Z","updated_at":"2025-03-16T12:31:03.684Z","avatar_url":"https://github.com/microsoft.png","language":"C++","readme":"![The Bond logo: a stylized glue gun](https://raw.githubusercontent.com/microsoft/bond/master/doc/src/logos/bond-logo-64x64-white.png)\n\u003chr /\u003e\n\n[![Build Status](https://github.com/microsoft/bond/workflows/Linux%20CI/badge.svg?event=push)](https://github.com/microsoft/bond/actions?query=event%3Apush)\n[![Bond.CSharp NuGet package](https://img.shields.io/nuget/v/Bond.CSharp.svg?style=flat)](https://microsoft.github.io/bond/manual/bond_cs.html#nuget-packages)\n\n# Bond\n\nBond is an open-source, cross-platform framework for working with schematized\ndata. It supports cross-language serialization/deserialization and powerful\ngeneric mechanisms for efficiently manipulating data. Bond is broadly used at\nMicrosoft in high scale services.\n\nBond is published on GitHub at [https://github.com/microsoft/bond/](https://github.com/microsoft/bond/).\n\n## Bond open-source project ending March 2025\n\nThe Bond open-source project will be ending development on March 31, 2025.\nFor more information, see [the shutdown announcement\nissue](https://github.com/microsoft/bond/issues/1215).\n\n## Documentation\n\nFor details, see the User's Manuals:\n\n* [C++](https://microsoft.github.io/bond/manual/bond_cpp.html)\n* [C#](https://microsoft.github.io/bond/manual/bond_cs.html)\n* [Java](https://microsoft.github.io/bond/manual/bond_java.html)\n* [Python](https://microsoft.github.io/bond/manual/bond_py.html)\n* [`gbc`, the Bond compiler/codegen tool](https://microsoft.github.io/bond/manual/compiler.html)\n    * See also\n      [the compiler library](https://hackage.haskell.org/package/bond) that\n      powers `gbc`.\n\nFor a discussion about how Bond compares to similar frameworks see [Why Bond](https://microsoft.github.io/bond/why_bond.html).\n\n## Dependencies\n\nBond C++ library requires some C++11 features (currently limited to those\nsupported by Visual C++ 2015); a C++11 compiler is required. Additionally,\nto build Bond you will need CMake (3.1+),\n[Haskell Stack](https://docs.haskellstack.org/en/stable/README/#how-to-install)\n(1.5.1+) and Boost (1.61+).\n\nAdditionally, Bond requires RapidJSON. The Bond repository has a Git submodules for RapidJSON. It should be cloned with the `--recursive` flag:\n\n```bash\ngit clone --recursive https://github.com/microsoft/bond.git\n```\n\nIf you already have RapidJSON and would like to build against it, add argument `-DBOND_FIND_RAPIDJSON=TRUE` to the CMake invocation. It will use find_package(RapidJSON). If you do not provide a RapidJSON library, Bond will also install RapidJSON.\n\nFollowing are specific instructions for building on various platforms.\n\n### Linux\n\nBond must be built with C++11 compiler. We test with Clang (3.8) and GNU C++\n(5.4). We recommend Clang as it's faster with template-heavy code like Bond.\n\nRun the following commands to install the minimal set of packages needed to\nbuild the core Bond library on Ubuntu 14.04:\n\n```bash\nsudo apt-get install \\\n    clang \\\n    cmake \\\n    zlib1g-dev \\\n    libboost-dev \\\n    libboost-thread-dev\n```\n\nAdditionally, you need the [Haskell Tool\nStack](https://docs.haskellstack.org/en/stable/README/). If your distro isn't\nshipping a new enough version of it, you may encounter some non-obvious build\nfailures, so we recommend installing the latest Stack outside of package\nmanagement:\n\n```bash\ncurl -sSL https://get.haskellstack.org/ | sh\n```\n\nIn the root `bond` directory run:\n\n```bash\nmkdir build\ncd build\ncmake ..\nmake\nsudo make install\n```\n\nThe `build` directory is just an example. Any directory can be used as the\nbuild destination.\n\nTo build the Bond Python module and all the C++/Python tests and\nexamples, a few more packages are needed.\n\n```bash\nsudo apt-get install \\\n    autoconf \\\n    build-essential \\\n    libboost-date-time-dev \\\n    libboost-python-dev \\\n    libboost-test-dev \\\n    libtool \\\n    python2.7-dev\n```\n\nCMake needs to be re-run with different options. This can be done after\nbuilding just the core libraries: the build tree will simply be updated with\nthe new options.\n\n```bash\ncd build # or wherever you ran CMake before\n```\n\nRunning the following command in the `build` directory will build and execute all\nthe tests and examples:\n\n```bash\nmake --jobs 8 check\nsudo make install # To install the other libraries just built\n```\n\n(The unit tests are large so you may want to run 4-8 build jobs in parallel,\nassuming you have enough memory.)\n\n### macOS\n\nInstall Xcode and then run the following command to install the required\npackages using Homebrew ([http://brew.sh/](http://brew.sh/)):\n\n```bash\nbrew install \\\n    cmake \\\n    haskell-stack \\\n    boost \\\n    boost-python\n```\n\n(boost-python is optional and only needed for Python support.)\n\nBond can be built on macOS using either standard \\*nix makefiles or Xcode. In\norder to generate and build from makefiles, in the root `bond` directory run:\n\n```bash\nmkdir build\ncd build\ncmake ..\nmake\nsudo make install\n```\n\nAlternatively, you can generate Xcode projects by passing the `-G Xcode` option\nto cmake:\n\n```bash\ncmake -G Xcode ..\n```\n\nYou can build and run unit tests by building the `check` target in Xcode or by\nrunning make in the `build` directory:\n\n```bash\nmake --jobs 8 check\n```\n\nNote that if you are using Homebrew's Python, you'll need to build\nboost-python from source:\n\n```bash\nbrew install --build-from-source boost-python\n```\n\nand tell cmake the location of Homebrew's libpython by setting the\n`PYTHON_LIBRARY` variable, e.g.:\n\n```bash\ncmake .. \\\n    -DPYTHON_LIBRARY=/usr/local/Cellar/python/2.7.9/Frameworks/Python.framework/Versions/2.7/lib/libpython2.7.dylib\n```\n\n### Windows\n\n[![Build Status](https://ci.appveyor.com/api/projects/status/7xd2a54x9cwco314/branch/master?svg=true)](https://ci.appveyor.com/project/MicrosoftBond/bond/branch/master)\n\nInstall the following tools:\n\n- Visual Studio 2017 or newer. The following components are required:\n  - .NET Framework 4.6.2 targeting pack\n  - C++ development tools. A working C++ compiler is needed to build gbc.\n- .NET SDK ([https://dotnet.microsoft.com/en-us/download](https://dotnet.microsoft.com/en-us/download))\n- CMake ([http://www.cmake.org/download/](http://www.cmake.org/download/))\n- Haskell Stack ([https://docs.haskellstack.org/en/stable/install_and_upgrade/#windows](https://docs.haskellstack.org/en/stable/install_and_upgrade/#windows))\n\nIf you are building on a network behind a proxy, set the environment variable\n`HTTP_PROXY`, e.g.:\n\n```bash\nset HTTP_PROXY=http://your-proxy-name:80\n```\n\nNow you are ready to build the C# version of Bond. Open the solution file\n`cs\\cs.sln` in Visual Studio and build as usual. The C# unit tests can\nalso be run from within the solution.\n\nTo build using the .NET SDK:\n\n```bash\ndotnet restore cs\\cs.sln\ndotnet msbuild cs\\cs.sln\n```\n\nThe C++ and Python versions of Bond additionally require:\n\n- Boost 1.61+ ([http://www.boost.org/users/download/](http://www.boost.org/users/download/))\n- Python 2.7 ([https://www.python.org/downloads/](https://www.python.org/downloads/))\n\nYou may need to set the environment variables `BOOST_ROOT` and `BOOST_LIBRARYDIR`\nto specify where Boost and its pre-built libraries for your environment (MSVC 12 or MSVC 14) can be\nfound, e.g.:\n\n```bash\nset BOOST_ROOT=D:\\boost_1_61_0\nset BOOST_LIBRARYDIR=D:\\boost_1_61_0\\lib64-msvc-14.0\n```\n\nThe core Bond library and most examples only require Boost headers. The\npre-built libraries are only needed for unit tests, and Python. If Boost or\nPython libraries are not found on the system, then some tests and examples\nwill not be built.\n\nYou can also get an appropriate version of boost using the same approach as employed\nby CI.  The appveyor.yml file includes an invocation of:\n```\ntools\\ci-scripts\\windows\\Install-Boost.ps1 `\n                        -Version $env:BOND_BOOST `\n                        -VcToolSetVer $vcToolSetVer `\n                        -Components $boostComponents\n```\nwhich can also be invoked manually in order to download the relevant version, e.g.\n```\nInstall-Boost.ps1 -Version 1.61.0 -VcToolSetVer 14.0\n```\nThis will return the location to which the files were downloaded.  It will be a temporary\nlocation, so you should subsequently copy the directories to a more permanent location and\nthen configure your environment variables to point to those locations.\n\nTo generate a solution to build the Bond Core C++ and Python with Visual\nStudio 2015 run the following commands from the root `bond` directory:\n\n```bash\nmkdir build\ncd build\nset PreferredToolArchitecture=x64\ncmake -G \"Visual Studio 14 2015 Win64\" ..\n```\n\nSetting `PreferredToolArchitecture=x64` selects the 64-bit toolchain which\ndramatically improves build speed. (The Bond unit tests are too big to build\nwith 32-bit tools.)\n\nInstead of `cmake` you can also use `cmake-gui` and specify configuration\nsettings in the UI. This configuration step has to be performed only once. From\nthen on you can use the generated solution `build\\bond.sln` from Visual Studio\nor build from the command line using `cmake`:\n\n```bash\ncmake --build . --target\ncmake --build . --target INSTALL\n```\n\nTo build and execute the unit tests and examples run:\n\n```bash\ncmake --build . --target check -- /maxcpucount:8\n```\n\nAlternatively, you can build and install Bond using the [vcpkg](https://github.com/microsoft/vcpkg/) dependency manager:\n\n```batch\ngit clone https://github.com/microsoft/vcpkg.git\ncd vcpkg\n./bootstrap-vcpkg.bat\n./vcpkg integrate install\n./vcpkg install bond\n```\n\nThe Bond port in vcpkg is kept up to date by Microsoft team members and community contributors.\nIf the version is out of date, please [create an issue or pull request in the vcpkg repository](https://github.com/microsoft/vcpkg/issues/new/choose).\n\n## Contributing\n\nInterested in contributing to Bond? Take a look at our\n[contribution guidelines](https://github.com/microsoft/bond/blob/master/CONTRIBUTING.md)\nto get started.\n","funding_links":[],"categories":["Frameworks, Libraries and Tools","Serialization","正则表达式","框架, 库和工具","序列化"],"sub_categories":["Serialization","序列化"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMicrosoft%2Fbond","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FMicrosoft%2Fbond","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMicrosoft%2Fbond/lists"}