mirror of https://github.com/grpc/grpc.git
commit
7e5cfc2ab3
3143 changed files with 220533 additions and 158515 deletions
@ -1,5 +1,12 @@ |
||||
--- |
||||
Language: Cpp |
||||
BasedOnStyle: Google |
||||
DerivePointerAlignment: false |
||||
PointerAlignment: Left |
||||
--- |
||||
Language: ObjC |
||||
BasedOnStyle: Google |
||||
ColumnLimit: 100 |
||||
ObjCBlockIndentWidth: 2 |
||||
... |
||||
|
||||
|
@ -1,6 +1,9 @@ |
||||
# Auto-generated by the tools/mkowners/mkowners.py tool |
||||
# Uses OWNERS files in different modules throughout the |
||||
# repository as the source of truth for module ownership. |
||||
/**/OWNERS @markdroth @nicolasnoble @ctiller |
||||
/bazel/** @nicolasnoble @dgquintas @ctiller |
||||
/src/core/ext/filters/client_channel/** @markdroth @dgquintas @ctiller |
||||
/**/OWNERS @markdroth @nicolasnoble @a11r |
||||
/bazel/** @nicolasnoble @dgquintas @a11r @vjpai |
||||
/cmake/** @jtattermusch @nicolasnoble @matt-kwong |
||||
/src/core/ext/filters/client_channel/** @markdroth @dgquintas @AspirinSJL |
||||
/tools/dockerfile/** @jtattermusch @matt-kwong @nicolasnoble |
||||
/tools/run_tests/performance/** @ncteisen @matt-kwong @jtattermusch |
||||
|
@ -0,0 +1,108 @@ |
||||
[VARIABLES] |
||||
|
||||
# TODO(https://github.com/PyCQA/pylint/issues/1345): How does the inspection |
||||
# not include "unused_" and "ignored_" by default? |
||||
dummy-variables-rgx=^ignored_|^unused_ |
||||
|
||||
[DESIGN] |
||||
|
||||
# NOTE(nathaniel): Not particularly attached to this value; it just seems to |
||||
# be what works for us at the moment (excepting the dead-code-walking Beta |
||||
# API). |
||||
max-args=6 |
||||
|
||||
[MISCELLANEOUS] |
||||
|
||||
# NOTE(nathaniel): We are big fans of "TODO(<issue link>): " and |
||||
# "NOTE(<username or issue link>): ". We do not allow "TODO:", |
||||
# "TODO(<username>):", "FIXME:", or anything else. |
||||
notes=FIXME,XXX |
||||
|
||||
[MESSAGES CONTROL] |
||||
|
||||
disable= |
||||
# These suppressions are specific to tests: |
||||
# |
||||
# TODO(https://github.com/grpc/grpc/issues/261): investigate |
||||
# each of the following one by one and consider eliminating |
||||
# the suppression category. |
||||
# Eventually, the hope is to eliminate the .pylintrc-tests |
||||
# altogether and rely on .pylintrc for everything. |
||||
pointless-statement, |
||||
no-member, |
||||
no-self-use, |
||||
attribute-defined-outside-init, |
||||
unused-argument, |
||||
unused-variable, |
||||
unused-import, |
||||
redefined-builtin, |
||||
too-many-public-methods, |
||||
too-many-locals, |
||||
redefined-variable-type, |
||||
redefined-outer-name, |
||||
ungrouped-imports, |
||||
too-many-branches, |
||||
too-many-arguments, |
||||
too-many-format-args, |
||||
too-many-return-statements, |
||||
too-many-statements, |
||||
line-too-long, |
||||
wrong-import-position, |
||||
wrong-import-order, |
||||
# -- END OF TEST-SPECIFIC SUPPRESSIONS -- |
||||
|
||||
|
||||
# TODO(https://github.com/PyCQA/pylint/issues/59#issuecomment-283774279): |
||||
# Enable cyclic-import after a 1.7-or-later pylint release that |
||||
# recognizes our disable=cyclic-import suppressions. |
||||
cyclic-import, |
||||
# TODO(https://github.com/grpc/grpc/issues/8622): Enable this after the |
||||
# Beta API is removed. |
||||
duplicate-code, |
||||
# TODO(https://github.com/grpc/grpc/issues/261): Doesn't seem to |
||||
# understand enum and concurrent.futures; look into this later with the |
||||
# latest pylint version. |
||||
import-error, |
||||
# TODO(https://github.com/grpc/grpc/issues/261): Enable this one. |
||||
# Should take a little configuration but not much. |
||||
invalid-name, |
||||
# TODO(https://github.com/grpc/grpc/issues/261): This doesn't seem to |
||||
# work for now? Try with a later pylint? |
||||
locally-disabled, |
||||
# NOTE(nathaniel): What even is this? *Enabling* an inspection results |
||||
# in a warning? How does that encourage more analysis and coverage? |
||||
locally-enabled, |
||||
# NOTE(nathaniel): We don't write doc strings for most private code |
||||
# elements. |
||||
missing-docstring, |
||||
# NOTE(nathaniel): In numeric comparisons it is better to have the |
||||
# lesser (or lesser-or-equal-to) quantity on the left when the |
||||
# expression is true than it is to worry about which is an identifier |
||||
# and which a literal value. |
||||
misplaced-comparison-constant, |
||||
# NOTE(nathaniel): Our completely abstract interface classes don't have |
||||
# constructors. |
||||
no-init, |
||||
# TODO(https://github.com/grpc/grpc/issues/261): Doesn't yet play |
||||
# nicely with some of our code being implemented in Cython. Maybe in a |
||||
# later version? |
||||
no-name-in-module, |
||||
# TODO(https://github.com/grpc/grpc/issues/261): Suppress these where |
||||
# the odd shape of the authentication portion of the API forces them on |
||||
# us and enable everywhere else. |
||||
protected-access, |
||||
# NOTE(nathaniel): Pylint and I will probably never agree on this. |
||||
too-few-public-methods, |
||||
# NOTE(nathaniel): Pylint and I wil probably never agree on this for |
||||
# private classes. For public classes maybe? |
||||
too-many-instance-attributes, |
||||
# NOTE(nathaniel): Some of our modules have a lot of lines... of |
||||
# specification and documentation. Maybe if this were |
||||
# lines-of-code-based we would use it. |
||||
too-many-lines, |
||||
# TODO(https://github.com/grpc/grpc/issues/261): Maybe we could have |
||||
# this one if we extracted just a few more helper functions... |
||||
too-many-nested-blocks, |
||||
# NOTE(nathaniel): I have disputed the premise of this inspection from |
||||
# the beginning and will continue to do so until it goes away for good. |
||||
useless-else-on-loop, |
File diff suppressed because it is too large
Load Diff
@ -1,99 +1,5 @@ |
||||
bind( |
||||
name = "nanopb", |
||||
actual = "//third_party/nanopb", |
||||
) |
||||
workspace(name = "com_github_grpc_grpc") |
||||
|
||||
bind( |
||||
name = "libssl", |
||||
actual = "@boringssl//:ssl", |
||||
) |
||||
|
||||
bind( |
||||
name = "zlib", |
||||
actual = "@submodule_zlib//:z", |
||||
) |
||||
|
||||
bind( |
||||
name = "protobuf", |
||||
actual = "@com_google_protobuf//:protobuf", |
||||
) |
||||
|
||||
bind( |
||||
name = "protobuf_clib", |
||||
actual = "@com_google_protobuf//:protoc_lib", |
||||
) |
||||
|
||||
bind( |
||||
name = "protocol_compiler", |
||||
actual = "@com_google_protobuf//:protoc", |
||||
) |
||||
|
||||
bind( |
||||
name = "cares", |
||||
actual = "@submodule_cares//:ares", |
||||
) |
||||
|
||||
bind( |
||||
name = "gtest", |
||||
actual = "@submodule_gtest//:gtest", |
||||
) |
||||
|
||||
bind( |
||||
name = "gmock", |
||||
actual = "@submodule_gtest//:gmock", |
||||
) |
||||
|
||||
bind( |
||||
name = "benchmark", |
||||
actual = "@submodule_benchmark//:benchmark", |
||||
) |
||||
|
||||
bind( |
||||
name = "gflags", |
||||
actual = "@com_github_gflags_gflags//:gflags", |
||||
) |
||||
|
||||
local_repository( |
||||
name = "boringssl", |
||||
path = "third_party/boringssl-with-bazel", |
||||
) |
||||
|
||||
new_local_repository( |
||||
name = "submodule_zlib", |
||||
build_file = "third_party/zlib.BUILD", |
||||
path = "third_party/zlib", |
||||
) |
||||
|
||||
new_local_repository( |
||||
name = "com_google_protobuf", |
||||
build_file = "third_party/protobuf/BUILD", |
||||
path = "third_party/protobuf", |
||||
) |
||||
|
||||
new_local_repository( |
||||
name = "submodule_gtest", |
||||
build_file = "third_party/gtest.BUILD", |
||||
path = "third_party/googletest", |
||||
) |
||||
|
||||
local_repository( |
||||
name = "com_github_gflags_gflags", |
||||
path = "third_party/gflags", |
||||
) |
||||
|
||||
new_local_repository( |
||||
name = "submodule_benchmark", |
||||
path = "third_party/benchmark", |
||||
build_file = "third_party/benchmark.BUILD", |
||||
) |
||||
|
||||
new_local_repository( |
||||
name = "submodule_cares", |
||||
path = "third_party/cares", |
||||
build_file = "third_party/cares/cares.BUILD", |
||||
) |
||||
|
||||
local_repository( |
||||
name = "com_google_absl", |
||||
path = "third_party/abseil-cpp", |
||||
) |
||||
load("//bazel:grpc_deps.bzl", "grpc_deps", "grpc_test_only_deps") |
||||
grpc_deps() |
||||
grpc_test_only_deps() |
||||
|
@ -1,5 +1,6 @@ |
||||
set noparent |
||||
@nicolasnoble |
||||
@dgquintas |
||||
@ctiller |
||||
@a11r |
||||
@vjpai |
||||
|
||||
|
@ -0,0 +1,193 @@ |
||||
"""Load dependencies needed to compile and test the grpc library as a 3rd-party consumer.""" |
||||
|
||||
def grpc_deps(): |
||||
"""Loads dependencies need to compile and test the grpc library.""" |
||||
native.bind( |
||||
name = "libssl", |
||||
actual = "@boringssl//:ssl", |
||||
) |
||||
|
||||
native.bind( |
||||
name = "zlib", |
||||
actual = "@com_github_madler_zlib//:z", |
||||
) |
||||
|
||||
native.bind( |
||||
name = "protobuf", |
||||
actual = "@com_google_protobuf//:protobuf", |
||||
) |
||||
|
||||
native.bind( |
||||
name = "protobuf_clib", |
||||
actual = "@com_google_protobuf//:protoc_lib", |
||||
) |
||||
|
||||
native.bind( |
||||
name = "protobuf_headers", |
||||
actual = "@com_google_protobuf//:protobuf_headers", |
||||
) |
||||
|
||||
native.bind( |
||||
name = "protocol_compiler", |
||||
actual = "@com_google_protobuf//:protoc", |
||||
) |
||||
|
||||
native.bind( |
||||
name = "cares", |
||||
actual = "@com_github_cares_cares//:ares", |
||||
) |
||||
|
||||
native.bind( |
||||
name = "gtest", |
||||
actual = "@com_github_google_googletest//:gtest", |
||||
) |
||||
|
||||
native.bind( |
||||
name = "gmock", |
||||
actual = "@com_github_google_googletest//:gmock", |
||||
) |
||||
|
||||
native.bind( |
||||
name = "benchmark", |
||||
actual = "@com_github_google_benchmark//:benchmark", |
||||
) |
||||
|
||||
native.bind( |
||||
name = "gflags", |
||||
actual = "@com_github_gflags_gflags//:gflags", |
||||
) |
||||
|
||||
native.bind( |
||||
name = "grpc_cpp_plugin", |
||||
actual = "@com_github_grpc_grpc//:grpc_cpp_plugin" |
||||
) |
||||
|
||||
native.bind( |
||||
name = "grpc++_codegen_proto", |
||||
actual = "@com_github_grpc_grpc//:grpc++_codegen_proto" |
||||
) |
||||
|
||||
if "boringssl" not in native.existing_rules(): |
||||
native.http_archive( |
||||
name = "boringssl", |
||||
# on the chromium-stable-with-bazel branch |
||||
url = "https://boringssl.googlesource.com/boringssl/+archive/dcd3e6e6ecddf059adb48fca45bc7346a108bdd9.tar.gz", |
||||
) |
||||
|
||||
if "com_github_madler_zlib" not in native.existing_rules(): |
||||
native.new_http_archive( |
||||
name = "com_github_madler_zlib", |
||||
build_file = "@com_github_grpc_grpc//third_party:zlib.BUILD", |
||||
strip_prefix = "zlib-cacf7f1d4e3d44d871b605da3b647f07d718623f", |
||||
url = "https://github.com/madler/zlib/archive/cacf7f1d4e3d44d871b605da3b647f07d718623f.tar.gz", |
||||
) |
||||
|
||||
if "com_google_protobuf" not in native.existing_rules(): |
||||
native.http_archive( |
||||
name = "com_google_protobuf", |
||||
strip_prefix = "protobuf-b5fbb742af122b565925987e65c08957739976a7", |
||||
url = "https://github.com/google/protobuf/archive/b5fbb742af122b565925987e65c08957739976a7.tar.gz", |
||||
) |
||||
|
||||
if "com_github_google_googletest" not in native.existing_rules(): |
||||
native.new_http_archive( |
||||
name = "com_github_google_googletest", |
||||
build_file = "@com_github_grpc_grpc//third_party:gtest.BUILD", |
||||
strip_prefix = "googletest-ec44c6c1675c25b9827aacd08c02433cccde7780", |
||||
url = "https://github.com/google/googletest/archive/ec44c6c1675c25b9827aacd08c02433cccde7780.tar.gz", |
||||
) |
||||
|
||||
if "com_github_gflags_gflags" not in native.existing_rules(): |
||||
native.http_archive( |
||||
name = "com_github_gflags_gflags", |
||||
strip_prefix = "gflags-30dbc81fb5ffdc98ea9b14b1918bfe4e8779b26e", |
||||
url = "https://github.com/gflags/gflags/archive/30dbc81fb5ffdc98ea9b14b1918bfe4e8779b26e.tar.gz", |
||||
) |
||||
|
||||
if "com_github_google_benchmark" not in native.existing_rules(): |
||||
native.new_http_archive( |
||||
name = "com_github_google_benchmark", |
||||
build_file = "@com_github_grpc_grpc//third_party:benchmark.BUILD", |
||||
strip_prefix = "benchmark-5b7683f49e1e9223cf9927b24f6fd3d6bd82e3f8", |
||||
url = "https://github.com/google/benchmark/archive/5b7683f49e1e9223cf9927b24f6fd3d6bd82e3f8.tar.gz", |
||||
) |
||||
|
||||
if "com_github_cares_cares" not in native.existing_rules(): |
||||
native.new_http_archive( |
||||
name = "com_github_cares_cares", |
||||
build_file = "@com_github_grpc_grpc//third_party:cares/cares.BUILD", |
||||
strip_prefix = "c-ares-3be1924221e1326df520f8498d704a5c4c8d0cce", |
||||
url = "https://github.com/c-ares/c-ares/archive/3be1924221e1326df520f8498d704a5c4c8d0cce.tar.gz", |
||||
) |
||||
|
||||
if "com_google_absl" not in native.existing_rules(): |
||||
native.http_archive( |
||||
name = "com_google_absl", |
||||
strip_prefix = "abseil-cpp-cc4bed2d74f7c8717e31f9579214ab52a9c9c610", |
||||
url = "https://github.com/abseil/abseil-cpp/archive/cc4bed2d74f7c8717e31f9579214ab52a9c9c610.tar.gz", |
||||
) |
||||
|
||||
if "com_github_bazelbuild_bazeltoolchains" not in native.existing_rules(): |
||||
native.http_archive( |
||||
name = "com_github_bazelbuild_bazeltoolchains", |
||||
strip_prefix = "bazel-toolchains-09c850dbb8e785ded3d23a7003e9a0168fe1fb2f", |
||||
urls = [ |
||||
"https://mirror.bazel.build/github.com/bazelbuild/bazel-toolchains/archive/09c850dbb8e785ded3d23a7003e9a0168fe1fb2f.tar.gz", |
||||
"https://github.com/bazelbuild/bazel-toolchains/archive/09c850dbb8e785ded3d23a7003e9a0168fe1fb2f.tar.gz", |
||||
], |
||||
sha256 = "08e521cf2d0998e3d27a16c2e2542ebf4d3857b3ddadcfd145d128140754d7bd", |
||||
) |
||||
|
||||
# TODO: move some dependencies from "grpc_deps" here? |
||||
def grpc_test_only_deps(): |
||||
"""Internal, not intended for use by packages that are consuming grpc. |
||||
Loads dependencies that are only needed to run grpc library's tests.""" |
||||
native.bind( |
||||
name = "twisted", |
||||
actual = "@com_github_twisted_twisted//:twisted", |
||||
) |
||||
|
||||
native.bind( |
||||
name = "yaml", |
||||
actual = "@com_github_yaml_pyyaml//:yaml", |
||||
) |
||||
|
||||
if "com_github_twisted_twisted" not in native.existing_rules(): |
||||
native.new_http_archive( |
||||
name = "com_github_twisted_twisted", |
||||
strip_prefix = "twisted-twisted-17.5.0", |
||||
url = "https://github.com/twisted/twisted/archive/twisted-17.5.0.zip", |
||||
build_file = "@com_github_grpc_grpc//third_party:twisted.BUILD", |
||||
) |
||||
|
||||
if "com_github_yaml_pyyaml" not in native.existing_rules(): |
||||
native.new_http_archive( |
||||
name = "com_github_yaml_pyyaml", |
||||
strip_prefix = "pyyaml-3.12", |
||||
url = "https://github.com/yaml/pyyaml/archive/3.12.zip", |
||||
build_file = "@com_github_grpc_grpc//third_party:yaml.BUILD", |
||||
) |
||||
|
||||
if "com_github_twisted_incremental" not in native.existing_rules(): |
||||
native.new_http_archive( |
||||
name = "com_github_twisted_incremental", |
||||
strip_prefix = "incremental-incremental-17.5.0", |
||||
url = "https://github.com/twisted/incremental/archive/incremental-17.5.0.zip", |
||||
build_file = "@com_github_grpc_grpc//third_party:incremental.BUILD", |
||||
) |
||||
|
||||
if "com_github_zopefoundation_zope_interface" not in native.existing_rules(): |
||||
native.new_http_archive( |
||||
name = "com_github_zopefoundation_zope_interface", |
||||
strip_prefix = "zope.interface-4.4.3", |
||||
url = "https://github.com/zopefoundation/zope.interface/archive/4.4.3.zip", |
||||
build_file = "@com_github_grpc_grpc//third_party:zope_interface.BUILD", |
||||
) |
||||
|
||||
if "com_github_twisted_constantly" not in native.existing_rules(): |
||||
native.new_http_archive( |
||||
name = "com_github_twisted_constantly", |
||||
strip_prefix = "constantly-15.1.0", |
||||
url = "https://github.com/twisted/constantly/archive/15.1.0.zip", |
||||
build_file = "@com_github_grpc_grpc//third_party:constantly.BUILD", |
||||
) |
@ -1,995 +0,0 @@ |
||||
# GRPC Node gyp file |
||||
# This currently builds the Node extension and dependencies |
||||
# This file has been automatically generated from a template file. |
||||
# Please look at the templates directory instead. |
||||
# This file can be regenerated from the template by running |
||||
# tools/buildgen/generate_projects.sh |
||||
|
||||
# Copyright 2015 gRPC authors. |
||||
# |
||||
# 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 IS" 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. |
||||
|
||||
# Some of this file is built with the help of |
||||
# https://n8.io/converting-a-c-library-to-gyp/ |
||||
{ |
||||
'variables': { |
||||
'runtime%': 'node', |
||||
# Some Node installations use the system installation of OpenSSL, and on |
||||
# some systems, the system OpenSSL still does not have ALPN support. This |
||||
# will let users recompile gRPC to work without ALPN. |
||||
'grpc_alpn%': 'true', |
||||
# Indicates that the library should be built with gcov. |
||||
'grpc_gcov%': 'false', |
||||
# Indicates that the library should be built with compatibility for musl |
||||
# libc, so that it can run on Alpine Linux. This is only necessary if not |
||||
# building on Alpine Linux |
||||
'grpc_alpine%': 'false' |
||||
}, |
||||
'target_defaults': { |
||||
'configurations': { |
||||
'Release': { |
||||
'cflags': [ |
||||
'-O2', |
||||
], |
||||
'defines': [ |
||||
'NDEBUG', |
||||
], |
||||
}, |
||||
'Debug': { |
||||
'cflags': [ |
||||
'-O0', |
||||
], |
||||
'defines': [ |
||||
'_DEBUG', |
||||
'DEBUG', |
||||
], |
||||
}, |
||||
}, |
||||
'cflags': [ |
||||
'-g', |
||||
'-Wall', |
||||
'-Wextra', |
||||
'-Werror', |
||||
'-Wno-long-long', |
||||
'-Wno-unused-parameter', |
||||
'-DOSATOMIC_USE_INLINED=1', |
||||
'-Ithird_party/abseil-cpp', |
||||
], |
||||
'ldflags': [ |
||||
'-g', |
||||
], |
||||
'cflags_c': [ |
||||
'-Werror', |
||||
'-std=c99' |
||||
], |
||||
'cflags_cc': [ |
||||
'-Werror', |
||||
'-std=c++11' |
||||
], |
||||
'include_dirs': [ |
||||
'.', |
||||
'include' |
||||
], |
||||
'defines': [ |
||||
'GPR_BACKWARDS_COMPATIBILITY_MODE', |
||||
'GRPC_ARES=0', |
||||
'GRPC_UV' |
||||
], |
||||
'conditions': [ |
||||
['grpc_gcov=="true"', { |
||||
'cflags': [ |
||||
'-O0', |
||||
'-fprofile-arcs', |
||||
'-ftest-coverage', |
||||
'-Wno-return-type', |
||||
], |
||||
'defines': [ |
||||
'_DEBUG', |
||||
'DEBUG', |
||||
'GPR_GCOV', |
||||
], |
||||
'ldflags': [ |
||||
'-fprofile-arcs', |
||||
'-ftest-coverage', |
||||
'-rdynamic', |
||||
'-lstdc++', |
||||
], |
||||
}], |
||||
['grpc_alpine=="true"', { |
||||
'defines': [ |
||||
'GPR_MUSL_LIBC_COMPAT' |
||||
] |
||||
}], |
||||
['OS!="win" and runtime=="electron"', { |
||||
"defines": [ |
||||
'OPENSSL_NO_THREADS' |
||||
] |
||||
}], |
||||
# This is the condition for using boringssl |
||||
['OS=="win" or runtime=="electron"', { |
||||
"include_dirs": [ |
||||
"third_party/boringssl/include" |
||||
], |
||||
"defines": [ |
||||
'OPENSSL_NO_ASM' |
||||
] |
||||
}, { |
||||
'conditions': [ |
||||
["target_arch=='ia32'", { |
||||
"include_dirs": [ "<(node_root_dir)/deps/openssl/config/piii" ] |
||||
}], |
||||
["target_arch=='x64'", { |
||||
"include_dirs": [ "<(node_root_dir)/deps/openssl/config/k8" ] |
||||
}], |
||||
["target_arch=='arm'", { |
||||
"include_dirs": [ "<(node_root_dir)/deps/openssl/config/arm" ] |
||||
}], |
||||
['grpc_alpn=="true"', { |
||||
'defines': [ |
||||
'TSI_OPENSSL_ALPN_SUPPORT=1' |
||||
], |
||||
}, { |
||||
'defines': [ |
||||
'TSI_OPENSSL_ALPN_SUPPORT=0' |
||||
], |
||||
}] |
||||
], |
||||
'include_dirs': [ |
||||
'<(node_root_dir)/deps/openssl/openssl/include', |
||||
] |
||||
}], |
||||
['OS == "win"', { |
||||
"include_dirs": [ |
||||
"third_party/zlib", |
||||
"third_party/cares/cares" |
||||
], |
||||
"defines": [ |
||||
'_WIN32_WINNT=0x0600', |
||||
'WIN32_LEAN_AND_MEAN', |
||||
'_HAS_EXCEPTIONS=0', |
||||
'UNICODE', |
||||
'_UNICODE', |
||||
'NOMINMAX', |
||||
], |
||||
"msvs_settings": { |
||||
'VCCLCompilerTool': { |
||||
'RuntimeLibrary': 1, # static debug |
||||
} |
||||
}, |
||||
"libraries": [ |
||||
"ws2_32" |
||||
] |
||||
}, { # OS != "win" |
||||
'include_dirs': [ |
||||
'<(node_root_dir)/deps/zlib', |
||||
'<(node_root_dir)/deps/cares/include' |
||||
] |
||||
}], |
||||
['OS == "mac"', { |
||||
'xcode_settings': { |
||||
'OTHER_CFLAGS': [ |
||||
'-g', |
||||
'-Wall', |
||||
'-Wextra', |
||||
'-Werror', |
||||
'-Wno-long-long', |
||||
'-Wno-unused-parameter', |
||||
'-DOSATOMIC_USE_INLINED=1', |
||||
'-Ithird_party/abseil-cpp', |
||||
], |
||||
'OTHER_CPLUSPLUSFLAGS': [ |
||||
'-g', |
||||
'-Wall', |
||||
'-Wextra', |
||||
'-Werror', |
||||
'-Wno-long-long', |
||||
'-Wno-unused-parameter', |
||||
'-DOSATOMIC_USE_INLINED=1', |
||||
'-Ithird_party/abseil-cpp', |
||||
'-stdlib=libc++', |
||||
'-std=c++11', |
||||
'-Wno-error=deprecated-declarations' |
||||
], |
||||
}, |
||||
}] |
||||
] |
||||
}, |
||||
'conditions': [ |
||||
['OS=="win" or runtime=="electron"', { |
||||
'targets': [ |
||||
{ |
||||
'target_name': 'boringssl', |
||||
'product_prefix': 'lib', |
||||
'type': 'static_library', |
||||
'dependencies': [ |
||||
], |
||||
'sources': [ |
||||
'src/boringssl/err_data.c', |
||||
'third_party/boringssl/crypto/aes/aes.c', |
||||
'third_party/boringssl/crypto/aes/key_wrap.c', |
||||
'third_party/boringssl/crypto/aes/mode_wrappers.c', |
||||
'third_party/boringssl/crypto/asn1/a_bitstr.c', |
||||
'third_party/boringssl/crypto/asn1/a_bool.c', |
||||
'third_party/boringssl/crypto/asn1/a_d2i_fp.c', |
||||
'third_party/boringssl/crypto/asn1/a_dup.c', |
||||
'third_party/boringssl/crypto/asn1/a_enum.c', |
||||
'third_party/boringssl/crypto/asn1/a_gentm.c', |
||||
'third_party/boringssl/crypto/asn1/a_i2d_fp.c', |
||||
'third_party/boringssl/crypto/asn1/a_int.c', |
||||
'third_party/boringssl/crypto/asn1/a_mbstr.c', |
||||
'third_party/boringssl/crypto/asn1/a_object.c', |
||||
'third_party/boringssl/crypto/asn1/a_octet.c', |
||||
'third_party/boringssl/crypto/asn1/a_print.c', |
||||
'third_party/boringssl/crypto/asn1/a_strnid.c', |
||||
'third_party/boringssl/crypto/asn1/a_time.c', |
||||
'third_party/boringssl/crypto/asn1/a_type.c', |
||||
'third_party/boringssl/crypto/asn1/a_utctm.c', |
||||
'third_party/boringssl/crypto/asn1/a_utf8.c', |
||||
'third_party/boringssl/crypto/asn1/asn1_lib.c', |
||||
'third_party/boringssl/crypto/asn1/asn1_par.c', |
||||
'third_party/boringssl/crypto/asn1/asn_pack.c', |
||||
'third_party/boringssl/crypto/asn1/f_enum.c', |
||||
'third_party/boringssl/crypto/asn1/f_int.c', |
||||
'third_party/boringssl/crypto/asn1/f_string.c', |
||||
'third_party/boringssl/crypto/asn1/t_bitst.c', |
||||
'third_party/boringssl/crypto/asn1/tasn_dec.c', |
||||
'third_party/boringssl/crypto/asn1/tasn_enc.c', |
||||
'third_party/boringssl/crypto/asn1/tasn_fre.c', |
||||
'third_party/boringssl/crypto/asn1/tasn_new.c', |
||||
'third_party/boringssl/crypto/asn1/tasn_typ.c', |
||||
'third_party/boringssl/crypto/asn1/tasn_utl.c', |
||||
'third_party/boringssl/crypto/asn1/time_support.c', |
||||
'third_party/boringssl/crypto/asn1/x_bignum.c', |
||||
'third_party/boringssl/crypto/asn1/x_long.c', |
||||
'third_party/boringssl/crypto/base64/base64.c', |
||||
'third_party/boringssl/crypto/bio/bio.c', |
||||
'third_party/boringssl/crypto/bio/bio_mem.c', |
||||
'third_party/boringssl/crypto/bio/connect.c', |
||||
'third_party/boringssl/crypto/bio/fd.c', |
||||
'third_party/boringssl/crypto/bio/file.c', |
||||
'third_party/boringssl/crypto/bio/hexdump.c', |
||||
'third_party/boringssl/crypto/bio/pair.c', |
||||
'third_party/boringssl/crypto/bio/printf.c', |
||||
'third_party/boringssl/crypto/bio/socket.c', |
||||
'third_party/boringssl/crypto/bio/socket_helper.c', |
||||
'third_party/boringssl/crypto/bn/add.c', |
||||
'third_party/boringssl/crypto/bn/asm/x86_64-gcc.c', |
||||
'third_party/boringssl/crypto/bn/bn.c', |
||||
'third_party/boringssl/crypto/bn/bn_asn1.c', |
||||
'third_party/boringssl/crypto/bn/cmp.c', |
||||
'third_party/boringssl/crypto/bn/convert.c', |
||||
'third_party/boringssl/crypto/bn/ctx.c', |
||||
'third_party/boringssl/crypto/bn/div.c', |
||||
'third_party/boringssl/crypto/bn/exponentiation.c', |
||||
'third_party/boringssl/crypto/bn/gcd.c', |
||||
'third_party/boringssl/crypto/bn/generic.c', |
||||
'third_party/boringssl/crypto/bn/kronecker.c', |
||||
'third_party/boringssl/crypto/bn/montgomery.c', |
||||
'third_party/boringssl/crypto/bn/montgomery_inv.c', |
||||
'third_party/boringssl/crypto/bn/mul.c', |
||||
'third_party/boringssl/crypto/bn/prime.c', |
||||
'third_party/boringssl/crypto/bn/random.c', |
||||
'third_party/boringssl/crypto/bn/rsaz_exp.c', |
||||
'third_party/boringssl/crypto/bn/shift.c', |
||||
'third_party/boringssl/crypto/bn/sqrt.c', |
||||
'third_party/boringssl/crypto/buf/buf.c', |
||||
'third_party/boringssl/crypto/bytestring/asn1_compat.c', |
||||
'third_party/boringssl/crypto/bytestring/ber.c', |
||||
'third_party/boringssl/crypto/bytestring/cbb.c', |
||||
'third_party/boringssl/crypto/bytestring/cbs.c', |
||||
'third_party/boringssl/crypto/chacha/chacha.c', |
||||
'third_party/boringssl/crypto/cipher/aead.c', |
||||
'third_party/boringssl/crypto/cipher/cipher.c', |
||||
'third_party/boringssl/crypto/cipher/derive_key.c', |
||||
'third_party/boringssl/crypto/cipher/e_aes.c', |
||||
'third_party/boringssl/crypto/cipher/e_chacha20poly1305.c', |
||||
'third_party/boringssl/crypto/cipher/e_des.c', |
||||
'third_party/boringssl/crypto/cipher/e_null.c', |
||||
'third_party/boringssl/crypto/cipher/e_rc2.c', |
||||
'third_party/boringssl/crypto/cipher/e_rc4.c', |
||||
'third_party/boringssl/crypto/cipher/e_ssl3.c', |
||||
'third_party/boringssl/crypto/cipher/e_tls.c', |
||||
'third_party/boringssl/crypto/cipher/tls_cbc.c', |
||||
'third_party/boringssl/crypto/cmac/cmac.c', |
||||
'third_party/boringssl/crypto/conf/conf.c', |
||||
'third_party/boringssl/crypto/cpu-aarch64-linux.c', |
||||
'third_party/boringssl/crypto/cpu-arm-linux.c', |
||||
'third_party/boringssl/crypto/cpu-arm.c', |
||||
'third_party/boringssl/crypto/cpu-intel.c', |
||||
'third_party/boringssl/crypto/cpu-ppc64le.c', |
||||
'third_party/boringssl/crypto/crypto.c', |
||||
'third_party/boringssl/crypto/curve25519/curve25519.c', |
||||
'third_party/boringssl/crypto/curve25519/spake25519.c', |
||||
'third_party/boringssl/crypto/curve25519/x25519-x86_64.c', |
||||
'third_party/boringssl/crypto/des/des.c', |
||||
'third_party/boringssl/crypto/dh/check.c', |
||||
'third_party/boringssl/crypto/dh/dh.c', |
||||
'third_party/boringssl/crypto/dh/dh_asn1.c', |
||||
'third_party/boringssl/crypto/dh/params.c', |
||||
'third_party/boringssl/crypto/digest/digest.c', |
||||
'third_party/boringssl/crypto/digest/digests.c', |
||||
'third_party/boringssl/crypto/dsa/dsa.c', |
||||
'third_party/boringssl/crypto/dsa/dsa_asn1.c', |
||||
'third_party/boringssl/crypto/ec/ec.c', |
||||
'third_party/boringssl/crypto/ec/ec_asn1.c', |
||||
'third_party/boringssl/crypto/ec/ec_key.c', |
||||
'third_party/boringssl/crypto/ec/ec_montgomery.c', |
||||
'third_party/boringssl/crypto/ec/oct.c', |
||||
'third_party/boringssl/crypto/ec/p224-64.c', |
||||
'third_party/boringssl/crypto/ec/p256-64.c', |
||||
'third_party/boringssl/crypto/ec/p256-x86_64.c', |
||||
'third_party/boringssl/crypto/ec/simple.c', |
||||
'third_party/boringssl/crypto/ec/util-64.c', |
||||
'third_party/boringssl/crypto/ec/wnaf.c', |
||||
'third_party/boringssl/crypto/ecdh/ecdh.c', |
||||
'third_party/boringssl/crypto/ecdsa/ecdsa.c', |
||||
'third_party/boringssl/crypto/ecdsa/ecdsa_asn1.c', |
||||
'third_party/boringssl/crypto/engine/engine.c', |
||||
'third_party/boringssl/crypto/err/err.c', |
||||
'third_party/boringssl/crypto/evp/digestsign.c', |
||||
'third_party/boringssl/crypto/evp/evp.c', |
||||
'third_party/boringssl/crypto/evp/evp_asn1.c', |
||||
'third_party/boringssl/crypto/evp/evp_ctx.c', |
||||
'third_party/boringssl/crypto/evp/p_dsa_asn1.c', |
||||
'third_party/boringssl/crypto/evp/p_ec.c', |
||||
'third_party/boringssl/crypto/evp/p_ec_asn1.c', |
||||
'third_party/boringssl/crypto/evp/p_rsa.c', |
||||
'third_party/boringssl/crypto/evp/p_rsa_asn1.c', |
||||
'third_party/boringssl/crypto/evp/pbkdf.c', |
||||
'third_party/boringssl/crypto/evp/print.c', |
||||
'third_party/boringssl/crypto/evp/sign.c', |
||||
'third_party/boringssl/crypto/ex_data.c', |
||||
'third_party/boringssl/crypto/hkdf/hkdf.c', |
||||
'third_party/boringssl/crypto/hmac/hmac.c', |
||||
'third_party/boringssl/crypto/lhash/lhash.c', |
||||
'third_party/boringssl/crypto/md4/md4.c', |
||||
'third_party/boringssl/crypto/md5/md5.c', |
||||
'third_party/boringssl/crypto/mem.c', |
||||
'third_party/boringssl/crypto/modes/cbc.c', |
||||
'third_party/boringssl/crypto/modes/cfb.c', |
||||
'third_party/boringssl/crypto/modes/ctr.c', |
||||
'third_party/boringssl/crypto/modes/gcm.c', |
||||
'third_party/boringssl/crypto/modes/ofb.c', |
||||
'third_party/boringssl/crypto/modes/polyval.c', |
||||
'third_party/boringssl/crypto/obj/obj.c', |
||||
'third_party/boringssl/crypto/obj/obj_xref.c', |
||||
'third_party/boringssl/crypto/pem/pem_all.c', |
||||
'third_party/boringssl/crypto/pem/pem_info.c', |
||||
'third_party/boringssl/crypto/pem/pem_lib.c', |
||||
'third_party/boringssl/crypto/pem/pem_oth.c', |
||||
'third_party/boringssl/crypto/pem/pem_pk8.c', |
||||
'third_party/boringssl/crypto/pem/pem_pkey.c', |
||||
'third_party/boringssl/crypto/pem/pem_x509.c', |
||||
'third_party/boringssl/crypto/pem/pem_xaux.c', |
||||
'third_party/boringssl/crypto/pkcs8/p5_pbev2.c', |
||||
'third_party/boringssl/crypto/pkcs8/p8_pkey.c', |
||||
'third_party/boringssl/crypto/pkcs8/pkcs8.c', |
||||
'third_party/boringssl/crypto/poly1305/poly1305.c', |
||||
'third_party/boringssl/crypto/poly1305/poly1305_arm.c', |
||||
'third_party/boringssl/crypto/poly1305/poly1305_vec.c', |
||||
'third_party/boringssl/crypto/pool/pool.c', |
||||
'third_party/boringssl/crypto/rand/deterministic.c', |
||||
'third_party/boringssl/crypto/rand/fuchsia.c', |
||||
'third_party/boringssl/crypto/rand/rand.c', |
||||
'third_party/boringssl/crypto/rand/urandom.c', |
||||
'third_party/boringssl/crypto/rand/windows.c', |
||||
'third_party/boringssl/crypto/rc4/rc4.c', |
||||
'third_party/boringssl/crypto/refcount_c11.c', |
||||
'third_party/boringssl/crypto/refcount_lock.c', |
||||
'third_party/boringssl/crypto/rsa/blinding.c', |
||||
'third_party/boringssl/crypto/rsa/padding.c', |
||||
'third_party/boringssl/crypto/rsa/rsa.c', |
||||
'third_party/boringssl/crypto/rsa/rsa_asn1.c', |
||||
'third_party/boringssl/crypto/rsa/rsa_impl.c', |
||||
'third_party/boringssl/crypto/sha/sha1-altivec.c', |
||||
'third_party/boringssl/crypto/sha/sha1.c', |
||||
'third_party/boringssl/crypto/sha/sha256.c', |
||||
'third_party/boringssl/crypto/sha/sha512.c', |
||||
'third_party/boringssl/crypto/stack/stack.c', |
||||
'third_party/boringssl/crypto/thread.c', |
||||
'third_party/boringssl/crypto/thread_none.c', |
||||
'third_party/boringssl/crypto/thread_pthread.c', |
||||
'third_party/boringssl/crypto/thread_win.c', |
||||
'third_party/boringssl/crypto/x509/a_digest.c', |
||||
'third_party/boringssl/crypto/x509/a_sign.c', |
||||
'third_party/boringssl/crypto/x509/a_strex.c', |
||||
'third_party/boringssl/crypto/x509/a_verify.c', |
||||
'third_party/boringssl/crypto/x509/algorithm.c', |
||||
'third_party/boringssl/crypto/x509/asn1_gen.c', |
||||
'third_party/boringssl/crypto/x509/by_dir.c', |
||||
'third_party/boringssl/crypto/x509/by_file.c', |
||||
'third_party/boringssl/crypto/x509/i2d_pr.c', |
||||
'third_party/boringssl/crypto/x509/pkcs7.c', |
||||
'third_party/boringssl/crypto/x509/rsa_pss.c', |
||||
'third_party/boringssl/crypto/x509/t_crl.c', |
||||
'third_party/boringssl/crypto/x509/t_req.c', |
||||
'third_party/boringssl/crypto/x509/t_x509.c', |
||||
'third_party/boringssl/crypto/x509/t_x509a.c', |
||||
'third_party/boringssl/crypto/x509/x509.c', |
||||
'third_party/boringssl/crypto/x509/x509_att.c', |
||||
'third_party/boringssl/crypto/x509/x509_cmp.c', |
||||
'third_party/boringssl/crypto/x509/x509_d2.c', |
||||
'third_party/boringssl/crypto/x509/x509_def.c', |
||||
'third_party/boringssl/crypto/x509/x509_ext.c', |
||||
'third_party/boringssl/crypto/x509/x509_lu.c', |
||||
'third_party/boringssl/crypto/x509/x509_obj.c', |
||||
'third_party/boringssl/crypto/x509/x509_r2x.c', |
||||
'third_party/boringssl/crypto/x509/x509_req.c', |
||||
'third_party/boringssl/crypto/x509/x509_set.c', |
||||
'third_party/boringssl/crypto/x509/x509_trs.c', |
||||
'third_party/boringssl/crypto/x509/x509_txt.c', |
||||
'third_party/boringssl/crypto/x509/x509_v3.c', |
||||
'third_party/boringssl/crypto/x509/x509_vfy.c', |
||||
'third_party/boringssl/crypto/x509/x509_vpm.c', |
||||
'third_party/boringssl/crypto/x509/x509cset.c', |
||||
'third_party/boringssl/crypto/x509/x509name.c', |
||||
'third_party/boringssl/crypto/x509/x509rset.c', |
||||
'third_party/boringssl/crypto/x509/x509spki.c', |
||||
'third_party/boringssl/crypto/x509/x509type.c', |
||||
'third_party/boringssl/crypto/x509/x_algor.c', |
||||
'third_party/boringssl/crypto/x509/x_all.c', |
||||
'third_party/boringssl/crypto/x509/x_attrib.c', |
||||
'third_party/boringssl/crypto/x509/x_crl.c', |
||||
'third_party/boringssl/crypto/x509/x_exten.c', |
||||
'third_party/boringssl/crypto/x509/x_info.c', |
||||
'third_party/boringssl/crypto/x509/x_name.c', |
||||
'third_party/boringssl/crypto/x509/x_pkey.c', |
||||
'third_party/boringssl/crypto/x509/x_pubkey.c', |
||||
'third_party/boringssl/crypto/x509/x_req.c', |
||||
'third_party/boringssl/crypto/x509/x_sig.c', |
||||
'third_party/boringssl/crypto/x509/x_spki.c', |
||||
'third_party/boringssl/crypto/x509/x_val.c', |
||||
'third_party/boringssl/crypto/x509/x_x509.c', |
||||
'third_party/boringssl/crypto/x509/x_x509a.c', |
||||
'third_party/boringssl/crypto/x509v3/pcy_cache.c', |
||||
'third_party/boringssl/crypto/x509v3/pcy_data.c', |
||||
'third_party/boringssl/crypto/x509v3/pcy_lib.c', |
||||
'third_party/boringssl/crypto/x509v3/pcy_map.c', |
||||
'third_party/boringssl/crypto/x509v3/pcy_node.c', |
||||
'third_party/boringssl/crypto/x509v3/pcy_tree.c', |
||||
'third_party/boringssl/crypto/x509v3/v3_akey.c', |
||||
'third_party/boringssl/crypto/x509v3/v3_akeya.c', |
||||
'third_party/boringssl/crypto/x509v3/v3_alt.c', |
||||
'third_party/boringssl/crypto/x509v3/v3_bcons.c', |
||||
'third_party/boringssl/crypto/x509v3/v3_bitst.c', |
||||
'third_party/boringssl/crypto/x509v3/v3_conf.c', |
||||
'third_party/boringssl/crypto/x509v3/v3_cpols.c', |
||||
'third_party/boringssl/crypto/x509v3/v3_crld.c', |
||||
'third_party/boringssl/crypto/x509v3/v3_enum.c', |
||||
'third_party/boringssl/crypto/x509v3/v3_extku.c', |
||||
'third_party/boringssl/crypto/x509v3/v3_genn.c', |
||||
'third_party/boringssl/crypto/x509v3/v3_ia5.c', |
||||
'third_party/boringssl/crypto/x509v3/v3_info.c', |
||||
'third_party/boringssl/crypto/x509v3/v3_int.c', |
||||
'third_party/boringssl/crypto/x509v3/v3_lib.c', |
||||
'third_party/boringssl/crypto/x509v3/v3_ncons.c', |
||||
'third_party/boringssl/crypto/x509v3/v3_pci.c', |
||||
'third_party/boringssl/crypto/x509v3/v3_pcia.c', |
||||
'third_party/boringssl/crypto/x509v3/v3_pcons.c', |
||||
'third_party/boringssl/crypto/x509v3/v3_pku.c', |
||||
'third_party/boringssl/crypto/x509v3/v3_pmaps.c', |
||||
'third_party/boringssl/crypto/x509v3/v3_prn.c', |
||||
'third_party/boringssl/crypto/x509v3/v3_purp.c', |
||||
'third_party/boringssl/crypto/x509v3/v3_skey.c', |
||||
'third_party/boringssl/crypto/x509v3/v3_sxnet.c', |
||||
'third_party/boringssl/crypto/x509v3/v3_utl.c', |
||||
'third_party/boringssl/ssl/bio_ssl.c', |
||||
'third_party/boringssl/ssl/custom_extensions.c', |
||||
'third_party/boringssl/ssl/d1_both.c', |
||||
'third_party/boringssl/ssl/d1_lib.c', |
||||
'third_party/boringssl/ssl/d1_pkt.c', |
||||
'third_party/boringssl/ssl/d1_srtp.c', |
||||
'third_party/boringssl/ssl/dtls_method.c', |
||||
'third_party/boringssl/ssl/dtls_record.c', |
||||
'third_party/boringssl/ssl/handshake_client.c', |
||||
'third_party/boringssl/ssl/handshake_server.c', |
||||
'third_party/boringssl/ssl/s3_both.c', |
||||
'third_party/boringssl/ssl/s3_lib.c', |
||||
'third_party/boringssl/ssl/s3_pkt.c', |
||||
'third_party/boringssl/ssl/ssl_aead_ctx.c', |
||||
'third_party/boringssl/ssl/ssl_asn1.c', |
||||
'third_party/boringssl/ssl/ssl_buffer.c', |
||||
'third_party/boringssl/ssl/ssl_cert.c', |
||||
'third_party/boringssl/ssl/ssl_cipher.c', |
||||
'third_party/boringssl/ssl/ssl_ecdh.c', |
||||
'third_party/boringssl/ssl/ssl_file.c', |
||||
'third_party/boringssl/ssl/ssl_lib.c', |
||||
'third_party/boringssl/ssl/ssl_privkey.c', |
||||
'third_party/boringssl/ssl/ssl_privkey_cc.cc', |
||||
'third_party/boringssl/ssl/ssl_session.c', |
||||
'third_party/boringssl/ssl/ssl_stat.c', |
||||
'third_party/boringssl/ssl/ssl_transcript.c', |
||||
'third_party/boringssl/ssl/ssl_x509.c', |
||||
'third_party/boringssl/ssl/t1_enc.c', |
||||
'third_party/boringssl/ssl/t1_lib.c', |
||||
'third_party/boringssl/ssl/tls13_both.c', |
||||
'third_party/boringssl/ssl/tls13_client.c', |
||||
'third_party/boringssl/ssl/tls13_enc.c', |
||||
'third_party/boringssl/ssl/tls13_server.c', |
||||
'third_party/boringssl/ssl/tls_method.c', |
||||
'third_party/boringssl/ssl/tls_record.c', |
||||
], |
||||
'conditions': [ |
||||
['OS == "mac"', { |
||||
'xcode_settings': { |
||||
'MACOSX_DEPLOYMENT_TARGET': '10.9' |
||||
} |
||||
}] |
||||
] |
||||
}, |
||||
], |
||||
}], |
||||
['OS == "win" and runtime!="electron"', { |
||||
'targets': [ |
||||
{ |
||||
# IMPORTANT WINDOWS BUILD INFORMATION |
||||
# This library does not build on Windows without modifying the Node |
||||
# development packages that node-gyp downloads in order to build. |
||||
# Due to https://github.com/nodejs/node/issues/4932, the headers for |
||||
# BoringSSL conflict with the OpenSSL headers included by default |
||||
# when including the Node headers. The remedy for this is to remove |
||||
# the OpenSSL headers, from the downloaded Node development package, |
||||
# which is typically located in `.node-gyp` in your home directory. |
||||
# |
||||
# This is not true of Electron, which does not have OpenSSL headers. |
||||
'target_name': 'WINDOWS_BUILD_WARNING', |
||||
'rules': [ |
||||
{ |
||||
'rule_name': 'WINDOWS_BUILD_WARNING', |
||||
'extension': 'S', |
||||
'inputs': [ |
||||
'package.json' |
||||
], |
||||
'outputs': [ |
||||
'ignore_this_part' |
||||
], |
||||
'action': ['echo', 'IMPORTANT: Due to https://github.com/nodejs/node/issues/4932, to build this library on Windows, you must first remove <(node_root_dir)/include/node/openssl/'] |
||||
} |
||||
] |
||||
}, |
||||
] |
||||
}], |
||||
['OS == "win"', { |
||||
'targets': [ |
||||
# Only want to compile zlib under Windows |
||||
{ |
||||
'target_name': 'z', |
||||
'product_prefix': 'lib', |
||||
'type': 'static_library', |
||||
'dependencies': [ |
||||
], |
||||
'sources': [ |
||||
'third_party/zlib/adler32.c', |
||||
'third_party/zlib/compress.c', |
||||
'third_party/zlib/crc32.c', |
||||
'third_party/zlib/deflate.c', |
||||
'third_party/zlib/gzclose.c', |
||||
'third_party/zlib/gzlib.c', |
||||
'third_party/zlib/gzread.c', |
||||
'third_party/zlib/gzwrite.c', |
||||
'third_party/zlib/infback.c', |
||||
'third_party/zlib/inffast.c', |
||||
'third_party/zlib/inflate.c', |
||||
'third_party/zlib/inftrees.c', |
||||
'third_party/zlib/trees.c', |
||||
'third_party/zlib/uncompr.c', |
||||
'third_party/zlib/zutil.c', |
||||
] |
||||
}, |
||||
] |
||||
}] |
||||
], |
||||
'targets': [ |
||||
{ |
||||
'target_name': 'gpr', |
||||
'product_prefix': 'lib', |
||||
'type': 'static_library', |
||||
'dependencies': [ |
||||
], |
||||
'sources': [ |
||||
'src/core/lib/profiling/basic_timers.cc', |
||||
'src/core/lib/profiling/stap_timers.cc', |
||||
'src/core/lib/support/alloc.cc', |
||||
'src/core/lib/support/arena.cc', |
||||
'src/core/lib/support/atm.cc', |
||||
'src/core/lib/support/avl.cc', |
||||
'src/core/lib/support/cmdline.cc', |
||||
'src/core/lib/support/cpu_iphone.cc', |
||||
'src/core/lib/support/cpu_linux.cc', |
||||
'src/core/lib/support/cpu_posix.cc', |
||||
'src/core/lib/support/cpu_windows.cc', |
||||
'src/core/lib/support/env_linux.cc', |
||||
'src/core/lib/support/env_posix.cc', |
||||
'src/core/lib/support/env_windows.cc', |
||||
'src/core/lib/support/histogram.cc', |
||||
'src/core/lib/support/host_port.cc', |
||||
'src/core/lib/support/log.cc', |
||||
'src/core/lib/support/log_android.cc', |
||||
'src/core/lib/support/log_linux.cc', |
||||
'src/core/lib/support/log_posix.cc', |
||||
'src/core/lib/support/log_windows.cc', |
||||
'src/core/lib/support/mpscq.cc', |
||||
'src/core/lib/support/murmur_hash.cc', |
||||
'src/core/lib/support/stack_lockfree.cc', |
||||
'src/core/lib/support/string.cc', |
||||
'src/core/lib/support/string_posix.cc', |
||||
'src/core/lib/support/string_util_windows.cc', |
||||
'src/core/lib/support/string_windows.cc', |
||||
'src/core/lib/support/subprocess_posix.cc', |
||||
'src/core/lib/support/subprocess_windows.cc', |
||||
'src/core/lib/support/sync.cc', |
||||
'src/core/lib/support/sync_posix.cc', |
||||
'src/core/lib/support/sync_windows.cc', |
||||
'src/core/lib/support/thd.cc', |
||||
'src/core/lib/support/thd_posix.cc', |
||||
'src/core/lib/support/thd_windows.cc', |
||||
'src/core/lib/support/time.cc', |
||||
'src/core/lib/support/time_posix.cc', |
||||
'src/core/lib/support/time_precise.cc', |
||||
'src/core/lib/support/time_windows.cc', |
||||
'src/core/lib/support/tls_pthread.cc', |
||||
'src/core/lib/support/tmpfile_msys.cc', |
||||
'src/core/lib/support/tmpfile_posix.cc', |
||||
'src/core/lib/support/tmpfile_windows.cc', |
||||
'src/core/lib/support/wrap_memcpy.cc', |
||||
], |
||||
'conditions': [ |
||||
['OS == "mac"', { |
||||
'xcode_settings': { |
||||
'MACOSX_DEPLOYMENT_TARGET': '10.9' |
||||
} |
||||
}] |
||||
] |
||||
}, |
||||
{ |
||||
'target_name': 'grpc', |
||||
'product_prefix': 'lib', |
||||
'type': 'static_library', |
||||
'dependencies': [ |
||||
'gpr', |
||||
], |
||||
'sources': [ |
||||
'src/core/lib/surface/init.cc', |
||||
'src/core/lib/backoff/backoff.cc', |
||||
'src/core/lib/channel/channel_args.cc', |
||||
'src/core/lib/channel/channel_stack.cc', |
||||
'src/core/lib/channel/channel_stack_builder.cc', |
||||
'src/core/lib/channel/connected_channel.cc', |
||||
'src/core/lib/channel/handshaker.cc', |
||||
'src/core/lib/channel/handshaker_factory.cc', |
||||
'src/core/lib/channel/handshaker_registry.cc', |
||||
'src/core/lib/compression/compression.cc', |
||||
'src/core/lib/compression/message_compress.cc', |
||||
'src/core/lib/compression/stream_compression.cc', |
||||
'src/core/lib/compression/stream_compression_gzip.cc', |
||||
'src/core/lib/compression/stream_compression_identity.cc', |
||||
'src/core/lib/debug/stats.cc', |
||||
'src/core/lib/debug/stats_data.cc', |
||||
'src/core/lib/http/format_request.cc', |
||||
'src/core/lib/http/httpcli.cc', |
||||
'src/core/lib/http/parser.cc', |
||||
'src/core/lib/iomgr/call_combiner.cc', |
||||
'src/core/lib/iomgr/closure.cc', |
||||
'src/core/lib/iomgr/combiner.cc', |
||||
'src/core/lib/iomgr/endpoint.cc', |
||||
'src/core/lib/iomgr/endpoint_pair_posix.cc', |
||||
'src/core/lib/iomgr/endpoint_pair_uv.cc', |
||||
'src/core/lib/iomgr/endpoint_pair_windows.cc', |
||||
'src/core/lib/iomgr/error.cc', |
||||
'src/core/lib/iomgr/ev_epoll1_linux.cc', |
||||
'src/core/lib/iomgr/ev_epollex_linux.cc', |
||||
'src/core/lib/iomgr/ev_epollsig_linux.cc', |
||||
'src/core/lib/iomgr/ev_poll_posix.cc', |
||||
'src/core/lib/iomgr/ev_posix.cc', |
||||
'src/core/lib/iomgr/ev_windows.cc', |
||||
'src/core/lib/iomgr/exec_ctx.cc', |
||||
'src/core/lib/iomgr/executor.cc', |
||||
'src/core/lib/iomgr/gethostname_fallback.cc', |
||||
'src/core/lib/iomgr/gethostname_host_name_max.cc', |
||||
'src/core/lib/iomgr/gethostname_sysconf.cc', |
||||
'src/core/lib/iomgr/iocp_windows.cc', |
||||
'src/core/lib/iomgr/iomgr.cc', |
||||
'src/core/lib/iomgr/iomgr_posix.cc', |
||||
'src/core/lib/iomgr/iomgr_uv.cc', |
||||
'src/core/lib/iomgr/iomgr_windows.cc', |
||||
'src/core/lib/iomgr/is_epollexclusive_available.cc', |
||||
'src/core/lib/iomgr/load_file.cc', |
||||
'src/core/lib/iomgr/lockfree_event.cc', |
||||
'src/core/lib/iomgr/network_status_tracker.cc', |
||||
'src/core/lib/iomgr/polling_entity.cc', |
||||
'src/core/lib/iomgr/pollset_set_uv.cc', |
||||
'src/core/lib/iomgr/pollset_set_windows.cc', |
||||
'src/core/lib/iomgr/pollset_uv.cc', |
||||
'src/core/lib/iomgr/pollset_windows.cc', |
||||
'src/core/lib/iomgr/resolve_address_posix.cc', |
||||
'src/core/lib/iomgr/resolve_address_uv.cc', |
||||
'src/core/lib/iomgr/resolve_address_windows.cc', |
||||
'src/core/lib/iomgr/resource_quota.cc', |
||||
'src/core/lib/iomgr/sockaddr_utils.cc', |
||||
'src/core/lib/iomgr/socket_factory_posix.cc', |
||||
'src/core/lib/iomgr/socket_mutator.cc', |
||||
'src/core/lib/iomgr/socket_utils_common_posix.cc', |
||||
'src/core/lib/iomgr/socket_utils_linux.cc', |
||||
'src/core/lib/iomgr/socket_utils_posix.cc', |
||||
'src/core/lib/iomgr/socket_utils_uv.cc', |
||||
'src/core/lib/iomgr/socket_utils_windows.cc', |
||||
'src/core/lib/iomgr/socket_windows.cc', |
||||
'src/core/lib/iomgr/tcp_client_posix.cc', |
||||
'src/core/lib/iomgr/tcp_client_uv.cc', |
||||
'src/core/lib/iomgr/tcp_client_windows.cc', |
||||
'src/core/lib/iomgr/tcp_posix.cc', |
||||
'src/core/lib/iomgr/tcp_server_posix.cc', |
||||
'src/core/lib/iomgr/tcp_server_utils_posix_common.cc', |
||||
'src/core/lib/iomgr/tcp_server_utils_posix_ifaddrs.cc', |
||||
'src/core/lib/iomgr/tcp_server_utils_posix_noifaddrs.cc', |
||||
'src/core/lib/iomgr/tcp_server_uv.cc', |
||||
'src/core/lib/iomgr/tcp_server_windows.cc', |
||||
'src/core/lib/iomgr/tcp_uv.cc', |
||||
'src/core/lib/iomgr/tcp_windows.cc', |
||||
'src/core/lib/iomgr/time_averaged_stats.cc', |
||||
'src/core/lib/iomgr/timer_generic.cc', |
||||
'src/core/lib/iomgr/timer_heap.cc', |
||||
'src/core/lib/iomgr/timer_manager.cc', |
||||
'src/core/lib/iomgr/timer_uv.cc', |
||||
'src/core/lib/iomgr/udp_server.cc', |
||||
'src/core/lib/iomgr/unix_sockets_posix.cc', |
||||
'src/core/lib/iomgr/unix_sockets_posix_noop.cc', |
||||
'src/core/lib/iomgr/wakeup_fd_cv.cc', |
||||
'src/core/lib/iomgr/wakeup_fd_eventfd.cc', |
||||
'src/core/lib/iomgr/wakeup_fd_nospecial.cc', |
||||
'src/core/lib/iomgr/wakeup_fd_pipe.cc', |
||||
'src/core/lib/iomgr/wakeup_fd_posix.cc', |
||||
'src/core/lib/json/json.cc', |
||||
'src/core/lib/json/json_reader.cc', |
||||
'src/core/lib/json/json_string.cc', |
||||
'src/core/lib/json/json_writer.cc', |
||||
'src/core/lib/slice/b64.cc', |
||||
'src/core/lib/slice/percent_encoding.cc', |
||||
'src/core/lib/slice/slice.cc', |
||||
'src/core/lib/slice/slice_buffer.cc', |
||||
'src/core/lib/slice/slice_hash_table.cc', |
||||
'src/core/lib/slice/slice_intern.cc', |
||||
'src/core/lib/slice/slice_string_helpers.cc', |
||||
'src/core/lib/surface/alarm.cc', |
||||
'src/core/lib/surface/api_trace.cc', |
||||
'src/core/lib/surface/byte_buffer.cc', |
||||
'src/core/lib/surface/byte_buffer_reader.cc', |
||||
'src/core/lib/surface/call.cc', |
||||
'src/core/lib/surface/call_details.cc', |
||||
'src/core/lib/surface/call_log_batch.cc', |
||||
'src/core/lib/surface/channel.cc', |
||||
'src/core/lib/surface/channel_init.cc', |
||||
'src/core/lib/surface/channel_ping.cc', |
||||
'src/core/lib/surface/channel_stack_type.cc', |
||||
'src/core/lib/surface/completion_queue.cc', |
||||
'src/core/lib/surface/completion_queue_factory.cc', |
||||
'src/core/lib/surface/event_string.cc', |
||||
'src/core/lib/surface/lame_client.cc', |
||||
'src/core/lib/surface/metadata_array.cc', |
||||
'src/core/lib/surface/server.cc', |
||||
'src/core/lib/surface/validate_metadata.cc', |
||||
'src/core/lib/surface/version.cc', |
||||
'src/core/lib/transport/bdp_estimator.cc', |
||||
'src/core/lib/transport/byte_stream.cc', |
||||
'src/core/lib/transport/connectivity_state.cc', |
||||
'src/core/lib/transport/error_utils.cc', |
||||
'src/core/lib/transport/metadata.cc', |
||||
'src/core/lib/transport/metadata_batch.cc', |
||||
'src/core/lib/transport/pid_controller.cc', |
||||
'src/core/lib/transport/service_config.cc', |
||||
'src/core/lib/transport/static_metadata.cc', |
||||
'src/core/lib/transport/status_conversion.cc', |
||||
'src/core/lib/transport/timeout_encoding.cc', |
||||
'src/core/lib/transport/transport.cc', |
||||
'src/core/lib/transport/transport_op_string.cc', |
||||
'src/core/lib/debug/trace.cc', |
||||
'src/core/ext/transport/chttp2/server/secure/server_secure_chttp2.cc', |
||||
'src/core/ext/transport/chttp2/transport/bin_decoder.cc', |
||||
'src/core/ext/transport/chttp2/transport/bin_encoder.cc', |
||||
'src/core/ext/transport/chttp2/transport/chttp2_plugin.cc', |
||||
'src/core/ext/transport/chttp2/transport/chttp2_transport.cc', |
||||
'src/core/ext/transport/chttp2/transport/flow_control.cc', |
||||
'src/core/ext/transport/chttp2/transport/frame_data.cc', |
||||
'src/core/ext/transport/chttp2/transport/frame_goaway.cc', |
||||
'src/core/ext/transport/chttp2/transport/frame_ping.cc', |
||||
'src/core/ext/transport/chttp2/transport/frame_rst_stream.cc', |
||||
'src/core/ext/transport/chttp2/transport/frame_settings.cc', |
||||
'src/core/ext/transport/chttp2/transport/frame_window_update.cc', |
||||
'src/core/ext/transport/chttp2/transport/hpack_encoder.cc', |
||||
'src/core/ext/transport/chttp2/transport/hpack_parser.cc', |
||||
'src/core/ext/transport/chttp2/transport/hpack_table.cc', |
||||
'src/core/ext/transport/chttp2/transport/http2_settings.cc', |
||||
'src/core/ext/transport/chttp2/transport/huffsyms.cc', |
||||
'src/core/ext/transport/chttp2/transport/incoming_metadata.cc', |
||||
'src/core/ext/transport/chttp2/transport/parsing.cc', |
||||
'src/core/ext/transport/chttp2/transport/stream_lists.cc', |
||||
'src/core/ext/transport/chttp2/transport/stream_map.cc', |
||||
'src/core/ext/transport/chttp2/transport/varint.cc', |
||||
'src/core/ext/transport/chttp2/transport/writing.cc', |
||||
'src/core/ext/transport/chttp2/alpn/alpn.cc', |
||||
'src/core/ext/filters/http/client/http_client_filter.cc', |
||||
'src/core/ext/filters/http/http_filters_plugin.cc', |
||||
'src/core/ext/filters/http/message_compress/message_compress_filter.cc', |
||||
'src/core/ext/filters/http/server/http_server_filter.cc', |
||||
'src/core/lib/http/httpcli_security_connector.cc', |
||||
'src/core/lib/security/context/security_context.cc', |
||||
'src/core/lib/security/credentials/composite/composite_credentials.cc', |
||||
'src/core/lib/security/credentials/credentials.cc', |
||||
'src/core/lib/security/credentials/credentials_metadata.cc', |
||||
'src/core/lib/security/credentials/fake/fake_credentials.cc', |
||||
'src/core/lib/security/credentials/google_default/credentials_generic.cc', |
||||
'src/core/lib/security/credentials/google_default/google_default_credentials.cc', |
||||
'src/core/lib/security/credentials/iam/iam_credentials.cc', |
||||
'src/core/lib/security/credentials/jwt/json_token.cc', |
||||
'src/core/lib/security/credentials/jwt/jwt_credentials.cc', |
||||
'src/core/lib/security/credentials/jwt/jwt_verifier.cc', |
||||
'src/core/lib/security/credentials/oauth2/oauth2_credentials.cc', |
||||
'src/core/lib/security/credentials/plugin/plugin_credentials.cc', |
||||
'src/core/lib/security/credentials/ssl/ssl_credentials.cc', |
||||
'src/core/lib/security/transport/client_auth_filter.cc', |
||||
'src/core/lib/security/transport/lb_targets_info.cc', |
||||
'src/core/lib/security/transport/secure_endpoint.cc', |
||||
'src/core/lib/security/transport/security_connector.cc', |
||||
'src/core/lib/security/transport/security_handshaker.cc', |
||||
'src/core/lib/security/transport/server_auth_filter.cc', |
||||
'src/core/lib/security/transport/tsi_error.cc', |
||||
'src/core/lib/security/util/json_util.cc', |
||||
'src/core/lib/surface/init_secure.cc', |
||||
'src/core/tsi/fake_transport_security.cc', |
||||
'src/core/tsi/gts_transport_security.cc', |
||||
'src/core/tsi/ssl_transport_security.cc', |
||||
'src/core/tsi/transport_security_grpc.cc', |
||||
'src/core/tsi/transport_security.cc', |
||||
'src/core/tsi/transport_security_adapter.cc', |
||||
'src/core/ext/transport/chttp2/server/chttp2_server.cc', |
||||
'src/core/ext/transport/chttp2/client/secure/secure_channel_create.cc', |
||||
'src/core/ext/filters/client_channel/channel_connectivity.cc', |
||||
'src/core/ext/filters/client_channel/client_channel.cc', |
||||
'src/core/ext/filters/client_channel/client_channel_factory.cc', |
||||
'src/core/ext/filters/client_channel/client_channel_plugin.cc', |
||||
'src/core/ext/filters/client_channel/connector.cc', |
||||
'src/core/ext/filters/client_channel/http_connect_handshaker.cc', |
||||
'src/core/ext/filters/client_channel/http_proxy.cc', |
||||
'src/core/ext/filters/client_channel/lb_policy.cc', |
||||
'src/core/ext/filters/client_channel/lb_policy_factory.cc', |
||||
'src/core/ext/filters/client_channel/lb_policy_registry.cc', |
||||
'src/core/ext/filters/client_channel/parse_address.cc', |
||||
'src/core/ext/filters/client_channel/proxy_mapper.cc', |
||||
'src/core/ext/filters/client_channel/proxy_mapper_registry.cc', |
||||
'src/core/ext/filters/client_channel/resolver.cc', |
||||
'src/core/ext/filters/client_channel/resolver_factory.cc', |
||||
'src/core/ext/filters/client_channel/resolver_registry.cc', |
||||
'src/core/ext/filters/client_channel/retry_throttle.cc', |
||||
'src/core/ext/filters/client_channel/subchannel.cc', |
||||
'src/core/ext/filters/client_channel/subchannel_index.cc', |
||||
'src/core/ext/filters/client_channel/uri_parser.cc', |
||||
'src/core/ext/filters/deadline/deadline_filter.cc', |
||||
'src/core/ext/transport/chttp2/client/chttp2_connector.cc', |
||||
'src/core/ext/transport/chttp2/server/insecure/server_chttp2.cc', |
||||
'src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.cc', |
||||
'src/core/ext/transport/chttp2/client/insecure/channel_create.cc', |
||||
'src/core/ext/transport/chttp2/client/insecure/channel_create_posix.cc', |
||||
'src/core/ext/transport/inproc/inproc_plugin.cc', |
||||
'src/core/ext/transport/inproc/inproc_transport.cc', |
||||
'src/core/ext/filters/client_channel/lb_policy/grpclb/client_load_reporting_filter.cc', |
||||
'src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb.cc', |
||||
'src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_channel_secure.cc', |
||||
'src/core/ext/filters/client_channel/lb_policy/grpclb/grpclb_client_stats.cc', |
||||
'src/core/ext/filters/client_channel/lb_policy/grpclb/load_balancer_api.cc', |
||||
'src/core/ext/filters/client_channel/lb_policy/grpclb/proto/grpc/lb/v1/load_balancer.pb.c', |
||||
'third_party/nanopb/pb_common.c', |
||||
'third_party/nanopb/pb_decode.c', |
||||
'third_party/nanopb/pb_encode.c', |
||||
'src/core/ext/filters/client_channel/resolver/fake/fake_resolver.cc', |
||||
'src/core/ext/filters/client_channel/lb_policy/pick_first/pick_first.cc', |
||||
'src/core/ext/filters/client_channel/lb_policy/round_robin/round_robin.cc', |
||||
'src/core/ext/filters/client_channel/resolver/dns/c_ares/dns_resolver_ares.cc', |
||||
'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_ev_driver_posix.cc', |
||||
'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc', |
||||
'src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper_fallback.cc', |
||||
'src/core/ext/filters/client_channel/resolver/dns/native/dns_resolver.cc', |
||||
'src/core/ext/filters/client_channel/resolver/sockaddr/sockaddr_resolver.cc', |
||||
'src/core/ext/filters/load_reporting/server_load_reporting_filter.cc', |
||||
'src/core/ext/filters/load_reporting/server_load_reporting_plugin.cc', |
||||
'src/core/ext/census/base_resources.cc', |
||||
'src/core/ext/census/context.cc', |
||||
'src/core/ext/census/gen/census.pb.c', |
||||
'src/core/ext/census/gen/trace_context.pb.c', |
||||
'src/core/ext/census/grpc_context.cc', |
||||
'src/core/ext/census/grpc_filter.cc', |
||||
'src/core/ext/census/grpc_plugin.cc', |
||||
'src/core/ext/census/initialize.cc', |
||||
'src/core/ext/census/intrusive_hash_map.cc', |
||||
'src/core/ext/census/mlog.cc', |
||||
'src/core/ext/census/operation.cc', |
||||
'src/core/ext/census/placeholders.cc', |
||||
'src/core/ext/census/resource.cc', |
||||
'src/core/ext/census/trace_context.cc', |
||||
'src/core/ext/census/tracing.cc', |
||||
'src/core/ext/filters/max_age/max_age_filter.cc', |
||||
'src/core/ext/filters/message_size/message_size_filter.cc', |
||||
'src/core/ext/filters/workarounds/workaround_cronet_compression_filter.cc', |
||||
'src/core/ext/filters/workarounds/workaround_utils.cc', |
||||
'src/core/plugin_registry/grpc_plugin_registry.cc', |
||||
], |
||||
'conditions': [ |
||||
['OS == "mac"', { |
||||
'xcode_settings': { |
||||
'MACOSX_DEPLOYMENT_TARGET': '10.9' |
||||
} |
||||
}] |
||||
] |
||||
}, |
||||
{ |
||||
'include_dirs': [ |
||||
"<!(node -e \"require('nan')\")" |
||||
], |
||||
'cflags': [ |
||||
'-pthread', |
||||
'-zdefs', |
||||
'-Wno-error=deprecated-declarations' |
||||
], |
||||
"conditions": [ |
||||
['OS=="win" or runtime=="electron"', { |
||||
'dependencies': [ |
||||
"boringssl", |
||||
] |
||||
}], |
||||
['OS=="win"', { |
||||
'dependencies': [ |
||||
"z", |
||||
] |
||||
}], |
||||
['OS=="linux"', { |
||||
'ldflags': [ |
||||
'-Wl,-wrap,memcpy' |
||||
] |
||||
}], |
||||
['OS == "mac"', { |
||||
'xcode_settings': { |
||||
'MACOSX_DEPLOYMENT_TARGET': '10.9' |
||||
} |
||||
}] |
||||
], |
||||
"target_name": "grpc_node", |
||||
"sources": [ |
||||
"src/node/ext/byte_buffer.cc", |
||||
"src/node/ext/call.cc", |
||||
"src/node/ext/call_credentials.cc", |
||||
"src/node/ext/channel.cc", |
||||
"src/node/ext/channel_credentials.cc", |
||||
"src/node/ext/completion_queue.cc", |
||||
"src/node/ext/node_grpc.cc", |
||||
"src/node/ext/server.cc", |
||||
"src/node/ext/server_credentials.cc", |
||||
"src/node/ext/slice.cc", |
||||
"src/node/ext/timeval.cc", |
||||
], |
||||
"dependencies": [ |
||||
"grpc", |
||||
"gpr", |
||||
] |
||||
}, |
||||
{ |
||||
"target_name": "action_after_build", |
||||
"type": "none", |
||||
"dependencies": [ "<(module_name)" ], |
||||
"copies": [ |
||||
{ |
||||
"files": [ "<(PRODUCT_DIR)/<(module_name).node"], |
||||
"destination": "<(module_path)" |
||||
} |
||||
] |
||||
} |
||||
] |
||||
} |
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,4 @@ |
||||
set noparent |
||||
@jtattermusch |
||||
@nicolasnoble |
||||
@matt-kwong |
@ -0,0 +1,16 @@ |
||||
# Copyright 2017 gRPC authors. |
||||
# |
||||
# 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 IS" 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. |
||||
|
||||
set(_gRPC_ADDRESS_SORTING_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/third_party/address_sorting/include") |
||||
set(_gRPC_ADDRESS_SORTING_LIBRARIES address_sorting) |
@ -0,0 +1,37 @@ |
||||
# Copyright 2017 gRPC authors. |
||||
# |
||||
# 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 IS" 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. |
||||
|
||||
if("${gRPC_BENCHMARK_PROVIDER}" STREQUAL "module") |
||||
if(NOT BENCHMARK_ROOT_DIR) |
||||
set(BENCHMARK_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/third_party/benchmark) |
||||
endif() |
||||
if(EXISTS "${BENCHMARK_ROOT_DIR}/CMakeLists.txt") |
||||
add_subdirectory(${BENCHMARK_ROOT_DIR} third_party/benchmark) |
||||
if(TARGET benchmark) |
||||
set(_gRPC_BENCHMARK_LIBRARIES benchmark) |
||||
set(_gRPC_BENCHMARK_INCLUDE_DIR "${BENCHMARK_ROOT_DIR}/include") |
||||
endif() |
||||
else() |
||||
message(WARNING "gRPC_BENCHMARK_PROVIDER is \"module\" but BENCHMARK_ROOT_DIR is wrong") |
||||
endif() |
||||
elseif("${gRPC_BENCHMARK_PROVIDER}" STREQUAL "package") |
||||
# Use "CONFIG" as there is no built-in cmake module for benchmark. |
||||
find_package(benchmark REQUIRED CONFIG) |
||||
if(TARGET benchmark::benchmark) |
||||
set(_gRPC_BENCHMARK_LIBRARIES benchmark::benchmark) |
||||
# extract the include dir from target's properties |
||||
get_target_property(_gRPC_BENCHMARK_INCLUDE_DIR benchmark::benchmark INTERFACE_INCLUDE_DIRECTORIES) |
||||
endif() |
||||
set(_gRPC_FIND_BENCHMARK "if(NOT benchmark_FOUND)\n find_package(benchmark CONFIG)\nendif()") |
||||
endif() |
@ -0,0 +1,40 @@ |
||||
# Copyright 2017 gRPC authors. |
||||
# |
||||
# 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 IS" 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. |
||||
|
||||
if("${gRPC_CARES_PROVIDER}" STREQUAL "module") |
||||
if(NOT CARES_ROOT_DIR) |
||||
set(CARES_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/third_party/cares/cares) |
||||
endif() |
||||
set(CARES_SHARED OFF CACHE BOOL "disable shared library") |
||||
set(CARES_STATIC ON CACHE BOOL "link cares statically") |
||||
add_subdirectory(third_party/cares/cares) |
||||
|
||||
if(TARGET c-ares) |
||||
set(_gRPC_CARES_LIBRARIES c-ares) |
||||
set(_gRPC_CARES_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/third_party/cares/cares" "${CMAKE_CURRENT_BINARY_DIR}/third_party/cares/cares") |
||||
endif() |
||||
|
||||
if(gRPC_INSTALL) |
||||
message(WARNING "gRPC_INSTALL will be forced to FALSE because gRPC_CARES_PROVIDER is \"module\"") |
||||
set(gRPC_INSTALL FALSE) |
||||
endif() |
||||
elseif("${gRPC_CARES_PROVIDER}" STREQUAL "package") |
||||
# Use "CONFIG" as there is no built-in cmake module for c-ares. |
||||
find_package(c-ares REQUIRED CONFIG) |
||||
if(TARGET c-ares::cares) |
||||
set(_gRPC_CARES_LIBRARIES c-ares::cares) |
||||
set(_gRPC_CARES_INCLUDE_DIR ${c-ares_INCLUDE_DIR}) |
||||
endif() |
||||
set(_gRPC_FIND_CARES "if(NOT c-ares_FOUND)\n find_package(c-ares CONFIG)\nendif()") |
||||
endif() |
@ -0,0 +1,36 @@ |
||||
# Copyright 2017 gRPC authors. |
||||
# |
||||
# 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 IS" 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. |
||||
|
||||
if("${gRPC_GFLAGS_PROVIDER}" STREQUAL "module") |
||||
if(NOT GFLAGS_ROOT_DIR) |
||||
set(GFLAGS_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/third_party/gflags) |
||||
endif() |
||||
if(EXISTS "${GFLAGS_ROOT_DIR}/CMakeLists.txt") |
||||
add_subdirectory(${GFLAGS_ROOT_DIR} third_party/gflags) |
||||
if(TARGET gflags_static) |
||||
set(_gRPC_GFLAGS_LIBRARIES gflags_static) |
||||
set(_gRPC_GFLAGS_INCLUDE_DIR "${CMAKE_CURRENT_BINARY_DIR}/third_party/gflags/include") |
||||
endif() |
||||
else() |
||||
message(WARNING "gRPC_GFLAGS_PROVIDER is \"module\" but GFLAGS_ROOT_DIR is wrong") |
||||
endif() |
||||
elseif("${gRPC_GFLAGS_PROVIDER}" STREQUAL "package") |
||||
# Use "CONFIG" as there is no built-in cmake module for gflags. |
||||
find_package(gflags REQUIRED CONFIG) |
||||
if(TARGET gflags::gflags) |
||||
set(_gRPC_GFLAGS_LIBRARIES gflags::gflags) |
||||
set(_gRPC_GFLAGS_INCLUDE_DIR ${GFLAGS_INCLUDE_DIR}) |
||||
endif() |
||||
set(_gRPC_FIND_GFLAGS "if(NOT gflags_FOUND)\n find_package(gflags CONFIG)\nendif()") |
||||
endif() |
@ -0,0 +1,85 @@ |
||||
# Copyright 2017 gRPC authors. |
||||
# |
||||
# 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 IS" 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. |
||||
|
||||
if("${gRPC_PROTOBUF_PROVIDER}" STREQUAL "module") |
||||
# Building the protobuf tests require gmock what is not part of a standard protobuf checkout. |
||||
# Disable them unless they are explicitly requested from the cmake command line (when we assume |
||||
# gmock is downloaded to the right location inside protobuf). |
||||
if(NOT protobuf_BUILD_TESTS) |
||||
set(protobuf_BUILD_TESTS OFF CACHE BOOL "Build protobuf tests") |
||||
endif() |
||||
# Disable building protobuf with zlib. Building protobuf with zlib breaks |
||||
# the build if zlib is not installed on the system. |
||||
if(NOT protobuf_WITH_ZLIB) |
||||
set(protobuf_WITH_ZLIB OFF CACHE BOOL "Build protobuf with zlib.") |
||||
endif() |
||||
if(NOT PROTOBUF_ROOT_DIR) |
||||
set(PROTOBUF_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/third_party/protobuf) |
||||
endif() |
||||
|
||||
if(EXISTS "${PROTOBUF_ROOT_DIR}/cmake/CMakeLists.txt") |
||||
set(protobuf_MSVC_STATIC_RUNTIME OFF CACHE BOOL "Link static runtime libraries") |
||||
add_subdirectory(${PROTOBUF_ROOT_DIR}/cmake third_party/protobuf) |
||||
if(TARGET ${_gRPC_PROTOBUF_LIBRARY_NAME}) |
||||
set(_gRPC_PROTOBUF_LIBRARIES ${_gRPC_PROTOBUF_LIBRARY_NAME}) |
||||
endif() |
||||
if(TARGET libprotoc) |
||||
set(_gRPC_PROTOBUF_PROTOC_LIBRARIES libprotoc) |
||||
endif() |
||||
if(TARGET protoc) |
||||
set(_gRPC_PROTOBUF_PROTOC protoc) |
||||
set(_gRPC_PROTOBUF_PROTOC_EXECUTABLE $<TARGET_FILE:protoc>) |
||||
endif() |
||||
set(_gRPC_PROTOBUF_INCLUDE_DIR "${PROTOBUF_ROOT_DIR}") |
||||
# For well-known .proto files distributed with protobuf |
||||
set(_gRPC_PROTOBUF_WELLKNOWN_INCLUDE_DIR "${PROTOBUF_ROOT_DIR}/src") |
||||
else() |
||||
message(WARNING "gRPC_PROTOBUF_PROVIDER is \"module\" but PROTOBUF_ROOT_DIR is wrong") |
||||
endif() |
||||
if(gRPC_INSTALL) |
||||
message(WARNING "gRPC_INSTALL will be forced to FALSE because gRPC_PROTOBUF_PROVIDER is \"module\"") |
||||
set(gRPC_INSTALL FALSE) |
||||
endif() |
||||
elseif("${gRPC_PROTOBUF_PROVIDER}" STREQUAL "package") |
||||
find_package(Protobuf REQUIRED ${gRPC_PROTOBUF_PACKAGE_TYPE}) |
||||
|
||||
# {Protobuf,PROTOBUF}_FOUND is defined based on find_package type ("MODULE" vs "CONFIG"). |
||||
# For "MODULE", the case has also changed between cmake 3.5 and 3.6. |
||||
# We use the legacy uppercase version for *_LIBRARIES AND *_INCLUDE_DIRS variables |
||||
# as newer cmake versions provide them too for backward compatibility. |
||||
if(Protobuf_FOUND OR PROTOBUF_FOUND) |
||||
if(TARGET protobuf::${_gRPC_PROTOBUF_LIBRARY_NAME}) |
||||
set(_gRPC_PROTOBUF_LIBRARIES protobuf::${_gRPC_PROTOBUF_LIBRARY_NAME}) |
||||
else() |
||||
set(_gRPC_PROTOBUF_LIBRARIES ${PROTOBUF_LIBRARIES}) |
||||
endif() |
||||
if(TARGET protobuf::libprotoc) |
||||
set(_gRPC_PROTOBUF_PROTOC_LIBRARIES protobuf::libprotoc) |
||||
# extract the include dir from target's properties |
||||
get_target_property(_gRPC_PROTOBUF_WELLKNOWN_INCLUDE_DIR protobuf::libprotoc INTERFACE_INCLUDE_DIRECTORIES) |
||||
else() |
||||
set(_gRPC_PROTOBUF_PROTOC_LIBRARIES ${PROTOBUF_PROTOC_LIBRARIES}) |
||||
set(_gRPC_PROTOBUF_WELLKNOWN_INCLUDE_DIR ${PROTOBUF_INCLUDE_DIRS}) |
||||
endif() |
||||
if(TARGET protobuf::protoc) |
||||
set(_gRPC_PROTOBUF_PROTOC protobuf::protoc) |
||||
set(_gRPC_PROTOBUF_PROTOC_EXECUTABLE $<TARGET_FILE:protobuf::protoc>) |
||||
else() |
||||
set(_gRPC_PROTOBUF_PROTOC ${PROTOBUF_PROTOC_EXECUTABLE}) |
||||
set(_gRPC_PROTOBUF_PROTOC_EXECUTABLE ${PROTOBUF_PROTOC_EXECUTABLE}) |
||||
endif() |
||||
set(_gRPC_PROTOBUF_INCLUDE_DIR ${PROTOBUF_INCLUDE_DIRS}) |
||||
set(_gRPC_FIND_PROTOBUF "if(NOT Protobuf_FOUND AND NOT PROTOBUF_FOUND)\n find_package(Protobuf ${gRPC_PROTOBUF_PACKAGE_TYPE})\nendif()") |
||||
endif() |
||||
endif() |
@ -0,0 +1,48 @@ |
||||
# Copyright 2017 gRPC authors. |
||||
# |
||||
# 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 IS" 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. |
||||
|
||||
if("${gRPC_SSL_PROVIDER}" STREQUAL "module") |
||||
if(NOT BORINGSSL_ROOT_DIR) |
||||
set(BORINGSSL_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/third_party/boringssl) |
||||
endif() |
||||
if(EXISTS "${BORINGSSL_ROOT_DIR}/CMakeLists.txt") |
||||
set(OPENSSL_NO_ASM ON) # make boringssl buildable with Visual Studio |
||||
add_subdirectory(${BORINGSSL_ROOT_DIR} third_party/boringssl) |
||||
if(TARGET ssl) |
||||
set(_gRPC_SSL_LIBRARIES ssl) |
||||
set(_gRPC_SSL_INCLUDE_DIR ${BORINGSSL_ROOT_DIR}/include) |
||||
endif() |
||||
else() |
||||
message(WARNING "gRPC_SSL_PROVIDER is \"module\" but BORINGSSL_ROOT_DIR is wrong") |
||||
endif() |
||||
if(gRPC_INSTALL) |
||||
message(WARNING "gRPC_INSTALL will be forced to FALSE because gRPC_SSL_PROVIDER is \"module\"") |
||||
set(gRPC_INSTALL FALSE) |
||||
endif() |
||||
elseif("${gRPC_SSL_PROVIDER}" STREQUAL "package") |
||||
# OpenSSL installation directory can be configured by setting OPENSSL_ROOT_DIR |
||||
# We expect to locate OpenSSL using the built-in cmake module as the openssl |
||||
# project itself does not provide installation support in its CMakeLists.txt |
||||
# See https://cmake.org/cmake/help/v3.6/module/FindOpenSSL.html |
||||
find_package(OpenSSL REQUIRED) |
||||
|
||||
if(TARGET OpenSSL::SSL) |
||||
set(_gRPC_SSL_LIBRARIES OpenSSL::SSL OpenSSL::Crypto) |
||||
else() |
||||
set(_gRPC_SSL_LIBRARIES ${OPENSSL_LIBRARIES}) |
||||
endif() |
||||
set(_gRPC_SSL_INCLUDE_DIR ${OPENSSL_INCLUDE_DIR}) |
||||
|
||||
set(_gRPC_FIND_SSL "if(NOT OPENSSL_FOUND)\n find_package(OpenSSL)\nendif()") |
||||
endif() |
@ -0,0 +1,51 @@ |
||||
# Copyright 2017 gRPC authors. |
||||
# |
||||
# 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 IS" 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. |
||||
|
||||
if("${gRPC_ZLIB_PROVIDER}" STREQUAL "module") |
||||
if(NOT ZLIB_ROOT_DIR) |
||||
set(ZLIB_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/third_party/zlib) |
||||
endif() |
||||
if(EXISTS "${ZLIB_ROOT_DIR}/CMakeLists.txt") |
||||
# TODO(jtattermusch): workaround for https://github.com/madler/zlib/issues/218 |
||||
include_directories("${ZLIB_ROOT_DIR}") |
||||
add_subdirectory(${ZLIB_ROOT_DIR} third_party/zlib) |
||||
|
||||
if(TARGET zlibstatic) |
||||
set(_gRPC_ZLIB_LIBRARIES zlibstatic) |
||||
set(_gRPC_ZLIB_INCLUDE_DIR "${ZLIB_ROOT_DIR}" "${CMAKE_CURRENT_BINARY_DIR}/third_party/zlib") |
||||
endif() |
||||
else() |
||||
message(WARNING "gRPC_ZLIB_PROVIDER is \"module\" but ZLIB_ROOT_DIR is wrong") |
||||
endif() |
||||
if(gRPC_INSTALL) |
||||
message(WARNING "gRPC_INSTALL will be forced to FALSE because gRPC_ZLIB_PROVIDER is \"module\"") |
||||
set(gRPC_INSTALL FALSE) |
||||
endif() |
||||
elseif("${gRPC_ZLIB_PROVIDER}" STREQUAL "package") |
||||
# zlib installation directory can be configured by setting ZLIB_ROOT |
||||
# We allow locating zlib using both "CONFIG" and "MODULE" as the expectation |
||||
# is that many Linux systems will have zlib installed via a distribution |
||||
# package ("MODULE"), while on Windows the user is likely to have installed |
||||
# zlib using cmake ("CONFIG"). |
||||
# See https://cmake.org/cmake/help/v3.6/module/FindZLIB.html |
||||
find_package(ZLIB REQUIRED) |
||||
|
||||
if(TARGET ZLIB::ZLIB) |
||||
set(_gRPC_ZLIB_LIBRARIES ZLIB::ZLIB) |
||||
else() |
||||
set(_gRPC_ZLIB_LIBRARIES ${ZLIB_LIBRARIES}) |
||||
endif() |
||||
set(_gRPC_ZLIB_INCLUDE_DIR ${ZLIB_INCLUDE_DIRS}) |
||||
set(_gRPC_FIND_ZLIB "if(NOT ZLIB_FOUND)\n find_package(ZLIB)\nendif()") |
||||
endif() |
@ -0,0 +1,197 @@ |
||||
# Transport Explainer |
||||
|
||||
@vjpai |
||||
|
||||
## Existing Transports |
||||
|
||||
[gRPC |
||||
transports](https://github.com/grpc/grpc/tree/master/src/core/ext/transport) |
||||
plug in below the core API (one level below the C++ or other wrapped-language |
||||
API). You can write your transport in C or C++ though; currently (Nov 2017) all |
||||
the transports are nominally written in C++ though they are idiomatically C. The |
||||
existing transports are: |
||||
|
||||
* [HTTP/2](https://github.com/grpc/grpc/tree/master/src/core/ext/transport/chttp2) |
||||
* [Cronet](https://github.com/grpc/grpc/tree/master/src/core/ext/transport/cronet) |
||||
* [In-process](https://github.com/grpc/grpc/tree/master/src/core/ext/transport/inproc) |
||||
|
||||
Among these, the in-process is likely the easiest to understand, though arguably |
||||
also the least similar to a "real" sockets-based transport since it is only used |
||||
in a single process. |
||||
|
||||
## Transport stream ops |
||||
|
||||
In the gRPC core implementation, a fundamental struct is the |
||||
`grpc_transport_stream_op_batch` which represents a collection of stream |
||||
operations sent to a transport. (Note that in gRPC, _stream_ and _RPC_ are used |
||||
synonymously since all RPCs are actually streams internally.) The ops in a batch |
||||
can include: |
||||
|
||||
* send\_initial\_metadata |
||||
- Client: initate an RPC |
||||
- Server: supply response headers |
||||
* recv\_initial\_metadata |
||||
- Client: get response headers |
||||
- Server: accept an RPC |
||||
* send\_message (zero or more) : send a data buffer |
||||
* recv\_message (zero or more) : receive a data buffer |
||||
* send\_trailing\_metadata |
||||
- Client: half-close indicating that no more messages will be coming |
||||
- Server: full-close providing final status for the RPC |
||||
* recv\_trailing\_metadata: get final status for the RPC |
||||
- Server extra: This op shouldn't actually be considered complete until the |
||||
server has also sent trailing metadata to provide the other side with final |
||||
status |
||||
* cancel\_stream: Attempt to cancel an RPC |
||||
* collect\_stats: Get stats |
||||
|
||||
The fundamental responsibility of the transport is to transform between this |
||||
internal format and an actual wire format, so the processing of these operations |
||||
is largely transport-specific. |
||||
|
||||
One or more of these ops are grouped into a batch. Applications can start all of |
||||
a call's ops in a single batch, or they can split them up into multiple |
||||
batches. Results of each batch are returned asynchronously via a completion |
||||
queue. |
||||
|
||||
Internally, we use callbacks to indicate completion. The surface layer creates a |
||||
callback when starting a new batch and sends it down the filter stack along with |
||||
the batch. The transport must invoke this callback when the batch is complete, |
||||
and then the surface layer returns an event to the application via the |
||||
completion queue. Each batch can have up to 3 callbacks: |
||||
|
||||
* recv\_initial\_metadata\_ready (called by the transport when the |
||||
recv\_initial\_metadata op is complete) |
||||
* recv\_message\_ready (called by the transport when the recv_message op is |
||||
complete) |
||||
* on\_complete (called by the transport when the entire batch is complete) |
||||
|
||||
## Timelines of transport stream op batches |
||||
|
||||
The transport's job is to sequence and interpret various possible interleavings |
||||
of the basic stream ops. For example, a sample timeline of batches would be: |
||||
|
||||
1. Client send\_initial\_metadata: Initiate an RPC with a path (method) and authority |
||||
1. Server recv\_initial\_metadata: accept an RPC |
||||
1. Client send\_message: Supply the input proto for the RPC |
||||
1. Server recv\_message: Get the input proto from the RPC |
||||
1. Client send\_trailing\_metadata: This is a half-close indicating that the |
||||
client will not be sending any more messages |
||||
1. Server recv\_trailing\_metadata: The server sees this from the client and |
||||
knows that it will not get any more messages. This won't complete yet though, |
||||
as described above. |
||||
1. Server send\_initial\_metadata, send\_message, send\_trailing\_metadata: A |
||||
batch can contain multiple ops, and this batch provides the RPC response |
||||
headers, response content, and status. Note that sending the trailing |
||||
metadata will also complete the server's receive of trailing metadata. |
||||
1. Client recv\_initial\_metadata: The number of ops in one side of the batch |
||||
has no relation with the number of ops on the other side of the batch. In |
||||
this case, the client is just collecting the response headers. |
||||
1. Client recv\_message, recv\_trailing\_metadata: Get the data response and |
||||
status |
||||
|
||||
|
||||
There are other possible sample timelines. For example, for client-side streaming, a "typical" sequence would be: |
||||
|
||||
1. Server: recv\_initial\_metadata |
||||
- At API-level, that would be the server requesting an RPC |
||||
1. Server: recv\_trailing\_metadata |
||||
- This is for when the server wants to know the final completion of the RPC |
||||
through an `AsyncNotifyWhenDone` API in C++ |
||||
1. Client: send\_initial\_metadata, recv\_message, recv\_trailing\_metadata |
||||
- At API-level, that's a client invoking a client-side streaming call. The |
||||
send\_initial\_metadata is the call invocation, the recv\_message colects |
||||
the final response from the server, and the recv\_trailing\_metadata gets |
||||
the `grpc::Status` value that will be returned from the call |
||||
1. Client: send\_message / Server: recv\_message |
||||
- Repeat the above step numerous times; these correspond to a client issuing |
||||
`Write` in a loop and a server doing `Read` in a loop until `Read` fails |
||||
1. Client: send\_trailing\_metadata / Server: recv\_message that indicates doneness (NULL) |
||||
- These correspond to a client issuing `WritesDone` which causes the server's |
||||
`Read` to fail |
||||
1. Server: send\_message, send\_trailing\_metadata |
||||
- These correpond to the server doing `Finish` |
||||
|
||||
The sends on one side will call their own callbacks when complete, and they will |
||||
in turn trigger actions that cause the other side's recv operations to |
||||
complete. In some transports, a send can sometimes complete before the recv on |
||||
the other side (e.g., in HTTP/2 if there is sufficient flow-control buffer space |
||||
available) |
||||
|
||||
## Other transport duties |
||||
|
||||
In addition to these basic stream ops, the transport must handle cancellations |
||||
of a stream at any time and pass their effects to the other side. For example, |
||||
in HTTP/2, this triggers a `RST_STREAM` being sent on the wire. The transport |
||||
must perform operations like pings and statistics that are used to shape |
||||
transport-level characteristics like flow control (see, for example, their use |
||||
in the HTTP/2 transport). |
||||
|
||||
## Putting things together with detail: Sending Metadata |
||||
|
||||
* API layer: `map<string, string>` that is specific to this RPC |
||||
* Core surface layer: array of `{slice, slice}` pairs where each slice |
||||
references an underlying string |
||||
* [Core transport |
||||
layer](https://github.com/grpc/grpc/tree/master/src/core/lib/transport): list |
||||
of `{slice, slice}` pairs that includes the above plus possibly some general |
||||
metadata (e.g., Method and Authority for initial metadata) |
||||
* [Specific transport |
||||
layer](https://github.com/grpc/grpc/tree/master/src/core/ext/transport): |
||||
- Either send it to the other side using transport-specific API (e.g., Cronet) |
||||
- Or have it sent through the [iomgr/endpoint |
||||
layer](https://github.com/grpc/grpc/tree/master/src/core/lib/iomgr) (e.g., |
||||
HTTP/2) |
||||
- Or just manipulate pointers to get it from one side to the other (e.g., |
||||
In-process) |
||||
|
||||
## Requirements for any transport |
||||
|
||||
Each transport implements several operations in a vtbl (may change to actual |
||||
virtual functions as transport moves to idiomatic C++). |
||||
|
||||
The most important and common one is `perform_stream_op`. This function |
||||
processes a single stream op batch on a specific stream that is associated with |
||||
a specific transport: |
||||
|
||||
* Gets the 6 ops/cancel passed down from the surface |
||||
* Pass metadata from one side to the other as described above |
||||
* Transform messages between slice buffer structure and stream of bytes to pass |
||||
to other side |
||||
- May require insertion of extra bytes (e.g., per-message headers in HTTP/2) |
||||
* React to metadata to preserve expected orderings (*) |
||||
* Schedule invocation of completion callbacks |
||||
|
||||
There are other functions in the vtbl as well. |
||||
|
||||
* `perform_transport_op` |
||||
- Configure the transport instance for the connectivity state change notifier |
||||
or the server-side accept callback |
||||
- Disconnect transport or set up a goaway for later streams |
||||
* `init_stream` |
||||
- Starts a stream from the client-side |
||||
- (*) Server-side of the transport must call `accept_stream_cb` when a new |
||||
stream is available |
||||
* Triggers request-matcher |
||||
* `destroy_stream`, `destroy_transport` |
||||
- Free up data related to a stream or transport |
||||
* `set_pollset`, `set_pollset_set`, `get_endpoint` |
||||
- Map each specific instance of the transport to FDs being used by iomgr (for |
||||
HTTP/2) |
||||
- Get a pointer to the endpoint structure that actually moves the data |
||||
(wrapper around a socket for HTTP/2) |
||||
|
||||
## Book-keeping responsibilities of the transport layer |
||||
|
||||
A given transport must keep all of its transport and streams ref-counted. This |
||||
is essential to make sure that no struct disappears before it is done being |
||||
used. |
||||
|
||||
A transport must also preserve relevant orders for the different categories of |
||||
ops on a stream, as described above. A transport must also make sure that all |
||||
relevant batch operations have completed before scheduling the `on_complete` |
||||
closure for a batch. Further examples include the idea that the server logic |
||||
expects to not complete recv\_trailing\_metadata until after it actually sends |
||||
trailing metadata since it would have already found this out by seeing a NULL’ed |
||||
recv\_message. This is considered part of the transport's duties in preserving |
||||
orders. |
@ -0,0 +1,46 @@ |
||||
# Background # |
||||
|
||||
In Python, multithreading is ineffective at concurrency for CPU bound tasks |
||||
due to the GIL (global interpreter lock). Extension modules can release |
||||
the GIL in CPU bound tasks, but that isn't an option in pure Python. |
||||
Users use libraries such as multiprocessing, subprocess, concurrent.futures.ProcessPoolExecutor, |
||||
etc, to work around the GIL. These modules call ```fork()``` underneath the hood. Various issues have |
||||
been reported when using these modules with gRPC Python. gRPC Python wraps |
||||
gRPC core, which uses multithreading for performance, and hence doesn't support ```fork()```. |
||||
Historically, we didn't support forking in gRPC, but some users seemed |
||||
to be doing fine until their code started to break on version 1.6. This was |
||||
likely caused by the addition of background c-threads and a background |
||||
Python thread. |
||||
|
||||
# Current Status # |
||||
|
||||
## 1.11 ## |
||||
The background Python thread was removed entirely. This allows forking |
||||
after creating a channel. However, the channel must not have issued any |
||||
RPCs prior to the fork. Attempting to fork with an active channel that |
||||
has been used can result in deadlocks/corrupted wire data. |
||||
|
||||
## 1.9 ## |
||||
A regression was noted in cases where users are doing fork/exec. This |
||||
was due to ```pthread_atfork()``` handler that was added in 1.7 to partially |
||||
support forking in gRPC. A deadlock can happen when pthread_atfork |
||||
handler is running, and an application thread is calling into gRPC. |
||||
We have provided a workaround for this issue by allowing users to turn |
||||
off the handler using env flag ```GRPC_ENABLE_FORK_SUPPORT=False```. |
||||
This should be set whenever a user expects to always call exec |
||||
immediately following fork. It will disable the fork handlers. |
||||
|
||||
## 1.7 ## |
||||
A ```pthread_atfork()``` handler was added in 1.7 to automatically shut down |
||||
the background c-threads when fork was called. This does not shut down the |
||||
background Python thread, so users could not have any open channels when |
||||
forking. |
||||
|
||||
# Future Work # |
||||
|
||||
## 1.13 ## |
||||
The workaround when using fork/exec by setting |
||||
```GRPC_ENABLE_FORK_SUPPORT=False``` should no longer be needed. Following |
||||
[this PR](https://github.com/grpc/grpc/pull/14647), fork |
||||
handlers will not automatically run when multiple threads are calling |
||||
into gRPC. |
@ -1,14 +1,15 @@ |
||||
Each version of gRPC gets a new description of what the 'g' stands for, since |
||||
we've never really been able to figure it out. |
||||
'g' stands for something different every gRPC release: |
||||
|
||||
Below is a list of already-used definitions (that should not be repeated in the |
||||
future), and the corresponding version numbers that used them: |
||||
|
||||
- 1.0 'g' stands for 'gRPC' |
||||
- 1.1 'g' stands for 'good' |
||||
- 1.2 'g' stands for 'green' |
||||
- 1.3 'g' stands for 'gentle' |
||||
- 1.4 'g' stands for 'gregarious' |
||||
- 1.6 'g' stands for 'garcia' |
||||
- 1.7 'g' stands for 'gambit' |
||||
- 1.8 'g' stands for 'generous' |
||||
- 1.0 'g' stands for ['gRPC'](https://github.com/grpc/grpc/tree/v1.0.x) |
||||
- 1.1 'g' stands for ['good'](https://github.com/grpc/grpc/tree/v1.1.x) |
||||
- 1.2 'g' stands for ['green'](https://github.com/grpc/grpc/tree/v1.2.x) |
||||
- 1.3 'g' stands for ['gentle'](https://github.com/grpc/grpc/tree/v1.3.x) |
||||
- 1.4 'g' stands for ['gregarious'](https://github.com/grpc/grpc/tree/v1.4.x) |
||||
- 1.6 'g' stands for ['garcia'](https://github.com/grpc/grpc/tree/v1.6.x) |
||||
- 1.7 'g' stands for ['gambit'](https://github.com/grpc/grpc/tree/v1.7.x) |
||||
- 1.8 'g' stands for ['generous'](https://github.com/grpc/grpc/tree/v1.8.x) |
||||
- 1.9 'g' stands for ['glossy'](https://github.com/grpc/grpc/tree/v1.9.x) |
||||
- 1.10 'g' stands for ['glamorous'](https://github.com/grpc/grpc/tree/v1.10.x) |
||||
- 1.11 'g' stands for ['gorgeous'](https://github.com/grpc/grpc/tree/v1.11.x) |
||||
- 1.12 'g' stands for ['glorious'](https://github.com/grpc/grpc/tree/v1.12.x) |
||||
- 1.13 'g' stands for ['gloriosa'](https://github.com/grpc/grpc/tree/master) |
||||
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,9 @@ |
||||
*.iml |
||||
.gradle |
||||
/local.properties |
||||
/.idea/workspace.xml |
||||
/.idea/libraries |
||||
.DS_Store |
||||
/build |
||||
/captures |
||||
.externalNativeBuild |
@ -0,0 +1,24 @@ |
||||
gRPC on Android |
||||
============== |
||||
|
||||
Note: Building the protobuf dependency for Android requires |
||||
https://github.com/google/protobuf/pull/3878. This fix will be in the next |
||||
protobuf release, but until then must be manually patched in to |
||||
`third_party/protobuf` to build gRPC for Android. |
||||
|
||||
PREREQUISITES |
||||
------------- |
||||
|
||||
- Android SDK |
||||
- Android NDK |
||||
- `protoc` and `grpc_cpp_plugin` binaries on the host system |
||||
|
||||
INSTALL |
||||
------- |
||||
|
||||
The example application can be built via Android Studio or on the command line |
||||
using `gradle`: |
||||
|
||||
```sh |
||||
$ ./gradlew installDebug |
||||
``` |
@ -0,0 +1 @@ |
||||
/build |
@ -0,0 +1,86 @@ |
||||
cmake_minimum_required(VERSION 3.4.1) |
||||
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") |
||||
|
||||
set(helloworld_PROTOBUF_PROTOC_EXECUTABLE "/usr/local/bin/protoc" CACHE STRING "Protoc binary on host") |
||||
set(helloworld_GRPC_CPP_PLUGIN_EXECUTABLE "/usr/local/bin/grpc_cpp_plugin" CACHE STRING "gRPC CPP plugin binary on host") |
||||
|
||||
set(GRPC_SRC_DIR ../../../../) |
||||
|
||||
set(GRPC_BUILD_DIR ../grpc/outputs/${ANDROID_ABI}) |
||||
file(MAKE_DIRECTORY ${GRPC_BUILD_DIR}) |
||||
|
||||
add_subdirectory(${GRPC_SRC_DIR} ${GRPC_BUILD_DIR}) |
||||
|
||||
set(GRPC_PROTO_GENS_DIR ${CMAKE_BINARY_DIR}/gens) |
||||
file(MAKE_DIRECTORY ${GRPC_PROTO_GENS_DIR}) |
||||
include_directories(${GRPC_PROTO_GENS_DIR}) |
||||
|
||||
function(android_protobuf_grpc_generate_cpp SRC_FILES HDR_FILES INCLUDE_ROOT) |
||||
if(NOT ARGN) |
||||
message(SEND_ERROR "Error: android_protobuf_grpc_generate_cpp() called without any proto files") |
||||
return() |
||||
endif() |
||||
|
||||
set(${SRC_FILES}) |
||||
set(${HDR_FILES}) |
||||
set(PROTOBUF_INCLUDE_PATH -I ${INCLUDE_ROOT}) |
||||
foreach(FIL ${ARGN}) |
||||
get_filename_component(ABS_FIL ${FIL} ABSOLUTE) |
||||
get_filename_component(FIL_WE ${FIL} NAME_WE) |
||||
file(RELATIVE_PATH REL_FIL ${CMAKE_CURRENT_SOURCE_DIR}/${INCLUDE_ROOT} ${ABS_FIL}) |
||||
get_filename_component(REL_DIR ${REL_FIL} DIRECTORY) |
||||
set(RELFIL_WE "${REL_DIR}/${FIL_WE}") |
||||
|
||||
list(APPEND ${SRC_FILES} "${GRPC_PROTO_GENS_DIR}/${RELFIL_WE}.pb.cc") |
||||
list(APPEND ${HDR_FILES} "${GRPC_PROTO_GENS_DIR}/${RELFIL_WE}.pb.h") |
||||
list(APPEND ${SRC_FILES} "${GRPC_PROTO_GENS_DIR}/${RELFIL_WE}.grpc.pb.cc") |
||||
list(APPEND ${HDR_FILES} "${GRPC_PROTO_GENS_DIR}/${RELFIL_WE}.grpc.pb.h") |
||||
|
||||
add_custom_command( |
||||
OUTPUT "${GRPC_PROTO_GENS_DIR}/${RELFIL_WE}.grpc.pb.cc" |
||||
"${GRPC_PROTO_GENS_DIR}/${RELFIL_WE}.grpc.pb.h" |
||||
"${GRPC_PROTO_GENS_DIR}/${RELFIL_WE}.pb.cc" |
||||
"${GRPC_PROTO_GENS_DIR}/${RELFIL_WE}.pb.h" |
||||
COMMAND ${helloworld_PROTOBUF_PROTOC_EXECUTABLE} |
||||
ARGS --grpc_out=${GRPC_PROTO_GENS_DIR} |
||||
--cpp_out=${GRPC_PROTO_GENS_DIR} |
||||
--plugin=protoc-gen-grpc=${helloworld_GRPC_CPP_PLUGIN_EXECUTABLE} |
||||
${PROTOBUF_INCLUDE_PATH} |
||||
${REL_FIL} |
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} |
||||
DEPENDS ${helloworld_PROTOBUF_PROTOC_EXECUTABLE} ${helloworld_GRPC_CPP_PLUGIN_EXECUTABLE} ${ABS_FIL} ) |
||||
endforeach() |
||||
|
||||
set_source_files_properties(${${SRC_FILES}} ${${HDR_FILES}} PROPERTIES GENERATED TRUE) |
||||
set(${SRC_FILES} ${${SRC_FILES}} PARENT_SCOPE) |
||||
set(${HDR_FILES} ${${HDR_FILES}} PARENT_SCOPE) |
||||
endfunction() |
||||
|
||||
set(PROTO_BASE_DIR ${GRPC_SRC_DIR}/examples/protos) |
||||
|
||||
android_protobuf_grpc_generate_cpp( |
||||
HELLOWORLD_PROTO_SRCS HELLOWORLD_PROTO_HDRS ${PROTO_BASE_DIR} ${PROTO_BASE_DIR}/helloworld.proto) |
||||
|
||||
add_library(helloworld_proto_lib |
||||
SHARED ${HELLOWORLD_PROTO_HDRS} ${HELLOWORLD_PROTO_SRCS}) |
||||
|
||||
target_link_libraries(helloworld_proto_lib |
||||
grpc++ |
||||
libprotobuf |
||||
android |
||||
log) |
||||
|
||||
find_library(log-lib |
||||
log) |
||||
|
||||
add_library(grpc-helloworld |
||||
SHARED src/main/cpp/grpc-helloworld.cc) |
||||
|
||||
target_include_directories(grpc-helloworld |
||||
PRIVATE ${HELLOWORLD_PROTO_HEADERS}) |
||||
|
||||
target_link_libraries(grpc-helloworld |
||||
helloworld_proto_lib |
||||
android |
||||
${log-lib}) |
@ -0,0 +1,56 @@ |
||||
apply plugin: 'com.android.application' |
||||
|
||||
android { |
||||
compileSdkVersion 26 |
||||
defaultConfig { |
||||
applicationId "io.grpc.android.cpp.helloworldexample" |
||||
minSdkVersion 14 |
||||
targetSdkVersion 26 |
||||
versionCode 1 |
||||
versionName "1.0" |
||||
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" |
||||
externalNativeBuild { |
||||
cmake { |
||||
// The paths to the protoc and grpc_cpp_plugin binaries on the host system (codegen |
||||
// is not cross-compiled to Android) |
||||
def protoc = project.hasProperty('protoc') ? |
||||
project.property('protoc') : '/usr/local/bin/protoc' |
||||
def grpc_cpp_plugin = project.hasProperty('grpc_cpp_plugin') ? |
||||
project.property('grpc_cpp_plugin') : '/usr/local/bin/grpc_cpp_plugin' |
||||
|
||||
cppFlags "-std=c++14 -frtti -fexceptions" |
||||
arguments '-DANDROID_STL=c++_static' |
||||
arguments '-DRUN_HAVE_POSIX_REGEX=0' |
||||
arguments '-DRUN_HAVE_STD_REGEX=0' |
||||
arguments '-DRUN_HAVE_STEADY_CLOCK=0' |
||||
arguments '-Dprotobuf_BUILD_PROTOC_BINARIES=off' |
||||
arguments '-DgRPC_BUILD_CODEGEN=off' |
||||
arguments '-Dhelloworld_PROTOBUF_PROTOC_EXECUTABLE=' + protoc |
||||
arguments '-Dhelloworld_GRPC_CPP_PLUGIN_EXECUTABLE=' + grpc_cpp_plugin |
||||
} |
||||
} |
||||
ndk.abiFilters 'x86' |
||||
} |
||||
buildTypes { |
||||
debug { |
||||
minifyEnabled false |
||||
} |
||||
release { |
||||
minifyEnabled true |
||||
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' |
||||
} |
||||
} |
||||
externalNativeBuild { |
||||
cmake { |
||||
path "CMakeLists.txt" |
||||
} |
||||
} |
||||
} |
||||
|
||||
dependencies { |
||||
implementation fileTree(dir: 'libs', include: ['*.jar']) |
||||
implementation 'com.android.support:appcompat-v7:26.1.0' |
||||
testImplementation 'junit:junit:4.12' |
||||
androidTestImplementation 'com.android.support.test:runner:1.0.1' |
||||
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1' |
||||
} |
@ -0,0 +1,21 @@ |
||||
# Add project specific ProGuard rules here. |
||||
# You can control the set of applied configuration files using the |
||||
# proguardFiles setting in build.gradle. |
||||
# |
||||
# For more details, see |
||||
# http://developer.android.com/guide/developing/tools/proguard.html |
||||
|
||||
# If your project uses WebView with JS, uncomment the following |
||||
# and specify the fully qualified class name to the JavaScript interface |
||||
# class: |
||||
#-keepclassmembers class fqcn.of.javascript.interface.for.webview { |
||||
# public *; |
||||
#} |
||||
|
||||
# Uncomment this to preserve the line number information for |
||||
# debugging stack traces. |
||||
#-keepattributes SourceFile,LineNumberTable |
||||
|
||||
# If you keep the line number information, uncomment this to |
||||
# hide the original source file name. |
||||
#-renamesourcefileattribute SourceFile |
@ -0,0 +1,22 @@ |
||||
<?xml version="1.0" encoding="utf-8"?> |
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" |
||||
package="io.grpc.helloworldexample.cpp" > |
||||
|
||||
<uses-permission android:name="android.permission.INTERNET" /> |
||||
|
||||
<application |
||||
android:allowBackup="false" |
||||
android:icon="@mipmap/ic_launcher" |
||||
android:label="@string/app_name" |
||||
android:theme="@style/Base.V7.Theme.AppCompat.Light" > |
||||
<activity |
||||
android:name=".HelloworldActivity" |
||||
android:label="@string/app_name" > |
||||
<intent-filter> |
||||
<action android:name="android.intent.action.MAIN" /> |
||||
<category android:name="android.intent.category.LAUNCHER" /> |
||||
</intent-filter> |
||||
</activity> |
||||
</application> |
||||
|
||||
</manifest> |
@ -0,0 +1,142 @@ |
||||
/*
|
||||
* |
||||
* Copyright 2018 gRPC authors. |
||||
* |
||||
* 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 IS" 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. |
||||
* |
||||
*/ |
||||
|
||||
#include <atomic> |
||||
|
||||
#include <grpc++/grpc++.h> |
||||
#include <jni.h> |
||||
|
||||
#include "helloworld.grpc.pb.h" |
||||
|
||||
using grpc::Channel; |
||||
using grpc::ClientContext; |
||||
using grpc::Server; |
||||
using grpc::ServerBuilder; |
||||
using grpc::ServerContext; |
||||
using grpc::Status; |
||||
using helloworld::Greeter; |
||||
using helloworld::HelloReply; |
||||
using helloworld::HelloRequest; |
||||
|
||||
std::atomic<bool> stop_server(false); |
||||
|
||||
// Logic and data behind the server's behavior.
|
||||
class GreeterServiceImpl final : public Greeter::Service { |
||||
Status SayHello(ServerContext* context, const HelloRequest* request, |
||||
HelloReply* reply) override { |
||||
std::string prefix("Hello "); |
||||
reply->set_message(prefix + request->name()); |
||||
return Status::OK; |
||||
} |
||||
}; |
||||
|
||||
void StartServer(JNIEnv* env, jobject obj, jmethodID is_cancelled_mid, |
||||
int port) { |
||||
const int host_port_buf_size = 1024; |
||||
char host_port[host_port_buf_size]; |
||||
snprintf(host_port, host_port_buf_size, "0.0.0.0:%d", port); |
||||
|
||||
GreeterServiceImpl service; |
||||
ServerBuilder builder; |
||||
// Listen on the given address without any authentication mechanism.
|
||||
builder.AddListeningPort(host_port, grpc::InsecureServerCredentials()); |
||||
// Register "service" as the instance through which we'll communicate with
|
||||
// clients. In this case it corresponds to an *synchronous* service.
|
||||
builder.RegisterService(&service); |
||||
// Finally assemble the server.
|
||||
std::unique_ptr<Server> server(builder.BuildAndStart()); |
||||
while (!stop_server.load()) { |
||||
// Check with the Java code to see if the user has requested the server stop or the app is no
|
||||
// longer in the foreground.
|
||||
jboolean is_cancelled = env->CallBooleanMethod(obj, is_cancelled_mid); |
||||
if (is_cancelled == JNI_TRUE) { |
||||
stop_server = true; |
||||
} |
||||
} |
||||
} |
||||
|
||||
class GreeterClient { |
||||
public: |
||||
GreeterClient(std::shared_ptr<Channel> channel) |
||||
: stub_(Greeter::NewStub(channel)) {} |
||||
|
||||
// Assembles the client's payload, sends it and presents the response back
|
||||
// from the server.
|
||||
std::string SayHello(const std::string& user) { |
||||
// Data we are sending to the server.
|
||||
HelloRequest request; |
||||
request.set_name(user); |
||||
|
||||
// Container for the data we expect from the server.
|
||||
HelloReply reply; |
||||
|
||||
// Context for the client. It could be used to convey extra information to
|
||||
// the server and/or tweak certain RPC behaviors.
|
||||
ClientContext context; |
||||
// The actual RPC.
|
||||
Status status = stub_->SayHello(&context, request, &reply); |
||||
|
||||
if (status.ok()) { |
||||
return reply.message(); |
||||
} else { |
||||
return status.error_message(); |
||||
} |
||||
} |
||||
|
||||
private: |
||||
std::unique_ptr<Greeter::Stub> stub_; |
||||
}; |
||||
|
||||
// Send an RPC and return the response. Invoked from Java code.
|
||||
extern "C" JNIEXPORT jstring JNICALL |
||||
Java_io_grpc_helloworldexample_cpp_HelloworldActivity_sayHello( |
||||
JNIEnv* env, jobject obj_unused, jstring host_raw, jint port_raw, |
||||
jstring message_raw) { |
||||
const char* host_chars = env->GetStringUTFChars(host_raw, (jboolean*)0); |
||||
std::string host(host_chars, env->GetStringUTFLength(host_raw)); |
||||
|
||||
int port = static_cast<int>(port_raw); |
||||
|
||||
const char* message_chars = env->GetStringUTFChars(message_raw, (jboolean*)0); |
||||
std::string message(message_chars, env->GetStringUTFLength(message_raw)); |
||||
|
||||
const int host_port_buf_size = 1024; |
||||
char host_port[host_port_buf_size]; |
||||
snprintf(host_port, host_port_buf_size, "%s:%d", host.c_str(), port); |
||||
|
||||
GreeterClient greeter( |
||||
grpc::CreateChannel(host_port, grpc::InsecureChannelCredentials())); |
||||
std::string reply = greeter.SayHello(message); |
||||
|
||||
return env->NewStringUTF(reply.c_str()); |
||||
} |
||||
|
||||
// Start the server. Invoked from Java code.
|
||||
extern "C" JNIEXPORT void JNICALL |
||||
Java_io_grpc_helloworldexample_cpp_HelloworldActivity_startServer( |
||||
JNIEnv* env, jobject obj_this, jint port_raw) { |
||||
int port = static_cast<int>(port_raw); |
||||
|
||||
jclass cls = env->GetObjectClass(obj_this); |
||||
jmethodID is_cancelled_mid = |
||||
env->GetMethodID(cls, "isRunServerTaskCancelled", "()Z"); |
||||
|
||||
stop_server = false; |
||||
|
||||
StartServer(env, obj_this, is_cancelled_mid, port); |
||||
} |
@ -0,0 +1,167 @@ |
||||
/* |
||||
* Copyright 2018, gRPC Authors All rights reserved. |
||||
* |
||||
* 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 IS" 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. |
||||
*/ |
||||
|
||||
package io.grpc.helloworldexample.cpp; |
||||
|
||||
import android.content.Context; |
||||
import android.os.AsyncTask; |
||||
import android.os.Bundle; |
||||
import android.support.v7.app.AppCompatActivity; |
||||
import android.text.TextUtils; |
||||
import android.text.method.ScrollingMovementMethod; |
||||
import android.view.View; |
||||
import android.view.inputmethod.InputMethodManager; |
||||
import android.widget.Button; |
||||
import android.widget.EditText; |
||||
import android.widget.TextView; |
||||
import android.widget.Toast; |
||||
import java.lang.ref.WeakReference; |
||||
|
||||
public class HelloworldActivity extends AppCompatActivity { |
||||
|
||||
static { |
||||
System.loadLibrary("grpc-helloworld"); |
||||
} |
||||
|
||||
private Button sendButton; |
||||
private Button serverButton; |
||||
private EditText hostEdit; |
||||
private EditText portEdit; |
||||
private EditText messageEdit; |
||||
private EditText serverPortEdit; |
||||
private TextView resultText; |
||||
private GrpcTask grpcTask; |
||||
private RunServerTask runServerTask; |
||||
|
||||
@Override |
||||
protected void onCreate(Bundle savedInstanceState) { |
||||
super.onCreate(savedInstanceState); |
||||
setContentView(R.layout.activity_helloworld); |
||||
sendButton = (Button) findViewById(R.id.send_button); |
||||
serverButton = (Button) findViewById(R.id.server_button); |
||||
hostEdit = (EditText) findViewById(R.id.host_edit_text); |
||||
portEdit = (EditText) findViewById(R.id.port_edit_text); |
||||
messageEdit = (EditText) findViewById(R.id.message_edit_text); |
||||
serverPortEdit = (EditText) findViewById(R.id.server_port_edit_text); |
||||
resultText = (TextView) findViewById(R.id.grpc_response_text); |
||||
resultText.setMovementMethod(new ScrollingMovementMethod()); |
||||
} |
||||
|
||||
@Override |
||||
protected void onPause() { |
||||
super.onPause(); |
||||
if (runServerTask != null) { |
||||
runServerTask.cancel(true); |
||||
runServerTask = null; |
||||
serverButton.setText("Start gRPC Server"); |
||||
} |
||||
if (grpcTask != null) { |
||||
grpcTask.cancel(true); |
||||
grpcTask = null; |
||||
} |
||||
} |
||||
|
||||
public void sendMessage(View view) { |
||||
((InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE)) |
||||
.hideSoftInputFromWindow(hostEdit.getWindowToken(), 0); |
||||
sendButton.setEnabled(false); |
||||
resultText.setText(""); |
||||
grpcTask = new GrpcTask(this); |
||||
grpcTask.executeOnExecutor( |
||||
AsyncTask.THREAD_POOL_EXECUTOR, |
||||
hostEdit.getText().toString(), |
||||
messageEdit.getText().toString(), |
||||
portEdit.getText().toString()); |
||||
} |
||||
|
||||
public void startOrStopServer(View view) { |
||||
if (runServerTask != null) { |
||||
runServerTask.cancel(true); |
||||
runServerTask = null; |
||||
serverButton.setText("Start gRPC Server"); |
||||
Toast.makeText(this, "Server stopped", Toast.LENGTH_SHORT).show(); |
||||
} else { |
||||
runServerTask = new RunServerTask(this); |
||||
String portStr = serverPortEdit.getText().toString(); |
||||
int port = TextUtils.isEmpty(portStr) ? 50051 : Integer.valueOf(portStr); |
||||
runServerTask.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, port); |
||||
serverButton.setText("Stop gRPC Server"); |
||||
Toast.makeText(this, "Server started on port " + port, Toast.LENGTH_SHORT).show(); |
||||
} |
||||
} |
||||
|
||||
private static class RunServerTask extends AsyncTask<Integer, Void, Void> { |
||||
private final WeakReference<HelloworldActivity> activityReference; |
||||
|
||||
private RunServerTask(HelloworldActivity activity) { |
||||
this.activityReference = new WeakReference<HelloworldActivity>(activity); |
||||
} |
||||
|
||||
@Override |
||||
protected Void doInBackground(Integer... params) { |
||||
int port = params[0]; |
||||
HelloworldActivity activity = activityReference.get(); |
||||
if (activity != null) { |
||||
activity.startServer(port); |
||||
} |
||||
return null; |
||||
} |
||||
} |
||||
|
||||
private static class GrpcTask extends AsyncTask<String, Void, String> { |
||||
private final WeakReference<HelloworldActivity> activityReference; |
||||
|
||||
private GrpcTask(HelloworldActivity activity) { |
||||
this.activityReference = new WeakReference<HelloworldActivity>(activity); |
||||
} |
||||
|
||||
@Override |
||||
protected String doInBackground(String... params) { |
||||
String host = params[0]; |
||||
String message = params[1]; |
||||
String portStr = params[2]; |
||||
int port = TextUtils.isEmpty(portStr) ? 50051 : Integer.valueOf(portStr); |
||||
return sayHello(host, port, message); |
||||
} |
||||
|
||||
@Override |
||||
protected void onPostExecute(String result) { |
||||
HelloworldActivity activity = activityReference.get(); |
||||
if (activity == null || isCancelled()) { |
||||
return; |
||||
} |
||||
TextView resultText = (TextView) activity.findViewById(R.id.grpc_response_text); |
||||
Button sendButton = (Button) activity.findViewById(R.id.send_button); |
||||
resultText.setText(result); |
||||
sendButton.setEnabled(true); |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* Invoked by native code to stop server when RunServerTask has been canceled, either by user |
||||
* request or upon app moving to background. |
||||
*/ |
||||
public boolean isRunServerTaskCancelled() { |
||||
if (runServerTask != null) { |
||||
return runServerTask.isCancelled(); |
||||
} |
||||
return false; |
||||
} |
||||
|
||||
public static native String sayHello(String host, int port, String message); |
||||
|
||||
public native void startServer(int port); |
||||
} |
@ -0,0 +1,86 @@ |
||||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" |
||||
xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" |
||||
android:layout_height="match_parent" |
||||
tools:context=".HelloworldActivity" |
||||
android:orientation="vertical" > |
||||
|
||||
<TextView |
||||
android:layout_width="match_parent" |
||||
android:layout_height="wrap_content" |
||||
android:paddingTop="12dp" |
||||
android:paddingBottom="12dp" |
||||
android:textSize="16sp" |
||||
android:text="gRPC Client Configuration" |
||||
android:textStyle="bold" /> |
||||
|
||||
<LinearLayout |
||||
android:layout_width="match_parent" |
||||
android:layout_height="wrap_content" |
||||
android:orientation="horizontal"> |
||||
<EditText |
||||
android:id="@+id/host_edit_text" |
||||
android:layout_weight="2" |
||||
android:layout_width="0dp" |
||||
android:layout_height="wrap_content" |
||||
android:hint="Enter Host" /> |
||||
<EditText |
||||
android:id="@+id/port_edit_text" |
||||
android:layout_weight="1" |
||||
android:layout_width="0dp" |
||||
android:layout_height="wrap_content" |
||||
android:inputType="numberDecimal" |
||||
android:hint="Enter Port" /> |
||||
</LinearLayout> |
||||
|
||||
|
||||
<EditText |
||||
android:id="@+id/message_edit_text" |
||||
android:layout_width="match_parent" |
||||
android:layout_height="wrap_content" |
||||
android:hint="Enter message to send" /> |
||||
|
||||
<Button |
||||
android:id="@+id/send_button" |
||||
android:layout_width="match_parent" |
||||
android:layout_height="wrap_content" |
||||
android:onClick="sendMessage" |
||||
android:text="Send gRPC Request" /> |
||||
|
||||
<TextView |
||||
android:layout_width="match_parent" |
||||
android:layout_height="wrap_content" |
||||
android:paddingTop="12dp" |
||||
android:paddingBottom="12dp" |
||||
android:textSize="16sp" |
||||
android:text="Response:" /> |
||||
|
||||
<TextView |
||||
android:id="@+id/grpc_response_text" |
||||
android:layout_width="match_parent" |
||||
android:layout_height="wrap_content" |
||||
android:scrollbars = "vertical" |
||||
android:textSize="16sp" /> |
||||
|
||||
<TextView |
||||
android:layout_width="match_parent" |
||||
android:layout_height="wrap_content" |
||||
android:paddingTop="12dp" |
||||
android:paddingBottom="12dp" |
||||
android:textSize="16sp" |
||||
android:text="gRPC Server Configuration" |
||||
android:textStyle="bold" /> |
||||
|
||||
<EditText |
||||
android:id="@+id/server_port_edit_text" |
||||
android:layout_width="match_parent" |
||||
android:layout_height="wrap_content" |
||||
android:hint="Server port" /> |
||||
|
||||
<Button |
||||
android:id="@+id/server_button" |
||||
android:layout_width="match_parent" |
||||
android:layout_height="wrap_content" |
||||
android:onClick="startOrStopServer" |
||||
android:text="Start gRPC Server" /> |
||||
|
||||
</LinearLayout> |
After Width: | Height: | Size: 3.3 KiB |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 4.7 KiB |
After Width: | Height: | Size: 7.5 KiB |
@ -0,0 +1,3 @@ |
||||
<resources> |
||||
<string name="app_name">GrpcHelloworldCppExample</string> |
||||
</resources> |
@ -0,0 +1,24 @@ |
||||
// Top-level build file where you can add configuration options common to all sub-projects/modules. |
||||
|
||||
buildscript { |
||||
repositories { |
||||
google() |
||||
jcenter() |
||||
} |
||||
dependencies { |
||||
classpath 'com.android.tools.build:gradle:3.0.1' |
||||
// NOTE: Do not place your application dependencies here; they belong |
||||
// in the individual module build.gradle files |
||||
} |
||||
} |
||||
|
||||
allprojects { |
||||
repositories { |
||||
google() |
||||
jcenter() |
||||
} |
||||
} |
||||
|
||||
task clean(type: Delete) { |
||||
delete rootProject.buildDir |
||||
} |
@ -0,0 +1,17 @@ |
||||
# Project-wide Gradle settings. |
||||
|
||||
# IDE (e.g. Android Studio) users: |
||||
# Gradle settings configured through the IDE *will override* |
||||
# any settings specified in this file. |
||||
|
||||
# For more details on how to configure your build environment visit |
||||
# http://www.gradle.org/docs/current/userguide/build_environment.html |
||||
|
||||
# Specifies the JVM arguments used for the daemon process. |
||||
# The setting is particularly useful for tweaking memory settings. |
||||
org.gradle.jvmargs=-Xmx1536m |
||||
|
||||
# When configured, Gradle will run in incubating parallel mode. |
||||
# This option should only be used with decoupled projects. More details, visit |
||||
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects |
||||
# org.gradle.parallel=true |
Binary file not shown.
@ -0,0 +1,6 @@ |
||||
#Thu Jan 25 11:45:30 PST 2018 |
||||
distributionBase=GRADLE_USER_HOME |
||||
distributionPath=wrapper/dists |
||||
zipStoreBase=GRADLE_USER_HOME |
||||
zipStorePath=wrapper/dists |
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip |
@ -0,0 +1,160 @@ |
||||
#!/usr/bin/env bash |
||||
|
||||
############################################################################## |
||||
## |
||||
## Gradle start up script for UN*X |
||||
## |
||||
############################################################################## |
||||
|
||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. |
||||
DEFAULT_JVM_OPTS="" |
||||
|
||||
APP_NAME="Gradle" |
||||
APP_BASE_NAME=`basename "$0"` |
||||
|
||||
# Use the maximum available, or set MAX_FD != -1 to use that value. |
||||
MAX_FD="maximum" |
||||
|
||||
warn ( ) { |
||||
echo "$*" |
||||
} |
||||
|
||||
die ( ) { |
||||
echo |
||||
echo "$*" |
||||
echo |
||||
exit 1 |
||||
} |
||||
|
||||
# OS specific support (must be 'true' or 'false'). |
||||
cygwin=false |
||||
msys=false |
||||
darwin=false |
||||
case "`uname`" in |
||||
CYGWIN* ) |
||||
cygwin=true |
||||
;; |
||||
Darwin* ) |
||||
darwin=true |
||||
;; |
||||
MINGW* ) |
||||
msys=true |
||||
;; |
||||
esac |
||||
|
||||
# Attempt to set APP_HOME |
||||
# Resolve links: $0 may be a link |
||||
PRG="$0" |
||||
# Need this for relative symlinks. |
||||
while [ -h "$PRG" ] ; do |
||||
ls=`ls -ld "$PRG"` |
||||
link=`expr "$ls" : '.*-> \(.*\)$'` |
||||
if expr "$link" : '/.*' > /dev/null; then |
||||
PRG="$link" |
||||
else |
||||
PRG=`dirname "$PRG"`"/$link" |
||||
fi |
||||
done |
||||
SAVED="`pwd`" |
||||
cd "`dirname \"$PRG\"`/" >/dev/null |
||||
APP_HOME="`pwd -P`" |
||||
cd "$SAVED" >/dev/null |
||||
|
||||
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar |
||||
|
||||
# Determine the Java command to use to start the JVM. |
||||
if [ -n "$JAVA_HOME" ] ; then |
||||
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then |
||||
# IBM's JDK on AIX uses strange locations for the executables |
||||
JAVACMD="$JAVA_HOME/jre/sh/java" |
||||
else |
||||
JAVACMD="$JAVA_HOME/bin/java" |
||||
fi |
||||
if [ ! -x "$JAVACMD" ] ; then |
||||
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME |
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the |
||||
location of your Java installation." |
||||
fi |
||||
else |
||||
JAVACMD="java" |
||||
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. |
||||
|
||||
Please set the JAVA_HOME variable in your environment to match the |
||||
location of your Java installation." |
||||
fi |
||||
|
||||
# Increase the maximum file descriptors if we can. |
||||
if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then |
||||
MAX_FD_LIMIT=`ulimit -H -n` |
||||
if [ $? -eq 0 ] ; then |
||||
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then |
||||
MAX_FD="$MAX_FD_LIMIT" |
||||
fi |
||||
ulimit -n $MAX_FD |
||||
if [ $? -ne 0 ] ; then |
||||
warn "Could not set maximum file descriptor limit: $MAX_FD" |
||||
fi |
||||
else |
||||
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" |
||||
fi |
||||
fi |
||||
|
||||
# For Darwin, add options to specify how the application appears in the dock |
||||
if $darwin; then |
||||
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" |
||||
fi |
||||
|
||||
# For Cygwin, switch paths to Windows format before running java |
||||
if $cygwin ; then |
||||
APP_HOME=`cygpath --path --mixed "$APP_HOME"` |
||||
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` |
||||
JAVACMD=`cygpath --unix "$JAVACMD"` |
||||
|
||||
# We build the pattern for arguments to be converted via cygpath |
||||
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` |
||||
SEP="" |
||||
for dir in $ROOTDIRSRAW ; do |
||||
ROOTDIRS="$ROOTDIRS$SEP$dir" |
||||
SEP="|" |
||||
done |
||||
OURCYGPATTERN="(^($ROOTDIRS))" |
||||
# Add a user-defined pattern to the cygpath arguments |
||||
if [ "$GRADLE_CYGPATTERN" != "" ] ; then |
||||
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" |
||||
fi |
||||
# Now convert the arguments - kludge to limit ourselves to /bin/sh |
||||
i=0 |
||||
for arg in "$@" ; do |
||||
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` |
||||
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option |
||||
|
||||
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition |
||||
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` |
||||
else |
||||
eval `echo args$i`="\"$arg\"" |
||||
fi |
||||
i=$((i+1)) |
||||
done |
||||
case $i in |
||||
(0) set -- ;; |
||||
(1) set -- "$args0" ;; |
||||
(2) set -- "$args0" "$args1" ;; |
||||
(3) set -- "$args0" "$args1" "$args2" ;; |
||||
(4) set -- "$args0" "$args1" "$args2" "$args3" ;; |
||||
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; |
||||
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; |
||||
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; |
||||
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; |
||||
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; |
||||
esac |
||||
fi |
||||
|
||||
# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules |
||||
function splitJvmOpts() { |
||||
JVM_OPTS=("$@") |
||||
} |
||||
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS |
||||
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" |
||||
|
||||
exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" |
@ -0,0 +1,90 @@ |
||||
@if "%DEBUG%" == "" @echo off |
||||
@rem ########################################################################## |
||||
@rem |
||||
@rem Gradle startup script for Windows |
||||
@rem |
||||
@rem ########################################################################## |
||||
|
||||
@rem Set local scope for the variables with windows NT shell |
||||
if "%OS%"=="Windows_NT" setlocal |
||||
|
||||
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. |
||||
set DEFAULT_JVM_OPTS= |
||||
|
||||
set DIRNAME=%~dp0 |
||||
if "%DIRNAME%" == "" set DIRNAME=. |
||||
set APP_BASE_NAME=%~n0 |
||||
set APP_HOME=%DIRNAME% |
||||
|
||||
@rem Find java.exe |
||||
if defined JAVA_HOME goto findJavaFromJavaHome |
||||
|
||||
set JAVA_EXE=java.exe |
||||
%JAVA_EXE% -version >NUL 2>&1 |
||||
if "%ERRORLEVEL%" == "0" goto init |
||||
|
||||
echo. |
||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. |
||||
echo. |
||||
echo Please set the JAVA_HOME variable in your environment to match the |
||||
echo location of your Java installation. |
||||
|
||||
goto fail |
||||
|
||||
:findJavaFromJavaHome |
||||
set JAVA_HOME=%JAVA_HOME:"=% |
||||
set JAVA_EXE=%JAVA_HOME%/bin/java.exe |
||||
|
||||
if exist "%JAVA_EXE%" goto init |
||||
|
||||
echo. |
||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% |
||||
echo. |
||||
echo Please set the JAVA_HOME variable in your environment to match the |
||||
echo location of your Java installation. |
||||
|
||||
goto fail |
||||
|
||||
:init |
||||
@rem Get command-line arguments, handling Windowz variants |
||||
|
||||
if not "%OS%" == "Windows_NT" goto win9xME_args |
||||
if "%@eval[2+2]" == "4" goto 4NT_args |
||||
|
||||
:win9xME_args |
||||
@rem Slurp the command line arguments. |
||||
set CMD_LINE_ARGS= |
||||
set _SKIP=2 |
||||
|
||||
:win9xME_args_slurp |
||||
if "x%~1" == "x" goto execute |
||||
|
||||
set CMD_LINE_ARGS=%* |
||||
goto execute |
||||
|
||||
:4NT_args |
||||
@rem Get arguments from the 4NT Shell from JP Software |
||||
set CMD_LINE_ARGS=%$ |
||||
|
||||
:execute |
||||
@rem Setup the command line |
||||
|
||||
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar |
||||
|
||||
@rem Execute Gradle |
||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% |
||||
|
||||
:end |
||||
@rem End local scope for the variables with windows NT shell |
||||
if "%ERRORLEVEL%"=="0" goto mainEnd |
||||
|
||||
:fail |
||||
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of |
||||
rem the _cmd.exe /c_ return code! |
||||
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 |
||||
exit /b 1 |
||||
|
||||
:mainEnd |
||||
if "%OS%"=="Windows_NT" endlocal |
||||
|
||||
:omega |
@ -0,0 +1 @@ |
||||
include ':app' |
@ -0,0 +1,116 @@ |
||||
# Copyright 2018 gRPC authors. |
||||
# |
||||
# 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 IS" 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. |
||||
# |
||||
# cmake "superbuild" file for C++ helloworld example. |
||||
# This build file demonstrates how to build the helloworld project |
||||
# and all its dependencies in a single cmake build (hence "superbuild") |
||||
# that is easy to build and maintain. |
||||
# cmake's ExternalProject_Add() is used to import all the sub-projects, |
||||
# including the "helloworld" project itself. |
||||
# See https://blog.kitware.com/cmake-superbuilds-git-submodules/ |
||||
|
||||
cmake_minimum_required(VERSION 2.8) |
||||
|
||||
# Project |
||||
project(HelloWorld-SuperBuild C CXX) |
||||
|
||||
include(ExternalProject) |
||||
|
||||
# Builds c-ares project from the git submodule. |
||||
# Note: For all external projects, instead of using checked-out code, one could |
||||
# specify GIT_REPOSITORY and GIT_TAG to have cmake download the dependency directly, |
||||
# without needing to add a submodule to your project. |
||||
ExternalProject_Add(c-ares |
||||
PREFIX c-ares |
||||
SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../../../third_party/cares/cares" |
||||
CMAKE_CACHE_ARGS |
||||
-DCARES_SHARED:BOOL=OFF |
||||
-DCARES_STATIC:BOOL=ON |
||||
-DCARES_STATIC_PIC:BOOL=ON |
||||
-DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_CURRENT_BINARY_DIR}/c-ares |
||||
) |
||||
|
||||
# Builds protobuf project from the git submodule. |
||||
ExternalProject_Add(protobuf |
||||
PREFIX protobuf |
||||
SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../../../third_party/protobuf/cmake" |
||||
CMAKE_CACHE_ARGS |
||||
-Dprotobuf_BUILD_TESTS:BOOL=OFF |
||||
-Dprotobuf_WITH_ZLIB:BOOL=OFF |
||||
-Dprotobuf_MSVC_STATIC_RUNTIME:BOOL=OFF |
||||
-DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_CURRENT_BINARY_DIR}/protobuf |
||||
) |
||||
|
||||
# Builds zlib project from the git submodule. |
||||
ExternalProject_Add(zlib |
||||
PREFIX zlib |
||||
SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../../../third_party/zlib" |
||||
CMAKE_CACHE_ARGS |
||||
-DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_CURRENT_BINARY_DIR}/zlib |
||||
) |
||||
|
||||
# the location where protobuf-config.cmake will be installed varies by platform |
||||
if (WIN32) |
||||
set(_FINDPACKAGE_PROTOBUF_CONFIG_DIR "${CMAKE_CURRENT_BINARY_DIR}/protobuf/cmake") |
||||
else() |
||||
set(_FINDPACKAGE_PROTOBUF_CONFIG_DIR "${CMAKE_CURRENT_BINARY_DIR}/protobuf/lib/cmake/protobuf") |
||||
endif() |
||||
|
||||
# if OPENSSL_ROOT_DIR is set, propagate that hint path to the external projects with OpenSSL dependency. |
||||
set(_CMAKE_ARGS_OPENSSL_ROOT_DIR "") |
||||
if (OPENSSL_ROOT_DIR) |
||||
set(_CMAKE_ARGS_OPENSSL_ROOT_DIR "-DOPENSSL_ROOT_DIR:PATH=${OPENSSL_ROOT_DIR}") |
||||
endif() |
||||
|
||||
# Builds gRPC based on locally checked-out sources and set arguments so that all the dependencies |
||||
# are correctly located. |
||||
ExternalProject_Add(grpc |
||||
PREFIX grpc |
||||
SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../../.." |
||||
CMAKE_CACHE_ARGS |
||||
-DgRPC_INSTALL:BOOL=ON |
||||
-DgRPC_BUILD_TESTS:BOOL=OFF |
||||
-DgRPC_PROTOBUF_PROVIDER:STRING=package |
||||
-DgRPC_PROTOBUF_PACKAGE_TYPE:STRING=CONFIG |
||||
-DProtobuf_DIR:PATH=${_FINDPACKAGE_PROTOBUF_CONFIG_DIR} |
||||
-DgRPC_ZLIB_PROVIDER:STRING=package |
||||
-DZLIB_ROOT:STRING=${CMAKE_CURRENT_BINARY_DIR}/zlib |
||||
-DgRPC_CARES_PROVIDER:STRING=package |
||||
-Dc-ares_DIR:PATH=${CMAKE_CURRENT_BINARY_DIR}/c-ares/lib/cmake/c-ares |
||||
-DgRPC_SSL_PROVIDER:STRING=package |
||||
${_CMAKE_ARGS_OPENSSL_ROOT_DIR} |
||||
-DCMAKE_INSTALL_PREFIX:PATH=${CMAKE_CURRENT_BINARY_DIR}/grpc |
||||
DEPENDS c-ares protobuf zlib |
||||
) |
||||
|
||||
# Build the helloworld projects itself using a CMakeLists.txt that assumes all the dependencies |
||||
# have already been installed. |
||||
# Even though helloworld is not really an "external project" from perspective of this build, |
||||
# we are still importing it using ExternalProject_Add because that allows us to use find_package() |
||||
# to locate all the dependencies (if we were building helloworld directly in this build we, |
||||
# we would have needed to manually import the libraries as opposed to reusing targets exported by |
||||
# gRPC and protobuf). |
||||
ExternalProject_Add(helloworld |
||||
PREFIX helloworld |
||||
SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/.." |
||||
BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/helloworld" |
||||
INSTALL_COMMAND "" |
||||
CMAKE_CACHE_ARGS |
||||
-DProtobuf_DIR:PATH=${_FINDPACKAGE_PROTOBUF_CONFIG_DIR} |
||||
-Dc-ares_DIR:PATH=${CMAKE_CURRENT_BINARY_DIR}/c-ares/lib/cmake/c-ares |
||||
-DZLIB_ROOT:STRING=${CMAKE_CURRENT_BINARY_DIR}/zlib |
||||
${_CMAKE_ARGS_OPENSSL_ROOT_DIR} |
||||
-DgRPC_DIR:PATH=${CMAKE_CURRENT_BINARY_DIR}/grpc/lib/cmake/grpc |
||||
DEPENDS protobuf grpc |
||||
) |
@ -0,0 +1,409 @@ |
||||
// !$*UTF8*$! |
||||
{ |
||||
archiveVersion = 1; |
||||
classes = { |
||||
}; |
||||
objectVersion = 48; |
||||
objects = { |
||||
|
||||
/* Begin PBXBuildFile section */ |
||||
3DC71E95B8670DC619CF8693 /* libPods-HelloWorldCpp.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 8E3077D82811A6434769B437 /* libPods-HelloWorldCpp.a */; }; |
||||
5E9D65611FFD689B00C955D4 /* AppDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5E9D65601FFD689B00C955D4 /* AppDelegate.mm */; }; |
||||
5E9D65641FFD689B00C955D4 /* ViewController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 5E9D65631FFD689B00C955D4 /* ViewController.mm */; }; |
||||
5E9D65671FFD689B00C955D4 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 5E9D65651FFD689B00C955D4 /* Main.storyboard */; }; |
||||
5E9D65691FFD689B00C955D4 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 5E9D65681FFD689B00C955D4 /* Assets.xcassets */; }; |
||||
5E9D656C1FFD689B00C955D4 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 5E9D656A1FFD689B00C955D4 /* LaunchScreen.storyboard */; }; |
||||
5E9D656F1FFD689C00C955D4 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 5E9D656E1FFD689C00C955D4 /* main.m */; }; |
||||
/* End PBXBuildFile section */ |
||||
|
||||
/* Begin PBXFileReference section */ |
||||
0A6137606FDBA874FCF64753 /* Pods-HelloWorldCpp.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-HelloWorldCpp.release.xcconfig"; path = "Pods/Target Support Files/Pods-HelloWorldCpp/Pods-HelloWorldCpp.release.xcconfig"; sourceTree = "<group>"; }; |
||||
5E9D655C1FFD689B00C955D4 /* HelloWorldCpp.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = HelloWorldCpp.app; sourceTree = BUILT_PRODUCTS_DIR; }; |
||||
5E9D655F1FFD689B00C955D4 /* AppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AppDelegate.h; sourceTree = "<group>"; }; |
||||
5E9D65601FFD689B00C955D4 /* AppDelegate.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = AppDelegate.mm; sourceTree = "<group>"; }; |
||||
5E9D65621FFD689B00C955D4 /* ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ViewController.h; sourceTree = "<group>"; }; |
||||
5E9D65631FFD689B00C955D4 /* ViewController.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = ViewController.mm; sourceTree = "<group>"; }; |
||||
5E9D65661FFD689B00C955D4 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; }; |
||||
5E9D65681FFD689B00C955D4 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; }; |
||||
5E9D656B1FFD689B00C955D4 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/LaunchScreen.storyboard; sourceTree = "<group>"; }; |
||||
5E9D656D1FFD689C00C955D4 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; }; |
||||
5E9D656E1FFD689C00C955D4 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; }; |
||||
8E3077D82811A6434769B437 /* libPods-HelloWorldCpp.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-HelloWorldCpp.a"; sourceTree = BUILT_PRODUCTS_DIR; }; |
||||
AF0FF6EB66DA2C30CFC575EA /* Pods-HelloWorldCpp.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-HelloWorldCpp.debug.xcconfig"; path = "Pods/Target Support Files/Pods-HelloWorldCpp/Pods-HelloWorldCpp.debug.xcconfig"; sourceTree = "<group>"; }; |
||||
/* End PBXFileReference section */ |
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */ |
||||
5E9D65591FFD689B00C955D4 /* Frameworks */ = { |
||||
isa = PBXFrameworksBuildPhase; |
||||
buildActionMask = 2147483647; |
||||
files = ( |
||||
3DC71E95B8670DC619CF8693 /* libPods-HelloWorldCpp.a in Frameworks */, |
||||
); |
||||
runOnlyForDeploymentPostprocessing = 0; |
||||
}; |
||||
/* End PBXFrameworksBuildPhase section */ |
||||
|
||||
/* Begin PBXGroup section */ |
||||
08FBFA5AB49E037A86EA64D7 /* Frameworks */ = { |
||||
isa = PBXGroup; |
||||
children = ( |
||||
8E3077D82811A6434769B437 /* libPods-HelloWorldCpp.a */, |
||||
); |
||||
name = Frameworks; |
||||
sourceTree = "<group>"; |
||||
}; |
||||
5E9D65531FFD689B00C955D4 = { |
||||
isa = PBXGroup; |
||||
children = ( |
||||
5E9D655E1FFD689B00C955D4 /* HelloWorldCpp */, |
||||
5E9D655D1FFD689B00C955D4 /* Products */, |
||||
E40B264856595518D408CF3E /* Pods */, |
||||
08FBFA5AB49E037A86EA64D7 /* Frameworks */, |
||||
); |
||||
sourceTree = "<group>"; |
||||
}; |
||||
5E9D655D1FFD689B00C955D4 /* Products */ = { |
||||
isa = PBXGroup; |
||||
children = ( |
||||
5E9D655C1FFD689B00C955D4 /* HelloWorldCpp.app */, |
||||
); |
||||
name = Products; |
||||
sourceTree = "<group>"; |
||||
}; |
||||
5E9D655E1FFD689B00C955D4 /* HelloWorldCpp */ = { |
||||
isa = PBXGroup; |
||||
children = ( |
||||
5E9D655F1FFD689B00C955D4 /* AppDelegate.h */, |
||||
5E9D65601FFD689B00C955D4 /* AppDelegate.mm */, |
||||
5E9D65621FFD689B00C955D4 /* ViewController.h */, |
||||
5E9D65631FFD689B00C955D4 /* ViewController.mm */, |
||||
5E9D65651FFD689B00C955D4 /* Main.storyboard */, |
||||
5E9D65681FFD689B00C955D4 /* Assets.xcassets */, |
||||
5E9D656A1FFD689B00C955D4 /* LaunchScreen.storyboard */, |
||||
5E9D656D1FFD689C00C955D4 /* Info.plist */, |
||||
5E9D656E1FFD689C00C955D4 /* main.m */, |
||||
); |
||||
path = HelloWorldCpp; |
||||
sourceTree = "<group>"; |
||||
}; |
||||
E40B264856595518D408CF3E /* Pods */ = { |
||||
isa = PBXGroup; |
||||
children = ( |
||||
AF0FF6EB66DA2C30CFC575EA /* Pods-HelloWorldCpp.debug.xcconfig */, |
||||
0A6137606FDBA874FCF64753 /* Pods-HelloWorldCpp.release.xcconfig */, |
||||
); |
||||
name = Pods; |
||||
sourceTree = "<group>"; |
||||
}; |
||||
/* End PBXGroup section */ |
||||
|
||||
/* Begin PBXNativeTarget section */ |
||||
5E9D655B1FFD689B00C955D4 /* HelloWorldCpp */ = { |
||||
isa = PBXNativeTarget; |
||||
buildConfigurationList = 5E9D65721FFD689C00C955D4 /* Build configuration list for PBXNativeTarget "HelloWorldCpp" */; |
||||
buildPhases = ( |
||||
4D66D60BD88AA4D5813859A9 /* [CP] Check Pods Manifest.lock */, |
||||
5E9D65581FFD689B00C955D4 /* Sources */, |
||||
5E9D65591FFD689B00C955D4 /* Frameworks */, |
||||
5E9D655A1FFD689B00C955D4 /* Resources */, |
||||
CA89B315EACC5A6F8816FD26 /* [CP] Embed Pods Frameworks */, |
||||
6C4D930C765719D03893663B /* [CP] Copy Pods Resources */, |
||||
); |
||||
buildRules = ( |
||||
); |
||||
dependencies = ( |
||||
); |
||||
name = HelloWorldCpp; |
||||
productName = HelloWorldCpp; |
||||
productReference = 5E9D655C1FFD689B00C955D4 /* HelloWorldCpp.app */; |
||||
productType = "com.apple.product-type.application"; |
||||
}; |
||||
/* End PBXNativeTarget section */ |
||||
|
||||
/* Begin PBXProject section */ |
||||
5E9D65541FFD689B00C955D4 /* Project object */ = { |
||||
isa = PBXProject; |
||||
attributes = { |
||||
LastUpgradeCheck = 0920; |
||||
ORGANIZATIONNAME = gRPC; |
||||
TargetAttributes = { |
||||
5E9D655B1FFD689B00C955D4 = { |
||||
CreatedOnToolsVersion = 9.2; |
||||
ProvisioningStyle = Automatic; |
||||
}; |
||||
}; |
||||
}; |
||||
buildConfigurationList = 5E9D65571FFD689B00C955D4 /* Build configuration list for PBXProject "HelloWorldCpp" */; |
||||
compatibilityVersion = "Xcode 8.0"; |
||||
developmentRegion = en; |
||||
hasScannedForEncodings = 0; |
||||
knownRegions = ( |
||||
en, |
||||
Base, |
||||
); |
||||
mainGroup = 5E9D65531FFD689B00C955D4; |
||||
productRefGroup = 5E9D655D1FFD689B00C955D4 /* Products */; |
||||
projectDirPath = ""; |
||||
projectRoot = ""; |
||||
targets = ( |
||||
5E9D655B1FFD689B00C955D4 /* HelloWorldCpp */, |
||||
); |
||||
}; |
||||
/* End PBXProject section */ |
||||
|
||||
/* Begin PBXResourcesBuildPhase section */ |
||||
5E9D655A1FFD689B00C955D4 /* Resources */ = { |
||||
isa = PBXResourcesBuildPhase; |
||||
buildActionMask = 2147483647; |
||||
files = ( |
||||
5E9D656C1FFD689B00C955D4 /* LaunchScreen.storyboard in Resources */, |
||||
5E9D65691FFD689B00C955D4 /* Assets.xcassets in Resources */, |
||||
5E9D65671FFD689B00C955D4 /* Main.storyboard in Resources */, |
||||
); |
||||
runOnlyForDeploymentPostprocessing = 0; |
||||
}; |
||||
/* End PBXResourcesBuildPhase section */ |
||||
|
||||
/* Begin PBXShellScriptBuildPhase section */ |
||||
4D66D60BD88AA4D5813859A9 /* [CP] Check Pods Manifest.lock */ = { |
||||
isa = PBXShellScriptBuildPhase; |
||||
buildActionMask = 2147483647; |
||||
files = ( |
||||
); |
||||
inputPaths = ( |
||||
"${PODS_PODFILE_DIR_PATH}/Podfile.lock", |
||||
"${PODS_ROOT}/Manifest.lock", |
||||
); |
||||
name = "[CP] Check Pods Manifest.lock"; |
||||
outputPaths = ( |
||||
"$(DERIVED_FILE_DIR)/Pods-HelloWorldCpp-checkManifestLockResult.txt", |
||||
); |
||||
runOnlyForDeploymentPostprocessing = 0; |
||||
shellPath = /bin/sh; |
||||
shellScript = "diff \"${PODS_PODFILE_DIR_PATH}/Podfile.lock\" \"${PODS_ROOT}/Manifest.lock\" > /dev/null\nif [ $? != 0 ] ; then\n # print error to STDERR\n echo \"error: The sandbox is not in sync with the Podfile.lock. Run 'pod install' or update your CocoaPods installation.\" >&2\n exit 1\nfi\n# This output is used by Xcode 'outputs' to avoid re-running this script phase.\necho \"SUCCESS\" > \"${SCRIPT_OUTPUT_FILE_0}\"\n"; |
||||
showEnvVarsInLog = 0; |
||||
}; |
||||
6C4D930C765719D03893663B /* [CP] Copy Pods Resources */ = { |
||||
isa = PBXShellScriptBuildPhase; |
||||
buildActionMask = 2147483647; |
||||
files = ( |
||||
); |
||||
inputPaths = ( |
||||
); |
||||
name = "[CP] Copy Pods Resources"; |
||||
outputPaths = ( |
||||
); |
||||
runOnlyForDeploymentPostprocessing = 0; |
||||
shellPath = /bin/sh; |
||||
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-HelloWorldCpp/Pods-HelloWorldCpp-resources.sh\"\n"; |
||||
showEnvVarsInLog = 0; |
||||
}; |
||||
CA89B315EACC5A6F8816FD26 /* [CP] Embed Pods Frameworks */ = { |
||||
isa = PBXShellScriptBuildPhase; |
||||
buildActionMask = 2147483647; |
||||
files = ( |
||||
); |
||||
inputPaths = ( |
||||
); |
||||
name = "[CP] Embed Pods Frameworks"; |
||||
outputPaths = ( |
||||
); |
||||
runOnlyForDeploymentPostprocessing = 0; |
||||
shellPath = /bin/sh; |
||||
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-HelloWorldCpp/Pods-HelloWorldCpp-frameworks.sh\"\n"; |
||||
showEnvVarsInLog = 0; |
||||
}; |
||||
/* End PBXShellScriptBuildPhase section */ |
||||
|
||||
/* Begin PBXSourcesBuildPhase section */ |
||||
5E9D65581FFD689B00C955D4 /* Sources */ = { |
||||
isa = PBXSourcesBuildPhase; |
||||
buildActionMask = 2147483647; |
||||
files = ( |
||||
5E9D65641FFD689B00C955D4 /* ViewController.mm in Sources */, |
||||
5E9D656F1FFD689C00C955D4 /* main.m in Sources */, |
||||
5E9D65611FFD689B00C955D4 /* AppDelegate.mm in Sources */, |
||||
); |
||||
runOnlyForDeploymentPostprocessing = 0; |
||||
}; |
||||
/* End PBXSourcesBuildPhase section */ |
||||
|
||||
/* Begin PBXVariantGroup section */ |
||||
5E9D65651FFD689B00C955D4 /* Main.storyboard */ = { |
||||
isa = PBXVariantGroup; |
||||
children = ( |
||||
5E9D65661FFD689B00C955D4 /* Base */, |
||||
); |
||||
name = Main.storyboard; |
||||
sourceTree = "<group>"; |
||||
}; |
||||
5E9D656A1FFD689B00C955D4 /* LaunchScreen.storyboard */ = { |
||||
isa = PBXVariantGroup; |
||||
children = ( |
||||
5E9D656B1FFD689B00C955D4 /* Base */, |
||||
); |
||||
name = LaunchScreen.storyboard; |
||||
sourceTree = "<group>"; |
||||
}; |
||||
/* End PBXVariantGroup section */ |
||||
|
||||
/* Begin XCBuildConfiguration section */ |
||||
5E9D65701FFD689C00C955D4 /* Debug */ = { |
||||
isa = XCBuildConfiguration; |
||||
buildSettings = { |
||||
ALWAYS_SEARCH_USER_PATHS = NO; |
||||
CLANG_ANALYZER_NONNULL = YES; |
||||
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; |
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; |
||||
CLANG_CXX_LIBRARY = "libc++"; |
||||
CLANG_ENABLE_MODULES = YES; |
||||
CLANG_ENABLE_OBJC_ARC = YES; |
||||
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; |
||||
CLANG_WARN_BOOL_CONVERSION = YES; |
||||
CLANG_WARN_COMMA = YES; |
||||
CLANG_WARN_CONSTANT_CONVERSION = YES; |
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; |
||||
CLANG_WARN_DOCUMENTATION_COMMENTS = YES; |
||||
CLANG_WARN_EMPTY_BODY = YES; |
||||
CLANG_WARN_ENUM_CONVERSION = YES; |
||||
CLANG_WARN_INFINITE_RECURSION = YES; |
||||
CLANG_WARN_INT_CONVERSION = YES; |
||||
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; |
||||
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; |
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; |
||||
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; |
||||
CLANG_WARN_STRICT_PROTOTYPES = YES; |
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES; |
||||
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; |
||||
CLANG_WARN_UNREACHABLE_CODE = YES; |
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; |
||||
CODE_SIGN_IDENTITY = "iPhone Developer"; |
||||
COPY_PHASE_STRIP = NO; |
||||
DEBUG_INFORMATION_FORMAT = dwarf; |
||||
ENABLE_STRICT_OBJC_MSGSEND = YES; |
||||
ENABLE_TESTABILITY = YES; |
||||
GCC_C_LANGUAGE_STANDARD = gnu11; |
||||
GCC_DYNAMIC_NO_PIC = NO; |
||||
GCC_NO_COMMON_BLOCKS = YES; |
||||
GCC_OPTIMIZATION_LEVEL = 0; |
||||
GCC_PREPROCESSOR_DEFINITIONS = ( |
||||
"DEBUG=1", |
||||
"$(inherited)", |
||||
); |
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES; |
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; |
||||
GCC_WARN_UNDECLARED_SELECTOR = YES; |
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; |
||||
GCC_WARN_UNUSED_FUNCTION = YES; |
||||
GCC_WARN_UNUSED_VARIABLE = YES; |
||||
IPHONEOS_DEPLOYMENT_TARGET = 11.2; |
||||
MTL_ENABLE_DEBUG_INFO = YES; |
||||
ONLY_ACTIVE_ARCH = YES; |
||||
SDKROOT = iphoneos; |
||||
}; |
||||
name = Debug; |
||||
}; |
||||
5E9D65711FFD689C00C955D4 /* Release */ = { |
||||
isa = XCBuildConfiguration; |
||||
buildSettings = { |
||||
ALWAYS_SEARCH_USER_PATHS = NO; |
||||
CLANG_ANALYZER_NONNULL = YES; |
||||
CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE; |
||||
CLANG_CXX_LANGUAGE_STANDARD = "gnu++14"; |
||||
CLANG_CXX_LIBRARY = "libc++"; |
||||
CLANG_ENABLE_MODULES = YES; |
||||
CLANG_ENABLE_OBJC_ARC = YES; |
||||
CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; |
||||
CLANG_WARN_BOOL_CONVERSION = YES; |
||||
CLANG_WARN_COMMA = YES; |
||||
CLANG_WARN_CONSTANT_CONVERSION = YES; |
||||
CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; |
||||
CLANG_WARN_DOCUMENTATION_COMMENTS = YES; |
||||
CLANG_WARN_EMPTY_BODY = YES; |
||||
CLANG_WARN_ENUM_CONVERSION = YES; |
||||
CLANG_WARN_INFINITE_RECURSION = YES; |
||||
CLANG_WARN_INT_CONVERSION = YES; |
||||
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES; |
||||
CLANG_WARN_OBJC_LITERAL_CONVERSION = YES; |
||||
CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; |
||||
CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; |
||||
CLANG_WARN_STRICT_PROTOTYPES = YES; |
||||
CLANG_WARN_SUSPICIOUS_MOVE = YES; |
||||
CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE; |
||||
CLANG_WARN_UNREACHABLE_CODE = YES; |
||||
CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; |
||||
CODE_SIGN_IDENTITY = "iPhone Developer"; |
||||
COPY_PHASE_STRIP = NO; |
||||
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; |
||||
ENABLE_NS_ASSERTIONS = NO; |
||||
ENABLE_STRICT_OBJC_MSGSEND = YES; |
||||
GCC_C_LANGUAGE_STANDARD = gnu11; |
||||
GCC_NO_COMMON_BLOCKS = YES; |
||||
GCC_WARN_64_TO_32_BIT_CONVERSION = YES; |
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; |
||||
GCC_WARN_UNDECLARED_SELECTOR = YES; |
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; |
||||
GCC_WARN_UNUSED_FUNCTION = YES; |
||||
GCC_WARN_UNUSED_VARIABLE = YES; |
||||
IPHONEOS_DEPLOYMENT_TARGET = 11.2; |
||||
MTL_ENABLE_DEBUG_INFO = NO; |
||||
SDKROOT = iphoneos; |
||||
VALIDATE_PRODUCT = YES; |
||||
}; |
||||
name = Release; |
||||
}; |
||||
5E9D65731FFD689C00C955D4 /* Debug */ = { |
||||
isa = XCBuildConfiguration; |
||||
baseConfigurationReference = AF0FF6EB66DA2C30CFC575EA /* Pods-HelloWorldCpp.debug.xcconfig */; |
||||
buildSettings = { |
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; |
||||
CODE_SIGN_STYLE = Automatic; |
||||
DEVELOPMENT_TEAM = EQHXZ8M8AV; |
||||
INFOPLIST_FILE = HelloWorldCpp/Info.plist; |
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; |
||||
PRODUCT_BUNDLE_IDENTIFIER = io.grpc.HelloWorldCpp; |
||||
PRODUCT_NAME = "$(TARGET_NAME)"; |
||||
TARGETED_DEVICE_FAMILY = "1,2"; |
||||
}; |
||||
name = Debug; |
||||
}; |
||||
5E9D65741FFD689C00C955D4 /* Release */ = { |
||||
isa = XCBuildConfiguration; |
||||
baseConfigurationReference = 0A6137606FDBA874FCF64753 /* Pods-HelloWorldCpp.release.xcconfig */; |
||||
buildSettings = { |
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; |
||||
CODE_SIGN_STYLE = Automatic; |
||||
DEVELOPMENT_TEAM = EQHXZ8M8AV; |
||||
INFOPLIST_FILE = HelloWorldCpp/Info.plist; |
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks"; |
||||
PRODUCT_BUNDLE_IDENTIFIER = io.grpc.HelloWorldCpp; |
||||
PRODUCT_NAME = "$(TARGET_NAME)"; |
||||
TARGETED_DEVICE_FAMILY = "1,2"; |
||||
}; |
||||
name = Release; |
||||
}; |
||||
/* End XCBuildConfiguration section */ |
||||
|
||||
/* Begin XCConfigurationList section */ |
||||
5E9D65571FFD689B00C955D4 /* Build configuration list for PBXProject "HelloWorldCpp" */ = { |
||||
isa = XCConfigurationList; |
||||
buildConfigurations = ( |
||||
5E9D65701FFD689C00C955D4 /* Debug */, |
||||
5E9D65711FFD689C00C955D4 /* Release */, |
||||
); |
||||
defaultConfigurationIsVisible = 0; |
||||
defaultConfigurationName = Release; |
||||
}; |
||||
5E9D65721FFD689C00C955D4 /* Build configuration list for PBXNativeTarget "HelloWorldCpp" */ = { |
||||
isa = XCConfigurationList; |
||||
buildConfigurations = ( |
||||
5E9D65731FFD689C00C955D4 /* Debug */, |
||||
5E9D65741FFD689C00C955D4 /* Release */, |
||||
); |
||||
defaultConfigurationIsVisible = 0; |
||||
defaultConfigurationName = Release; |
||||
}; |
||||
/* End XCConfigurationList section */ |
||||
}; |
||||
rootObject = 5E9D65541FFD689B00C955D4 /* Project object */; |
||||
} |
@ -0,0 +1,22 @@ |
||||
/* |
||||
* |
||||
* Copyright 2018 gRPC authors. |
||||
* |
||||
* 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 IS" 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. |
||||
* |
||||
*/ |
||||
|
||||
#import "AppDelegate.h" |
||||
|
||||
@implementation AppDelegate |
||||
@end |
@ -0,0 +1,93 @@ |
||||
{ |
||||
"images" : [ |
||||
{ |
||||
"idiom" : "iphone", |
||||
"size" : "20x20", |
||||
"scale" : "2x" |
||||
}, |
||||
{ |
||||
"idiom" : "iphone", |
||||
"size" : "20x20", |
||||
"scale" : "3x" |
||||
}, |
||||
{ |
||||
"idiom" : "iphone", |
||||
"size" : "29x29", |
||||
"scale" : "2x" |
||||
}, |
||||
{ |
||||
"idiom" : "iphone", |
||||
"size" : "29x29", |
||||
"scale" : "3x" |
||||
}, |
||||
{ |
||||
"idiom" : "iphone", |
||||
"size" : "40x40", |
||||
"scale" : "2x" |
||||
}, |
||||
{ |
||||
"idiom" : "iphone", |
||||
"size" : "40x40", |
||||
"scale" : "3x" |
||||
}, |
||||
{ |
||||
"idiom" : "iphone", |
||||
"size" : "60x60", |
||||
"scale" : "2x" |
||||
}, |
||||
{ |
||||
"idiom" : "iphone", |
||||
"size" : "60x60", |
||||
"scale" : "3x" |
||||
}, |
||||
{ |
||||
"idiom" : "ipad", |
||||
"size" : "20x20", |
||||
"scale" : "1x" |
||||
}, |
||||
{ |
||||
"idiom" : "ipad", |
||||
"size" : "20x20", |
||||
"scale" : "2x" |
||||
}, |
||||
{ |
||||
"idiom" : "ipad", |
||||
"size" : "29x29", |
||||
"scale" : "1x" |
||||
}, |
||||
{ |
||||
"idiom" : "ipad", |
||||
"size" : "29x29", |
||||
"scale" : "2x" |
||||
}, |
||||
{ |
||||
"idiom" : "ipad", |
||||
"size" : "40x40", |
||||
"scale" : "1x" |
||||
}, |
||||
{ |
||||
"idiom" : "ipad", |
||||
"size" : "40x40", |
||||
"scale" : "2x" |
||||
}, |
||||
{ |
||||
"idiom" : "ipad", |
||||
"size" : "76x76", |
||||
"scale" : "1x" |
||||
}, |
||||
{ |
||||
"idiom" : "ipad", |
||||
"size" : "76x76", |
||||
"scale" : "2x" |
||||
}, |
||||
{ |
||||
"idiom" : "ipad", |
||||
"size" : "83.5x83.5", |
||||
"scale" : "2x" |
||||
} |
||||
], |
||||
"info" : { |
||||
"version" : 1, |
||||
"author" : "xcode" |
||||
} |
||||
} |
@ -0,0 +1,25 @@ |
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?> |
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13122.16" systemVersion="17A277" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="01J-lp-oVM"> |
||||
<dependencies> |
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13104.12"/> |
||||
<capability name="Safe area layout guides" minToolsVersion="9.0"/> |
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> |
||||
</dependencies> |
||||
<scenes> |
||||
<!--View Controller--> |
||||
<scene sceneID="EHf-IW-A2E"> |
||||
<objects> |
||||
<viewController id="01J-lp-oVM" sceneMemberID="viewController"> |
||||
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3"> |
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/> |
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> |
||||
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> |
||||
<viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/> |
||||
</view> |
||||
</viewController> |
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/> |
||||
</objects> |
||||
<point key="canvasLocation" x="53" y="375"/> |
||||
</scene> |
||||
</scenes> |
||||
</document> |
@ -0,0 +1,24 @@ |
||||
<?xml version="1.0" encoding="UTF-8"?> |
||||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13122.16" systemVersion="17A277" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="BYZ-38-t0r"> |
||||
<dependencies> |
||||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13104.12"/> |
||||
<capability name="Safe area layout guides" minToolsVersion="9.0"/> |
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> |
||||
</dependencies> |
||||
<scenes> |
||||
<!--View Controller--> |
||||
<scene sceneID="tne-QT-ifu"> |
||||
<objects> |
||||
<viewController id="BYZ-38-t0r" customClass="ViewController" customModuleProvider="" sceneMemberID="viewController"> |
||||
<view key="view" contentMode="scaleToFill" id="8bC-Xf-vdC"> |
||||
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/> |
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> |
||||
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="custom" customColorSpace="sRGB"/> |
||||
<viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/> |
||||
</view> |
||||
</viewController> |
||||
<placeholder placeholderIdentifier="IBFirstResponder" id="dkx-z0-nzr" sceneMemberID="firstResponder"/> |
||||
</objects> |
||||
</scene> |
||||
</scenes> |
||||
</document> |
@ -0,0 +1,101 @@ |
||||
/* |
||||
* |
||||
* Copyright 2018 gRPC authors. |
||||
* |
||||
* 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 IS" 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. |
||||
* |
||||
*/ |
||||
|
||||
#import "ViewController.h" |
||||
#import <grpcpp/grpcpp.h> |
||||
#include <grpcpp/generic/generic_stub.h> |
||||
#include <grpcpp/generic/async_generic_service.h> |
||||
|
||||
static void* tag(int i) { return (void*)(intptr_t)i; } |
||||
|
||||
// Serialized Proto bytes of Hello World example |
||||
const uint8_t kMessage[] = |
||||
{0x0A, 0x0B, 0x4F, 0x62, 0x6A, 0x65, 0x63, 0x74, 0x69, 0x76, 0x65, 0x2D, 0x43}; |
||||
|
||||
@interface ViewController () |
||||
|
||||
@end |
||||
|
||||
@implementation ViewController { |
||||
grpc::CompletionQueue cq_; |
||||
std::unique_ptr<grpc::GenericStub> generic_stub_; |
||||
} |
||||
|
||||
- (void)viewDidLoad { |
||||
[super viewDidLoad]; |
||||
|
||||
// Setup call stub |
||||
std::shared_ptr<grpc::Channel> channel = |
||||
CreateChannel("localhost:50051", grpc::InsecureChannelCredentials()); |
||||
generic_stub_.reset(new grpc::GenericStub(channel)); |
||||
|
||||
const grpc::string kMethodName("/helloworld.Greeter/SayHello"); |
||||
void* got_tag; |
||||
bool ok; |
||||
|
||||
grpc::ClientContext cli_ctx; |
||||
std::unique_ptr<grpc::GenericClientAsyncReaderWriter> call = |
||||
generic_stub_->Call(&cli_ctx, kMethodName, &cq_, tag(1)); |
||||
cq_.Next(&got_tag, &ok); |
||||
if (!ok || got_tag != tag(1)) { |
||||
NSLog(@"Failed to create call."); |
||||
abort(); |
||||
} |
||||
grpc::Slice send_slice = grpc::Slice(kMessage, sizeof(kMessage) / sizeof(kMessage[0])); |
||||
std::unique_ptr<grpc::ByteBuffer> send_buffer(new grpc::ByteBuffer(&send_slice, 1)); |
||||
call->Write(*send_buffer, tag(2)); |
||||
cq_.Next(&got_tag, &ok); |
||||
if (!ok || got_tag != tag(2)) { |
||||
NSLog(@"Failed to send message."); |
||||
abort(); |
||||
} |
||||
grpc::ByteBuffer recv_buffer; |
||||
call->Read(&recv_buffer, tag(3)); |
||||
cq_.Next(&got_tag, &ok); |
||||
if (!ok || got_tag != tag(3)) { |
||||
NSLog(@"Failed to receive message."); |
||||
abort(); |
||||
} |
||||
|
||||
grpc::Status status; |
||||
call->Finish(&status, tag(4)); |
||||
cq_.Next(&got_tag, &ok); |
||||
if (!ok || got_tag != tag(4)) { |
||||
NSLog(@"Failed to finish call."); |
||||
abort(); |
||||
} |
||||
if (!status.ok()) { |
||||
NSLog(@"Received unsuccessful status code: %d", status.error_code()); |
||||
abort(); |
||||
} |
||||
std::vector<grpc::Slice> slices; |
||||
recv_buffer.Dump(&slices); |
||||
NSString *recvBytes = [[NSString alloc] init]; |
||||
for (auto slice : slices) { |
||||
auto p = slice.begin(); |
||||
while (p != slice.end()) { |
||||
recvBytes = |
||||
[recvBytes stringByAppendingString:[NSString stringWithFormat:@"%02x ", *p]]; |
||||
p++; |
||||
} |
||||
} |
||||
NSLog(@"Hello World succeeded.\nReceived bytes: %@\n" |
||||
"Expected bytes: 0a 11 48 65 6c 6c 6f 20 4f 62 6a 65 63 74 69 76 65 2d 43", recvBytes); |
||||
} |
||||
|
||||
@end |
@ -0,0 +1,8 @@ |
||||
source 'https://github.com/CocoaPods/Specs.git' |
||||
platform :ios, '8.0' |
||||
|
||||
install! 'cocoapods', :deterministic_uuids => false |
||||
|
||||
target 'HelloWorldCpp' do |
||||
pod 'gRPC-C++' |
||||
end |
@ -1,5 +0,0 @@ |
||||
{ |
||||
"sdk": { |
||||
"version": "1.0.0" |
||||
} |
||||
} |
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue