aboutsummaryrefslogtreecommitdiffhomepage
path: root/templates
diff options
context:
space:
mode:
authorGravatar murgatroid99 <michael.lumish@gmail.com>2017-01-17 12:02:50 -0800
committerGravatar murgatroid99 <michael.lumish@gmail.com>2017-01-17 12:02:50 -0800
commit58233dbc1a7893756d33ecfc1ec7ffe6607c3168 (patch)
tree8e966022d92babe3fef8b956e78839b425d0c996 /templates
parentc781f6451887ee5b47623c511ba337b08532f583 (diff)
parent1e2775861fbdbaa6f00553b5eaf708e46efc10a6 (diff)
Merge branch 'master' into makefile_ruby_version_fixes
Diffstat (limited to 'templates')
-rw-r--r--templates/BUILD.template256
-rw-r--r--templates/CMakeLists.txt.template17
-rw-r--r--templates/Makefile.template24
-rw-r--r--templates/binding.gyp.template125
-rw-r--r--templates/config.m4.template6
-rw-r--r--templates/gRPC-Core.podspec.template6
-rw-r--r--templates/grpc.gemspec.template2
-rw-r--r--templates/package.json.template4
-rw-r--r--templates/tools/dockerfile/clang_format.include5
-rw-r--r--templates/tools/dockerfile/grpc_clang_format/Dockerfile.template37
-rw-r--r--templates/tools/dockerfile/test/bazel/Dockerfile.template48
-rw-r--r--templates/tools/dockerfile/test/node_jessie_x64/Dockerfile.template15
-rw-r--r--templates/tools/dockerfile/test/sanity/Dockerfile.template19
-rw-r--r--templates/tools/doxygen/Doxyfile.include29
-rw-r--r--templates/tools/run_tests/generated/configs.json.template (renamed from templates/tools/run_tests/configs.json.template)0
-rw-r--r--templates/tools/run_tests/generated/sources_and_headers.json.template (renamed from templates/tools/run_tests/sources_and_headers.json.template)0
-rw-r--r--templates/tools/run_tests/generated/tests.json.template (renamed from templates/tools/run_tests/tests.json.template)0
-rw-r--r--templates/vsprojects/grpc.sln.template2
-rw-r--r--templates/vsprojects/protobuf.props.template2
-rw-r--r--templates/vsprojects/protoc.props.template2
20 files changed, 271 insertions, 328 deletions
diff --git a/templates/BUILD.template b/templates/BUILD.template
deleted file mode 100644
index af23fb2799..0000000000
--- a/templates/BUILD.template
+++ /dev/null
@@ -1,256 +0,0 @@
-%YAML 1.2
---- |
- # GRPC Bazel BUILD file.
- # This currently builds C, C++ and Objective-C code.
- # 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, Google Inc.
- # All rights reserved.
- #
- # Redistribution and use in source and binary forms, with or without
- # modification, are permitted provided that the following conditions are
- # met:
- #
- # * Redistributions of source code must retain the above copyright
- # notice, this list of conditions and the following disclaimer.
- # * Redistributions in binary form must reproduce the above
- # copyright notice, this list of conditions and the following disclaimer
- # in the documentation and/or other materials provided with the
- # distribution.
- # * Neither the name of Google Inc. nor the names of its
- # contributors may be used to endorse or promote products derived from
- # this software without specific prior written permission.
- #
- # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
- licenses(["notice"]) # 3-clause BSD
-
- exports_files(["LICENSE"])
-
- package(default_visibility = ["//visibility:public"])
-
- <%!
- def get_deps(target_dict):
- deps = []
- if target_dict.get('secure', False):
- deps = [
- "//external:libssl",
- ]
- if target_dict.get('build', None) == 'protoc':
- deps.append("//external:protobuf_compiler")
- if (target_dict['name'] == 'grpc++_unsecure' or
- target_dict['name'] == 'grpc++' or
- target_dict['name'] == 'grpc++_codegen_lib'):
- deps.append("//external:protobuf_clib")
- elif target_dict['name'] == 'grpc':
- deps.append("//external:zlib")
- for d in target_dict.get('deps', []):
- if d.find('//') == 0 or d[0] == ':':
- deps.append(d)
- else:
- deps.append(':%s' % (d))
- return deps
- %>
-
- % for lib in libs:
- % if lib.build in ("all", "protoc"):
- ${cc_library(lib)}
- % endif
- % endfor
-
- % for lib in libs:
- % if lib.name in ("grpc", "gpr"):
- ${objc_library(lib)}
- % endif
- % endfor
-
- % for tgt in targets:
- % if tgt.build == 'protoc':
- ${cc_binary(tgt)}
- % endif
- % endfor
-
- <%def name="cc_library(lib)">
- <%
- lib_hdrs = lib.get("headers", [])
- hdrs = [h for h in lib_hdrs if not h.startswith('third_party/nanopb')]
- srcs = [s for s in lib.src if not s.startswith('third_party/nanopb')]
- uses_nanopb = len(lib_hdrs) != len(hdrs) or len(srcs) != len(lib.src)
- %>
- cc_library(
- name = "${lib.name}",
- srcs = [
- % for hdr in hdrs:
- "${hdr}",
- % endfor
- % for src in srcs:
- "${src}",
- % endfor
- ],
- hdrs = [
- % for hdr in lib.get("public_headers", []):
- "${hdr}",
- % endfor
- ],
- includes = [
- "include",
- ".",
- ],
- deps = [
- % for dep in get_deps(lib):
- "${dep}",
- % endfor
- % if uses_nanopb:
- "//external:nanopb",
- % endif
- ],
- % if lib.name in ("grpc", "grpc_unsecure"):
- copts = [
- "-std=gnu99",
- ],
- % endif
- )
- </%def>
-
- <%def name="objc_library(lib)">
- <%
- lib_hdrs = lib.get("headers", [])
- hdrs = [h for h in lib_hdrs if not h.startswith('third_party/nanopb')]
- srcs = [s for s in lib.src if not s.startswith('third_party/nanopb')]
- uses_nanopb = len(lib_hdrs) != len(hdrs) or len(srcs) != len(lib.src)
- %>
- objc_library(
- name = "${lib.name}_objc",
- srcs = [
- % for src in srcs:
- "${src}",
- % endfor
- ],
- hdrs = [
- % for hdr in lib.get("public_headers", []):
- "${hdr}",
- % endfor
- % for hdr in hdrs:
- "${hdr}",
- % endfor
- ],
- includes = [
- "include",
- ".",
- ],
- deps = [
- % for dep in lib.get("deps", []):
- ":${dep}_objc",
- % endfor
- % if lib.get('secure', False):
- "//external:libssl_objc",
- % endif
- % if uses_nanopb:
- "//external:nanopb",
- % endif
- ],
- % if lib.get("baselib", false):
- sdk_dylibs = ["libz"],
- % endif
- )
- </%def>
-
- <%def name="cc_binary(tgt)">
- cc_binary(
- name = "${tgt.name}",
- srcs = [
- % for src in tgt.src:
- "${src}",
- % endfor
- ],
- deps = [
- % for dep in get_deps(tgt):
- "${dep}",
- % endfor
- ],
- )
- </%def>
-
- objc_path = "src/objective-c"
-
- rx_library_path = objc_path + "/RxLibrary"
-
- objc_library(
- name = "rx_library",
- hdrs = glob([
- rx_library_path + "/*.h",
- rx_library_path + "/transformations/*.h",
- ]),
- srcs = glob([
- rx_library_path + "/*.m",
- rx_library_path + "/transformations/*.m",
- ]),
- includes = [objc_path],
- deps = [
- ":rx_library_private",
- ],
- )
-
- objc_library(
- name = "rx_library_private",
- hdrs = glob([rx_library_path + "/private/*.h"]),
- srcs = glob([rx_library_path + "/private/*.m"]),
- visibility = ["//visibility:private"],
- )
-
- objc_client_path = objc_path + "/GRPCClient"
-
- objc_library(
- name = "grpc_client",
- hdrs = glob([
- objc_client_path + "/*.h",
- objc_client_path + "/private/*.h",
- ]),
- srcs = glob([
- objc_client_path + "/*.m",
- objc_client_path + "/private/*.m",
- ]),
- includes = [objc_path],
- bundles = [":gRPCCertificates"],
- deps = [
- ":grpc_objc",
- ":rx_library",
- ],
- )
-
- objc_bundle_library(
- # The choice of name is signicant here, since it determines the bundle name.
- name = "gRPCCertificates",
- resources = ["etc/roots.pem"],
- )
-
- proto_objc_rpc_path = objc_path + "/ProtoRPC"
-
- objc_library(
- name = "proto_objc_rpc",
- hdrs = glob([
- proto_objc_rpc_path + "/*.h",
- ]),
- srcs = glob([
- proto_objc_rpc_path + "/*.m",
- ]),
- includes = [objc_path],
- deps = [
- ":grpc_client",
- ":rx_library",
- "//external:protobuf_objc",
- ],
- )
diff --git a/templates/CMakeLists.txt.template b/templates/CMakeLists.txt.template
index c3c636c6af..028c1b8c32 100644
--- a/templates/CMakeLists.txt.template
+++ b/templates/CMakeLists.txt.template
@@ -84,7 +84,13 @@
set(gRPC_USE_PROTO_LITE OFF CACHE BOOL "Use the protobuf-lite library")
if (MSVC)
- add_definitions( -D_WIN32_WINNT=0x600 )
+ add_definitions(-D_WIN32_WINNT=0x600 -D_SCL_SECURE_NO_WARNINGS -D_CRT_SECURE_NO_WARNINGS -D_WINSOCK_DEPRECATED_NO_WARNINGS)
+ # needed to compile boringssl
+ add_definitions(/wd4464 /wd4623 /wd4668 /wd4701 /wd4702 /wd4777 /wd5027)
+ # needed to compile protobuf
+ add_definitions(/wd4065 /wd4506)
+ # TODO(jtattermusch): revisit C4267 occurrences throughout the code
+ add_definitions(/wd4267)
endif()
if (gRPC_USE_PROTO_LITE)
@@ -188,14 +194,19 @@
endif()
% for lib in libs:
- % if lib.build in ["all", "protoc", "tool"]:
+ % if lib.build in ["all", "protoc", "tool"] and lib.language in ['c', 'c++']:
+ ## TODO(jtattermusch): grpc++_reflection includes .proto files
+ ## which is not yet supported and thus fails the entire build.
+ ## Re-enable once fixed.
+ % if lib.name != 'grpc++_reflection':
${cc_library(lib)}
${cc_install(lib)}
% endif
+ % endif
% endfor
% for tgt in targets:
- % if tgt.build in ["all", "protoc", "tool"]:
+ % if tgt.build in ["all", "protoc", "tool"] and tgt.language in ['c', 'c++']:
${cc_binary(tgt)}
${cc_install(tgt)}
% endif
diff --git a/templates/Makefile.template b/templates/Makefile.template
index d58d4fce41..6f4db26f2b 100644
--- a/templates/Makefile.template
+++ b/templates/Makefile.template
@@ -182,12 +182,19 @@
endif
STRIP ?= strip -x
else
+ ifeq ($(SYSTEM),MINGW32)
+ ifeq ($(origin AR), default)
+ AR = ar rcs
+ endif
+ STRIP ?= strip --strip-unneeded
+ else
ifeq ($(origin AR), default)
AR = ar rcs
endif
STRIP ?= strip
endif
endif
+ endif
INSTALL ?= install
RM ?= rm -f
PKG_CONFIG ?= pkg-config
@@ -392,6 +399,7 @@
Libs.private: $(PC_LIBS_PRIVATE)
ifeq ($(SYSTEM),MINGW32)
+ EXECUTABLE_SUFFIX = .exe
SHARED_EXT_CORE = dll
SHARED_EXT_CPP = dll
SHARED_EXT_CSHARP = dll
@@ -400,6 +408,7 @@
SHARED_VERSION_CPP = -${settings.cpp_version.major}
SHARED_VERSION_CSHARP = -${settings.csharp_version.major}
else ifeq ($(SYSTEM),Darwin)
+ EXECUTABLE_SUFFIX =
SHARED_EXT_CORE = dylib
SHARED_EXT_CPP = dylib
SHARED_EXT_CSHARP = dylib
@@ -408,6 +417,7 @@
SHARED_VERSION_CPP =
SHARED_VERSION_CSHARP =
else
+ EXECUTABLE_SUFFIX =
SHARED_EXT_CORE = so.$(CORE_VERSION)
SHARED_EXT_CPP = so.$(CPP_VERSION)
SHARED_EXT_CSHARP = so.$(CSHARP_VERSION)
@@ -1196,7 +1206,7 @@
$(GENDIR)/${p}.grpc.pb.cc: ${p}.proto $(PROTOBUF_DEP) $(PROTOC_PLUGINS) ${' '.join('$(GENDIR)/%s.pb.cc $(GENDIR)/%s.grpc.pb.cc' % (q,q) for q in proto_deps.get(p, []))}
$(E) "[GRPC] Generating gRPC's protobuf service CC file from $<"
$(Q) mkdir -p `dirname $@`
- $(Q) $(PROTOC) -Ithird_party/protobuf/src -I. --grpc_out=$(GENDIR) --plugin=protoc-gen-grpc=$(PROTOC_PLUGINS_DIR)/grpc_cpp_plugin $<
+ $(Q) $(PROTOC) -Ithird_party/protobuf/src -I. --grpc_out=$(GENDIR) --plugin=protoc-gen-grpc=$(PROTOC_PLUGINS_DIR)/grpc_cpp_plugin$(EXECUTABLE_SUFFIX) $<
endif
% endfor
@@ -1295,7 +1305,7 @@
$(Q) $(INSTALL) -d $(prefix)/lib
$(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/$(SHARED_PREFIX)${lib.name}$(SHARED_VERSION_${lang_to_var[lib.language]}).$(SHARED_EXT_${lang_to_var[lib.language]}) $(prefix)/lib/$(SHARED_PREFIX)${lib.name}$(SHARED_VERSION_${lang_to_var[lib.language]}).$(SHARED_EXT_${lang_to_var[lib.language]})
ifeq ($(SYSTEM),MINGW32)
- $(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/lib${lib.name}-imp.a $(prefix)/lib/lib${lib.name}-imp.a
+ $(Q) $(INSTALL) $(LIBDIR)/$(CONFIG)/lib${lib.name}$(SHARED_VERSION_${lang_to_var[lib.language]})-dll.a $(prefix)/lib/lib${lib.name}.a
else ifneq ($(SYSTEM),Darwin)
$(Q) ln -sf $(SHARED_PREFIX)${lib.name}$(SHARED_VERSION_${lang_to_var[lib.language]}).$(SHARED_EXT_${lang_to_var[lib.language]}) $(prefix)/lib/lib${lib.name}.so.${settings.core_version.major}
$(Q) ln -sf $(SHARED_PREFIX)${lib.name}$(SHARED_VERSION_${lang_to_var[lib.language]}).$(SHARED_EXT_${lang_to_var[lib.language]}) $(prefix)/lib/lib${lib.name}.so
@@ -1322,9 +1332,6 @@
${install_shared("csharp")}
install-plugins: $(PROTOC_PLUGINS)
- ifeq ($(SYSTEM),MINGW32)
- $(Q) false
- else
$(E) "[INSTALL] Installing grpc protoc plugins"
% for tgt in targets:
% if tgt.build == 'protoc':
@@ -1332,7 +1339,6 @@
$(Q) $(INSTALL) $(BINDIR)/$(CONFIG)/${tgt.name} $(prefix)/bin/${tgt.name}
% endif
% endfor
- endif
install-pkg-config_c: pc_c pc_c_unsecure
$(E) "[INSTALL] Installing C pkg-config files"
@@ -1513,8 +1519,8 @@
assert dep_lib, 'lib %s not found (in %s)' % (dep, lib.name)
link_libs = link_libs + ' -l' + dep
lib_deps = lib_deps + ' $(LIBDIR)/$(CONFIG)/lib' + dep + '.$(SHARED_EXT_' + lang_to_var[dep_lib.language] + ')'
- mingw_libs = mingw_libs + ' -l' + dep + '-imp'
- mingw_lib_deps = mingw_lib_deps + ' $(LIBDIR)/$(CONFIG)/' + dep + '.$(SHARED_EXT_' + lang_to_var[dep_lib.language] + ')'
+ mingw_libs = mingw_libs + ' -l' + dep + '$(SHARED_VERSION_' + lang_to_var[dep_lib.language] + ')-dll'
+ mingw_lib_deps = mingw_lib_deps + ' $(LIBDIR)/$(CONFIG)/' + dep + '$(SHARED_VERSION_' + lang_to_var[dep_lib.language] + ').$(SHARED_EXT_' + lang_to_var[dep_lib.language] + ')'
security = lib.get('secure', 'check')
if security == True:
@@ -1546,7 +1552,7 @@
${out_mingbase}.$(SHARED_EXT_${lang_to_var[lib.language]}): $(LIB${lib.name.upper()}_OBJS) ${mingw_lib_deps}
$(E) "[LD] Linking $@"
$(Q) mkdir -p `dirname $@`
- $(Q) ${ld} ${ldflags} -L$(LIBDIR)/$(CONFIG) -shared ${lib.name}.def -Wl,--output-def=${out_mingbase}.def -Wl,--out-implib=${out_libbase}-dll.a -o ${out_mingbase}.$(SHARED_EXT_${lang_to_var[lib.language]}) ${common}${mingw_libs}
+ $(Q) ${ld} ${ldflags} -L$(LIBDIR)/$(CONFIG) -shared -Wl,--output-def=${out_mingbase}.def -Wl,--out-implib=${out_libbase}-dll.a -o ${out_mingbase}.$(SHARED_EXT_${lang_to_var[lib.language]}) ${common}${mingw_libs}
else
${out_libbase}.$(SHARED_EXT_${lang_to_var[lib.language]}): $(LIB${lib.name.upper()}_OBJS) ${lib_deps}
$(E) "[LD] Linking $@"
diff --git a/templates/binding.gyp.template b/templates/binding.gyp.template
index e6592acebb..851effc4f3 100644
--- a/templates/binding.gyp.template
+++ b/templates/binding.gyp.template
@@ -39,18 +39,68 @@
# Some of this file is built with the help of
# https://n8.io/converting-a-c-library-to-gyp/
{
+ 'variables': {
+ 'runtime%': 'node'
+ },
'target_defaults': {
'include_dirs': [
'.',
'include'
],
'defines': [
- 'GRPC_UV'
+ 'GPR_BACKWARDS_COMPATIBILITY_MODE'
],
'conditions': [
+ ['runtime=="node"', {
+ 'defines': [
+ 'GRPC_UV'
+ ]
+ }],
+ ['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'
+ ]
+ }, {
+ # Based on logic above, we know that this must be a non-Windows system
+ 'variables': {
+ # The output of "node --version" is "v[version]". We use cut to
+ # remove the first character.
+ 'target%': '<!(node --version | cut -c2-)'
+ },
+ # Empirically, Node only exports ALPN symbols if its major version is >0.
+ # io.js always reports versions >0 and always exports ALPN symbols.
+ # Therefore, Node's major version will be truthy if and only if it
+ # supports ALPN. The target is "[major].[minor].[patch]". We split by
+ # periods and take the first field to get the major version.
+ 'defines': [
+ 'TSI_OPENSSL_ALPN_SUPPORT=<!(echo <(target) | cut -d. -f1)'
+ ],
+ 'include_dirs': [
+ '<(node_root_dir)/deps/openssl/openssl/include',
+ ],
+ '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" ]
+ }]
+ ]
+ }],
['OS == "win"', {
"include_dirs": [
- "third_party/boringssl/include",
"third_party/zlib"
],
"defines": [
@@ -60,8 +110,6 @@
'UNICODE',
'_UNICODE',
'NOMINMAX',
- 'OPENSSL_NO_ASM',
- 'GPR_BACKWARDS_COMPATIBILITY_MODE'
],
"msvs_settings": {
'VCCLCompilerTool': {
@@ -74,21 +122,8 @@
}, { # OS != "win"
'variables': {
'config': '<!(echo $CONFIG)',
- # The output of "node --version" is "v[version]". We use cut to
- # remove the first character.
- 'target%': '<!(node --version | cut -c2-)'
},
- # Empirically, Node only exports ALPN symbols if its major version is >0.
- # io.js always reports versions >0 and always exports ALPN symbols.
- # Therefore, Node's major version will be truthy if and only if it
- # supports ALPN. The target is "[major].[minor].[patch]". We split by
- # periods and take the first field to get the major version.
- 'defines': [
- 'TSI_OPENSSL_ALPN_SUPPORT=<!(echo <(target) | cut -d. -f1)',
- 'GPR_BACKWARDS_COMPATIBILITY_MODE'
- ],
'include_dirs': [
- '<(node_root_dir)/deps/openssl/openssl/include',
'<(node_root_dir)/deps/zlib'
],
'conditions': [
@@ -103,21 +138,42 @@
'-fprofile-arcs'
]
}
- ],
- ["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" ]
- }]
+ ]
]
}]
]
},
'conditions': [
+ ['OS=="win" or runtime=="electron"', {
+ 'targets': [
+ % for module in node_modules:
+ % for lib in libs:
+ % if lib.name in module.transitive_deps and lib.name == 'boringssl':
+ {
+ 'cflags': [
+ '-std=c99',
+ '-Wall',
+ '-Werror'
+ ],
+ 'target_name': '${lib.name}',
+ 'product_prefix': 'lib',
+ 'type': 'static_library',
+ 'dependencies': [
+ % for dep in getattr(lib, 'deps', []):
+ '${dep}',
+ % endfor
+ ],
+ 'sources': [
+ % for source in lib.src:
+ '${source}',
+ % endfor
+ ]
+ },
+ % endif
+ % endfor
+ % endfor
+ ]
+ }],
['OS == "win"', {
'targets': [
{
@@ -143,10 +199,10 @@
}
]
},
- # Only want to compile BoringSSL and zlib under Windows
+ # Only want to compile zlib under Windows
% for module in node_modules:
% for lib in libs:
- % if lib.name in module.transitive_deps and lib.name in ('boringssl', 'z'):
+ % if lib.name in module.transitive_deps and lib.name == 'z':
{
'cflags': [
'-std=c99',
@@ -223,6 +279,15 @@
'-g'
],
"conditions": [
+ ['OS=="win" or runtime=="electron"', {
+ 'dependencies': [
+ % for dep in getattr(module, 'deps', []):
+ % if dep == 'boringssl':
+ "${dep}",
+ % endif
+ % endfor
+ ]
+ }],
['OS=="mac"', {
'xcode_settings': {
'MACOSX_DEPLOYMENT_TARGET': '10.9',
@@ -235,7 +300,7 @@
['OS=="win"', {
'dependencies': [
% for dep in getattr(module, 'deps', []):
- % if dep in ('boringssl', 'z'):
+ % if dep == 'z':
"${dep}",
% endif
% endfor
diff --git a/templates/config.m4.template b/templates/config.m4.template
index 5847d456f5..f5f1d23088 100644
--- a/templates/config.m4.template
+++ b/templates/config.m4.template
@@ -7,9 +7,9 @@
dnl Write more examples of tests here...
dnl # --with-grpc -> add include path
- PHP_ADD_INCLUDE(../../grpc/include)
- PHP_ADD_INCLUDE(../../grpc/src/php/ext/grpc)
- PHP_ADD_INCLUDE(../../grpc/third_party/boringssl/include)
+ PHP_ADD_INCLUDE(PHP_EXT_SRCDIR()/include)
+ PHP_ADD_INCLUDE(PHP_EXT_SRCDIR()/src/php/ext/grpc)
+ PHP_ADD_INCLUDE(PHP_EXT_SRCDIR()/third_party/boringssl/include)
LIBS="-lpthread $LIBS"
diff --git a/templates/gRPC-Core.podspec.template b/templates/gRPC-Core.podspec.template
index fbad1a3f70..1b97d18f16 100644
--- a/templates/gRPC-Core.podspec.template
+++ b/templates/gRPC-Core.podspec.template
@@ -62,7 +62,7 @@
%>
Pod::Spec.new do |s|
s.name = 'gRPC-Core'
- version = '1.0.1'
+ version = '1.0.2'
s.version = version
s.summary = 'Core cross-platform gRPC library, written in C'
s.homepage = 'http://www.grpc.io'
@@ -71,7 +71,9 @@
s.source = {
:git => 'https://github.com/grpc/grpc.git',
- :tag => "v#{version}",
+ # TODO(mxyan): Change back to "v#{version}" for next release
+ #:tag => "v#{version}",
+ :tag => "objective-c-v#{version}",
# TODO(jcanizales): Depend explicitly on the nanopb pod, and disable submodules.
:submodules => true,
}
diff --git a/templates/grpc.gemspec.template b/templates/grpc.gemspec.template
index 62d61b75c1..82fbb69008 100644
--- a/templates/grpc.gemspec.template
+++ b/templates/grpc.gemspec.template
@@ -29,7 +29,7 @@
s.require_paths = %w( src/ruby/bin src/ruby/lib src/ruby/pb )
s.platform = Gem::Platform::RUBY
- s.add_dependency 'google-protobuf', '~> 3.0.2'
+ s.add_dependency 'google-protobuf', '~> 3.1.0'
s.add_dependency 'googleauth', '~> 0.5.1'
s.add_development_dependency 'bundler', '~> 1.9'
diff --git a/templates/package.json.template b/templates/package.json.template
index 81f39d27f5..316c28e478 100644
--- a/templates/package.json.template
+++ b/templates/package.json.template
@@ -23,6 +23,7 @@
"scripts": {
"lint": "node ./node_modules/jshint/bin/jshint src/node/src src/node/test src/node/interop src/node/index.js --exclude-path=src/node/.jshintignore",
"test": "./node_modules/.bin/mocha src/node/test && npm run-script lint",
+ "electron-build": "./node_modules/.bin/node-pre-gyp configure build --runtime=electron --disturl=https://atom.io/download/atom-shell",
"gen_docs": "./node_modules/.bin/jsdoc -c src/node/jsdoc_conf.json",
"coverage": "./node_modules/.bin/istanbul cover ./node_modules/.bin/_mocha src/node/test",
"install": "./node_modules/.bin/node-pre-gyp install --fallback-to-build"
@@ -40,6 +41,7 @@
"devDependencies": {
"async": "^2.0.1",
"body-parser": "^1.15.2",
+ "electron-mocha": "^3.1.1",
"express": "^4.14.0",
"google-auth-library": "^0.9.2",
"google-protobuf": "^3.0.0",
@@ -52,7 +54,7 @@
"poisson-process": "^0.2.1"
},
"engines": {
- "node": ">=0.12.0"
+ "node": ">=1.1.0"
},
"binary": {
"module_name": "grpc_node",
diff --git a/templates/tools/dockerfile/clang_format.include b/templates/tools/dockerfile/clang_format.include
new file mode 100644
index 0000000000..9a2b60ba8c
--- /dev/null
+++ b/templates/tools/dockerfile/clang_format.include
@@ -0,0 +1,5 @@
+RUN apt-get update && apt-get -y install wget
+RUN echo deb http://llvm.org/apt/wily/ llvm-toolchain-wily-3.8 main >> /etc/apt/sources.list
+RUN echo deb-src http://llvm.org/apt/wily/ llvm-toolchain-wily-3.8 main >> /etc/apt/sources.list
+RUN wget -O - http://llvm.org/apt/llvm-snapshot.gpg.key| apt-key add -
+RUN apt-get update && apt-get -y install clang-format-3.8
diff --git a/templates/tools/dockerfile/grpc_clang_format/Dockerfile.template b/templates/tools/dockerfile/grpc_clang_format/Dockerfile.template
new file mode 100644
index 0000000000..8360fc121c
--- /dev/null
+++ b/templates/tools/dockerfile/grpc_clang_format/Dockerfile.template
@@ -0,0 +1,37 @@
+%YAML 1.2
+--- |
+ # Copyright 2015, Google Inc.
+ # All rights reserved.
+ #
+ # Redistribution and use in source and binary forms, with or without
+ # modification, are permitted provided that the following conditions are
+ # met:
+ #
+ # * Redistributions of source code must retain the above copyright
+ # notice, this list of conditions and the following disclaimer.
+ # * Redistributions in binary form must reproduce the above
+ # copyright notice, this list of conditions and the following disclaimer
+ # in the documentation and/or other materials provided with the
+ # distribution.
+ # * Neither the name of Google Inc. nor the names of its
+ # contributors may be used to endorse or promote products derived from
+ # this software without specific prior written permission.
+ #
+ # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ FROM ubuntu:15.10
+
+ <%include file="../clang_format.include"/>
+ ADD clang_format_all_the_things.sh /
+ CMD ["echo 'Run with tools/distrib/clang_format_code.sh'"]
+
diff --git a/templates/tools/dockerfile/test/bazel/Dockerfile.template b/templates/tools/dockerfile/test/bazel/Dockerfile.template
new file mode 100644
index 0000000000..82f90bef68
--- /dev/null
+++ b/templates/tools/dockerfile/test/bazel/Dockerfile.template
@@ -0,0 +1,48 @@
+%YAML 1.2
+--- |
+ # Copyright 2015, Google Inc.
+ # All rights reserved.
+ #
+ # Redistribution and use in source and binary forms, with or without
+ # modification, are permitted provided that the following conditions are
+ # met:
+ #
+ # * Redistributions of source code must retain the above copyright
+ # notice, this list of conditions and the following disclaimer.
+ # * Redistributions in binary form must reproduce the above
+ # copyright notice, this list of conditions and the following disclaimer
+ # in the documentation and/or other materials provided with the
+ # distribution.
+ # * Neither the name of Google Inc. nor the names of its
+ # contributors may be used to endorse or promote products derived from
+ # this software without specific prior written permission.
+ #
+ # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ FROM ubuntu:15.10
+
+ <%include file="../../apt_get_basic.include"/>
+
+ #========================
+ # Bazel installation
+ RUN apt-get install -y software-properties-common g++
+ RUN echo "deb [arch=amd64] http://storage.googleapis.com/bazel-apt stable jdk1.8" > /etc/apt/sources.list.d/bazel.list
+ RUN curl https://bazel.build/bazel-release.pub.gpg | apt-key add -
+ RUN apt-get -y update
+ RUN apt-get -y install bazel
+
+ RUN mkdir -p /var/local/jenkins
+
+ # Define the default command.
+ CMD ["bash"]
+
diff --git a/templates/tools/dockerfile/test/node_jessie_x64/Dockerfile.template b/templates/tools/dockerfile/test/node_jessie_x64/Dockerfile.template
index 72b098f0c2..ceaa9aa5ab 100644
--- a/templates/tools/dockerfile/test/node_jessie_x64/Dockerfile.template
+++ b/templates/tools/dockerfile/test/node_jessie_x64/Dockerfile.template
@@ -28,10 +28,21 @@
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
+
FROM debian:jessie
-
+
<%include file="../../apt_get_basic.include"/>
+
+ # Install Electron apt dependencies
+ RUN apt-get update && apt-get install -y ${'\\'}
+ libasound2 ${'\\'}
+ libgconf-2-4 ${'\\'}
+ libgtk2.0-0 ${'\\'}
+ libnss3 ${'\\'}
+ libxss1 ${'\\'}
+ libxtst6 ${'\\'}
+ xvfb
+
<%include file="../../python_deps.include"/>
<%include file="../../node_deps.include"/>
<%include file="../../run_tests_addons.include"/>
diff --git a/templates/tools/dockerfile/test/sanity/Dockerfile.template b/templates/tools/dockerfile/test/sanity/Dockerfile.template
index 12309b64d1..8617666b21 100644
--- a/templates/tools/dockerfile/test/sanity/Dockerfile.template
+++ b/templates/tools/dockerfile/test/sanity/Dockerfile.template
@@ -48,19 +48,16 @@
#======================================
# More sanity test dependencies (bazel)
RUN apt-get install -y openjdk-8-jdk
- # TOOD(jtattermusch): pin the bazel version
- RUN git clone https://github.com/bazelbuild/bazel.git /bazel
- RUN cd /bazel && ./compile.sh
+ # Check out Bazel version 0.4.1 since this version allows running
+ # ./compile.sh without a local protoc dependency
+ # TODO(mattkwong): install dependencies to support latest Bazel version if newer
+ # version is needed
+ RUN git clone https://github.com/bazelbuild/bazel.git /bazel && ${"\\"}
+ cd /bazel && git checkout tags/0.4.1 && ./compile.sh
RUN ln -s /bazel/output/bazel /bin/
- #===================
- # Docker "inception"
- # Note this is quite the ugly hack.
- # This makes sure that the docker binary we inject has its dependencies.
- RUN curl https://get.docker.com/ | sh
- RUN apt-get remove --purge -y docker-engine
-
- RUN mkdir /var/local/jenkins
+ <%include file="../../clang_format.include"/>
+ <%include file="../../run_tests_addons.include"/>
# Define the default command.
CMD ["bash"]
diff --git a/templates/tools/doxygen/Doxyfile.include b/templates/tools/doxygen/Doxyfile.include
index 8b0c528c1f..e26ae2b948 100644
--- a/templates/tools/doxygen/Doxyfile.include
+++ b/templates/tools/doxygen/Doxyfile.include
@@ -8,7 +8,10 @@
<%def name="gen_doxyfile(libnames, packagename, collection, internal)">
<%
import itertools
+ import glob
+ import os
targets = []
+ docpackage = packagename.replace('+', 'p').lower()
for libname in libnames:
target = None
for p in collection:
@@ -16,6 +19,11 @@
target = p
assert(target)
targets.append(target)
+ srcdoc = []
+ for dirpath, dirnames, filenames in os.walk('src/%s' % docpackage):
+ for filename in filenames:
+ if os.path.splitext(filename)[1] == '.md':
+ srcdoc.append(os.path.join(dirpath, filename))
%>
# Doxyfile 1.8.9.1
@@ -778,13 +786,20 @@ WARN_LOGFILE =
# spaces.
# Note: If this tag is empty the current directory is searched.
-INPUT = ${' \\\n'.join(
- itertools.chain.from_iterable(
- target.public_headers +
- ([]
- if not internal
- else target.headers + target.src)
- for target in targets))}
+INPUT = ${
+ ' \\\n'.join(sorted(
+ itertools.chain(
+ itertools.chain.from_iterable(
+ target.public_headers +
+ ([]
+ if not internal
+ else target.headers + target.src)
+ for target in targets),
+ glob.glob('doc/*.md'),
+ glob.glob('doc/%s/*.md' % docpackage),
+ [] if not internal else srcdoc)
+ ))
+}
# This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
diff --git a/templates/tools/run_tests/configs.json.template b/templates/tools/run_tests/generated/configs.json.template
index 5c82dfb347..5c82dfb347 100644
--- a/templates/tools/run_tests/configs.json.template
+++ b/templates/tools/run_tests/generated/configs.json.template
diff --git a/templates/tools/run_tests/sources_and_headers.json.template b/templates/tools/run_tests/generated/sources_and_headers.json.template
index 1c5c9747d6..1c5c9747d6 100644
--- a/templates/tools/run_tests/sources_and_headers.json.template
+++ b/templates/tools/run_tests/generated/sources_and_headers.json.template
diff --git a/templates/tools/run_tests/tests.json.template b/templates/tools/run_tests/generated/tests.json.template
index 1e21465dd2..1e21465dd2 100644
--- a/templates/tools/run_tests/tests.json.template
+++ b/templates/tools/run_tests/generated/tests.json.template
diff --git a/templates/vsprojects/grpc.sln.template b/templates/vsprojects/grpc.sln.template
index ded98383da..0b28e936be 100644
--- a/templates/vsprojects/grpc.sln.template
+++ b/templates/vsprojects/grpc.sln.template
@@ -2,6 +2,6 @@
--- |
<%namespace file="sln_defs.include" import="gen_solution"/>\
<%
- solution_projects = [p for p in vsprojects if p.build not in ['protoc', 'test', 'fuzzer'] and p.language in ['c', 'c++'] and p.vs_proj_dir == '.' and not (p.build == 'private' and p.language == 'c++')]
+ solution_projects = [p for p in vsprojects if p.build not in ['protoc', 'test', 'fuzzer'] and p.language in ['c', 'c++'] and p.vs_proj_dir == '.' and not (p.build == 'private' and p.language == 'c++') and not p.name in ['z', 'boringssl', 'grpc++_reflection']]
%>\
${gen_solution(solution_projects, use_dlls='yes')}
diff --git a/templates/vsprojects/protobuf.props.template b/templates/vsprojects/protobuf.props.template
index 48f9431c1c..3ae7c745de 100644
--- a/templates/vsprojects/protobuf.props.template
+++ b/templates/vsprojects/protobuf.props.template
@@ -6,7 +6,7 @@
<ItemDefinitionGroup>
<Link>
<AdditionalDependencies>libprotobuf.lib;%(AdditionalDependencies)</AdditionalDependencies>
- <AdditionalLibraryDirectories>$(SolutionDir)\..\third_party\protobuf\cmake\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+ <AdditionalLibraryDirectories>$(SolutionDir)\..\third_party\protobuf\cmake\build\solution\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
</Link>
</ItemDefinitionGroup>
<ItemGroup />
diff --git a/templates/vsprojects/protoc.props.template b/templates/vsprojects/protoc.props.template
index ced6028a4b..2c3844a9a4 100644
--- a/templates/vsprojects/protoc.props.template
+++ b/templates/vsprojects/protoc.props.template
@@ -9,7 +9,7 @@
</ClCompile>
<Link>
<AdditionalDependencies>libprotoc.lib;%(AdditionalDependencies)</AdditionalDependencies>
- <AdditionalLibraryDirectories>$(SolutionDir)\..\third_party\protobuf\cmake\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
+ <AdditionalLibraryDirectories>$(SolutionDir)\..\third_party\protobuf\cmake\build\solution\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
</Link>
</ItemDefinitionGroup>
<ItemGroup />