#####################################################################################
BEGIN ASSIST NOTICES
<>
This listing provides notice and guidance regarding the indicated items and should not be construed as an admission that the listed component appears in the distribution or in the manner indicated. For example, the listing may include various dependencies applicable only to development, testing, and evaluation, which may not be included in the distribution and, indeed, may have been deprecated in favor of alternatives. Similarly, fulfilling a license’s compliance requirements for a particular form of distribution is not an admission that the software is in fact distributed in that form. For example, some dependencies may be dual-licensed and may permit redistribution under different licenses. Distributions and packaging vary and not all third party components are relied upon in the same manner or degree. The presence of a dependency under a given header below is merely for organizational purposes and is not necessarily indicative of the relevant, or elected, license. Where dependency authors provided incomplete or inconsistent documentation, inferences have been made with the intention of giving effect to the dependency author’s desired intent. Note that some compliance documentation may be found in the software itself.
Where third party licenses require that an offer to provide relevant source code be made, in accordance with the terms of the third party license, please contact Magic Leap if you wish to receive such a copy.
<>
This listing provides notice and guidance regarding the indicated items and should not be construed as an admission that the listed component appears in the distribution or in the manner indicated. For example, the listing may include various dependencies applicable only to development, testing and evaluation, which may not be included in the distribution and, indeed, may have been deprecated in favour of alternatives. Similarly, fulfilling a licence's compliance requirements for a particular form of distribution is not an admission that the software is in fact distributed in that form. For example, some dependencies may be dual-licensed and may permit redistribution under different licences. Distributions and packaging vary and not all third-party components are relied upon in the same manner or degree. The presence of a dependency under a given header below is merely for organisational purposes and is not necessarily indicative of the relevant, or elected, licence. Where dependency authors provided incomplete or inconsistent documentation, inferences have been made with the intention of giving effect to the dependency author's desired intent. Note that some compliance documentation may be found in the software itself.
Where third-party licences require that an offer to provide relevant source code be made, in accordance with the terms of the third-party licence, please contact Magic Leap if you wish to receive such a copy.
<>
Die Auflistung enthält Hinweise und Anleitungen zu den angegebenen Komponenten. Sie gewährleistet nicht, dass die Komponenten in der vertriebenen Version enthalten sind oder in der angegebenen Weise erscheinen. In der Auflistung können beispielsweise verschiedene Abhängigkeiten enthalten sein, die nur für Entwicklungen, Tests und Bewertungen gelten, aber nicht in der vertriebenen Version enthalten sind und möglicherweise sogar durch Alternativen ersetzt wurden. Auch die Erfüllung der Compliance-Anforderungen einer Lizenz für eine bestimmte Vertriebsform gewährleistet nicht, dass die Software tatsächlich in dieser Form vertrieben wird. Einige Abhängigkeiten können beispielsweise doppelt lizenziert sein und den Weiterverkauf unter verschiedenen Lizenzen ermöglichen. Der Vertrieb und die Verpackung variieren. Nicht alle Komponenten von Drittanbietern werden auf die gleiche Weise oder im gleichen Umfang eingesetzt. Eine Abhängigkeit in einem der nachfolgenden Zusammenhänge dient lediglich organisatorischen Zwecken und ist kein zwingender Hinweis auf die entsprechende oder gewählte Lizenz. Wenn Autoren von Abhängigkeiten unvollständige oder inkonsistente Dokumentation bereitgestellt haben, wurden Rückschlüsse auf die Absicht des Autors der Abhängigkeit gezogen. Bestimmte Compliance-Dokumente sind direkt in der Software enthalten.
Wenn für Lizenzen von Drittanbietern ein Angebot zur Bereitstellung von relevantem Quellcode gemäß den Bedingungen der Drittanbieterlizenz erforderlich ist, fordern Sie dieses bei Magic Leap an.
<>
Cette liste fournit des mentions et des conseils concernant les éléments indiqués et ne signifie en aucun cas que le composant répertorié apparaît dans la distribution ou de la manière indiquée. Par exemple, la liste peut inclure différentes dépendances applicables uniquement au développement, aux tests et à l'évaluation, qui peuvent ne pas être incluses dans la distribution et qui peuvent en effet avoir été déconseillées au profit d'autres dépendances. De même, le respect des exigences de conformité d'une licence pour une forme de distribution particulière ne revient pas à admettre que le logiciel est effectivement distribué sous cette forme. Par exemple, certaines dépendances peuvent être sous double licence et permettre une redistribution sous des licences différentes. Les distributions et les packages varient, et tous les composants tiers ne sont pas utilisés de la même manière ou au même degré. La présence d'une dépendance sous un en-tête donné ci-dessous est uniquement destinée à des fins d'organisation et n'indique pas nécessairement la licence correspondante ou sélectionnée. Lorsque les auteurs de dépendances ont fourni une documentation incomplète ou incohérente, des inférences ont été effectuées dans l'intention de donner effet à l'intention souhaitée de l'auteur de la dépendance. Notez que certaines documentations de conformité sont disponibles dans le logiciel lui-même.
Si des licences tierces exigent qu'une offre de fourniture du code source approprié soit effectuée, conformément aux conditions de la licence tierce, contactez Magic Leap si vous souhaitez en recevoir une copie.
<>
Questo elenco fornisce avvisi e istruzioni relativi agli elementi indicati e non deve essere interpretato come una conferma che il componente in questione sia presente nella distribuzione o nella maniera indicata. Ad esempio, l'elenco può includere diverse dipendenze applicabili solo alle fasi di sviluppo, test e valutazione, che potrebbero non essere incluse nella distribuzione e, in effetti, potrebbero essere state deprecate a favore di alternative. Analogamente, il rispetto dei requisiti di conformità della licenza per una forma specifica di distribuzione non equivale all'ammissione che il software sia effettivamente distribuito in tale forma. Ad esempio, alcune dipendenze possono avere una doppia licenza e consentire la ridistribuzione con licenze differenti. Le distribuzioni e i pacchetti variano e non tutti i componenti di terze parti sono considerati attendibili nello stesso modo o allo stesso livello. La presenza di una dipendenza sotto una determinata intestazione di seguito è puramente a fini organizzativi e non è necessariamente indicativa del fatto che la licenza corrispondente sia pertinente o sia stata selezionata. Laddove gli autori delle dipendenze abbiano fornito una documentazione incompleta o incoerente, sono state fatte deduzioni con lo scopo di dare effetto all'intento desiderato dell'autore della dipendenza. Parte della documentazione sulla conformità può essere disponibile nel software stesso.
Laddove licenze di terze parti richiedono che venga offerta la possibilità di ottenere il codice sorgente pertinente, in conformità ai termini della licenza di terze parti, è possibile contattare Magic Leap per ricevere tale copia.
<>
Este listado proporciona notificaciones y orientación referentes a los elementos indicados y no se debe interpretar como una admisión de que el componente enumerado aparece en la distribución o de la manera indicada. Por ejemplo, la lista puede incluir varias dependencias aplicables solo al desarrollo, prueba y evaluación, que pueden no estar incluidas en la distribución y, de hecho, pueden haber quedado en desuso en favor de las alternativas. Del mismo modo, cumplir con los requisitos de cumplimiento de una licencia para una forma particular de distribución no es una admisión de que el software se distribuye de esa forma. Por ejemplo, algunas dependencias pueden tener doble licencia y pueden permitir la redistribución en virtud de diferentes licencias. Las distribuciones y el embalaje varían y no todos los componentes de terceros se basan en la misma manera o grado. La presencia de una dependencia debajo de un encabezado proporcionado a continuación es meramente para fines organizativos y no es necesariamente un indicativo de la licencia oportuna o elegida. Cuando los autores de la dependencia proporcionaron documentación incompleta o incoherente, se produjeron inferencias con la intención de dar efecto a la intención deseada del autor de la dependencia. Tenga en cuenta que se puede encontrar documentación de cumplimiento en el propio software.
En el caso de que licencias de terceros requieran de una oferta para proporcionar un código fuente relevante, de acuerdo con los términos de la licencia de terceros, póngase en contacto con Magic LEAP si desea recibir dicha copia.
<>
このリストは、示された項目についての注記とガイダンスを提供するものであり、リストされている項目を配布物の中または示された方法で表示することを許可するものと解釈しないでください。 たとえば、リストには開発、試験、および評価のためにのみ適用されるさまざまな依存関係が含まれている可能性があり、配布物には含まれていなかったり、実際にそれらの使用は推奨されておらず、代替品を使用することが推奨されていたりする可能性があります。 同様に、特定の配布形態でのライセンスのコンプライアンス要件を満たしていても、そのソフトウェアを実際にその形式で配布することを許可するものではありません。 たとえば、一部の依存関係はデュアルライセンスの対象となっていて、異なるライセンスの下での再配布が許可されている可能性があります。 配布とパッケージングはそれぞれ異なり、すべてのサードパーティコンポーネントが同じ方法で、または同程度依存しているわけではありません。以下の特定の見出しの下で依存関係が存在することは、単に整理を目的としており、必ずしも関連する、または選択されたライセンスの存在を示すものではありません。 依存関係の作者が不十分な、または一貫していない文書類しか提供していない場合は、作者の望む意図での依存関係に、その意図がどのような影響をもたらすかについての推論がなされています。 一部のコンプライアンス文書類は、ソフトウェア自体の中にある場合もあることに注意してください。
サードパーティのライセンスが、関連するソースコードの提供を要求している場合、そのようなコピーを受け取ることを望む場合は、サードパーティのライセンスの条件に従い、Magic Leapにお問い合わせください。
TABLE OF CONTENTS:
-------------------
MIT / BSD AND VARIANT LICENSED THIRD PARTY CODE
-------------------
protobuf-3.19.2
@testing-library/jest-dom 5.16.5
@testing-library/react 11.2.7
@testing-library/user-event 12.8.3
file-saver 2.0.5
jose 4.9.3
nodemon 2.0.20
react 17.0.2
react-dnd 14.0.5
react-dnd-html 14.1.0
react-dom 17.0.2
react-horizontal-scrolling-menu 3.2.0
react-modal 3.15.1
react-redux 7.2.8
react-router-dom 5.3.3
react-scripts 4.0.3
styled-components 5.3.5
PuerkitoBio_purell v1.1.1
PuerkitoBio_urlesc v0.0.0-20170810143723-de5bf2ad4578
cespare_xxhash v2.1.2
davecgh_go-spew v1.1.1
dgryski_go-rendezvous v0.0.0-20200823014737-9f7001d12a5f
emicklei_go-restful v3.8.0
evanphx_json-patch v4.12.0
go-redis_redis v8.11.4
go-redsync_redsync v4.5.1
gogo_protobuf v1.3.2
golang-jwt_jwt v3.2.2
golang_protobuf v1.5.2
google_uuid v1.3.0
gorilla_mux v1.8.0
imdario_mergo v0.3.12
josharian_intern v1.0.0
json-iterator_go v1.1.12
mailru_easyjson v0.7.6
munnerz_goautoneg v0.0.0-20191010083416-a7dc8b61c822
pkg_errors v0.9.1
sirupsen_logrus v1.9.0
spf13_pflag v1.0.5
x_net v0.0.0-20220826154423-83b083e8dc8b
x_oauth2 v0.0.0-20220822191816-0ebed06d0094
x_sys v0.0.0-20220728004956-3c1f35247d10
x_term v0.0.0-20210927222741-03fcf44c2211
x_text v0.3.7
x_time v0.0.0-20220210224613-90d013bbcef8
protobuf v1.28.0
inf.v0 v0.9.1
yaml v1.3.0
gorilla_mux v1.8.0
joho_godotenv v1.4.0
pkg_errors v0.9.1
rs_cors v1.8.2
twilio_twilio-go v0.26.0
x_crypto v0.0.0-20191011191535-87dc89f01550
x_net v0.0.0-20210405180319-a5a99cb37ef4
x_oauth2 v0.0.0-20200107190931-bf48bf16ab8d
felixge_httpsnoop v1.0.1
tmiv_simple-service-account-oidc
golang-jwt_jwt v3.2.2
google_uuid v1.3.0
gorilla_handlers v1.5.1
cespare_xxhash_v2.1.2
dgryski_go-rendezvous_v0.0.0-20200823014737-9f7001d12a5f
go-redis_redis_v8.11.4
go-redsync_redsync_v4.5.1
golang-jwt_jwt_v3.2.2
gorilla_mux_v1.8.0
pkg_errors_v0.9.1
rs_cors_v1.8.2
sirupsen_logrus_v1.8.1
swaggo_files_v0.0.0-20210815190702-a29dd2bc99b2
x_crypto_v0.0.0-20210220033148-5ea612d1eb83
go_lang_x_net_v0.0.0-20210805182204-aaa1db679c0d
go_lang_x_oauth2_v0.0.0-20200107190931-bf48bf16ab8d
go_lang_x_sys_v0.0.0-20210817190340-bfb29a6856f2
golang-jwt_jwt
gorilla_mux
joho_godotenv_v1.4.0
sendgrid_rest_v2.6.9
sendgrid_sendgrid-go_v3.11.1
x_crypto_v0.0.0-20190308221718-c2843e01d9a2
x_net_v0.0.0-20200505041828-1ed23360d12c
x_oauth2_v0.0.0-20200107190931-bf48bf16ab8d
golang_protobuf_v1.5.2
google_go-cmp_v0.5.7
google_uuid_v1.1.2
googleapis_gax-go_v2.3.0
gorilla_mux_v1.8.0
rs_cors_v1.8.2
golang.org_x_net 0.1.0
golang.org_x_oauth2 0.1.0
golang.org_x_sys 0.1.0
golang.org_x_text 0.3.0
google.golang.org_protobuf 1.28.0
x_xerrors_v0.0.0-20220411194840-2f41105eb62f
api_v0.74.0
golang-jwt_jwt_v3.2.2
gorilla_mux_v1.8.0
golang.org_x_crypto_v0.0.0-20220307211146-efcb8507fb70
google_uuid_v1.3.0
gorilla_mux_v1.8.0
rs_cors_v1.8.2
-------------------
APACHE LICENSE 2.0 THIRD PARTY CODE
-------------------
react-unity-webgl 8.8.0
web-vitals 1.1.2
go-logr_logr v1.2.3
go-openapi_jsonpointer v0.19.5
go-openapi_jsonreference v0.19.5
go-openapi_swag v0.19.14
google_gnostic v0.5.7-v3refs
google_gofuzz v1.1.0
icza_gox v0.0.0-20220812133721-0fbf7a534d8e
modern-go_concurrent v0.0.0-20180306012644-bacd9c7ef1dd
modern-go_reflect2 v1.0.2
yaml.v2 v2.4.0
yaml.v3 v3.0.1
api v0.25.0
apimachinery v0.25.0
client-go v0.25.0
klog v2.70.1
kube-openapi v0.0.0-20220803162953-67bda5d908f1
utils v0.0.0-20220728103510-ee6ede2d64ed
controller-runtime v0.12.3
json v0.0.0-20220713155537-f223a00ba0e2
structured-merge-diff v4.2.3
coreos_go-oidc v3.1.0
golang_mock v1.6.0
square_go-jose.v2 v2.5.1
gorilla_mux v1.8.0
yaml.v2 v2.4.0
coreos_go-oidc_v3.2.0
gosimple_unidecode_v1.0.1
icza_gox_v0.0.0-20220321141217-e2d488ab2fbc
square_go-jose.v2_v2.5.1
k8s.io_apimachinery 0.25.0
coreos_go-oidc_v3.1.0
mrz1836_go-sanitize_v1.1.5
square_go-jose.v2v2.5.1
golang_groupcache_8c9f03a8e57eb486e42badaed3fb287da51807ba
googleapis_go-type-adapters_v1.0.0
go.opencensus.io 0.23.0
genproto_v0.0.0-20220518221133-4f43b3371335
grpc_v1.46.0
go v0.100.2
-------------------
MOZILLA PUBLIC LICENSE 2.0 THIRD PARTY CODE
-------------------
hashicorp_errwrap v1.0.0
hashicorp_go-multierror v1.1.0
gosimple_slug_v1.12.0
hashicorp_errwrap_v1.0.0
hashicorp_go-multierror_v1.1.0
-------------------------------------------------------------------------------------------------------------------
BEGIN MIT / BSD AND VARIANT LICENSED THIRD PARTY CODE
-------------------------------------------------------------------------------------------------------------------
////Begin:protobuf-3.19.2--------------------
.\protobuf-3.19.2\composer.json recites:
{
"name": "google/protobuf",
"type": "library",
"description": "proto library for PHP",
"keywords": ["proto"],
"homepage": "https://developers.google.com/protocol-buffers/",
"license": "BSD-3-Clause",
"require": {
"php": ">=5.5.0"
},
"require-dev": {
"phpunit/phpunit": ">=4.8.0"
},
"suggest": {
"ext-bcmath": "Need to support JSON deserialization"
},
"autoload": {
"psr-4": {
"Google\\Protobuf\\": "php/src/Google/Protobuf",
"GPBMetadata\\Google\\Protobuf\\": "php/src/GPBMetadata/Google/Protobuf"
}
}
}
.\protobuf-3.19.2\CONTRIBUTORS.txt recites:
This file contains a list of people who have made large contributions
to the public version of Protocol Buffers.
Original Protocol Buffers design and implementation:
Sanjay Ghemawat
Jeff Dean
Daniel Dulitz
Craig Silverstein
Paul Haahr
Corey Anderson
(and many others)
Proto2 C++ and Java primary author:
Kenton Varda
Proto2 Python primary authors:
Will Robinson
Petar Petrov
Java Nano primary authors:
Brian Duff
Tom Chao
Max Cai
Ulas Kirazci
Large code contributions:
Jason Hsueh
Joseph Schorr
Wenbo Zhu
Large quantity of code reviews:
Scott Bruce
Frank Yellin
Neal Norwitz
Jeffrey Yasskin
Ambrose Feinstein
Documentation:
Lisa Carey
Maven packaging:
Gregory Kick
Patch contributors:
Kevin Ko
* Small patch to handle trailing slashes in --proto_path flag.
Johan Euphrosine
* Small patch to fix Python CallMethod().
Ulrich Kunitz
* Small optimizations to Python serialization.
Leandro Lucarella
* VI syntax highlighting tweaks.
* Fix compiler to not make output executable.
Dilip Joseph
* Heuristic detection of sub-messages when printing unknown fields in
text format.
Brian Atkinson
* Added @Override annotation to generated Java code where appropriate.
Vincent Choinière
* Tru64 support.
Monty Taylor
* Solaris 10 + Sun Studio fixes.
Alek Storm
* Slicing support for repeated scalar fields for the Python API.
Oleg Smolsky
* MS Visual Studio error format option.
* Detect unordered_map in stl_hash.m4.
Brian Olson
* gzip/zlib I/O support.
Michael Poole
* Fixed warnings about generated constructors not explicitly initializing
all fields (only present with certain compiler settings).
* Added generation of field number constants.
Wink Saville
* Fixed initialization ordering problem in logging code.
Will Pierce
* Small patch improving performance of in Python serialization.
Alexandre Vassalotti
* Emacs mode for Protocol Buffers (editors/protobuf-mode.el).
Scott Stafford
* Added Swap(), SwapElements(), and RemoveLast() to Reflection interface.
Alexander Melnikov
* HPUX support.
Oliver Jowett
* Detect whether zlib is new enough in configure script.
* Fixes for Solaris 10 32/64-bit confusion.
Evan Jones
* Optimize Java serialization code when writing a small message to a stream.
* Optimize Java serialization of strings so that UTF-8 encoding happens only
once per string per serialization call.
* Clean up some Java warnings.
* Fix bug with permanent callbacks that delete themselves when run.
Michael Kucharski
* Added CodedInputStream.getTotalBytesRead().
Kacper Kowalik
* Fixed m4/acx_pthread.m4 problem for some Linux distributions.
William Orr
* Fixed detection of sched_yield on Solaris.
* Added atomicops for Solaris
Andrew Paprocki
* Fixed minor IBM xlC compiler build issues
* Added atomicops for AIX (POWER)
.\protobuf-3.19.2\LICENSE recites:
Copyright 2008 Google Inc. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
c
opyright notice, this list of conditions and the following disclaimer
in the documentation and/or other materials provided with the
distribution.
* Neither the name of Google Inc. nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Code generated by the Protocol Buffer compiler is owned by the owner
of the input file used when generating it. This code is not
standalone and requires a support library to be linked with it. This
support library is itself covered by the above license.
.\protobuf-3.19.2\Protobuf-C++.podspec recites:
Pod::Spec.new do |s|
s.name = 'Protobuf-C++'
s.version = '3.19.2'
s.summary = 'Protocol Buffers v3 runtime library for C++.'
s.homepage = 'https://github.com/google/protobuf'
s.license = '3-Clause BSD License'
s.authors = { 'The Protocol Buffers contributors' => 'protobuf@googlegroups.com' }
s.cocoapods_version = '>= 1.0'
.\protobuf-3.19.2\Protobuf.podspec recites:
# This file describes to Cocoapods how to integrate the Objective-C runtime into a dependent
# project.
# Despite this file being specific to Objective-C, it needs to be on the root of the repository.
# Otherwise, Cocoapods gives trouble like not picking up the license file correctly, or not letting
# dependent projects use the :git notation to refer to the library.
Pod::Spec.new do |s|
s.name = 'Protobuf'
s.version = '3.19.2'
s.summary = 'Protocol Buffers v.3 runtime library for Objective-C.'
s.homepage = 'https://github.com/protocolbuffers/protobuf'
s.license = '3-Clause BSD License'
s.authors = { 'The Protocol Buffers contributors' => 'protobuf@googlegroups.com' }
s.cocoapods_version = '>= 1.0'
s.source = { :git => 'https://github.com/protocolbuffers/protobuf.git',
:tag => "v#{s.version}" }
.\protobuf-3.19.2\README.md recites:
Protocol Buffers - Google's data interchange format
===================================================
Copyright 2008 Google Inc.
https://developers.google.com/protocol-buffers/
Overview
--------
Protocol Buffers (a.k.a., protobuf) are Google's language-neutral,
platform-neutral, extensible mechanism for serializing structured data. You
can find [protobuf's documentation on the Google Developers site](https://developers.google.com/protocol-buffers/).
This README file contains protobuf installation instructions. To install
protobuf, you need to install the protocol compiler (used to compile .proto
files) and the protobuf runtime for your chosen programming language.
Protocol Compiler Installation
------------------------------
The protocol compiler is written in C++. If you are using C++, please follow
the [C++ Installation Instructions](src/README.md) to install protoc along
with the C++ runtime.
For non-C++ users, the simplest way to install the protocol compiler is to
download a pre-built binary from our release page:
[https://github.com/protocolbuffers/protobuf/releases](https://github.com/protocolbuffers/protobuf/releases)
In the downloads section of each release, you can find pre-built binaries in
zip packages: protoc-$VERSION-$PLATFORM.zip. It contains the protoc binary
as well as a set of standard .proto files distributed along with protobuf.
If you are looking for an old version that is not available in the release
page, check out the maven repo here:
[https://repo1.maven.org/maven2/com/google/protobuf/protoc/](https://repo1.maven.org/maven2/com/google/protobuf/protoc/)
These pre-built binaries are only provided for released versions. If you want
to use the github master version at HEAD, or you need to modify protobuf code,
or you are using C++, it's recommended to build your own protoc binary from
source.
If you would like to build protoc binary from source, see the [C++ Installation
Instructions](src/README.md).
Protobuf Runtime Installation
-----------------------------
Protobuf supports several different programming languages. For each programming
language, you can find instructions in the corresponding source directory about
how to install protobuf runtime for that specific language:
| Language | Source
|
|--------------------------------------|-------------------------------------------------------------|
| C++ (include C++ runtime and protoc) | [src](src) |
| Java | [java](java) |
| Python | [python](python) |
| Objective-C | [objectivec](objectivec) |
| C# | [csharp](csharp) |
| JavaScript | [js](js) |
| Ruby | [ruby](ruby) |
| Go | [protocolbuffers/protobuf-go](https://github.com/protocolbuffers/protobuf-go)|
| PHP | [php](php) |
| Dart | [dart-lang/protobuf](https://github.com/dart-lang/protobuf) |
Quick Start
-----------
The best way to learn how to use protobuf is to follow the tutorials in our
developer guide:
https://developers.google.com/protocol-buffers/docs/tutorials
If you want to learn from code examples, take a look at the examples in the
[examples](examples) directory.
Documentation
-------------
The complete documentation for Protocol Buffers is available via the
web at:
https://developers.google.com/protocol-buffers/
.\protobuf-3.19.2\benchmarks\benchmarks.proto recites:
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc. All rights reserved.
// https://developers.google.com/protocol-buffers/
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\protobuf-3.19.2\cmake\README.md recites:
This directory contains *CMake* files that can be used to build protobuf
with *MSVC* on *Windows*. You can build the project from *Command Prompt*
and using an *Visual Studio* IDE.
You need to have [CMake](http://www.cmake.org), [Visual Studio](https://www.visualstudio.com)
and optionally [Git](http://git-scm.com) installed on your computer before proceeding.
Most of the instructions will be given to the *áommand Prompt*, but the same
actions can be performed using appropriate GUI tools.
Environment Setup
=================
Open the appropriate *Command Prompt* from the *Start* menu.
For example *x86 Native Tools Command Prompt for VS 2019*:
C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional>
Change to your working directory:
C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional>cd C:\Path\to
C:\Path\to>
Where *C:\Path\to* is path to your real working directory.
Create a folder where protobuf headers/libraries/binaries will be installed after built:
C:\Path\to>mkdir install
If *cmake* command is not available from *Command Prompt*, add it to system *PATH* variable:
C:\Path\to>set PATH=%PATH%;C:\Program Files (x86)\CMake\bin
If *git* command is not available from *Command Prompt*, add it to system *PATH* variable:
C:\Path\to>set PATH=%PATH%;C:\Program Files\Git\cmd
Good. Now you are ready to continue.
Getting Sources
===============
You can get the latest stable source packages from the release page:
https://github.com/protocolbuffers/protobuf/releases/latest
For example: if you only need C++, download `protobuf-cpp-
[VERSION].tar.gz`; if
you need C++ and Java, download `protobuf-java-[VERSION].tar.gz` (every package
contains C++ source already); if you need C++ and multiple other languages,
download `protobuf-all-[VERSION].tar.gz`.
Or you can use git to clone from protobuf git repository.
C:\Path\to> git clone -b [release_tag] https://github.com/protocolbuffers/protobuf.git
Where *[release_tag]* is a git tag like *v3.0.0-beta-1* or a branch name like *master*
if you want to get the latest code.
Go to the project folder:
C:\Path\to>cd protobuf
C:\Path\to\protobuf>
Remember to update any submodules if you are using git clone (you can skip this
step if you are using a release .tar.gz or .zip package):
```console
C:\Path\to> git submodule update --init --recursive
```
Now go to *cmake* folder in protobuf sources:
C:\Path\to\protobuf>cd cmake
C:\Path\to\protobuf\cmake>
Good. Now you are ready to *CMake* configuration.
CMake Configuration
===================
*CMake* supports a lot of different
[generators](http://www.cmake.org/cmake/help/latest/manual/cmake-generators.7.html)
for various native build systems.
We are only interested in
[Makefile](http://www.cmake.org/cmake/help/latest/manual/cmake-generators.7.html#makefile-generators)
and
[Visual Studio](http://www.cmake.org/cmake/help/latest/manual/cmake-generators.7.html#visual-studio-generators)
generators.
We will use shadow building to separate the temporary files from the protobuf source code.
Create a temporary *build* folder and change your working directory to it:
C:\Path\to\protobuf\cmake>mkdir build & cd build
C:\Path\to\protobuf\cmake\build>
The *Makefile* generator can build the project in only one configuration, so you need to build
a separate folder for each configuration.
To start using a *Release* configuration:
C:\Path\to\protobuf\cmake\build>mkdir release & cd release
C:\Path\to\protobuf\cmake\build\release>cmake -G "NMake Makefiles" ^
-DCMAKE_BUILD_TYPE=Release ^
-DCMAKE_INSTALL_PREFIX=../../../../install ^
../..
It will generate *nmake* *Makefile* in current directory.
To use *Debug* configuration:
C:\Path\to\protobuf\cmake\build>mkdir debug & cd debug
C:\Path\to\protobuf\cmake\build\debug>cmake -G "NMake Makefiles" ^
-DCMAKE_BUILD_TYPE=Debug ^
-DCMAKE_INSTALL_PREFIX=../../../../install ^
../..
It will generate *nmake* *Makefile* in current directory.
To create *Visual Studio* solution file:
C:\Path\to\protobuf\cmake\build>mkdir solution & cd solution
C:\Path\to\protobuf\cmake\build\solution>cmake -G "Visual Studio 16 2019" ^
-DCMAKE_INSTALL_PREFIX=../../../../install ^
../..
It will generate *Visual Studio* solution file *protobuf.sln* in current directory.
If the *gmock* directory does not exist, and you do not want to build protobuf unit tests,
you need to add *cmake* command argument `-Dprotobuf_BUILD_TESTS=OFF` to disable testing.
To make a *Visual Studio* file for Visual Studio 16 2019, create the *Visual Studio*
solution file above and edit the CMakeCache file.
C:Path\to\protobuf\cmake\build\solution\CMakeCache
Then create the *Visual Studio* solution file again
Compiling
=========
To compile protobuf:
C:\Path\to\protobuf\cmake\build\release>nmake
or
C:\Path\to\protobuf\cmake\build\debug>nmake
And wait for the compilation to finish.
If you prefer to use the IDE:
* Open the generated protobuf.sln file in Microsoft Visual Studio.
* Choose "Debug" or "Release" configuration as desired.
* From the Build menu, choose "Build Solution".
And wait for the compilation to finish.
Testing
=======
To run unit-tests, first you must compile protobuf as described above.
Then run:
C:\Path\to\protobuf\cmake\build\release>nmake check
or
C:\Path\to\protobuf\cmake\build\debug>nmake check
You can also build project *check* from Visual Studio solution.
Yes, it may sound strange, but it works.
You should see output similar to:
Running main() from gmock_main.cc
[==========] Running 1546 tests from 165 test cases.
...
[==========] 1546 tests from 165 test cases ran. (2529 ms total)
[ PASSED ] 1546 tests.
To run specific tests:
C:\Path\to\protobuf>cmake\build\release\tests.exe --gtest_filter=AnyTest*
Running main() from gmock_main.cc
Note: Google Test filter = AnyTest*
[==========] Running 3 tests from 1 test case.
[----------] Global test environment set-up.
[----------] 3 tests from AnyTest
[ RUN ] AnyTest.TestPackAndUnpack
[ OK ] AnyTest.TestPackAndUnpack (0 ms)
[ RUN ] AnyTest.TestPackAndUnpackAny
[ OK ] AnyTest.TestPackAndUnpackAny (0 ms)
[ RUN ] AnyTest.TestIs
[ OK ] AnyTest.TestIs (0 ms)
[----------] 3 tests from AnyTest (1 ms total)
[----------] Global test environment tear-down
[==========] 3 tests from 1 test case ran. (2 ms total)
[ PASSED ] 3
tests.
Note that the tests must be run from the source folder.
If all tests are passed, safely continue.
Installing
==========
To install protobuf to the specified *install* folder:
C:\Path\to\protobuf\cmake\build\release>nmake install
or
C:\Path\to\protobuf\cmake\build\debug>nmake install
You can also build project *INSTALL* from Visual Studio solution.
It sounds not so strange and it works.
This will create the following folders under the *install* location:
* bin - that contains protobuf *protoc.exe* compiler;
* include - that contains C++ headers and protobuf *.proto files;
* lib - that contains linking libraries and *CMake* configuration files for *protobuf* package.
Now you can if needed:
* Copy the contents of the include directory to wherever you want to put headers.
* Copy protoc.exe wherever you put build tools (probably somewhere in your PATH).
* Copy linking libraries libprotobuf[d].lib, libprotobuf-lite[d].lib, and libprotoc[d].lib wherever you put libraries.
To avoid conflicts between the MSVC debug and release runtime libraries, when
compiling a debug build of your application, you may need to link against a
debug build of libprotobufd.lib with "d" postfix. Similarly, release builds should link against
release libprotobuf.lib library.
DLLs vs. static linking
=======================
Static linking is now the default for the Protocol Buffer libraries. Due to
issues with Win32's use of a separate heap for each DLL, as well as binary
compatibility issues between different versions of MSVC's STL library, it is
recommended that you use static linkage only. However, it is possible to
build libprotobuf and libprotoc as DLLs if you really want. To do this,
do the following:
* Add an additional flag `-Dprotobuf_BUILD_SHARED_LIBS=ON` when invoking cmake
* Follow the same steps as described in the above section.
* When compiling your project, make sure to `#define PROTOBUF_USE_DLLS`.
When distributing your software to end users, we strongly recommend that you
do NOT install libprotobuf.dll or libprotoc.dll to any shared location.
Instead, keep these libraries next to your binaries, in your application's
own install directory. C++ makes it very difficult to maintain binary
compatibility between releases, so it is likely that future versions of these
libraries will *not* be usable as drop-in replacements.
If your project is itself a DLL intended for use by third-party software, we
recommend that you do NOT expose protocol buffer objects in your library's
public interface, and that you statically link protocol buffers into your
library.
ZLib support
============
If you want to include GzipInputStream and GzipOutputStream
(google/protobuf/io/gzip_stream.h) in libprotobuf, you will need to do a few
additional steps.
Obtain a copy of the zlib library. The pre-compiled DLL at zlib.net works.
You need prepare it:
* Make sure zlib's two headers are in your `C:\Path\to\install\include` path
* Make sure zlib's linking libraries (*.lib file) is in your
`C:\Path\to\install\lib` library path.
You can also compile it from source by yourself.
Getting sources:
C:\Path\to>git clone -b v1.2.8 https://github.com/madler/zlib.git
C:\Path\to>cd zlib
Compiling and Installing:
C:\Path\to\zlib>mkdir build & cd build
C:\Path\to\zlib\build>mkdir release & cd release
C:\Path\to\zlib\build\release>cmake -G "NMake Makefiles" -DCMAKE_BUILD_TYPE=Release ^
-DCMAKE_INSTALL_PREFIX=../../../install ../..
C:\Path\to\zlib\build\release>nmake & nmake install
You can make *debug* version or use *Visual Studio* generator also as before for the
protobuf project.
Now add *bin* folder from *install* to system *PATH*:
C:\Path\to>set PATH=%PATH%;C:\Path\to\install\bin
You need reconfigure protobuf with flag `-Dprotobuf_WITH_ZLIB=ON` when invoking cmake.
Note that if you have compiled ZLIB yourself, as stated above,
further disable the option `-Dprotobuf_MSVC_STATIC_RUNTIME=OFF`.
If it reports NOTFOUND for zlib_include or zlib_lib, you might haven't put
the headers or the .lib file in the right directory.
If you already have ZLIB library and headers at some other location on your system then alternatively you can define following configuration flags to locate them:
-DZLIB_INCLUDE_DIR=
-DZLIB_LIB=
Build and testing protobuf as usual.
Notes on Compiler Warnings
==========================
The following warnings have been disabled while building the protobuf libraries
and compiler. You may have to disable some of them in your own project as
well, or live with them.
* C4018 - 'expression' : signed/unsigned mismatch
* C4146 - unary minus operator applied to unsigned type, result still unsigned
* C4244 - Conversion from 'type1' to 'type2', possible loss of data.
* C4251 - 'identifier' : class 'type' needs to have dll-interface to be used by
clients of class 'type2'
* C426
7 - Conversion from 'size_t' to 'type', possible loss of data.
* C4305 - 'identifier' : truncation from 'type1' to 'type2'
* C4355 - 'this' : used in base member initializer list
* C4800 - 'type' : forcing value to bool 'true' or 'false' (performance warning)
* C4996 - 'function': was declared deprecated
C4251 is of particular note, if you are compiling the Protocol Buffer library
as a DLL (see previous section). The protocol buffer library uses templates in
its public interfaces. MSVC does not provide any reasonable way to export
template classes from a DLL. However, in practice, it appears that exporting
templates is not necessary anyway. Since the complete definition of any
template is available in the header files, anyone importing the DLL will just
end up compiling instances of the templates into their own binary. The
Protocol Buffer implementation does not rely on static template members being
unique, so there should be no problem with this, but MSVC prints warning
nevertheless. So, we disable it. Unfortunately, this warning will also be
produced when compiling code which merely uses protocol buffers, meaning you
may have to disable it in your code too.
.\protobuf-3.19.2\cmake\version.rc.in recites:
K "StringFileInfo"
BEGIN
BLOCK "040904b0"
BEGIN
VALUE "FileDescription", "Compiled with @CMAKE_CXX_COMPILER_ID@ @CMAKE_CXX_COMPILER_VERSION@\0"
VALUE "ProductVersion", "@protobuf_VERSION@\0"
VALUE "FileVersion", "@protobuf_VERSION@\0"
VALUE "InternalName", "protobuf\0"
VALUE "ProductName", "Protocol Buffers - Google's Data Interchange Format\0"
VALUE "CompanyName", "Google Inc.\0"
VALUE "LegalCopyright", "Copyright 2008 Google Inc. All rights reserved.\0"
VALUE "Licence", "BSD\0"
VALUE "Info", "https://developers.google.com/protocol-buffers/\0"
END
END
END
.\protobuf-3.19.2\conformance\conformance_objc.m recites:
// Protocol Buffers - Google's data interchange format
// Copyright 2015 Google Inc. All rights reserved.
// https://developers.google.com/protocol-buffers/
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\protobuf-3.19.2\conformance\conformance_python.py recites:
#!/usr/bin/env python
# Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# https://developers.google.com/protocol-buffers/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following disclaimer
# in the documentation and/or other materials provided with the
# distribution.
# * Neither the name of Google Inc. nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCL
UDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\protobuf-3.19.2\conformance\README.md recites:
Protocol Buffers - Google's data interchange format
===================================================
Copyright 2008 Google Inc.
This directory contains conformance tests for testing completeness and
correctness of Protocol Buffers implementations. These tests are designed
to be easy to run against any Protocol Buffers implementation.
This directory contains the tester process `conformance-test`, which
contains all of the tests themselves. Then separate programs written
in whatever language you want to test communicate with the tester
program over a pipe.
Before running any of these tests, make sure you run `make` in the base
directory to build `protoc`, since all the tests depend on it.
$ make
Running the tests for C++
-------------------------
To run the tests against the C++ implementation, run:
$ cd conformance && make test_cpp
Running the tests for JavaScript (Node.js)
------------------------------------------
To run the JavaScript tests against Node.js, make sure you have "node"
on your path and then run:
$ cd conformance && make test_nodejs
Running the tests for Ruby (MRI)
--------------------------------
To run the Ruby tests against MRI, first build the C extension:
$ cd ruby && rake
Then run the tests like so:
$ cd conformance && make test_ruby
Running the tests for other languages
-------------------------------------
Most of the languages in the Protobuf source tree are set up to run
conformance tests. However some of them are more tricky to set up
properly. See `tests.sh` in the base of the repository to see how
Travis runs the tests.
Testing other Protocol Buffer implementations
---------------------------------------------
To run these tests against a new Protocol Buffers implementation, write a
program in your language that uses the protobuf implementation you want
to test. This program should implement the testing protocol defined in
[conformance.proto](https://github.com/protocolbuffers/protobuf/blob/master/conformance/conformance.proto).
This is designed to be as easy as possible: the C++ version is only
150 lines and is a good example for what this program should look like
(see [conformance_cpp.cc](https://github.com/protocolbuffers/protobuf/blob/master/conformance/conformance_cpp.cc)).
The program only needs to be able to read from stdin and write to stdout.
Portability
-----------
Note that the test runner currently does not work on Windows. Patches
to fix this are welcome! (But please get in touch first to settle on
a general implementation strategy).
.\protobuf-3.19.2\conformance\third_party\jsoncpp\json.h recites:
(http://jsoncpp.sourceforge.net/).
/// It is intended to be used with #include "json/json.h"
// ////////////////////////////////////////////////////////////////
// Beginning of content of file: LICENSE
// //////////////////////////////////////////////////////////////////////
/*
The JsonCpp library's source code, including accompanying documentation,
tests and demonstration applications, are licensed under the following
conditions...
The author (Baptiste Lepilleur) explicitly disclaims copyright in all
jurisdictions which recognize such a disclaimer. In such jurisdictions,
this software is released into the Public Domain.
In jurisdictions which do not recognize Public Domain property (e.g. Germany as of
2010), this software is Copyright (c) 2007-2010 by Baptiste Lepilleur, and is
released under the terms of the MIT License (see below).
In jurisdictions which recognize Public Domain property, the user of this
software may choose to accept it either as 1) Public Domain, 2) under the
conditions of the MIT License (see below), or 3) under the terms of dual
Public Domain/MIT License conditions described here, as they choose.
The MIT License is about as close to Public Domain as a license can get, and is
described in clear, concise terms at:
http://en.wikipedia.org/wiki/MIT_License
The full text of the MIT License follows:
========================================================================
Copyright (c) 2007-2010 Baptiste Lepilleur
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use, copy,
modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and
this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
========================================================================
(END LICENSE TEXT)
The MIT license is compatible with both the GPL and commercial
software, affording one all of the rights of Public Domain with the
minor nuisance of being required to keep the above copyright notice
and license text in the source code. Note also that by accepting the
Public Domain "license" you can re-license your copy using whatever
license you like.
*/
// ////////////////////////////////////////////////
.\protobuf-3.19.2\csharp\Google.Protobuf.Tools.nuspec recites:
e's data interchange format.
See project site for more info.
3.19.2
Google Inc.
protobuf-packages
https://github.com/protocolbuffers/protobuf/blob/master/LICENSE
https://github.com/protocolbuffers/protobuf
false
Tools for Protocol Buffers
Copyright 2015, Google Inc.
Protocol Buffers Binary Serialization Format Google proto proto3
.\protobuf-3.19.2\csharp\README.md recites:
This directory contains the C# Protocol Buffers runtime library.
Usage
=====
The easiest way how to use C# protobufs is via the `Google.Protobuf`
NuGet package. Just add the NuGet package to your VS project.
You will also want to install the `Google.Protobuf.Tools` NuGet package, which
contains precompiled version of `protoc.exe` and a copy of well known `.proto`
files under the package's `tools` directory.
To generate C# files from your `.proto` files, invoke `protoc` with the
`--csharp_out` option.
Supported platforms
===================
The runtime library is built as a portable class library, supporting:
- .NET 4.5
- Windows 8
- Windows Phone Silverlight 8
- Windows Phone 8.1
- .NET Core
You should be able to use Protocol Buffers in Visual Studio 2012 and
all later versions. This includes all code generated by `protoc`,
which only uses features from C# 3 and earlier.
Building
========
Open the `src/Google.Protobuf.sln` solution in Visual Studio 2017 or
later.
Although *users* of this project are only expected to have Visual
Studio 2012 or later, *developers* of the library are required to
have Visual Studio 2017 or later, as the library uses C# 6 features
in its implementation, as well as the new Visual Studio 2017 csproj
format. These features have no impact when using the compiled code -
they're only relevant when building the `Google.Protobuf` assembly.
In order to run and debug the AddressBook example in the IDE, you must
install the optional component, ".Net Core 1.0 - 1.1 development tools
for Web" (as it's labelled in current versions of the VS2017
installer), above and beyond the main .NET Core cross-platform
development feature.
Testing
=======
The unit tests use [NUnit 3](https://github.com/nunit/nunit). Tests can be
run using the Visual Studio Test Explorer or `dotnet test`.
.NET 3.5
========
We don't officially support .NET 3.5. However, there has been some effort
to make enabling .NET 3.5 support relatively painless in case you require it.
There's no guarantee that this will continue in the future, so rely on .NET
3.5 support at your peril.
To enable .NET 3.5 support, you must edit the `TargetFrameworks` elements of
[src/Google.Protobuf/Google.Protobuf.csproj](src/Google.Protobuf/Google.Protobuf.csproj)
(and [src/Google.Protobuf.Test/Google.Protobuf.Test.csproj](src/Google.Protobuf.Test/Google.Protobuf.Test.csproj)
if you want to run the unit tests):
Open the .csproj file in a text editor and simply add `net35` to the list of
target frameworks, noting that the `TargetFrameworks` element appears twice in
the file (once in the first `PropertyGroup` element, and again in the second
`PropertyGroup` element, i.e., the one with the conditional).
History of C# protobufs
=======================
This subtree was originally imported from https://github.com/jskeet/protobuf-csharp-port
and represents the latest development version of C# protobufs, that will now be developed
and maintained by Google. All the development will be done in open, under this repository
(https://github.com/protocolbuffers/protobuf).
The previous project differs from this project in a number of ways:
- The old code only sup
ported proto2; the new code only supports
proto3 (so no unknown fields, no required/optional distinction, no
extensions)
- The old code was based on immutable message types and builders for
them
- The old code did not support maps or `oneof`
- The old code had its own JSON representation, whereas the new code
uses the standard protobuf JSON representation
- The old code had no notion of the "well-known types" which have
special support in the new code
- The old project supported some older platforms (such as older
versions of Silverlight) which are not currently supported in the
new project
.\protobuf-3.19.2\csharp\compatibility_tests\v3.0.0\src\Google.Protobuf.Test\ByteStringTest.cs recites:
#region Copyright notice and license
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc. All rights reserved.
// https://developers.google.com/protocol-buffers/
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\protobuf-3.19.2\csharp\compatibility_tests\v3.0.0\src\Google.Protobuf.Test\CodedInputStreamExtensions.cs recites:
#region Copyright notice and license
// Protocol Buffers - Google's data interchange format
// Copyright 2015 Google Inc. All rights reserved.
// https://developers.google.com/protocol-buffers/
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\protobuf-3.19.2\csharp\compatibility_tests\v3.0.0\src\Google.Protobuf.Test\Program.cs recites:
#region Copyright notice and license
// Protocol Buffers - Google's data interchange format
// Copyright 2017 Google Inc. All rights reserved.
// https://developers.google.com/protocol-buffers/
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided wi
th the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\protobuf-3.19.2\csharp\compatibility_tests\v3.0.0\src\Google.Protobuf.Test\TestProtos\ForeignMessagePartial.cs recites:
#region Copyright notice and license
// Protocol Buffers - Google's data interchange format
// Copyright 2016 Google Inc. All rights reserved.
// https://developers.google.com/protocol-buffers/
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#endregion
.\protobuf-3.19.2\csharp\keys\README.md recites:
Contents
--------
- Google.Protobuf.public.snk:
Public key to verify strong name of Google.Protobuf assemblies.
- Google.Protobuf.snk:
Signing key to provide strong name of Google.Protobuf assemblies.
As per [Microsoft guidance](https://msdn.microsoft.com/en-us/library/wd40t7ad(v=vs.110).aspx)
signing key should be checked into the repository.
.\protobuf-3.19.2\csharp\protos\README.md recites:
This directory contains unit test protos adapted from those in
src/google/protobuf, and C#-specific test protos for regression
tests against bugs found in the C# codegen or library.
.\protobuf-3.19.2\csharp\src\Google.Protobuf\Google.Protobuf.csproj recites:
C# runtime library for Protocol Buffers - Google's data interchange format.
Copyright 2015, Google Inc.
Google Protocol Buffers
3.19.2
7.2
Google Inc.
.\protobuf-3.19.2\csharp\src\Google.Protobuf\Reflection\DescriptorDeclaration.cs recites:
#region Copyright notice and license
// Protocol Buffers - Google's data interchange format
// Copyright 2018 Google Inc. All rights reserved.
// https://developers.google.com/protocol-buffers/
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written
permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\protobuf-3.19.2\csharp\src\Google.Protobuf.Benchmarks\BenchmarkDatasetConfig.cs recites:
#region Copyright notice and license
// Protocol Buffers - Google's data interchange format
// Copyright 2019 Google Inc. All rights reserved.
// https://github.com/protocolbuffers/protobuf
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\protobuf-3.19.2\editors\proto.vim recites:
" Protocol Buffers - Google's data interchange format
" Copyright 2008 Google Inc. All rights reserved.
" https://developers.google.com/protocol-buffers/
"
" Redistribution and use in source and binary forms, with or without
" modification, are permitted provided that the following conditions are
" met:
"
" * Redistributions of source code must retain the above copyright
" notice, this list of conditions and the following disclaimer.
" * Redistributions in binary form must reproduce the above
" copyright notice, this list of conditions and the following disclaimer
" in the documentation and/or other materials provided with the
" distribution.
" * Neither the name of Google Inc. nor the names of its
" contributors may be used to endorse or promote products derived from
" this software without specific prior written permission.
"
" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
" "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
" A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
" OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
" OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\protobuf-3.19.2\editors\protobuf-mode.el recites:
;;; protobuf-mode.el --- major mode for editing protocol buffers. -*- lexical-binding: t; -*-
;; Author: Alexandre Vassalotti
;; Created: 23-Apr-2009
;; Version: 0.3
;; Keywords: google protobuf languages
;; Redistribution and use in source and binary forms, with or without
;; modification, are permitted provided that the following conditions are
;; met:
;;
;; * Redistributions of source code must retain the above copyright
;; notice, this list of conditions and the following disclaimer.
;; * Redistributions in binary form must reproduce the above
;; copyright notice, this list of conditions and the following disclaimer
;; in the document
ation and/or other materials provided with the
;; distribution.
;; * Neither the name of Google Inc. nor the names of its
;; contributors may be used to endorse or promote products derived from
;; this software without specific prior written permission.
;;
;; THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
;; "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
;; LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
;; A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
;; OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
;; SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
;; LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
;; DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
;; THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
;; (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
;; OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\protobuf-3.19.2\examples\README.md recites:
# Protocol Buffers - Code Example
This directory contains example code that uses Protocol Buffers to manage an
address book. Two programs are provided for each supported language. The
add_person example adds a new person to an address book, prompting the user to
input the person's information. The list_people example lists people already in
the address book. The examples use the exact same format in all three languages,
so you can, for example, use add_person_java to create an address book and then
use list_people_python to read it.
These examples are part of the Protocol Buffers tutorial, located at:
https://developers.google.com/protocol-buffers/docs/tutorials
## Build the example using bazel
The example requires bazel 0.5.4 or newer to build. You can download/install
the latest version of bazel from bazel's release page:
https://github.com/bazelbuild/bazel/releases
Once you have bazel installed, simply run the following command in this examples
directory to build the code:
$ bazel build :all
Then you can run the built binary:
$ bazel-bin/add_person_cpp addressbook.data
To use protobuf in your own bazel project, please follow instructions in the
[BUILD](BUILD) file and [WORKSPACE](WORKSPACE) file.
## Build the example using make
You must install the protobuf package before you can build it using make. The
minimum requirement is to install protocol compiler (i.e., the protoc binary)
and the protobuf runtime for the language you want to build.
You can simply run "make" to build the example for all languages (except for
Go). However, since different language has different installation requirement,
it will likely fail. It's better to follow individual instructions below to
build only the language you are interested in.
### C++
You can follow instructions in [../src/README.md](../src/README.md) to install
protoc and protobuf C++ runtime from source.
Then run "make cpp" in this examples directory to build the C++ example. It
will create two executables: add_person_cpp and list_people_cpp. These programs
simply take an address book file as their parameter. The add_person_cpp
programs will create the file if it doesn't already exist.
To run the examples:
$ ./add_person_cpp addressbook.data
$ ./list_people_cpp addressbook.data
Note that on some platforms you may have to edit the Makefile and remove
"-lpthread" from the linker commands (perhaps replacing it with something else).
We didn't do this automatically because we wanted to keep the example simple.
### Python
Follow instructions in [../README.md](../README.md) to install protoc and then
follow [../python/README.md](../python/README.md) to install protobuf python
runtime from source. You can also install python runtime using pip:
$ pip install protobuf
Make sure the runtime version is the same as protoc binary, or it may not work.
After you have install both protoc and python runtime, run "make python" to
build two executables (shell scripts actually): add_person_python and
list_people_python. They work the same way as the C++ executables.
### Java
Follow instructions in [../README.md](../README.md) to install protoc and then
download protobuf Java runtime .jar file from maven:
https://mvnrepository.com/artifact/com.google.protobuf/protobuf-java
Then run the following:
$ export CLASSPATH=/path/to/protobuf-java-[version].jar
$ make java
This will create the add_person_java/list_people_java executables (shell
scripts) and can be used to create/display an address book data file.
### Go
The Go example requires a plugin to the protocol buffer compiler, so it is not
build with all the other examples. See:
https://github.com/golang/protobuf
for more information about Go protocol buffer support.
First, install the Protocol Buffers compiler (protoc).
Then, install the Go Protocol Buffers plugin ($GOPATH/bin must be
in your $PATH
for protoc to find it):
go get github.com/golang/protobuf/protoc-gen-go
Build the Go samples in this directory with "make go". This creates the
following executable files in the current directory:
add_person_go list_people_go
To run the example:
./add_person_go addressbook.data
to add a person to the protocol buffer encoded file addressbook.data. The file
is created if it does not exist. To view the data, run:
./list_people_go addressbook.data
Observe that the C++, Python, Java, and Dart examples in this directory run in a
similar way and can view/modify files created by the Go example and vice
versa.
### Dart
First, follow the instructions in [../README.md](../README.md) to install the Protocol Buffer Compiler (protoc).
Then, install the Dart Protocol Buffer plugin as described [here](https://github.com/dart-lang/dart-protoc-plugin#how-to-build-and-use).
Note, the executable `bin/protoc-gen-dart` must be in your `PATH` for `protoc` to find it.
Build the Dart samples in this directory with `make dart`.
To run the examples:
```sh
$ dart add_person.dart addressbook.data
$ dart list_people.dart addressbook.data
```
The two programs take a protocol buffer encoded file as their parameter.
The first can be used to add a person to the file. The file is created
if it does not exist. The second displays the data in the file.
.\protobuf-3.19.2\java\lite.md recites:
# Protocol Buffers - Google's data interchange format
Copyright 2008 Google Inc.
https://developers.google.com/protocol-buffers/
## Use Protobuf Java Lite Runtime
Protobuf Java Lite runtime is separated from the main Java runtime because
it's designed/implemented with different constraints. In particular, Java
Lite runtime has a much smaller code size which makes it more suitable to
be used on Android.
Note that in order to achieve maximum performance and code size, we will
NOT guarantee API/ABI stability for Java Lite. If this is not acceptable
for your use-case, please use the full Java runtime instead. Note that
the latest version of Java Lite is not compatible with the 3.0.0 version.
You can generate Java Lite code for your .proto files:
$ protoc --java_out=lite:${OUTPUT_DIR} path/to/your/proto/file
Note that "optimize_for = LITE_RUNTIME" option in proto file is deprecated
and will not have any effect any more.
Include the generated Java files in your project and add a dependency on the
protobuf Java runtime. If you are using Maven, use the following:
```xml
com.google.protobuf
protobuf-javalite
3.19.2
```
## R8 rule to make production app builds work
The Lite runtime internally uses reflection to avoid generating hashCode/equals/(de)serialization methods.
R8 by default obfuscates the field names, which makes the reflection fail causing exceptions of the form
`java.lang.RuntimeException: Field {NAME}_ for {CLASS} not found. Known fields are [ {FIELDS} ]` in MessageSchema.java.
There are open issues for this on the [protobuf Github project](https://github.com/protocolbuffers/protobuf/issues/6463) and [R8](https://issuetracker.google.com/issues/144631039).
Until the issues is resolved you need to add the following line to your `proguard-rules.pro` file inside your project:
```
-keep class * extends com.google.protobuf.GeneratedMessageLite { *; }
```
## Older versions
For the older version of Java Lite (v3.0.0), please refer to:
https://github.com/protocolbuffers/protobuf/blob/javalite/java/lite.md
.\protobuf-3.19.2\java\pom.xml recites:
4.0.0
com.google.protobuf
protobuf-parent
3.19.2
pom
Protocol Buffers [Parent]
2008
https://developers.google.com/protocol-buffers/
Protocol Buffers are a way of encoding structured data in an efficient yet
extensible format.
haon
Hao Nguyen
haon@google.com
Google
https://cloud.google.com
America/Los_Angeles
UTF-8
UTF-8
${project.basedir}/../..
${protobuf.basedir}/src
${protobuf.source.dir}/protoc
src/test/proto
${project.build.directory}/generated-sources
${project.build.directory}/generated-test-sources
3-Clause BSD License
https://opensource.org/licenses/BSD-3-Clause
repo
https://github.com/protocolbuffers/protobuf
scm:git:https://github.com/protocolbuffers/protobuf.git
sonatype-nexus-staging
https://oss.sonatype.org/content/repositories/snapshots
sonatype-nexus-staging
https://oss.sonatype.org/service/local/staging/deploy/maven2/
com.google.protobuf
protobuf-bom
${project.version}
pom
import
junit
junit
4.13.2
test
org.easymock
easymock
3.2
test
com.google.guava
guava
30.1.1-android
com.google.guava
guava-testlib
30.1.1-android
test
com.google.truth
truth
1.1.2
test
maven-compiler-plugin
3.6.1
1.7
1.7
maven-source-plugin
2.4
attach-sources
jar-no-fork
maven-javadoc-plugin
2.10.3
attach-javadocs
jar
false
maven-jar-plugin
2.6
org.codehaus.mojo
build-helper-maven-plugin
1.10
org.apache.felix
maven-bundle-plugin
3.0.1
maven-antrun-plugin
3.0.0
org.codehaus.mojo
animal-sniffer-maven-plugin
1.20
net.sf.androidscents.signature
android-api-level-14
4.0_r4
android
test
check
release
org.apache.maven.plugins
maven-source-plugin
2.2.1
attach-sources
jar-no-fork
org.apache.maven.plugins
maven-javadoc-plugin
2.10.3
attach-javadocs
jar
false
maven-gpg-plugin
1.6
sign-artifacts
verify
sign
org.sonatype.plugins
nexus-staging-maven-plugin
1.6.6
true
sonatype-nexus-staging
https://oss.sonatype.org/
false
org.jetbrains.dokka
dokka-maven-plugin
1.4.32
prepare-package
javadocJar
bom
lite
core
util
kotlin
kotlin-lite
.\protobuf-3.19.2\java\README.md recites:
# Protocol Buffers - Google's data interchange format
Copyright 2008 Google Inc.
https://developers.google.com/protocol-buffers/
## Use Java Protocol Buffers
To use protobuf in Java, first obtain the protocol compiler (a.k.a., protoc,
see instructions in the toplevel [README.md](../README.md)) and use it to
generate Java code for your .proto files:
$ protoc --java_out=${OUTPUT_DIR} path/to/your/proto/file
Include the generated Java files in your project and add a dependency on the
protobuf Java runtime.
### Maven
If you are using Maven, use the following:
```xml
com.google.protobuf
protobuf-java
3.19.2
```
Make sure the version number of the runtime matches (or is newer than) the
version number of the protoc.
If you want to use features like protobuf JsonFormat, add a dependency on the
protobuf-java-util package:
```xml
com.google.protobuf
protobuf-java-util
3.19.2
```
### Gradle
If you are using Gradle, add the following to your `build.gradle` file's dependencies:
```
implementation 'com.google.protobuf:protobuf-java:3.19.2'
```
Again, be sure to check that the version number matches (or is newer than) the version number of protoc that you are using.
### Use Java Protocol Buffers on Android
For Android users, it's recommended to use protobuf Java Lite runtime because
of its smaller code size. Java Lite runtime also works better with Proguard
because it doesn't rely on Java reflection and is optimized to allow as much
code stripping as possible. You can following these [instructions to use Java
Lite runtime](lite.md).
### Use Java Protocol Buffers with Bazel
Bazel has native build rules to work with protobuf. For Java, you can use the
`java_proto_library` rule for server and the `java_lite_proto_library` rule
for Android. Check out [our build files examples](../examples/BUILD) to learn
how to use them.
## Build from Source
Most users should follow the instructions above to use protobuf Java runtime.
If you are contributing code to protobuf or want to use a protobuf version
that hasn't been officially released yet, you can follow the instructions
below to build protobuf from source code.
### Build from Source - With Maven
1) Install Apache Maven if you don't have it:
http://maven.apache.org/
2) Build the C++ code, or obtain a binary distribution of protoc (see
the toplevel [README.md](../README.md)). If you install a binary
distribution, make sure that it is the same version as this pac
kage.
If in doubt, run:
$ protoc --version
You will need to place the protoc executable in ../src. (If you
built it yourself, it should already be there.)
3) Run the tests:
$ mvn test
If some tests fail, this library may not work correctly on your
system. Continue at your own risk.
4) Install the library into your Maven repository:
$ mvn install
5) If you do not use Maven to manage your own build, you can build a
.jar file to use:
$ mvn package
The .jar will be placed in the "target" directory.
The above instructions will install 2 maven artifacts:
* protobuf-java: The core Java Protocol Buffers library. Most users only
need this artifact.
* protobuf-java-util: Utilities to work with protos. It contains JSON support
as well as utilities to work with proto3 well-known
types.
### Build from Source - Without Maven
If you would rather not install Maven to build the library, you may
follow these instructions instead. Note that these instructions skip
running unit tests and only describes how to install the core protobuf
library (without the util package).
1) Build the C++ code, or obtain a binary distribution of protoc. If
you install a binary distribution, make sure that it is the same
version as this package. If in doubt, run:
$ protoc --version
If you built the C++ code without installing, the compiler binary
should be located in ../src.
2) Invoke protoc to build DescriptorProtos.java:
$ protoc --java_out=core/src/main/java -I../src \
../src/google/protobuf/descriptor.proto
3) Compile the code in core/src/main/java using whatever means you prefer.
4) Install the classes wherever you prefer.
## Compatibility Notice
* Protobuf minor version releases are backwards-compatible. If your code
can build/run against the old version, it's expected to build/run against
the new version as well. Both binary compatibility and source compatibility
are guaranteed for minor version releases if the user follows the guideline
described in this section.
* Protobuf major version releases may also be backwards-compatible with the
last release of the previous major version. See the release notice for more
details.
* APIs marked with the @ExperimentalApi annotation are subject to change. They
can be modified in any way, or even removed, at any time. Don't use them if
compatibility is needed. If your code is a library itself (i.e. it is used on
the CLASSPATH of users outside your own control), you should not use
experimental APIs, unless you repackage them (e.g. using ProGuard).
* Deprecated non-experimental APIs will be removed two years after the release
in which they are first deprecated. You must fix your references before this
time. If you don't, any manner of breakage could result (you are not
guaranteed a compilation error).
* Protobuf message interfaces/classes are designed to be subclassed by protobuf
generated code only. Do not subclass these message interfaces/classes
yourself. We may add new methods to the message interfaces/classes which will
break your own subclasses.
* Don't use any method/class that is marked as "used by generated code only".
Such methods/classes are subject to change.
* Protobuf LITE runtime APIs are not stable yet. They are subject to change even
in minor version releases.
## Documentation
The complete documentation for Protocol Buffers is available via the
web at:
https://developers.google.com/protocol-buffers/
## Kotlin Protocol Buffers
Code to support more idiomatic Kotlin protocol buffers has been added to the
repository, and Kotlin support will be launched in the next numbered release.
.\protobuf-3.19.2\js\package.json recites:
{
"name": "google-protobuf",
"version": "3.19.2",
"description": "Protocol Buffers for JavaScript",
"main": "google-protobuf.js",
"files": [
"google"
],
"dependencies": {},
"devDependencies": {
"glob": "~7.1.4",
"google-closure-compiler": "~20190819.0.0",
"google-closure-deps": "^20210406.0.0",
"google-closure-library": "~20190819.0.0",
"gulp": "~4.0.2",
"jasmine": "~3.4.0"
},
"scripts": {
"test": "node ./node_modules/gulp/bin/gulp.js test"
},
"repository": {
"type": "git",
"url": "https://github.com/protocolbuffers/protobuf/tree/master/js"
},
"author": "Google Protocol Buffers Team",
"license": "BSD-3-Clause"
}
.\protobuf-3.19.2\js\README.md recites:
Protocol Buffers - Google's data interchange format
===================================================
Copyright 2008 Google Inc.
This directory contains the JavaScript Protocol Buffers runtime library.
The library is currently compatible with:
1. CommonJS-style imports (eg. `var protos = require('my-protos');`)
2. Closure-style imports (eg. `goog.require('my.package.MyProto');`)
Support for ES6-style imports is not implemented yet
. Browsers can
be supported by using Browserify, webpack, Closure Compiler, etc. to
resolve imports at compile time.
To use Protocol Buffers with JavaScript, you need two main components:
1. The protobuf runtime library. You can install this with
`npm install google-protobuf`, or use the files in this directory.
If npm is not being used, as of 3.3.0, the files needed are located in binary subdirectory;
arith.js, constants.js, decoder.js, encoder.js, map.js, message.js, reader.js, utils.js, writer.js
2. The Protocol Compiler `protoc`. This translates `.proto` files
into `.js` files. The compiler is not currently available via
npm, but you can download a pre-built binary
[on GitHub](https://github.com/protocolbuffers/protobuf/releases)
(look for the `protoc-*.zip` files under **Downloads**).
Setup
=====
First, obtain the Protocol Compiler. The easiest way is to download
a pre-built binary from [https://github.com/protocolbuffers/protobuf/releases](https://github.com/protocolbuffers/protobuf/releases).
If you want, you can compile `protoc` from source instead. To do this
follow the instructions in [the top-level
README](https://github.com/protocolbuffers/protobuf/blob/master/src/README.md).
Once you have `protoc` compiled, you can run the tests provided along with our project to examine whether it can run successfully. In order to do this, you should download the Protocol Buffer source code from the release page with the link above. Then extract the source code and navigate to the folder named `js` containing a `package.json` file and a series of test files. In this folder, you can run the commands below to run the tests automatically.
$ npm install
$ npm test
# If your protoc is somewhere else than ../src/protoc, instead do this.
# But make sure your protoc is the same version as this (or compatible)!
$ PROTOC=/usr/local/bin/protoc npm test
This will run two separate copies of the tests: one that uses
Closure Compiler style imports and one that uses CommonJS imports.
You can see all the CommonJS files in `commonjs_out/`.
If all of these tests pass, you know you have a working setup.
Using Protocol Buffers in your own project
==========================================
To use Protocol Buffers in your own project, you need to integrate
the Protocol Compiler into your build system. The details are a
little different depending on whether you are using Closure imports
or CommonJS imports:
Closure Imports
---------------
If you want to use Closure imports, your build should run a command
like this:
$ protoc --js_out=library=myproto_libs,binary:. messages.proto base.proto
For Closure imports, `protoc` will generate a single output file
(`myproto_libs.js` in this example). The generated file will `goog.provide()`
all of the types defined in your .proto files. For example, for the unit
tests the generated files contain many `goog.provide` statements like:
goog.provide('proto.google.protobuf.DescriptorProto');
goog.provide('proto.google.protobuf.DescriptorProto.ExtensionRange');
goog.provide('proto.google.protobuf.DescriptorProto.ReservedRange');
goog.provide('proto.google.protobuf.EnumDescriptorProto');
goog.provide('proto.google.protobuf.EnumOptions');
The generated code will also `goog.require()` many types in the core library,
and they will require many types in the Google Closure library. So make sure
that your `goog.provide()` / `goog.require()` setup can find all of your
generated code, the core library `.js` files in this directory, and the
Google Closure library itself.
Once you've done this, you should be able to import your types with
statements like:
goog.require('proto.my.package.MyMessage');
var message = proto.my.package.MyMessage();
If unfamiliar with Closure or its compiler, consider reviewing
[Closure documentation](https://developers.google.com/closure/library).
CommonJS imports
----------------
If you want to use CommonJS imports, your build should run a command
like this:
$ protoc --js_out=import_style=commonjs,binary:. messages.proto base.proto
For CommonJS imports, `protoc` will spit out one file per input file
(so `messages_pb.js` and `base_pb.js` in this example). The generated
code will depend on the core runtime, which should be in a file called
`google-protobuf.js`. If you are installing from `npm`, this file should
already be built and available. If you are running from GitHub, you need
to build it first by running:
$ gulp dist
Once you've done this, you should be able to import your types with
statements like:
var messages = require('./messages_pb');
var message = new messages.MyMessage();
The `--js_out` flag
-------------------
The syntax of the `--js_out` flag is:
--js_out=[OPTIONS:]output_dir
Where `OPTIONS` are separated by commas. Options are either `opt=val` or
just `opt` (for options that don't take a value). The available options
are specif
ied and documented in the `GeneratorOptions` struct in
[src/google/protobuf/compiler/js/js_generator.h](https://github.com/protocolbuffers/protobuf/blob/master/src/google/protobuf/compiler/js/js_generator.h#L53).
Some examples:
- `--js_out=library=myprotos_lib.js,binary:.`: this contains the options
`library=myprotos.lib.js` and `binary` and outputs to the current directory.
The `import_style` option is left to the default, which is `closure`.
- `--js_out=import_style=commonjs,binary:protos`: this contains the options
`import_style=commonjs` and `binary` and outputs to the directory `protos`.
`import_style=commonjs_strict` doesn't expose the output on the global scope.
API
===
The API is not well-documented yet. Here is a quick example to give you an
idea of how the library generally works:
var message = new MyMessage();
message.setName("John Doe");
message.setAge(25);
message.setPhoneNumbers(["800-555-1212", "800-555-0000"]);
// Serializes to a UInt8Array.
var bytes = message.serializeBinary();
var message2 = MyMessage.deserializeBinary(bytes);
For more examples, see the tests. You can also look at the generated code
to see what methods are defined for your generated messages.
.\protobuf-3.19.2\js\commonjs\import_test.js recites:
// Protocol Buffers - Google's data interchange format
// Copyright 2016 Google Inc. All rights reserved.
// https://developers.google.com/protocol-buffers/
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// Test suite is written using Jasmine -- see http://jasmine.github.io/
.\protobuf-3.19.2\m4\ax_cxx_compile_stdcxx.m4 recites:
#
# LICENSE
#
# Copyright (c) 2008 Benjamin Kosnik
# Copyright (c) 2012 Zack Weinberg
# Copyright (c) 2013 Roy Stogner
# Copyright (c) 2014, 2015 Google Inc.; contributed by Alexey Sokolov
# Copyright (c) 2015 Paul Norman
# Copyright (c) 2015 Moritz Klammler
# Copyright (c) 2016 Krzesimir Nowak
#
# Copying and distribution of this file, with or without modification, are
# permitted in any medium without royalty provided the copyright notice
# and this notice are preserved. This file is offered as-is, without any
# warranty.
.\protobuf-3.19.2\m4\ax_prog_cc_for_build.m4 recites:
#
# LICENSE
#
# Copyright (c) 2008 Paolo Bonzini
#
# Copying and distribution of this file, with or without modification, are
# permitted in any medium without royalty provided the copyright notice
# and this notice are preserved. This file is offered as-is, without any
# warranty.
.\protobuf-3.19.2\m4\ax_prog_cxx_for_build.m4 recites:
# LICENSE
#
# Copyright (c) 2008 Paolo Bonzini
# Copyright (c) 2012 Avionic Design GmbH
#
# Based on the AX_PROG_CC_FOR_BUILD macro by Paolo Bonzini.
#
# Copying and distribution of this file, with or without modification, are
# permitted in any medium without royalty provided the copyright notice
# and this notice are preserved. This file is offered as-is, without any
# warranty.
.\protobuf-3.19.2\m4\ax_pthread.m4 recites:
# Please let the authors know if this macro fails on any platform, or if
# you have any other suggestions or comments. This macro was based on work
# by SGJ on autoconf scripts for FFTW (http://www.fftw.org/) (with help
# from M. Frigo), as well as ac_pthread and hb_pthread macros posted by
# Alejandro Forero Cue
rvo to the autoconf macro repository. We are also
# grateful for the helpful feedback of numerous users.
#
# Updated for Autoconf 2.68 by Daniel Richard G.
#
# LICENSE
#
# Copyright (c) 2008 Steven G. Johnson
# Copyright (c) 2011 Daniel Richard G.
# Copyright (c) 2019 Marc Stevens
#
# This program is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation, either version 3 of the License, or (at your
# option) any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
# Public License for more details.
#
# You should have received a copy of the GNU General Public License along
# with this program. If not, see .
#
# As a special exception, the respective Autoconf Macro's copyright owner
# gives unlimited permission to copy, distribute and modify the configure
# scripts that are the output of Autoconf when processing the Macro. You
# need not follow the terms of the GNU General Public License when using
# or distributing such scripts, even though portions of the text of the
# Macro appear in them. The GNU General Public License (GPL) does govern
# all other use of the material that constitutes the Autoconf Macro.
#
# This special exception to the GPL applies to versions of the Autoconf
# Macro released by the Autoconf Archive. When you make and distribute a
# modified version of the Autoconf Macro, you may extend this special
# exception to the GPL to apply to your modified version as well.
.\protobuf-3.19.2\objectivec\README.md recites:
Protocol Buffers - Google's data interchange format
===================================================
Copyright 2008 Google Inc.
This directory contains the Objective C Protocol Buffers runtime library.
Requirements
------------
The Objective C implementation requires:
- Objective C 2.0 Runtime (32bit & 64bit iOS, 64bit OS X).
- Xcode 10.3 (or later).
- The library code does *not* use ARC (for performance reasons), but it all can
be called from ARC code.
Installation
------------
The distribution pulled from github includes the sources for both the
compiler (protoc) and the runtime (this directory). After cloning the distribution
and needed submodules ([see the src directory's README](../src/README.md)),
to build the compiler and run the runtime tests, you can use:
$ objectivec/DevTools/full_mac_build.sh
This will generate the `src/protoc` binary.
Building
--------
There are two ways to include the Runtime sources in your project:
Add `objectivec/*.h`, `objectivec/google/protobuf/*.pbobjc.h`, and
`objectivec/GPBProtocolBuffers.m` to your project.
*or*
Add `objectivec/*.h`, `objectivec/google/protobuf/*.pbobjc.h`,
`objectivec/google/protobuf/*.pbobjc.m`, and `objectivec/*.m` except for
`objectivec/GPBProtocolBuffers.m` to your project.
If the target is using ARC, remember to turn off ARC (`-fno-objc-arc`) for the
`.m` files.
The files generated by `protoc` for the `*.proto` files (`*.pbobjc.h` and
`*.pbobjc.m`) are then also added to the target.
Usage
-----
The objects generated for messages should work like any other Objective C
object. They are mutable objects, but if you don't change them, they are safe
to share between threads (similar to passing an NSMutableDictionary between
threads/queues; as long as no one mutates it, things are fine).
There are a few behaviors worth calling out:
A property that is type NSString\* will never return nil. If the value is
unset, it will return an empty string (@""). This is inpart to align things
with the Protocol Buffers spec which says the default for strings is an empty
string, but also so you can always safely pass them to isEqual:/compare:, etc.
and have deterministic results.
A property that is type NSData\* also won't return nil, it will return an empty
data ([NSData data]). The reasoning is the same as for NSString not returning
nil.
A property that is another GPBMessage class also will not return nil. If the
field wasn't already set, you will get a instance of the correct class. This
instance will be a temporary instance unless you mutate it, at which point it
will be attached to its parent object. We call this pattern *autocreators*.
Similar to NSString and NSData properties it makes things a little safer when
using them with isEqual:/etc.; but more importantly, this allows you to write
code that uses Objective C's property dot notation to walk into nested objects
and access and/or assign things without having to check that they are not nil
and create them each step along the way. You can write this:
```
- (void)updateRecord:(MyMessage *)msg {
...
// Note: You don't have to check subMe
ssage and otherMessage for nil and
// alloc/init/assign them back along the way.
msg.subMessage.otherMessage.lastName = @"Smith";
...
}
```
If you want to check if a GPBMessage property is present, there is always as
`has\[NAME\]` property to go with the main property to check if it is set.
A property that is of an Array or Dictionary type also provides *autocreator*
behavior and will never return nil. This provides all the same benefits you
see for the message properties. Again, you can write:
```
- (void)updateRecord:(MyMessage *)msg {
...
// Note: Just like above, you don't have to check subMessage and otherMessage
// for nil and alloc/init/assign them back along the way. You also don't have
// to create the siblingsArray, you can safely just append to it.
[msg.subMessage.otherMessage.siblingsArray addObject:@"Pat"];
...
}
```
If you are inspecting a message you got from some other place (server, disk,
etc), you may want to check if the Array or Dictionary has entries without
causing it to be created for you. For this, there is always a `\[NAME\]_Count`
property also provided that can return zero or the real count, but won't trigger
the creation.
For primitive type fields (ints, floats, bools, enum) in messages defined in a
`.proto` file that use *proto2* syntax there are conceptual differences between
having an *explicit* and *default* value. You can always get the value of the
property. In the case that it hasn't been set you will get the default. In
cases where you need to know whether it was set explicitly or you are just
getting the default, you can use the `has\[NAME\]` property. If the value has
been set, and you want to clear it, you can set the `has\[NAME\]` to `NO`.
*proto3* syntax messages do away with this concept, thus the default values are
never included when the message is encoded.
The Objective C classes/enums can be used from Swift code.
Objective C Generator Proto File Options
----------------------------------------
**objc_class_prefix=\** (no default)
This options allow you to provide a custom prefix for all the symbols generated
from a proto file (classes (from message), enums, the Root for extension
support).
If not set, the generation option `use_package_as_prefix` (documented below)
controls what is used instead. Since Objective C uses a global namespace for all
of its classes, there can be collisions. `use_package_as_prefix=yes` should
avoid collisions since proto package are used to scope/name things in other
languages, but this option can be used to get shorter names instead. Convention
is to base the explicit prefix on the proto package.
Objective C Generator `protoc` Options
--------------------------------------
When generating Objective C code, `protoc` supports a `--objc_opt` argument; the
argument is comma-delimited name/value pairs (_key=value,key2=value2_). The
_keys_ are used to change the behavior during generation. The currently
supported keys are:
* `generate_for_named_framework`: The `value` used for this key will be used
when generating the `` statements in the generated code. Instead
of being plain ` "some/path/file.pbobjc.h"` lines, they will be
framework based, i.e. - ` `.
_NOTE:_ If this is used with `named_framework_to_proto_path_mappings_path`,
then this is effectively the _default_ to use for everything that wasn't
mapped by the other.
* `named_framework_to_proto_path_mappings_path`: The `value` used for this key
is a path to a file containing the listing of framework names and proto
files. The generator uses this to decide if another proto file referenced
should use a framework style import vs. a user level import
(` ` vs ` "dir/file.pbobjc.h"`).
The format of the file is:
* An entry is a line of `frameworkName: file.proto, dir/file2.proto`.
* Comments start with `#`.
* A comment can go on a line after an entry.
(i.e. - `frameworkName: file.proto # comment`)
Any number of files can be listed for a framework, just separate them with
commas.
There can be multiple lines listing the same frameworkName in case it has a
lot of proto files included in it; and having multiple lines makes things
easier to read.
* `runtime_import_prefix`: The `value` used for this key to be used as a
prefix on ``s of runtime provided headers in the generated files.
When integrating ObjC protos into a build system, this can be used to avoid
having to add the runtime directory to the header search path since the
generate `` will be more complete.
* `use_package_as_prefix` and `proto_package_prefix_exceptions_path`: The
`value` for `use_package_as_prefix` can be `yes` or `no`, and indicates
if a prefix should be derived from the proto package for all the symbols
for files that don't have the `objc_class_prefix` file option (mentioned
above). This helps ensure the s
ymbols are more unique and means there is
less chance of ObjC class name collisions.
To help in migrating code to using this support,
`proto_package_prefix_exceptions_path` can be used to provide the path
to a file that contains proto package names (one per line, comments allowed
if prefixed with `#`). These package won't get the derived prefix, allowing
migrations to the behavior one proto package at a time across a code base.
`use_package_as_prefix` currently defaults to `no` (existing behavior), but
in the future (as a breaking change), that is likely to change since it
helps prepare folks before they end up using a lot of protos and getting a
lot of collisions.
Contributing
------------
Please make updates to the tests along with changes. If just changing the
runtime, the Xcode projects can be used to build and run tests. If your change
also requires changes to the generated code,
`objectivec/DevTools/full_mac_build.sh` can be used to easily rebuild and test
changes. Passing `-h` to the script will show the addition options that could
be useful.
Documentation
-------------
The complete documentation for Protocol Buffers is available via the
web at:
https://developers.google.com/protocol-buffers/
.\protobuf-3.19.2\objectivec\DevTools\pddm.py recites:
#! /usr/bin/python
#
# Protocol Buffers - Google's data interchange format
# Copyright 2015 Google Inc. All rights reserved.
# https://developers.google.com/protocol-buffers/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following disclaimer
# in the documentation and/or other materials provided with the
# distribution.
# * Neither the name of Google Inc. nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\protobuf-3.19.2\objectivec\Tests\GPBConcurrencyTests.m recites:
// Protocol Buffers - Google's data interchange format
// Copyright 2014 Google Inc. All rights reserved.
// https://developers.google.com/protocol-buffers/
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\protobuf-3.19.2\objectivec\Tests\GPBDictionaryTests.m recites:
// Protocol Buffers - Google's data interchange format
// Copyright 2017 Google Inc. All rights reserved.
// https://developers.google.com/protocol-buffers/
//
// Redistribution and use in source and binary forms, with or without
/
/ modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\protobuf-3.19.2\objectivec\Tests\GPBMessageTests.m recites:
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc. All rights reserved.
// https://developers.google.com/protocol-buffers/
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\protobuf-3.19.2\objectivec\Tests\GPBObjectiveCPlusPlusTest.mm recites:
// Protocol Buffers - Google's data interchange format
// Copyright 2013 Google Inc. All rights reserved.
// https://developers.google.com/protocol-buffers/
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\protobuf-3.19.2\objectivec\Tests\unittest_cycle.proto recites:
// Protocol Buffers - Google's data interchan
ge format
// Copyright 2015 Google Inc. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\protobuf-3.19.2\objectivec\Tests\unittest_deprecated.proto recites:
// Protocol Buffers - Google's data interchange format
// Copyright 2016 Google Inc. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\protobuf-3.19.2\objectivec\Tests\unittest_objc.proto recites:
// Protocol Buffers - Google's data interchange format
// Copyright 2011 Google Inc. All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\protobuf-3.19.2\objectivec\Tests\CocoaPods\README.md recites:
CocoaPods Protocol
Buffers Integration Tests
============================================
The sub directories are the basic projects as created by Xcode 6.3. They are
used to then drive `pod` and `xcodebuild` to ensure things integrate/build
as expected.
`run_tests.sh` defaults to running all the tests, invoke it with `--help` to
see the arguments to control what tests are run.
.\protobuf-3.19.2\php\composer.json recites:
{
"name": "google/protobuf",
"type": "library",
"description": "proto library for PHP",
"keywords": ["proto"],
"homepage": "https://developers.google.com/protocol-buffers/",
"license": "BSD-3-Clause",
"require": {
"php": ">=7.0.0"
},
"require-dev": {
"phpunit/phpunit": ">=5.0.0"
},
"autoload": {
"psr-4": {
"Google\\Protobuf\\": "src/Google/Protobuf",
"GPBMetadata\\Google\\Protobuf\\": "src/GPBMetadata/Google/Protobuf"
}
},
"autoload-dev": {
"psr-4": {
"": "tmp"
}
},
"scripts": {
"test_c": "./generate_test_protos.sh && ./tests/compile_extension.sh && php -dextension=ext/google/protobuf/modules/protobuf.so vendor/bin/phpunit --bootstrap tests/force_c_ext.php tests",
"test_valgrind": "./generate_test_protos.sh && ./tests/compile_extension.sh && ZEND_DONT_UNLOAD_MODULES=1 USE_ZEND_ALLOC=0 valgrind --leak-check=full --error-exitcode=1 php -dextension=ext/google/protobuf/modules/protobuf.so vendor/bin/phpunit --bootstrap tests/force_c_ext.php tests",
"test": "./generate_test_protos.sh && vendor/bin/phpunit tests",
"aggregate_metadata_test": "./generate_test_protos.sh --aggregate_metadata && vendor/bin/phpunit tests"
}
}
.\protobuf-3.19.2\php\README.md recites:
This directory contains the Protocol Buffers runtime implementation via both a
pure PHP package and a native c extension. The pure PHP package is intended to
provide usability to wider range of PHP platforms, while the c extension is
intended to provide higher performance. Both implementations provide the same
runtime APIs and share the same generated code. Users don’t need to re-generate
code for the same proto definition when they want to switch the implementation
later.
Both implementations make use of generated PHP code that defines message and
enum types in PHP. We strongly recommend using protoc's PHP generation support
with .proto files. The build process in this directory only installs the
extension/package; you need to install protoc as well to have PHP code
generation functionality.
## Requirements
To use PHP runtime library requires:
- C extension: PHP 7.x, 8.0
- [PHP package](http://php.net/downloads.php): PHP 5.5, 5.6, 7.x, or 8.0.
## Installation
### C Extension
#### Prerequirements
To install the c extension, the following tools are needed:
* autoconf
* automake
* libtool
* make
* gcc
* pear
* pecl
On Ubuntu, you can install them with:
```
sudo apt-get install -y php-pear php5-dev autoconf automake libtool make gcc
```
On other platforms, please use the corresponding package managing tool to
install them before proceeding.
#### Installation from Source (Building extension)
To build the c extension, run the following command:
```
cd ext/google/protobuf
pear package
sudo pecl install protobuf-{VERSION}.tgz
```
#### Installation from PECL
When we release a version of Protocol Buffers, we will upload the extension to
[PECL](https://pecl.php.net/). To use this pre-packaged extension, simply
install it as you would any other extension:
```
sudo pecl install protobuf-{VERSION}
```
### PHP Package
#### Installation from composer
Simply add "google/protobuf" to the 'require' section of composer.json in your
project.
### Protoc
Once the extension or package is installed, if you wish to generate PHP code
from a `.proto` file, you will also want to install the Protocol Buffers
compiler (protoc), as described in this repository's main `README` file. The
version of `protoc` included in the latest release supports the `--php_out`
option to generate PHP code:
```
protoc --php_out=out_dir test.proto
```
## Usage
For generated code:
https://developers.google.com/protocol-buffers/docs/reference/php-generated
Known Issues
------------
* Missing native support for well known types.
* Missing support for proto2.
* No API provided for clear/copy messages.
* No API provided for encoding/decoding with stream.
* Map fields may not be garbage-collected if there is cycle reference.
* No debug information for messages in c extension.
* HHVM not tested.
* C extension not tested on windows, mac, php 7.0.
* Message name cannot be Empty.
## Development
### Docker Image
We provide a docker image for php development, which is also used in our automatic tests:
```
docker run --security-opt seccomp=unconfined -it protobuftesting/php_8dbe419c6df1a8b3af0ae3a267c112efb436b45c
```
### Test Native PHP
```
# Download protobuf
git clone https://github.com/protocolbuffers/protobuf.git
cd protobuf
# Build protoc
./autogen.sh
./configure
make -j4
# Test native ph
p
cd php
composer install
composer test
```
### Test C Extension
After you have finished testing the native php, you can test the c extension:
```
cd tests
./test.sh 5.6 # The php runtime version.
# We provide 5.5, 5.5-zts, 5.6, 5.6-zts, 7.0, 7.0-zts, 7.1, 7.1-zts, 7.2, 7.2-zts, 7.3 and 7.3-zts
# ls /usr/local for more details
```
If you want to use gdb to debug the c extension, you can do:
```
./gdb_test.sh
```
.\protobuf-3.19.2\php\ext\google\protobuf\package.xml recites:
tral, platform-neutral, extensible mechanism for serializing structured data.
https://developers.google.com/protocol-buffers/
Bo Yang
stanleycheung
protobuf-opensource@google.com
yes
2022-01-05
17:01:38
3.19.2
3.19.2
stable
stable
3-Clause BSD License
* No new changes in 3.19.2
3-Clause BSD License
3-Clause BSD License
.\protobuf-3.19.2\php\ext\google\protobuf\php-upb.c recites:
/* Amalgamated source file */
#include "php-upb.h"
/*
* Copyright (c) 2009-2021, Google LLC
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of Google LLC nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL Google LLC BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
.\protobuf-3.19.2\protoc-artifacts\build-zip.sh recites:
# Create a readme file.
cat < ${DIR}/readme.txt
Protocol Buffers - Google's data interchange format
Copyright 2008 Google Inc.
https://developers.google.com/protocol-buffers/
This package contains a precompiled binary version of the protocol buffer
compiler (protoc). This binary is intended for users who want to use Protocol
Buffers in languages other than C++ but do not want to compile protoc
themselves. To install, simply place this binary somewhere in your PATH.
.\protobuf-3.19.2\protoc-artifacts\pom.xml recites:
4.0.0
com.google
google
1
com.google.protobuf
protoc
3.19.2
pom
Protobuf Compiler
Protobuf Compiler (protoc) is a compiler for .proto files. It generates
language-specific code for Protobuf messages and RPC interfaces.
2008
https://developers.google.com/protocol-buffers/
3-Clause BSD License
https://opensource.org/licenses/BSD-3-Clause
repo
https://github.com/protocolbuffers/protobuf
scm:git:https://github.com/protocolbuffers/protobuf.git
org.codehaus.mojo
build-helper-maven-plugin
1.8
attach-artifacts
package
attach-artifact
${basedir}/target/linux/x86_64/protoc.exe
linux-x86_64
exe
${basedir}/target/linux/x86_32/protoc.exe
linux-x86_32
exe
${basedir}/target/windows/x86_64/protoc.exe
windows-x86_64
exe
${basedir}/target/windows/x86_32/protoc.exe
windows-x86_32
exe
${basedir}/target/osx/x86_64/protoc.exe
osx-x86_64
exe
${basedir}/target/osx/x86_64/protoc.exe
osx-aarch_64
exe
${basedir}/target/linux/aarch_64/protoc.exe
linux-aarch_64
exe
${basedir}/target/linux/ppcle_64/protoc.exe
linux-ppcle_64
exe
${basedir}/target/linux/s390_64/protoc.exe
linux-s390_64
exe
release
org.apache.maven.plugins
maven-gpg-plugin
1.5
sign-artifacts
verify
sign
org.sonatype.plugins
nexus-staging-maven-plugin
1.6.3
true
sonatype-nexus-staging
https://oss.sonatype.org/
true
false
${staging.repository}
.\protobuf-3.19.2\protoc-artifacts\README.md recites:
# Build scripts that publish pre-compiled protoc artifacts
``protoc`` is the compiler for ``.proto`` files. It generates language bindings
for the messages and/or RPC services from ``.proto`` files.
Because ``protoc`` is a native executable, the scripts under this directory
build and publish a ``protoc`` executable (a.k.a. artifact) to Maven
repositories. The artifact can be used by build automation tools so that users
would not need to compile and install ``protoc`` for their systems.
If you would like us to publish protoc artifact for a new platform, please send
us a pull request to add support for the new platform. You would need to change
the following files:
* [build-protoc.s
h](build-protoc.sh): script to cross-build the protoc for your
platform.
* [pom.xml](pom.xml): script to upload artifacts to maven.
* [build-zip.sh](build-zip.sh): script to package published maven artifacts in
our release page.
## Maven Location
The published protoc artifacts are available on Maven here:
https://repo.maven.apache.org/maven2/com/google/protobuf/protoc/
## Versioning
The version of the ``protoc`` artifact must be the same as the version of the
Protobuf project.
## Artifact name
The name of a published ``protoc`` artifact is in the following format:
``protoc---.exe``, e.g., ``protoc-3.6.1-linux-x86_64.exe``.
Note that artifacts for linux/macos also have the `.exe` suffix but they are
not windows binaries.
## System requirement
Install [Apache Maven](http://maven.apache.org/) if you don't have it.
The scripts only work under Unix-like environments, e.g., Linux, MacOSX, and
Cygwin or MinGW for Windows. Please see ``README.md`` of the Protobuf project
for how to set up the build environment.
## Building from a freshly checked-out source
If you just checked out the Protobuf source from github, you need to
generate the configure script.
Under the protobuf project directory:
```
$ ./autogen.sh
```
### Build the artifact for each platform
Run the build-protoc.sh script under this protoc-artifacts directory to build the protoc
artifact for each platform. For example:
```
$ cd protoc-artifacts
$ ./build-protoc.sh linux x86_64 protoc
```
The above command will produce a `target/linux/x86_64/protoc` binary under the
protoc-artifacts directory.
For a list of supported platforms, see the comments in the build-protoc.sh
script. We only use this script to build artifacts on Ubuntu and MacOS (both
with x86_64, and do cross-compilation for other platforms.
### Tips for building for Linux
We build on Centos 6.9 to provide a good compatibility for not very new
systems. We have provided a ``Dockerfile`` under this directory to build the
environment. It has been tested with Docker 1.6.1.
To build a image:
```
$ docker build -t protoc-artifacts .
```
To run the image:
```
$ docker run -it --rm=true protoc-artifacts bash
```
To checkout protobuf (run within the container):
```
$ # Replace v3.5.1 with the version you want
$ wget -O - https://github.com/protocolbuffers/protobuf/archive/v3.5.1.tar.gz | tar xvzp
```
### Windows build
We no longer use scripts in this directory to build windows artifacts. Instead,
we use Visual Studio 2015 to build our windows release artifacts. See our
[kokoro windows build scripts here](../kokoro/release/protoc/windows/build.bat).
To upload windows artifacts, copy the built binaries into this directory and
put it into the target/windows/(x86_64|x86_32) directory the same way as the
artifacts for other platforms. That will allow the maven script to find and
upload the artifacts to maven.
## To push artifacts to Maven Central
Before you can upload artifacts to Maven Central repository, make sure you have
read [this page](http://central.sonatype.org/pages/apache-maven.html) on how to
configure GPG and Sonatype account.
Before you do the deployment, make sure you have built the protoc artifacts for
every supported platform and put them under the target directory. Example
target directory layout:
+ pom.xml
+ target
+ linux
+ x86_64
protoc.exe
+ x86_32
protoc.exe
+ aarch_64
protoc.exe
+ ppcle_64
protoc.exe
+ s390_64
protoc.exe
+ osx
+ x86_64
protoc.exe
+ x86_32
protoc.exe
+ windows
+ x86_64
protoc.exe
+ x86_32
protoc.exe
You will need to build the artifacts on multiple machines and gather them
together into one place.
Use the following command to deploy artifacts for the host platform to a
staging repository.
```
$ mvn deploy -P release
```
It creates a new staging repository. Go to
https://oss.sonatype.org/#stagingRepositories and find the repository, usually
in the name like ``comgoogle-123``. Verify that the staging repository has all
the binaries, close and release this repository.
## Tested build environments
We have successfully built artifacts on the following environments:
- Linux x86_32 and x86_64:
- Centos 6.9 (within Docker 1.6.1)
- Ubuntu 14.04.5 64-bit
- Linux aarch_64: Cross compiled with `g++-aarch64-linux-gnu` on Ubuntu 14.04.5 64-bit
- Mac OS X x86_32 and x86_64: Mac OS X 10.9.5
.\protobuf-3.19.2\python\mox.py recites:
#!/usr/bin/python2.4
#
# Copyright 2008 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS I
S" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# This file is used for testing. The original is at:
# http://code.google.com/p/pymox/
.\protobuf-3.19.2\python\README.md recites:
Protocol Buffers - Google's data interchange format
===================================================
Copyright 2008 Google Inc.
This directory contains the Python Protocol Buffers runtime library.
Normally, this directory comes as part of the protobuf package, available
from:
https://developers.google.com/protocol-buffers/
The complete package includes the C++ source code, which includes the
Protocol Compiler (protoc). If you downloaded this package from PyPI
or some other Python-specific source, you may have received only the
Python part of the code. In this case, you will need to obtain the
Protocol Compiler from some other source before you can use this
package.
Development Warning
===================
The pure python performance is slow. For better performance please
use python c++ implementation.
Installation
============
1) Make sure you have Python 3.5 or newer. If in doubt, run:
$ python -V
2) If you do not have setuptools installed, note that it will be
downloaded and installed automatically as soon as you run `setup.py`.
If you would rather install it manually, you may do so by following
the instructions on [this page](https://packaging.python.org/en/latest/installing.html#setup-for-installing-packages).
3) Build the C++ code, or install a binary distribution of `protoc`. If
you install a binary distribution, make sure that it is the same
version as this package. If in doubt, run:
$ protoc --version
4) Build and run the tests:
$ python setup.py build
$ python setup.py test
To build, test, and use the C++ implementation, you must first compile
`libprotobuf.so`:
$ (cd .. && make)
On OS X:
If you are running a Homebrew-provided Python, you must make sure another
version of protobuf is not already installed, as Homebrew's Python will
search `/usr/local/lib` for `libprotobuf.so` before it searches
`../src/.libs`.
You can either unlink Homebrew's protobuf or install the `libprotobuf` you
built earlier:
$ brew unlink protobuf
or
$ (cd .. && make install)
On other *nix:
You must make `libprotobuf.so` dynamically available. You can either
install libprotobuf you built earlier, or set `LD_LIBRARY_PATH`:
$ export LD_LIBRARY_PATH=../src/.libs
or
$ (cd .. && make install)
To build the C++ implementation run:
$ python setup.py build --cpp_implementation
Then run the tests like so:
$ python setup.py test --cpp_implementation
If some tests fail, this library may not work correctly on your
system. Continue at your own risk.
Please note that there is a known problem with some versions of
Python on Cygwin which causes the tests to fail after printing the
error: `sem_init: Resource temporarily unavailable`. This appears
to be a [bug either in Cygwin or in
Python](http://www.cygwin.com/ml/cygwin/2005-07/msg01378.html).
We do not know if or when it might be fixed. We also do not know
how likely it is that this bug will affect users in practice.
5) Install:
$ python setup.py install
or:
$ (cd .. && make install)
$ python setup.py install --cpp_implementation
This step may require superuser privileges.
NOTE: To use C++ implementation, you need to export an environment
variable before running your program. See the "C++ Implementation"
section below for more details.
Usage
=====
The complete documentation for Protocol Buffers is available via the
web at:
https://developers.google.com/protocol-buffers/
C++ Implementation
==================
The C++ implementation for Python messages is built as a Python extension to
improve the overall protobuf Python performance.
To use the C++ implementation, you need to install the C++ protobuf runtime
library, please see instructions in the parent directory.
.\protobuf-3.19.2\python\setup.py recites:
setup(
name='protobuf',
version=GetVersion(),
description='Protocol Buffers',
download_url='https://github.com/protocolbuffers/protobuf/releases',
long_description="Protocol Buffers are Google's data interchange format",
url='https://developers.google.com/protocol-buffers/',
maintainer='protobuf@googlegroups.com',
maintainer_email='protobuf@googlegroups.com',
license='3-Clause BSD License',
.\protobuf-3.19.2\python\docs\conf.py recites:
# -*- coding: utf-8 -*-
# Protocol Buffers - Google's data interchange format
# Copyright 2019 Google LLC. All rights reserved.
# https://developers.google.com/protocol-buffers/
#
# Redistribution and use in source
and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following disclaimer
# in the documentation and/or other materials provided with the
# distribution.
# * Neither the name of Google Inc. nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# Configuration file for the Sphinx documentation builder.
#
# This file does only contain a selection of the most common options. For a
# full list see the documentation:
# http://www.sphinx-doc.org/en/master/config
# -- Path setup --------------------------------------------------------------
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
import os
# import sys
# sys.path.insert(0, os.path.abspath('.'))
import google.protobuf
# -- Project information -----------------------------------------------------
project = u"Protocol Buffers"
copyright = u"2008, Google LLC"
author = u"Google LLC"
.\protobuf-3.19.2\python\docs\generate_docs.py recites:
#!/usr/bin/env python
# Protocol Buffers - Google's data interchange format
# Copyright 2008 Google Inc. All rights reserved.
# https://developers.google.com/protocol-buffers/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following disclaimer
# in the documentation and/or other materials provided with the
# distribution.
# * Neither the name of Google Inc. nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\protobuf-3.19.2\python\google\protobuf\pyext\README recites:
This is the 'v2' C++ implementation for python proto2.
It is active when:
PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION=cpp
PROTOCOL_BUFFERS_PYTHON_IMPLEMENTATION_VERSION=2
.\protobuf-3.19.2\python\protobuf_distutils\README.md recites:
# Python setuptools extension
This is an extension for Python setuptools which uses an installed protobuf
compiler (`protoc`) to generate Python sources.
## Installing
To use this extension, it needs to be installed so it can be imported by other
projects' setup.py.
```shell
$ python setup.py build
$ python -m pip install .
```
(If you want to test changes to the extension, you can use `python setup.py
develop`.)
## Usage
### Example setup.py configuration
```python
from setuptools import setup
setup(
# ...
name='example_project',
# Require this package, but only for setup (not installation):
setup_requires=['protobuf_distutils'],
options={
# See below for details.
'generate_py_protobufs': {
'source_dir':
'path/to/protos',
'extra_proto_paths': ['path/to/other/project/protos'],
'output_dir': 'path/to/project/sources', # default '.'
'proto_files': ['relative/path/to/just_this_file.proto'],
'protoc': 'path/to/protoc.exe',
},
},
)
```
### Example build invocation
These steps will generate protobuf sources so they are included when building
and installing `example_project` (see above):
```shell
$ python setup.py generate_py_protobufs
$ python setup.py build
$ python -m pip install .
```
## Options
- `source_dir`:
This is the directory holding .proto files to be processed.
The default behavior is to generate sources for all .proto files found under
`source_dir`, recursively. This behavior can be controlled with options below.
- `proto_root_path`:
This is the root path for resolving imports in source .proto files.
The default is the shortest prefix of `source_dir` among `[source_dir] +
self.extra_proto_paths`.
- `extra_proto_paths`:
Specifies additional paths that should be used to find imports, in
addition to `source_dir`.
This option can be used to specify the path to other protobuf sources,
which are imported by files under `source_dir`. No Python code will
be generated for .proto files under `extra_proto_paths`.
- `output_dir`:
Specifies where generated code should be placed.
Typically, this should be the root package that generated Python modules
should be below.
The generated files will be placed under `output_dir` according to the
relative source paths under `proto_root_path`. For example, the source file
`${proto_root_path}/subdir/message.proto` will be generated as the Python
module `${output_dir}/subdir/message_pb2.py`.
- `proto_files`:
A list of strings, specific .proto file paths for generating code, instead of
searching for all .proto files under `source_path`.
These paths are relative to `source_dir`. For example, to generate code
for just `${source_dir}/subdir/message.proto`, specify
`['subdir/message.proto']`.
- `protoc`:
By default, the protoc binary (the Protobuf compiler) is found by
searching the environment path. To use a specific protoc binary, its
path can be specified. Resolution of the `protoc` value is as follows:
1. If the `--protoc=VALUE` flag is passed to `generate_py_protobufs`,
then `VALUE` will be used.
For example:
```shell
$ python setup.py generate_py_protobufs --protoc=/path/to/protoc
```
2. Otherwise, if a value was set in the `options`, it will be used.
(See "Example setup.py configuration," above.)
3. Otherwise, if the `PROTOC` environment variable is set, it will be
used. For example:
For example:
```shell
$ PROTOC=/path/to/protoc python setup.py generate_py_protobufs
```
4. Otherwise, `$PATH` will be searched.
.\protobuf-3.19.2\ruby\google-protobuf.gemspec recites:
Gem::Specification.new do |s|
s.name = "google-protobuf"
s.version = "3.19.2"
git_tag = "v#{s.version.to_s.sub('.rc.', '-rc')}" # Converts X.Y.Z.rc.N to vX.Y.Z-rcN, used for the git tag
s.licenses = ["BSD-3-Clause"]
s.summary = "Protocol Buffers"
s.description = "Protocol Buffers are Google's data interchange format."
s.homepage = "https://developers.google.com/protocol-buffers"
s.authors = ["Protobuf Authors"]
s.email = "protobuf@googlegroups.com"
s.metadata = { "source_code_uri" => "https://github.com/protocolbuffers/protobuf/tree/#{git_tag}/ruby" }
s.require_paths = ["lib"]
s.files = Dir.glob('lib/**/*.rb')
if RUBY_PLATFORM == "java"
s.platform = "java"
s.files += ["lib/google/protobuf_java.jar"]
else
s.files += Dir.glob('ext/**/*')
s.extensions= ["ext/google/protobuf_c/extconf.rb"]
s.add_development_dependency "rake-compiler-dock", "= 1.1.0"
end
s.test_files = ["tests/basic.rb",
"tests/stress.rb",
"tests/generated_code_test.rb"]
s.required_ruby_version = '>= 2.3'
s.add_development_dependency "rake-compiler", "~> 1.1.0"
s.add_development_dependency "test-unit", '~> 3.0', '>= 3.0.9'
end
.\protobuf-3.19.2\ruby\pom.xml recites:
4.0.0
com.google
google
1
com.google.protobuf.jruby
protobuf-jruby
3.19.2
Protocol Buffer JRuby native extension
Protocol Buffers are a way of encoding structured data in an efficient yet
extensible format.
2014
https://developers.google.com/protocol-buffers/
3-Clause BSD License
https://opensource.org/licenses/BSD-3-Clause
repo
https://github.com/protocolbuffers/protobuf
scm:git:https://github.com/protocolbuffers/protobuf.git
UTF-8
lib/google
protobuf_java
org.apache.maven.plugins
maven-assembly-plugin
3.3.0
${jar.finalName}
${ruby.sources}
false
jar-with-dependencies
make-assembly
package
single
org.apache.maven.plugins
maven-compiler-plugin
3.8.1
1.8
1.8
com.google.protobuf
protobuf-java-util
3.19.2
org.jruby
jruby-complete
9.2.19.0
provided
.\protobuf-3.19.2\ruby\README.md recites:
This directory contains the Ruby extension that implements Protocol Buffers
functionality in Ruby.
The Ruby extension makes use of generated Ruby code that defines message and
enum types in a Ruby DSL. You may write definitions in this DSL directly, but
we recommend using protoc's Ruby generation support with .proto files. The
build process in this directory only installs the extension; you need to
install protoc as well to have Ruby code generation functionality.
Installation from Gem
---------------------
In Gemfile (Please check a version of Protocol Buffers you needed [RubyGems](https://rubygems.org/gems/google-protobuf)):
gem 'google-protobuf'
Or for using this pre-packaged gem, simply install it as you would any other gem:
$ gem install [--prerelease] google-protobuf
Once the gem is installed, you may or may not need `protoc`. If you write your
message type descriptions directly in the Ruby DSL, you do not need it.
However, if you wish to generate the Ruby DSL from a `.proto` file, you will
also want to install Protocol Buffers itself, as described in this repository's
main `README` file. The version of `protoc` included in the latest release
supports the `--ruby_out` option to generate Ruby code.
A simple example of using the Ruby extension follows. More extensive
documentation may be found in the RubyDoc comments (`call-seq` tags) in the
source, and we plan to release separate, more detailed, documentation at a
later date.
```ruby
require 'google/protobuf'
# generated from my_proto_types.proto with protoc:
# $ protoc --ruby_out=. my_proto_types.proto
require 'my_proto_types'
mymessage = MyTestMessage.new(:field1 => 42, :field2 => ["a", "b", "c"])
mymessage.field1 = 43
mymessage.field2.push("d")
mymessage.field3 = SubMessage.new(:foo => 100)
encoded_data = MyTestMessage.encode(mymessage)
decoded = MyTestMessage.decode(encoded_data)
assert decoded == mymessage
puts "JSON:"
puts MyTestMessage.encode_json(mymessage)
```
Installation from Source (Building Gem)
---------------------------------------
To build this Ruby extension, you will need:
* Rake
* Bundler
* Ruby development headers
* a C compiler
To Build the JRuby extension, you will need:
* Maven
* The latest version of the protobuf java library (see ../java/README.md)
* Install JRuby via rbenv or RVM
First switch to the desired platform with r
benv or RVM.
Then install the required Ruby gems:
$ gem install bundler
$ bundle
Then build the Gem:
$ rake
$ rake clobber_package gem
$ gem install `ls pkg/google-protobuf-*.gem`
To run the specs:
$ rake test
This gem includes the upb parsing and serialization library as a single-file
amalgamation. It is up-to-date with upb git commit
`535bc2fe2f2b467f59347ffc9449e11e47791257`.
Version Number Scheme
---------------------
We are using a version number scheme that is a hybrid of Protocol Buffers'
overall version number and some Ruby-specific rules. Gem does not allow
re-uploads of a gem with the same version number, so we add a sequence number
("upload version") to the version. We also format alphabetical tags (alpha,
pre, ...) slightly differently, and we avoid hyphens. In more detail:
* First, we determine the prefix: a Protocol Buffers version "3.0.0-alpha-2"
becomes "3.0.0.alpha.2". When we release 3.0.0, this prefix will be simply
"3.0.0".
* We then append the upload version: "3.0.0.alpha.2.0" or "3.0.0.0". If we need
to upload a new version of the gem to fix an issue, the version becomes
"3.0.0.alpha.2.1" or "3.0.0.1".
* If we are working on a prerelease version, we append a prerelease tag:
"3.0.0.alpha.3.0.pre". The prerelease tag comes at the end so that when
version numbers are sorted, any prerelease builds are ordered between the
prior version and current version.
These rules are designed to work with the sorting rules for
[Gem::Version](http://ruby-doc.org/stdlib-2.0/libdoc/rubygems/rdoc/Gem/Version.html):
release numbers should sort in actual release order.
.\protobuf-3.19.2\ruby\compatibility_tests\v3.0.0\README.md recites:
# Protobuf Ruby Compatibility Tests
This directory contains a snapshot of protobuf ruby 3.0.0 unittest code and
test scripts used to verifies whether the latest version of protobuf is
still compatible with 3.0.0 generated code.
.\protobuf-3.19.2\ruby\src\main\java\com\google\protobuf\jruby\RubyDescriptor.java recites:
/*
* Protocol Buffers - Google's data interchange format
* Copyright 2014 Google Inc. All rights reserved.
* https://developers.google.com/protocol-buffers/
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following disclaimer
* in the documentation and/or other materials provided with the
* distribution.
* * Neither the name of Google Inc. nor the names of its
* contributors may be used to endorse or promote products derived from
* this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
.\protobuf-3.19.2\src\README.md recites:
Protocol Buffers - Google's data interchange format
===================================================
Copyright 2008 Google Inc.
https://developers.google.com/protocol-buffers/
C++ Installation - Unix
-----------------------
To build protobuf from source, the following tools are needed:
* autoconf
* automake
* libtool
* make
* g++
* unzip
On Ubuntu/Debian, you can install them with:
sudo apt-get install autoconf automake libtool curl make g++ unzip
On other platforms, please use the corresponding package managing tool to
install them before proceeding.
To get the source, download one of the release .tar.gz or .zip packages in the
release page:
https://github.com/protocolbuffers/protobuf/releases/latest
For example: if you only need C++, download `protobuf-cpp-[VERSION].tar.gz`; if
you need C++ and Java, download `protobuf-java-[VERSION].tar.gz` (every package
contains C++ source already); if you need C++ and multiple other languages,
download `protobuf-all-[VERSION].tar.gz`.
You can also get the source by "git clone" our git repository. Make sure you
have also cloned the submodules and generated the configure script (skip this
if you are using a release .tar.gz or .zip package):
git clone https://g
ithub.com/protocolbuffers/protobuf.git
cd protobuf
git submodule update --init --recursive
./autogen.sh
To build and install the C++ Protocol Buffer runtime and the Protocol
Buffer compiler (protoc) execute the following:
./configure
make
make check
sudo make install
sudo ldconfig # refresh shared library cache.
If "make check" fails, you can still install, but it is likely that
some features of this library will not work correctly on your system.
Proceed at your own risk.
For advanced usage information on configure and make, please refer to the
autoconf documentation:
http://www.gnu.org/software/autoconf/manual/autoconf.html#Running-configure-Scripts
**Hint on install location**
By default, the package will be installed to /usr/local. However,
on many platforms, /usr/local/lib is not part of LD_LIBRARY_PATH.
You can add it, but it may be easier to just install to /usr
instead. To do this, invoke configure as follows:
./configure --prefix=/usr
If you already built the package with a different prefix, make sure
to run "make clean" before building again.
**Compiling dependent packages**
To compile a package that uses Protocol Buffers, you need to pass
various flags to your compiler and linker. As of version 2.2.0,
Protocol Buffers integrates with pkg-config to manage this. If you
have pkg-config installed, then you can invoke it to get a list of
flags like so:
pkg-config --cflags protobuf # print compiler flags
pkg-config --libs protobuf # print linker flags
pkg-config --cflags --libs protobuf # print both
For example:
c++ my_program.cc my_proto.pb.cc `pkg-config --cflags --libs protobuf`
Note that packages written prior to the 2.2.0 release of Protocol
Buffers may not yet integrate with pkg-config to get flags, and may
not pass the correct set of flags to correctly link against
libprotobuf. If the package in question uses autoconf, you can
often fix the problem by invoking its configure script like:
configure CXXFLAGS="$(pkg-config --cflags protobuf)" \
LIBS="$(pkg-config --libs protobuf)"
This will force it to use the correct flags.
If you are writing an autoconf-based package that uses Protocol
Buffers, you should probably use the PKG_CHECK_MODULES macro in your
configure script like:
PKG_CHECK_MODULES([protobuf], [protobuf])
See the pkg-config man page for more info.
If you only want protobuf-lite, substitute "protobuf-lite" in place
of "protobuf" in these examples.
**Note for Mac users**
For a Mac system, Unix tools are not available by default. You will first need
to install Xcode from the Mac AppStore and then run the following command from
a terminal:
sudo xcode-select --install
To install Unix tools, you can install "port" following the instructions at
https://www.macports.org . This will reside in /opt/local/bin/port for most
Mac installations.
sudo /opt/local/bin/port install autoconf automake libtool
Then follow the Unix instructions above.
**Note for cross-compiling**
The makefiles normally invoke the protoc executable that they just
built in order to build tests. When cross-compiling, the protoc
executable may not be executable on the host machine. In this case,
you must build a copy of protoc for the host machine first, then use
the --with-protoc option to tell configure to use it instead. For
example:
./configure --with-protoc=protoc
This will use the installed protoc (found in your $PATH) instead of
trying to execute the one built during the build process. You can
also use an executable that hasn't been installed. For example, if
you built the protobuf package for your host machine in ../host,
you might do:
./configure --with-protoc=../host/src/protoc
Either way, you must make sure that the protoc executable you use
has the same version as the protobuf source code you are trying to
use it with.
**Note for Solaris users**
Solaris 10 x86 has a bug that will make linking fail, complaining
about libstdc++.la being invalid. We have included a work-around
in this package. To use the work-around, run configure as follows:
./configure LDFLAGS=-L$PWD/src/solaris
See src/solaris/libstdc++.la for more info on this bug.
**Note for HP C++ Tru64 users**
To compile invoke configure as follows:
./configure CXXFLAGS="-O -std ansi -ieee -D__USE_STD_IOSTREAM"
Also, you will need to use gmake instead of make.
**Note for AIX users**
Compile using the IBM xlC C++ compiler as follows:
./configure CXX=xlC
Also, you will need to use GNU `make` (`gmake`) instead of AIX `make`.
C++ Installation - Windows
--------------------------
If you only need the protoc binary, you can download it from the release
page:
https://github.com/protocolbuffers/protobuf/releases/latest
In the downloads section, download the zip file protoc-$VERSION-win32.zip.
It contains the protoc binary as well as public proto files of protobuf
library.
Pr
otobuf and its dependencies can be installed directly by using `vcpkg`:
>vcpkg install protobuf protobuf:x64-windows
If zlib support is desired, you'll also need to install the zlib feature:
>vcpkg install protobuf[zlib] protobuf[zlib]:x64-windows
See https://github.com/Microsoft/vcpkg for more information.
To build from source using Microsoft Visual C++, see [cmake/README.md](../cmake/README.md).
To build from source using Cygwin or MinGW, follow the Unix installation
instructions, above.
Binary Compatibility Warning
----------------------------
Due to the nature of C++, it is unlikely that any two versions of the
Protocol Buffers C++ runtime libraries will have compatible ABIs.
That is, if you linked an executable against an older version of
libprotobuf, it is unlikely to work with a newer version without
re-compiling. This problem, when it occurs, will normally be detected
immediately on startup of your app. Still, you may want to consider
using static linkage. You can configure this package to install
static libraries only using:
./configure --disable-shared
Usage
-----
The complete documentation for Protocol Buffers is available via the
web at:
https://developers.google.com/protocol-buffers/
.\protobuf-3.19.2\src\google\protobuf\compiler\zip_output_unittest.sh recites:
#!/bin/sh
#
# Protocol Buffers - Google's data interchange format
# Copyright 2009 Google Inc. All rights reserved.
# https://developers.google.com/protocol-buffers/
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# * Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following disclaimer
# in the documentation and/or other materials provided with the
# distribution.
# * Neither the name of Google Inc. nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# Author: kenton@google.com (Kenton Varda)
#
# Test protoc's zip output mode.
.\protobuf-3.19.2\src\google\protobuf\compiler\csharp\csharp_map_field.cc recites:
// Protocol Buffers - Google's data interchange format
// Copyright 2015 Google Inc. All rights reserved.
// https://developers.google.com/protocol-buffers/
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\protobuf-3.19.2\src\google\protobuf\stubs\mutex.h recites:
// Copyright (c) 2006, Google Inc.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification,
are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\protobuf-3.19.2\src\google\protobuf\stubs\platform_macros.h recites:
// Protocol Buffers - Google's data interchange format
// Copyright 2012 Google Inc. All rights reserved.
// https://developers.google.com/protocol-buffers/
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\protobuf-3.19.2\src\google\protobuf\stubs\template_util.h recites:
// Copyright 2005 Google Inc.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// ----
// Author: lar@google.com (Laramie Leavitt)
//
// Template
.\protobuf-3.19.2\src\google\protobuf\testing\zcgunzip.cc recites:
// Protocol Buffers - Google's data interchange format
// Copyright 2009 Google Inc. All ri
ghts reserved.
// https://developers.google.com/protocol-buffers/
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// Author: brianolson@google.com (Brian Olson)
// Based on original Protocol Buffers design by
// Sanjay Ghemawat, Jeff Dean, and others.
//
// Test program to verify that GzipInputStream is compatible with command line
// gunzip or java.util.zip.GzipInputStream
//
// Reads gzip stream on standard input and writes decompressed data to standard
// output.
.\protobuf-3.19.2\third_party\zlib.BUILD recites:
load("@rules_cc//cc:defs.bzl", "cc_library")
licenses(["notice"]) # BSD/MIT-like license (for zlib)
//////End:protobuf-3.19.2--------------------
////Begin:@testing-library/jest-dom 5.16.5--------------------
jest-dom-5.16.5\.all-contributorsrc recites:
{
"projectName": "jest-dom",
"projectOwner": "testing-library",
"repoType": "github",
"files": [
"README.md"
],
"imageSize": 100,
"commit": false,
"contributors": [
{
"login": "kentcdodds",
"name": "Kent C. Dodds",
"avatar_url": "https://avatars.githubusercontent.com/u/1500684?v=3",
"profile": "https://kentcdodds.com",
"contributions": [
"code",
"doc",
"infra",
"test"
]
},
{
"login": "audiolion",
"name": "Ryan Castner",
"avatar_url": "https://avatars1.githubusercontent.com/u/2430381?v=4",
"profile": "http://audiolion.github.io",
"contributions": [
"doc"
]
},
{
"login": "dnlsandiego",
"name": "Daniel Sandiego",
"avatar_url": "https://avatars0.githubusercontent.com/u/8008023?v=4",
"profile": "https://www.dnlsandiego.com",
"contributions": [
"code"
]
},
{
"login": "Miklet",
"name": "Paweł Mikołajczyk",
"avatar_url": "https://avatars2.githubusercontent.com/u/12592677?v=4",
"profile": "https://github.com/Miklet",
"contributions": [
"code"
]
},
{
"login": "alejandronanez",
"name": "Alejandro Ñáñez Ortiz",
"avatar_url": "https://avatars3.githubusercontent.com/u/464978?v=4",
"profile": "http://co.linkedin.com/in/alejandronanez/",
"contributions": [
"doc"
]
},
{
"login": "pbomb",
"name": "Matt Parrish",
"avatar_url": "https://avatars0.githubusercontent.com/u/1402095?v=4",
"profile": "https://github.com/pbomb",
"contributions": [
"bug",
"code",
"doc",
"test"
]
},
{
"login": "wKovacs64",
"name": "Justin Hall",
"avatar_url": "https://avatars1.githubusercontent.com/u/1288694?v=4",
"profile": "https://github.com/wKovacs64",
"contributions": [
"platform"
]
},
{
"login": "antoaravinth",
"name": "Anto Aravinth",
"avatar_url": "https://avatars1.githubusercontent.com/u/1241511?s=460&v=4",
"profile": "https://github.com/antoaravinth",
"contributions": [
"code",
"test",
"doc"
]
},
{
"login": "JonahMoses",
"name": "Jonah Moses",
"avatar_url": "https://avatars2.githubusercontent.com/u/3462296?v=4",
"profile": "https://github.com/JonahMoses",
"contributions": [
"doc"
]
},
{
"login": "lgandecki",
"name": "�ukasz Gandecki",
"avatar_url": "https://avatars1.githubusercontent.com/u/4002543?v=4",
"profile": "http://team.thebrain.pro",
"contributions": [
"code",
"test",
"doc"
]
},
{
"login": "sompylasar",
"name": "Ivan Babak",
"avatar_url": "https://avatars2.githubusercontent.com/u/498274?v=4",
"profile": "https://sompylasar.github.io",
"contributions": [
"bug",
"ideas"
]
},
{
"login": "jday3",
"name": "Jesse Day",
"avatar_url": "https://avatars3.githubusercontent.com/u/4439618?v=4",
"profile": "https://github.com/jday3",
"contributions": [
"code"
]
},
{
"login": "gnapse",
"name": "Ernesto GarcÃÂa",
"avatar_url": "https://avatars0.githubusercontent.com/u/15199?v=4",
"profile": "http://gnapse.github.io",
"contributions": [
"code",
"doc",
"test"
]
},
{
"login": "mvolkmann",
"name": "Mark Volkmann",
"avatar_url": "https://avatars0.githubusercontent.com/u/79312?v=4",
"profile": "http://ociweb.com/mark/",
"contributions": [
"bug",
"code"
]
},
{
"login": "smacpherson64",
"name": "smacpherson64",
"avatar_url": "https://avatars1.githubusercontent.com/u/1659099?v=4",
"profile": "https://github.com/smacpherson64",
"contributions": [
"code",
"doc",
"test"
]
},
{
"login": "jgoz",
"name": "John Gozde",
"avatar_url": "https://avatars2.githubusercontent.com/u/132233?v=4",
"profile": "https://github.com/jgoz",
"contributions": [
"bug",
"code"
]
},
{
"login": "callada",
"name": "Iwona",
"avatar_url": "https://avatars2.githubusercontent.com/u/7830590?v=4",
"profile": "https://github.com/callada",
"contributions": [
"code",
"doc",
"test"
]
},
{
"login": "6ewis",
"name": "Lewis",
"avatar_url": "https://avatars0.githubusercontent.com/u/840609?v=4",
"profile": "https://github.com/6ewis",
"contributions": [
"code"
]
},
{
"login": "lourenci",
"name": "Leandro Lourenci",
"avatar_url": "https://avatars3.githubus
ercontent.com/u/2339362?v=4",
"profile": "https://blog.lourenci.com/",
"contributions": [
"bug",
"doc",
"code",
"test"
]
},
{
"login": "mufasa71",
"name": "Shukhrat Mukimov",
"avatar_url": "https://avatars1.githubusercontent.com/u/626420?v=4",
"profile": "https://github.com/mufasa71",
"contributions": [
"bug"
]
},
{
"login": "dreyks",
"name": "Roman Usherenko",
"avatar_url": "https://avatars3.githubusercontent.com/u/1481264?v=4",
"profile": "https://github.com/dreyks",
"contributions": [
"code",
"test"
]
},
{
"login": "jhsu",
"name": "Joe Hsu",
"avatar_url": "https://avatars1.githubusercontent.com/u/648?v=4",
"profile": "http://josephhsu.com",
"contributions": [
"doc"
]
},
{
"login": "diegohaz",
"name": "Haz",
"avatar_url": "https://avatars3.githubusercontent.com/u/3068563?v=4",
"profile": "https://twitter.com/diegohaz",
"contributions": [
"bug",
"code"
]
},
{
"login": "revathskumar",
"name": "Revath S Kumar",
"avatar_url": "https://avatars3.githubusercontent.com/u/463904?v=4",
"profile": "https://blog.revathskumar.com",
"contributions": [
"code"
]
},
{
"login": "hiwelo",
"name": "hiwelo.",
"avatar_url": "https://avatars0.githubusercontent.com/u/4989733?v=4",
"profile": "https://raccoon.studio",
"contributions": [
"code",
"ideas",
"test"
]
},
{
"login": "lukaszfiszer",
"name": "�ukasz Fiszer",
"avatar_url": "https://avatars3.githubusercontent.com/u/1201711?v=4",
"profile": "https://github.com/lukaszfiszer",
"contributions": [
"code"
]
},
{
"login": "jeanchung",
"name": "Jean Chung",
"avatar_url": "https://avatars0.githubusercontent.com/u/10778036?v=4",
"profile": "https://github.com/jeanchung",
"contributions": [
"code",
"test"
]
},
{
"login": "CarlaTeo",
"name": "CarlaTeo",
"avatar_url": "https://avatars3.githubusercontent.com/u/9220147?v=4",
"profile": "https://github.com/CarlaTeo",
"contributions": [
"code",
"test"
]
},
{
"login": "YardenShoham",
"name": "Yarden Shoham",
"avatar_url": "https://avatars3.githubusercontent.com/u/20454870?v=4",
"profile": "https://github.com/YardenShoham",
"contributions": [
"doc"
]
},
{
"login": "kandros",
"name": "Jaga Santagostino",
"avatar_url": "https://avatars0.githubusercontent.com/u/4562878?v=4",
"profile": "http://jagascript.com",
"contributions": [
"bug",
"test",
"doc"
]
},
{
"login": "connormeredith",
"name": "Connor Meredith",
"avatar_url": "https://avatars0.githubusercontent.com/u/4907463?v=4",
"profile": "https://github.com/connormeredith",
"contributions": [
"code",
"test",
"doc"
]
},
{
"login": "pwolaq",
"name": "Pawel Wolak",
"avatar_url": "https://avatars3.githubusercontent.com/u/10261750?v=4",
"profile": "https://github.com/pwolaq",
"contributions": [
"test"
]
},
{
"login": "MichaelDeBoey",
"name": "Michaël De Boey",
"avatar_url": "https://avatars3.githubusercontent.com/u/6643991?v=4",
"profile": "https://michaeldeboey.be",
"contributions": [
"infra"
]
},
{
"login": "jzarzeckis",
"name": "J�nis Zaržeckis",
"avatar_url": "https://avatars3.githubusercontent.com/u/919350?v=4",
"profile": "https://github.com/jzarzeckis",
"contributions": [
"doc"
]
},
{
"login": "koala-lava",
"name": "koala-lava",
"avatar_url": "https://avatars0.githubusercontent.com/u/15828770?v=4",
"profile": "https://github.com/koala-lava",
"contributions": [
"doc"
]
},
{
"login": "JPBlancoDB",
"name": "Juan Pablo Blanco",
"avatar_url": "https://avatars1.githubusercontent.com/u/16567863?v=4",
"profile": "https://jpblanco.dev",
"contributions": [
"doc"
]
},
{
"login": "benmonro",
"name": "Ben Monro",
"avatar_url": "https://avatars3.githubusercontent.com/u/399236?v=4",
"profile": "https://github.com/benmonro",
"contributions": [
"doc"
]
},
{
"login": "jeffbernst",
"name": "Jeff Bernstein",
"avatar_url": "https://avatars1.githubusercontent.com/u/6685560?v=4",
"profile": "http://jeffbernstein.io",
"contributions": [
"doc"
]
},
{
"login": "SergiCL",
"name": "Sergi",
"avatar_
url": "https://avatars3.githubusercontent.com/u/41625166?v=4",
"profile": "https://github.com/SergiCL",
"contributions": [
"code",
"test"
]
},
{
"login": "skovy",
"name": "Spencer Miskoviak",
"avatar_url": "https://avatars1.githubusercontent.com/u/5247455?v=4",
"profile": "https://skovy.dev",
"contributions": [
"doc"
]
},
{
"login": "jonrimmer",
"name": "Jon Rimmer",
"avatar_url": "https://avatars1.githubusercontent.com/u/183786?v=4",
"profile": "https://twitter.com/jonrimmer",
"contributions": [
"code",
"test"
]
},
{
"login": "cloud-walker",
"name": "Luca Barone",
"avatar_url": "https://avatars3.githubusercontent.com/u/1144075?v=4",
"profile": "https://github.com/cloud-walker",
"contributions": [
"code",
"test",
"ideas"
]
},
{
"login": "mfelmy",
"name": "Malte Felmy",
"avatar_url": "https://avatars2.githubusercontent.com/u/29504917?v=4",
"profile": "https://github.com/mfelmy",
"contributions": [
"code",
"test"
]
},
{
"login": "Ishaan28malik",
"name": "Championrunner",
"avatar_url": "https://avatars3.githubusercontent.com/u/27343592?v=4",
"profile": "https://ghuser.io/Ishaan28malik",
"contributions": [
"doc"
]
},
{
"login": "BurntCaramel",
"name": "Patrick Smith",
"avatar_url": "https://avatars0.githubusercontent.com/u/2635733?v=4",
"profile": "https://icing.space/",
"contributions": [
"code",
"test",
"doc"
]
},
{
"login": "rubenmoya",
"name": "Rubén Moya",
"avatar_url": "https://avatars3.githubusercontent.com/u/905225?v=4",
"profile": "https://rubenmoya.dev",
"contributions": [
"code",
"test",
"doc"
]
},
{
"login": "DanielaValero",
"name": "Daniela Valero",
"avatar_url": "https://avatars1.githubusercontent.com/u/1307954?v=4",
"profile": "https://danielavalero.com/",
"contributions": [
"code",
"test",
"doc"
]
},
{
"login": "missilev",
"name": "Vladislav Katsura",
"avatar_url": "https://avatars1.githubusercontent.com/u/33201468?v=4",
"profile": "https://github.com/missilev",
"contributions": [
"code",
"test"
]
},
{
"login": "tf",
"name": "Tim Fischbach",
"avatar_url": "https://avatars3.githubusercontent.com/u/26554?v=4",
"profile": "http://stderr.timfischbach.de",
"contributions": [
"code",
"test",
"ideas"
]
},
{
"login": "kboedges",
"name": "Katie Boedges",
"avatar_url": "https://avatars1.githubusercontent.com/u/8322476?v=4",
"profile": "http://katieboedges.com/",
"contributions": [
"infra"
]
},
{
"login": "brrianalexis",
"name": "Brian Alexis",
"avatar_url": "https://avatars2.githubusercontent.com/u/51463930?v=4",
"profile": "https://github.com/brrianalexis",
"contributions": [
"test"
]
},
{
"login": "just-boris",
"name": "Boris Serdiuk",
"avatar_url": "https://avatars2.githubusercontent.com/u/812240?v=4",
"profile": "https://twitter.com/boriscoder",
"contributions": [
"bug",
"code",
"test"
]
},
{
"login": "danawoodman",
"name": "Dana Woodman",
"avatar_url": "https://avatars1.githubusercontent.com/u/157695?v=4",
"profile": "http://danawoodman.com",
"contributions": [
"doc"
]
},
{
"login": "MoSattler",
"name": "Mo Sattler",
"avatar_url": "https://avatars2.githubusercontent.com/u/64152453?v=4",
"profile": "https://github.com/MoSattler",
"contributions": [
"doc"
]
},
{
"login": "geoffrich",
"name": "Geoff Rich",
"avatar_url": "https://avatars2.githubusercontent.com/u/4992896?v=4",
"profile": "https://github.com/geoffrich",
"contributions": [
"code",
"test",
"ideas",
"bug"
]
},
{
"login": "syneva-runyan",
"name": "Syneva",
"avatar_url": "https://avatars0.githubusercontent.com/u/20505588?v=4",
"profile": "https://github.com/syneva-runyan",
"contributions": [
"code"
]
},
{
"login": "nickmccurdy",
"name": "Nick McCurdy",
"avatar_url": "https://avatars0.githubusercontent.com/u/927220?v=4",
"profile": "https://nickmccurdy.com/",
"contributions": [
"doc",
"bug",
"code"
]
},
{
"login": "obedparla",
"name": "Obed Marquez Parlapiano",
"avatar_url": "https://avatars1.githubusercontent.c
om/u/10674462?v=4",
"profile": "https://obedparla.com/",
"contributions": [
"doc"
]
},
{
"login": "calebeby",
"name": "Caleb Eby",
"avatar_url": "https://avatars.githubusercontent.com/u/13206945?v=4",
"profile": "https://github.com/calebeby",
"contributions": [
"doc",
"code",
"test"
]
},
{
"login": "marcelbarner",
"name": "Marcel Barner",
"avatar_url": "https://avatars.githubusercontent.com/u/12788744?v=4",
"profile": "https://github.com/marcelbarner",
"contributions": [
"code",
"test"
]
},
{
"login": "SevenOutman",
"name": "Doma",
"avatar_url": "https://avatars.githubusercontent.com/u/8225666?v=4",
"profile": "https://github.com/SevenOutman",
"contributions": [
"code",
"test"
]
},
{
"login": "julienw",
"name": "Julien Wajsberg",
"avatar_url": "https://avatars.githubusercontent.com/u/454175?v=4",
"profile": "http://everlong.org/",
"contributions": [
"code",
"test"
]
},
{
"login": "icecream17",
"name": "steven nguyen",
"avatar_url": "https://avatars.githubusercontent.com/u/58114641?v=4",
"profile": "http://lichess.org/@/StevenEmily",
"contributions": [
"doc"
]
},
{
"login": "tu4mo",
"name": "tu4mo",
"avatar_url": "https://avatars.githubusercontent.com/u/16735302?v=4",
"profile": "http://tu4mo.com",
"contributions": [
"doc"
]
},
{
"login": "MatanBobi",
"name": "Matan Borenkraout",
"avatar_url": "https://avatars.githubusercontent.com/u/12711091?v=4",
"profile": "https://matan.io",
"contributions": [
"platform"
]
},
{
"login": "yannbf",
"name": "Yann Braga",
"avatar_url": "https://avatars.githubusercontent.com/u/1671563?v=4",
"profile": "https://github.com/yannbf",
"contributions": [
"code"
]
},
{
"login": "IanVS",
"name": "Ian VanSchooten",
"avatar_url": "https://avatars.githubusercontent.com/u/4616705?v=4",
"profile": "https://github.com/IanVS",
"contributions": [
"code"
]
},
{
"login": "cbroeren",
"name": "Chantal Broeren",
"avatar_url": "https://avatars.githubusercontent.com/u/7499806?v=4",
"profile": "http://chantalbroeren.nl",
"contributions": [
"doc"
]
},
{
"login": "astorije",
"name": "Jérémie Astori",
"avatar_url": "https://avatars.githubusercontent.com/u/113730?v=4",
"profile": "https://jeremie.astori.fr",
"contributions": [
"code",
"ideas"
]
},
{
"login": "ashleyryan",
"name": "Ashley Ryan",
"avatar_url": "https://avatars.githubusercontent.com/u/9469374?v=4",
"profile": "https://github.com/ashleyryan",
"contributions": [
"code",
"ideas"
]
}
],
"repoHost": "https://github.com",
"contributorsPerLine": 7,
"skipCi": false
}
jest-dom-5.16.5\LICENSE recites:
The MIT License (MIT)
Copyright (c) 2017 Kent C. Dodds
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
jest-dom-5.16.5\package.json recites:
"kcd-scripts build",
"format": "kcd-scripts format",
"lint": "kcd-scripts lint",
"setup": "npm install && npm run validate -s",
"test": "kcd-scripts test",
"test:update": "npm test -- --updateSnapshot --coverage",
"validate": "kcd-scripts validate"
},
"files": [
"dist",
"extend-expect.js",
"matchers.js"
],
"keywords": [
"testing",
"dom",
"jest",
"jsdom"
],
"author": "Ernesto Garcia (http://gnapse.github.io)",
"license": "MIT",
"dependencies": {
"@babel/runtime": "^7.9.2",
"@types/testing-library__jest-dom": "^5.9.1",
"aria-query": "^5.0.0",
"chalk":
"^3.0.0",
"@adobe/css-tools": "^4.0.1",
"css.escape": "^1.5.1",
"dom-accessibility-api": "^0.5.6",
"lodash": "^4.17.15",
"redent": "^3.0.0"
},
"devDependencies": {
"jest-environment-jsdom-sixteen": "^1.0.3",
"jest-watch-select-projects": "^2.0.0",
"jsdom": "^16.2.1",
"kcd-scripts": "^11.1.0",
"pretty-format": "^25.1.0"
},
"eslintConfig": {
"extends": "./node_modules/kcd-scripts/eslint.js",
"rules": {
"@babel/no-invalid-this": "off"
},
"overrides": [
{
"files": [
"src/__tests__/*.js"
],
"rules": {
"max-lines-per-function": "off"
}
}
]
},
"eslintIgnore": [
"node_modules",
"coverage",
"dist"
],
"repository": {
"type": "git",
"url": "https://github.com/testing-library/jest-dom"
},
"bugs": {
"url": "https://github.com/testing-library/jest-dom/issues"
},
"homepage": "https://github.com/testing-library/jest-dom#readme"
}
jest-dom-5.16.5\README.md recites:
jest-dom
Custom jest matchers to test the state of the DOM
---
[![Build Status][build-badge]][build]
[![Code Coverage][coverage-badge]][coverage]
[![version][version-badge]][package] [![downloads][downloads-badge]][npmtrends]
[![MIT License][license-badge]][license]
[![All Contributors](https://img.shields.io/badge/all_contributors-28-orange.svg?style=flat-square)](#contributors-)
[![PRs Welcome][prs-badge]][prs] [![Code of Conduct][coc-badge]][coc]
[![Discord][discord-badge]][discord]
[![Watch on GitHub][github-watch-badge]][github-watch]
[![Star on GitHub][github-star-badge]][github-star]
[![Tweet][twitter-badge]][twitter]
## The problem
You want to use [jest][] to write tests that assert various things about the
state of a DOM. As part of that goal, you want to avoid all the repetitive
patterns that arise in doing so. Checking for an element's attributes, its text
content, its css classes, you name it.
## This solution
The `@testing-library/jest-dom` library provides a set of custom jest matchers
that you can use to extend jest. These will make your tests more declarative,
clear to read and to maintain.
## Table of Contents
- [Installation](#installation)
- [Usage](#usage)
- [With TypeScript](#with-typescript)
- [Custom matchers](#custom-matchers)
- [`toBeDisabled`](#tobedisabled)
- [`toBeEnabled`](#tobeenabled)
- [`toBeEmptyDOMElement`](#tobeemptydomelement)
- [`toBeInTheDocument`](#tobeinthedocument)
- [`toBeInvalid`](#tobeinvalid)
- [`toBeRequired`](#toberequired)
- [`toBeValid`](#tobevalid)
- [`toBeVisible`](#tobevisible)
- [`toContainElement`](#tocontainelement)
- [`toContainHTML`](#tocontainhtml)
- [`toHaveAccessibleDescription`](#tohaveaccessibledescription)
- [`toHaveAccessibleName`](#tohaveaccessiblename)
- [`toHaveAttribute`](#tohaveattribute)
- [`toHaveClass`](#tohaveclass)
- [`toHaveFocus`](#tohavefocus)
- [`toHaveFormValues`](#tohaveformvalues)
- [`toHaveStyle`](#tohavestyle)
- [`toHaveTextContent`](#tohavetextcontent)
- [`toHaveValue`](#tohavevalue)
- [`toHaveDisplayValue`](#tohavedisplayvalue)
- [`toBeChecked`](#tobechecked)
- [`toBePartiallyChecked`](#tobepartiallychecked)
- [`toHaveErrorMessage`](#tohaveerrormessage)
- [Deprecated matchers](#deprecated-matchers)
- [`toBeEmpty`](#tobeempty)
- [`toBeInTheDOM`](#tobeinthedom)
- [`toHaveDescription`](#tohavedescription)
- [Inspiration](#inspiration)
- [Other Solutions](#other-solutions)
- [Guiding Principles](#guiding-principles)
- [Contributors](#contributors)
- [LICENSE](#license)
## Installation
This module is distributed via [npm][npm] which is bundled with [node][node] and
should be installed as one of your project's `devDependencies`:
```
npm install --save-dev @testing-library/jest-dom
```
or
for installation with [yarn](https://yarnpkg.com/) package manager.
```
yarn add --dev @testing-library/jest-dom
```
> Note: We also recommend installing the jest-dom eslint plugin which provides
> auto-fixable lint rules that prevent false positive tests and improve test
> readability by ensuring you are using the right matchers in your tests. More
> details can be found at
> [eslint-plugin-jest-dom](https://github.com/testing-library/eslint-plugin-jest-dom).
## Usage
Import `@testing-library/jest-dom` once (for instance in your [tests setup
file][]) and you're good to go:
[tests setup file]:
https://jestjs.io/docs/en/configu
ration.html#setupfilesafterenv-array
```javascript
// In your own jest-setup.js (or any other name)
import '@testing-library/jest-dom'
// In jest.config.js add (if you haven't already)
setupFilesAfterEnv: ['/jest-setup.js']
```
### With TypeScript
If you're using TypeScript, make sure your setup file is a `.ts` and not a `.js`
to include the necessary types.
You will also need to include your setup file in your `tsconfig.json` if you
haven't already:
```json
// In tsconfig.json
"include": [
...
"./jest-setup.ts"
],
```
## Custom matchers
`@testing-library/jest-dom` can work with any library or framework that returns
DOM elements from queries. The custom matcher examples below are written using
matchers from `@testing-library`'s suite of libraries (e.g. `getByTestId`,
`queryByTestId`, `getByText`, etc.)
### `toBeDisabled`
```typescript
toBeDisabled()
```
This allows you to check whether an element is disabled from the user's
perspective. According to the specification, the following elements can be
[disabled](https://html.spec.whatwg.org/multipage/semantics-other.html#disabled-elements):
`button`, `input`, `select`, `textarea`, `optgroup`, `option`, `fieldset`, and
custom elements.
This custom matcher considers an element as disabled if the element is among the
types of elements that can be disabled (listed above), and the `disabled`
attribute is present. It will also consider the element as disabled if it's
inside a parent form element that supports being disabled and has the `disabled`
attribute present.
#### Examples
```html
submit
link
```
```javascript
expect(getByTestId('button')).toBeDisabled()
expect(getByTestId('input')).toBeDisabled()
expect(getByText('link')).not.toBeDisabled()
```
> This custom matcher does not take into account the presence or absence of the
> `aria-disabled` attribute. For more on why this is the case, check
> [#144](https://github.com/testing-library/jest-dom/issues/144).
### `toBeEnabled`
```typescript
toBeEnabled()
```
This allows you to check whether an element is not disabled from the user's
perspective.
It works like `not.toBeDisabled()`. Use this matcher to avoid double negation in
your tests.
> This custom matcher does not take into account the presence or absence of the
> `aria-disabled` attribute. For more on why this is the case, check
> [#144](https://github.com/testing-library/jest-dom/issues/144).
### `toBeEmptyDOMElement`
```typescript
toBeEmptyDOMElement()
```
This allows you to assert whether an element has no visible content for the
user. It ignores comments but will fail if the element contains white-space.
#### Examples
```html
```
```javascript
expect(getByTestId('empty')).toBeEmptyDOMElement()
expect(getByTestId('not-empty')).not.toBeEmptyDOMElement()
expect(getByTestId('with-whitespace')).not.toBeEmptyDOMElement()
```
### `toBeInTheDocument`
```typescript
toBeInTheDocument()
```
This allows you to assert whether an element is present in the document or not.
#### Examples
```html
Html Element
```
```javascript
expect(
getByTestId(document.documentElement, 'html-element'),
).toBeInTheDocument()
expect(getByTestId(document.documentElement, 'svg-element')).toBeInTheDocument()
expect(
queryByTestId(document.documentElement, 'does-not-exist'),
).not.toBeInTheDocument()
```
> Note: This matcher does not find detached elements. The element must be added
> to the document to be found by toBeInTheDocument. If you desire to search in a
> detached element please use: [`toContainElement`](#tocontainelement)
### `toBeInvalid`
```typescript
toBeInvalid()
```
This allows you to check if an element, is currently invalid.
An element is invalid if it has an
[`aria-invalid` attribute](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques/Using_the_aria-invalid_attribute)
with no value or a value of `"true"`, or if the result of
[`checkValidity()`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation)
is `false`.
#### Examples
```html
```
```javascript
expect(getByTestId('no-aria-invalid')).not.toBeInvalid()
expect(getByTestId('aria-invalid')).toBeInvalid()
expect(getByTestId('a
ria-invalid-value')).toBeInvalid()
expect(getByTestId('aria-invalid-false')).not.toBeInvalid()
expect(getByTestId('valid-form')).not.toBeInvalid()
expect(getByTestId('invalid-form')).toBeInvalid()
```
### `toBeRequired`
```typescript
toBeRequired()
```
This allows you to check if a form element is currently required.
An element is required if it is having a `required` or `aria-required="true"`
attribute.
#### Examples
```html
```
```javascript
expect(getByTestId('required-input')).toBeRequired()
expect(getByTestId('aria-required-input')).toBeRequired()
expect(getByTestId('conflicted-input')).toBeRequired()
expect(getByTestId('aria-not-required-input')).not.toBeRequired()
expect(getByTestId('optional-input')).not.toBeRequired()
expect(getByTestId('unsupported-type')).not.toBeRequired()
expect(getByTestId('select')).toBeRequired()
expect(getByTestId('textarea')).toBeRequired()
expect(getByTestId('supported-role')).not.toBeRequired()
expect(getByTestId('supported-role-aria')).toBeRequired()
```
### `toBeValid`
```typescript
toBeValid()
```
This allows you to check if the value of an element, is currently valid.
An element is valid if it has no
[`aria-invalid` attribute](https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/ARIA_Techniques/Using_the_aria-invalid_attribute)s
or an attribute value of `"false"`. The result of
[`checkValidity()`](https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/HTML5/Constraint_validation)
must also be `true` if it's a form element.
#### Examples
```html
```
```javascript
expect(getByTestId('no-aria-invalid')).toBeValid()
expect(getByTestId('aria-invalid')).not.toBeValid()
expect(getByTestId('aria-invalid-value')).not.toBeValid()
expect(getByTestId('aria-invalid-false')).toBeValid()
expect(getByTestId('valid-form')).toBeValid()
expect(getByTestId('invalid-form')).not.toBeValid()
```
### `toBeVisible`
```typescript
toBeVisible()
```
This allows you to check if an element is currently visible to the user.
An element is visible if **all** the following conditions are met:
- it is present in the document
- it does not have its css property `display` set to `none`
- it does not have its css property `visibility` set to either `hidden` or
`collapse`
- it does not have its css property `opacity` set to `0`
- its parent element is also visible (and so on up to the top of the DOM tree)
- it does not have the
[`hidden`](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/hidden)
attribute
- if ` ` it has the `open` attribute
#### Examples
```html
Zero Opacity Example
Visibility Hidden Example
Display None Example
Hidden Parent Example
Visible Example
Hidden Attribute Example
Title of hidden text
Hidden Details Example
Title of visible text
Visible Details Example
```
```javascript
expect(getByText('Zero Opacity Example')).not.toBeVisible()
expect(getByText('Visibility Hidden Example')).not.toBeVisible()
expect(getByText('Display None Example')).not.toBeVisible()
expect(getByText('Hidden Parent Example')).not.toBeVisible()
expect(getByText('Visible Example')).toBeVisible()
expect(getByText('Hidden Attribute Example')).not.toBeVisible()
expect(getByText('Hidden Details Example')).not.toBeVisible()
expect(getByText('Visible Details Example')).toBeVisible()
```
### `toContainElement`
```typescript
toContainElement(element: HTMLElement | SVGElement | null)
```
This allows you to assert whether an element contains another element as a
descendant or not.
#### Examples
```html
```
```javascript
const ancestor = getByTestId('ancestor')
const descendant = getByTestId('descendant')
const nonExistantElement = getByTestId('does-not-exist')
expect(ancestor).toContainElement(descendant)
expect(descendant).not.toContainElement(ancestor)
expect(ancestor).not.toContainElement(nonExistantElement)
```
### `toContainHTML`
```typescript
toContainHTML(htmlText: string)
```
Assert whether a string representing a HTML element is contained in another
element. The string should contain valid html, and not any incomplete html.
#### Examples
```html
```
```javascript
// These are valid uses
expect(getByTestId('parent')).toContainHTML(' ')
expect(getByTestId('parent')).toContainHTML(' ')
expect(getByTestId('parent')).not.toContainHTML(' ')
// These won't work
expect(getByTestId('parent')).toContainHTML('data-testid="child"')
expect(getByTestId('parent')).toContainHTML('data-testid')
expect(getByTestId('parent')).toContainHTML('')
```
> Chances are you probably do not need to use this matcher. We encourage testing
> from the perspective of how the user perceives the app in a browser. That's
> why testing against a specific DOM structure is not advised.
>
> It could be useful in situations where the code being tested renders html that
> was obtained from an external source, and you want to validate that that html
> code was used as intended.
>
> It should not be used to check DOM structure that you control. Please use
> [`toContainElement`](#tocontainelement) instead.
### `toHaveAccessibleDescription`
```typescript
toHaveAccessibleDescription(expectedAccessibleDescription?: string | RegExp)
```
This allows you to assert that an element has the expected
[accessible description](https://w3c.github.io/accname/).
You can pass the exact string of the expected accessible description, or you can
make a partial match passing a regular expression, or by using
[expect.stringContaining](https://jestjs.io/docs/en/expect.html#expectnotstringcontainingstring)/[expect.stringMatching](https://jestjs.io/docs/en/expect.html#expectstringmatchingstring-regexp).
#### Examples
```html
Start
About
The logo of Our Company
```
```js
expect(getByTestId('link')).toHaveAccessibleDescription()
expect(getByTestId('link')).toHaveAccessibleDescription('A link to start over')
expect(getByTestId('link')).not.toHaveAccessibleDescription('Home page')
expect(getByTestId('extra-link')).not.toHaveAccessibleDescription()
expect(getByTestId('avatar')).not.toHaveAccessibleDescription()
expect(getByTestId('logo')).not.toHaveAccessibleDescription('Company logo')
expect(getByTestId('logo')).toHaveAccessibleDescription(
'The logo of Our Company',
)
```
### `toHaveAccessibleName`
```typescript
toHaveAccessibleName(expectedAccessibleName?: string | RegExp)
```
This allows you to assert that an element has the expected
[accessible name](https://w3c.github.io/accname/). It is useful, for instance,
to assert that form elements and buttons are properly labelled.
You can pass the exact string of the expected accessible name, or you can make a
partial match passing a regular expression, or by using
[expect.stringContaining](https://jestjs.io/docs/en/expect.html#expectnotstringcontainingstring)/[expect.stringMatching](https://jestjs.io/docs/en/expect.html#expectstringmatchingstring-regexp).
#### Examples
```html
Test title
Test content
Test
```
```javascript
expect(getByTestId('img-alt')).toHaveAccessibleName('Test alt')
expect(getByTestId('img-empty-alt')).not.toHaveAccessibleName()
expect(getByTestId('svg-title')).toHaveAccessibleName('Test title')
expect(getByTestId('button-img-alt')).toHaveAccessibleName()
expect(getByTestId('img-paragraph')).not.toHaveAccessibleName()
expect(getByTestId('svg-button')).toHaveAccessibleName()
expect(getByTestId('svg-without-title')).not.toHaveAccessibleName()
expect(getByTestId('input-title')).toHaveAccessibleName()
```
### `toHaveAttribute`
```typescript
toHaveAttribute(attr: string, value?: any)
```
Th
is allows you to check whether the given element has an attribute or not. You
can also optionally check that the attribute has a specific expected value or
partial match using
[expect.stringContaining](https://jestjs.io/docs/en/expect.html#expectnotstringcontainingstring)/[expect.stringMatching](https://jestjs.io/docs/en/expect.html#expectstringmatchingstring-regexp)
#### Examples
```html
ok
```
```javascript
const button = getByTestId('ok-button')
expect(button).toHaveAttribute('disabled')
expect(button).toHaveAttribute('type', 'submit')
expect(button).not.toHaveAttribute('type', 'button')
expect(button).toHaveAttribute('type', expect.stringContaining('sub'))
expect(button).toHaveAttribute('type', expect.not.stringContaining('but'))
```
### `toHaveClass`
```typescript
toHaveClass(...classNames: string[], options?: {exact: boolean})
```
This allows you to check whether the given element has certain classes within
its `class` attribute.
You must provide at least one class, unless you are asserting that an element
does not have any classes.
#### Examples
```html
No Classes
```
```javascript
const deleteButton = getByTestId('delete-button')
const noClasses = getByTestId('no-classes')
expect(deleteButton).toHaveClass('extra')
expect(deleteButton).toHaveClass('btn-danger btn')
expect(deleteButton).toHaveClass('btn-danger', 'btn')
expect(deleteButton).not.toHaveClass('btn-link')
expect(deleteButton).toHaveClass('btn-danger extra btn', {exact: true}) // to check if the element has EXACTLY a set of classes
expect(deleteButton).not.toHaveClass('btn-danger extra', {exact: true}) // if it has more than expected it is going to fail
expect(noClasses).not.toHaveClass()
```
### `toHaveFocus`
```typescript
toHaveFocus()
```
This allows you to assert whether an element has focus or not.
#### Examples
```html
```
```javascript
const input = getByTestId('element-to-focus')
input.focus()
expect(input).toHaveFocus()
input.blur()
expect(input).not.toHaveFocus()
```
### `toHaveFormValues`
```typescript
toHaveFormValues(expectedValues: {
[name: string]: any
})
```
This allows you to check if a form or fieldset contains form controls for each
given name, and having the specified value.
> It is important to stress that this matcher can only be invoked on a [form][]
> or a [fieldset][] element.
>
> This allows it to take advantage of the [.elements][] property in `form` and
> `fieldset` to reliably fetch all form controls within them.
>
> This also avoids the possibility that users provide a container that contains
> more than one `form`, thereby intermixing form controls that are not related,
> and could even conflict with one another.
This matcher abstracts away the particularities with which a form control value
is obtained depending on the type of form control. For instance, ` `
elements have a `value` attribute, but `` elements do not. Here's a list
of all cases covered:
- ` ` elements return the value as a **number**, instead of
a string.
- ` ` elements:
- if there's a single one with the given `name` attribute, it is treated as a
**boolean**, returning `true` if the checkbox is checked, `false` if
unchecked.
- if there's more than one checkbox with the same `name` attribute, they are
all treated collectively as a single form control, which returns the value
as an **array** containing all the values of the selected checkboxes in the
collection.
- ` ` elements are all grouped by the `name` attribute, and
such a group treated as a single form control. This form control returns the
value as a **string** corresponding to the `value` attribute of the selected
radio button within the group.
- ` ` elements return the value as a **string**. This also
applies to ` ` elements having any other possible `type` attribute
that's not explicitly covered in different rules above (e.g. `search`,
`email`, `date`, `password`, `hidden`, etc.)
- `` elements without the `multiple` attribute return the value as a
**string** corresponding to the `value` attribute of the selected `option`, or
`undefined` if there's no selected option.
- `` elements return the value as an **array** containing all
the values of the [selected options][].
- `