Merge branch 'cleaner-build' into third-coming

pull/3097/head
Craig Tiller 9 years ago
commit e0b8a42552
  1. 1
      BUILD
  2. 8710
      Makefile
  3. 2689
      build.json
  4. 1000
      build.yaml
  5. 228
      templates/BUILD.template
  6. 2660
      templates/Makefile.template
  7. 88
      templates/gRPC.podspec.template
  8. 12
      templates/src/core/surface/version.c.template
  9. 6
      templates/tools/doxygen/Doxyfile.c++.internal.template
  10. 6
      templates/tools/doxygen/Doxyfile.c++.template
  11. 6
      templates/tools/doxygen/Doxyfile.core.internal.template
  12. 6
      templates/tools/doxygen/Doxyfile.core.template
  13. 16
      templates/tools/run_tests/sources_and_headers.json.template
  14. 10
      templates/tools/run_tests/tests.json.template
  15. 306
      templates/vsprojects/Grpc.mak.template
  16. 18
      templates/vsprojects/cpptest.props.template
  17. 16
      templates/vsprojects/global.props.template
  18. 2
      templates/vsprojects/gpr/gpr.vcxproj.filters.template
  19. 2
      templates/vsprojects/gpr/gpr.vcxproj.template
  20. 2
      templates/vsprojects/gpr_test_util/gpr_test_util.vcxproj.template
  21. 2
      templates/vsprojects/grpc++/grpc++.vcxproj.filters.template
  22. 2
      templates/vsprojects/grpc++/grpc++.vcxproj.template
  23. 6
      templates/vsprojects/grpc++_unsecure/grpc++_unsecure.vcxproj.filters.template
  24. 6
      templates/vsprojects/grpc++_unsecure/grpc++_unsecure.vcxproj.template
  25. 7
      templates/vsprojects/grpc+tests.sln.template
  26. 12
      templates/vsprojects/grpc.sln.template
  27. 2
      templates/vsprojects/grpc/grpc.vcxproj.filters.template
  28. 2
      templates/vsprojects/grpc/grpc.vcxproj.template
  29. 2
      templates/vsprojects/grpc/packages.config.template
  30. 6
      templates/vsprojects/grpc_cpp_plugin/grpc_cpp_plugin.vcxproj.template
  31. 12
      templates/vsprojects/grpc_csharp_ext.sln.template
  32. 2
      templates/vsprojects/grpc_csharp_ext/grpc_csharp_ext.vcxproj.template
  33. 2
      templates/vsprojects/grpc_csharp_ext/packages.config.template
  34. 6
      templates/vsprojects/grpc_csharp_plugin/grpc_csharp_plugin.vcxproj.template
  35. 6
      templates/vsprojects/grpc_objective_c_plugin/grpc_objective_c_plugin.vcxproj.template
  36. 2
      templates/vsprojects/grpc_plugin_support/grpc_plugin_support.vcxproj.template
  37. 12
      templates/vsprojects/grpc_protoc_plugins.sln.template
  38. 6
      templates/vsprojects/grpc_python_plugin/grpc_python_plugin.vcxproj.template
  39. 6
      templates/vsprojects/grpc_ruby_plugin/grpc_ruby_plugin.vcxproj.template
  40. 2
      templates/vsprojects/grpc_test_util/grpc_test_util.vcxproj.template
  41. 2
      templates/vsprojects/grpc_test_util_unsecure/grpc_test_util_unsecure.vcxproj.template
  42. 2
      templates/vsprojects/grpc_unsecure/grpc_unsecure.vcxproj.filters.template
  43. 2
      templates/vsprojects/grpc_unsecure/grpc_unsecure.vcxproj.template
  44. 2
      templates/vsprojects/grpc_unsecure/packages.config.template
  45. 13
      templates/vsprojects/openssl.props.template
  46. 75
      templates/vsprojects/packages.include
  47. 13
      templates/vsprojects/protobuf.props.template
  48. 13
      templates/vsprojects/protoc.props.template
  49. 8
      templates/vsprojects/sln_defs.include
  50. 8
      templates/vsprojects/vcxproj.filters_defs.include
  51. 18
      templates/vsprojects/vcxproj.template
  52. 74
      templates/vsprojects/vcxproj_defs.include
  53. 14
      templates/vsprojects/winsock.props.template
  54. 15
      templates/vsprojects/zlib-dll.props.template
  55. 15
      templates/vsprojects/zlib.props.template
  56. 7
      test/core/bad_client/gen_build_yaml.py
  57. 0
      test/core/end2end/fixtures/h2_compress.c
  58. 0
      test/core/end2end/fixtures/h2_fakesec.c
  59. 0
      test/core/end2end/fixtures/h2_full+poll.c
  60. 0
      test/core/end2end/fixtures/h2_full.c
  61. 0
      test/core/end2end/fixtures/h2_oauth2.c
  62. 0
      test/core/end2end/fixtures/h2_proxy.c
  63. 0
      test/core/end2end/fixtures/h2_sockpair+trace.c
  64. 0
      test/core/end2end/fixtures/h2_sockpair.c
  65. 0
      test/core/end2end/fixtures/h2_sockpair_1byte.c
  66. 0
      test/core/end2end/fixtures/h2_ssl+poll.c
  67. 0
      test/core/end2end/fixtures/h2_ssl.c
  68. 0
      test/core/end2end/fixtures/h2_ssl_proxy.c
  69. 0
      test/core/end2end/fixtures/h2_uds+poll.c
  70. 0
      test/core/end2end/fixtures/h2_uds.c
  71. 71
      test/core/end2end/gen_build_yaml.py
  72. 0
      test/core/end2end/tests/binary_metadata.c
  73. 0
      test/core/end2end/tests/call_creds.c
  74. 0
      test/core/end2end/tests/cancel_after_client_done.c
  75. 0
      test/core/end2end/tests/compressed_payload.c
  76. 0
      test/core/end2end/tests/high_initial_seqno.c
  77. 0
      test/core/end2end/tests/large_metadata.c
  78. 0
      test/core/end2end/tests/metadata.c
  79. 0
      test/core/end2end/tests/payload.c
  80. 0
      test/core/end2end/tests/shutdown_finishes_calls.c
  81. 0
      test/core/end2end/tests/shutdown_finishes_tags.c
  82. 0
      test/core/end2end/tests/trailing_metadata.c
  83. 4
      test/core/util/reconnect_server.c
  84. 2
      test/cpp/qps/client_sync.cc
  85. 1
      test/cpp/qps/driver.cc
  86. 3
      test/cpp/qps/server_async.cc
  87. 2
      test/cpp/qps/server_sync.cc
  88. 15
      tools/buildgen/build-cleaner.py
  89. 6
      tools/buildgen/generate_build_additions.sh
  90. 6
      tools/buildgen/generate_projects-old.sh
  91. 4
      tools/buildgen/generate_projects.sh
  92. 53
      tools/buildgen/mako_renderer.py
  93. 2
      tools/buildgen/plugins/expand_bin_attrs.py
  94. 4
      tools/buildgen/plugins/expand_filegroups.py
  95. 21
      tools/buildgen/plugins/generate_vsprojects.py
  96. 2
      tools/buildgen/plugins/list_protos.py
  97. 4390
      tools/run_tests/sources_and_headers.json
  98. 4902
      tools/run_tests/tests.json
  99. 6098
      vsprojects/Grpc.mak
  100. 19
      vsprojects/cpptest.props
  101. Some files were not shown because too many files have changed in this diff Show More

@ -769,6 +769,7 @@ cc_library(
".", ".",
], ],
deps = [ deps = [
"//external:libssl",
"//external:protobuf_clib", "//external:protobuf_clib",
":gpr", ":gpr",
":grpc", ":grpc",

8710
Makefile

File diff suppressed because one or more lines are too long

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

@ -1,47 +1,49 @@
# GRPC Bazel BUILD file. %YAML 1.2
# This currently builds C, C++ and Objective-C code. --- |
# This file has been automatically generated from a template file. # GRPC Bazel BUILD file.
# Please look at the templates directory instead. # This currently builds C, C++ and Objective-C code.
# This file can be regenerated from the template by running # This file has been automatically generated from a template file.
# tools/buildgen/generate_projects.sh # Please look at the templates directory instead.
# This file can be regenerated from the template by running
# Copyright 2015, Google Inc. # tools/buildgen/generate_projects.sh
# All rights reserved.
# # Copyright 2015, Google Inc.
# Redistribution and use in source and binary forms, with or without # All rights reserved.
# modification, are permitted provided that the following conditions are #
# met: # Redistribution and use in source and binary forms, with or without
# # modification, are permitted provided that the following conditions are
# * Redistributions of source code must retain the above copyright # met:
# notice, this list of conditions and the following disclaimer. #
# * Redistributions in binary form must reproduce the above # * Redistributions of source code must retain the above copyright
# copyright notice, this list of conditions and the following disclaimer # notice, this list of conditions and the following disclaimer.
# in the documentation and/or other materials provided with the # * Redistributions in binary form must reproduce the above
# distribution. # copyright notice, this list of conditions and the following disclaimer
# * Neither the name of Google Inc. nor the names of its # in the documentation and/or other materials provided with the
# contributors may be used to endorse or promote products derived from # distribution.
# this software without specific prior written permission. # * Neither the name of Google Inc. nor the names of its
# # contributors may be used to endorse or promote products derived from
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS # this software without specific prior written permission.
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT #
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
licenses(["notice"]) # 3-clause BSD # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
package(default_visibility = ["//visibility:public"]) licenses(["notice"]) # 3-clause BSD
<%! package(default_visibility = ["//visibility:public"])
def get_deps(target_dict):
<%!
def get_deps(target_dict):
deps = [] deps = []
if target_dict.get('secure', 'no') == 'yes': if target_dict.get('secure', False):
deps = [ deps = [
"//external:libssl", "//external:libssl",
] ]
@ -57,109 +59,109 @@ def get_deps(target_dict):
else: else:
deps.append(':%s' % (d)) deps.append(':%s' % (d))
return deps return deps
%> %>
% for lib in libs: % for lib in libs:
% if lib.build in ("all", "protoc"): % if lib.build in ("all", "protoc"):
${cc_library(lib)} ${cc_library(lib)}
% endif % endif
% endfor % endfor
% for lib in libs: % for lib in libs:
% if lib.name in ("grpc", "gpr"): % if lib.name in ("grpc", "gpr"):
${objc_library(lib)} ${objc_library(lib)}
% endif % endif
% endfor % endfor
% for tgt in targets: % for tgt in targets:
% if tgt.build == 'protoc': % if tgt.build == 'protoc':
${cc_binary(tgt)} ${cc_binary(tgt)}
% endif % endif
% endfor % endfor
<%def name="cc_library(lib)"> <%def name="cc_library(lib)">
cc_library( cc_library(
name = "${lib.name}", name = "${lib.name}",
srcs = [ srcs = [
% for hdr in lib.get("headers", []): % for hdr in lib.get("headers", []):
"${hdr}", "${hdr}",
% endfor % endfor
% for src in lib.src: % for src in lib.src:
"${src}", "${src}",
% endfor % endfor
], ],
hdrs = [ hdrs = [
% for hdr in lib.get("public_headers", []): % for hdr in lib.get("public_headers", []):
"${hdr}", "${hdr}",
% endfor % endfor
], ],
includes = [ includes = [
"include", "include",
".", ".",
], ],
deps = [ deps = [
% for dep in get_deps(lib): % for dep in get_deps(lib):
"${dep}", "${dep}",
% endfor % endfor
], ],
) )
</%def> </%def>
<%def name="objc_library(lib)"> <%def name="objc_library(lib)">
objc_library( objc_library(
name = "${lib.name}_objc", name = "${lib.name}_objc",
srcs = [ srcs = [
% for src in lib.src: % for src in lib.src:
"${src}", "${src}",
% endfor % endfor
], ],
hdrs = [ hdrs = [
% for hdr in lib.get("public_headers", []): % for hdr in lib.get("public_headers", []):
"${hdr}", "${hdr}",
% endfor % endfor
% for hdr in lib.get("headers", []): % for hdr in lib.get("headers", []):
"${hdr}", "${hdr}",
% endfor % endfor
], ],
includes = [ includes = [
"include", "include",
".", ".",
], ],
deps = [ deps = [
% for dep in lib.get("deps", []): % for dep in lib.get("deps", []):
":${dep}_objc", ":${dep}_objc",
% endfor % endfor
% if lib.get('secure', 'no') == 'yes': % if lib.get('secure', False):
"//external:libssl_objc", "//external:libssl_objc",
% endif % endif
], ],
% if lib.get("baselib", false): % if lib.get("baselib", false):
sdk_dylibs = ["libz"], sdk_dylibs = ["libz"],
% endif % endif
) )
</%def> </%def>
<%def name="cc_binary(tgt)"> <%def name="cc_binary(tgt)">
cc_binary( cc_binary(
name = "${tgt.name}", name = "${tgt.name}",
srcs = [ srcs = [
% for src in tgt.src: % for src in tgt.src:
"${src}", "${src}",
% endfor % endfor
], ],
deps = [ deps = [
% for dep in get_deps(tgt): % for dep in get_deps(tgt):
"${dep}", "${dep}",
% endfor % endfor
], ],
) )
</%def> </%def>
objc_path = "src/objective-c" objc_path = "src/objective-c"
rx_library_path = objc_path + "/RxLibrary" rx_library_path = objc_path + "/RxLibrary"
objc_library( objc_library(
name = "rx_library", name = "rx_library",
hdrs = glob([ hdrs = glob([
rx_library_path + "/*.h", rx_library_path + "/*.h",
@ -173,18 +175,18 @@ objc_library(
deps = [ deps = [
":rx_library_private", ":rx_library_private",
], ],
) )
objc_library( objc_library(
name = "rx_library_private", name = "rx_library_private",
hdrs = glob([rx_library_path + "/private/*.h"]), hdrs = glob([rx_library_path + "/private/*.h"]),
srcs = glob([rx_library_path + "/private/*.m"]), srcs = glob([rx_library_path + "/private/*.m"]),
visibility = ["//visibility:private"], visibility = ["//visibility:private"],
) )
objc_client_path = objc_path + "/GRPCClient" objc_client_path = objc_path + "/GRPCClient"
objc_library( objc_library(
name = "grpc_client", name = "grpc_client",
hdrs = glob([ hdrs = glob([
objc_client_path + "/*.h", objc_client_path + "/*.h",
@ -200,17 +202,17 @@ objc_library(
":grpc_objc", ":grpc_objc",
":rx_library", ":rx_library",
], ],
) )
objc_bundle_library( objc_bundle_library(
# The choice of name is signicant here, since it determines the bundle name. # The choice of name is signicant here, since it determines the bundle name.
name = "gRPCCertificates", name = "gRPCCertificates",
resources = ["etc/roots.pem"], resources = ["etc/roots.pem"],
) )
proto_objc_rpc_path = objc_path + "/ProtoRPC" proto_objc_rpc_path = objc_path + "/ProtoRPC"
objc_library( objc_library(
name = "proto_objc_rpc", name = "proto_objc_rpc",
hdrs = glob([ hdrs = glob([
proto_objc_rpc_path + "/*.h", proto_objc_rpc_path + "/*.h",
@ -224,4 +226,4 @@ objc_library(
":rx_library", ":rx_library",
"//external:protobuf_objc", "//external:protobuf_objc",
], ],
) )

File diff suppressed because it is too large Load Diff

@ -1,41 +1,43 @@
# GRPC CocoaPods podspec %YAML 1.2
# This file has been automatically generated from a template file. --- |
# Please look at the templates directory instead. # GRPC CocoaPods podspec
# This file can be regenerated from the template by running # This file has been automatically generated from a template file.
# tools/buildgen/generate_projects.sh # Please look at the templates directory instead.
# This file can be regenerated from the template by running
# Copyright 2015, Google Inc. # tools/buildgen/generate_projects.sh
# All rights reserved.
# # Copyright 2015, Google Inc.
# Redistribution and use in source and binary forms, with or without # All rights reserved.
# modification, are permitted provided that the following conditions are #
# met: # Redistribution and use in source and binary forms, with or without
# # modification, are permitted provided that the following conditions are
# * Redistributions of source code must retain the above copyright # met:
# notice, this list of conditions and the following disclaimer. #
# * Redistributions in binary form must reproduce the above # * Redistributions of source code must retain the above copyright
# copyright notice, this list of conditions and the following disclaimer # notice, this list of conditions and the following disclaimer.
# in the documentation and/or other materials provided with the # * Redistributions in binary form must reproduce the above
# distribution. # copyright notice, this list of conditions and the following disclaimer
# * Neither the name of Google Inc. nor the names of its # in the documentation and/or other materials provided with the
# contributors may be used to endorse or promote products derived from # distribution.
# this software without specific prior written permission. # * Neither the name of Google Inc. nor the names of its
# # contributors may be used to endorse or promote products derived from
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS # this software without specific prior written permission.
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT #
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # 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.
bad_header_names = ('time.h', 'string.h')
def fix_header_name(name): <%!
bad_header_names = ('time.h', 'string.h')
def fix_header_name(name):
split_name = name.split('/') split_name = name.split('/')
if split_name[-1] in bad_header_names: if split_name[-1] in bad_header_names:
split_name[-1] = 'grpc_' + split_name[-1] split_name[-1] = 'grpc_' + split_name[-1]
@ -43,7 +45,7 @@ def fix_header_name(name):
split_name = split_name[1:] split_name = split_name[1:]
return '/'.join(split_name) return '/'.join(split_name)
def grpc_files(libs): def grpc_files(libs):
out = [] out = []
for lib in libs: for lib in libs:
if lib.name in ("grpc", "gpr"): if lib.name in ("grpc", "gpr"):
@ -52,14 +54,14 @@ def grpc_files(libs):
out.extend(lib.get('src', [])) out.extend(lib.get('src', []))
return out; return out;
def grpc_private_headers(libs): def grpc_private_headers(libs):
out = [] out = []
for lib in libs: for lib in libs:
if lib.name in ("grpc", "gpr"): if lib.name in ("grpc", "gpr"):
out.extend(lib.get('headers', [])) out.extend(lib.get('headers', []))
return out return out
%> %>
Pod::Spec.new do |s| Pod::Spec.new do |s|
s.name = 'gRPC' s.name = 'gRPC'
s.version = '0.7.0' s.version = '0.7.0'
s.summary = 'gRPC client library for iOS/OSX' s.summary = 'gRPC client library for iOS/OSX'
@ -152,4 +154,4 @@ Pod::Spec.new do |s|
ss.dependency 'gRPC/RxLibrary' ss.dependency 'gRPC/RxLibrary'
ss.dependency 'Protobuf', '~> 3.0.0-alpha-3' ss.dependency 'Protobuf', '~> 3.0.0-alpha-3'
end end
end end

@ -1,4 +1,6 @@
/* %YAML 1.2
--- |
/*
* *
* Copyright 2015, Google Inc. * Copyright 2015, Google Inc.
* All rights reserved. * All rights reserved.
@ -31,11 +33,11 @@
* *
*/ */
/* This file is autogenerated from: /* This file is autogenerated from:
templates/src/core/surface/version.c.template */ templates/src/core/surface/version.c.template */
#include <grpc/grpc.h> #include <grpc/grpc.h>
const char *grpc_version_string(void) { const char *grpc_version_string(void) {
return "${settings.version.major}.${settings.version.minor}.${settings.version.micro}.${settings.version.build}"; return "${settings.version.major}.${settings.version.minor}.${settings.version.micro}.${settings.version.build}";
} }

@ -1,2 +1,4 @@
<%namespace file="Doxyfile.include" import="gen_doxyfile"/>\ %YAML 1.2
${gen_doxyfile(['grpc++'], 'C++', libs, True)} --- |
<%namespace file="Doxyfile.include" import="gen_doxyfile"/>\
${gen_doxyfile(['grpc++'], 'C++', libs, True)}

@ -1,2 +1,4 @@
<%namespace file="Doxyfile.include" import="gen_doxyfile"/>\ %YAML 1.2
${gen_doxyfile(['grpc++'], 'C++', libs, False)} --- |
<%namespace file="Doxyfile.include" import="gen_doxyfile"/>\
${gen_doxyfile(['grpc++'], 'C++', libs, False)}

@ -1,2 +1,4 @@
<%namespace file="Doxyfile.include" import="gen_doxyfile"/>\ %YAML 1.2
${gen_doxyfile(['grpc', 'gpr'], 'Core', libs, True)} --- |
<%namespace file="Doxyfile.include" import="gen_doxyfile"/>\
${gen_doxyfile(['grpc', 'gpr'], 'Core', libs, True)}

@ -1,2 +1,4 @@
<%namespace file="Doxyfile.include" import="gen_doxyfile"/>\ %YAML 1.2
${gen_doxyfile(['grpc', 'gpr'], 'Core', libs, False)} --- |
<%namespace file="Doxyfile.include" import="gen_doxyfile"/>\
${gen_doxyfile(['grpc', 'gpr'], 'Core', libs, False)}

@ -1,8 +1,10 @@
<%! %YAML 1.2
import json --- |
import os <%!
import json
import os
def proto_headers(src): def proto_headers(src):
out = [] out = []
for f in src: for f in src:
name, ext = os.path.splitext(f) name, ext = os.path.splitext(f)
@ -10,15 +12,15 @@ def proto_headers(src):
out.extend(fmt % name for fmt in ['%s.grpc.pb.h', '%s.pb.h']) out.extend(fmt % name for fmt in ['%s.grpc.pb.h', '%s.pb.h'])
return out return out
def no_protos(src): def no_protos(src):
out = [] out = []
for f in src: for f in src:
if os.path.splitext(f)[1] != '.proto': if os.path.splitext(f)[1] != '.proto':
out.append(f) out.append(f)
return out return out
%> %>
${json.dumps([{"name": tgt.name, ${json.dumps([{"name": tgt.name,
"language": tgt.language, "language": tgt.language,
"src": sorted( "src": sorted(
no_protos(tgt.src) + no_protos(tgt.src) +

@ -1,8 +1,10 @@
<%! %YAML 1.2
import json --- |
%> <%!
import json
%>
${json.dumps([{"name": tgt.name, ${json.dumps([{"name": tgt.name,
"language": tgt.language, "language": tgt.language,
"platforms": tgt.platforms, "platforms": tgt.platforms,
"ci_platforms": tgt.ci_platforms, "ci_platforms": tgt.ci_platforms,

@ -1,37 +1,39 @@
# Copyright 2015, Google Inc. %YAML 1.2
# All rights reserved. --- |
# # Copyright 2015, Google Inc.
# Redistribution and use in source and binary forms, with or without # All rights reserved.
# modification, are permitted provided that the following conditions are #
# met: # Redistribution and use in source and binary forms, with or without
# # modification, are permitted provided that the following conditions are
# * Redistributions of source code must retain the above copyright # met:
# notice, this list of conditions and the following disclaimer. #
# * Redistributions in binary form must reproduce the above # * Redistributions of source code must retain the above copyright
# copyright notice, this list of conditions and the following disclaimer # notice, this list of conditions and the following disclaimer.
# in the documentation and/or other materials provided with the # * Redistributions in binary form must reproduce the above
# distribution. # copyright notice, this list of conditions and the following disclaimer
# * Neither the name of Google Inc. nor the names of its # in the documentation and/or other materials provided with the
# contributors may be used to endorse or promote products derived from # distribution.
# this software without specific prior written permission. # * Neither the name of Google Inc. nor the names of its
# # contributors may be used to endorse or promote products derived from
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS # this software without specific prior written permission.
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT #
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT # A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, # OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY # SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT # LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # 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.
<%!
import re import re
%>\ %>\
<%namespace file="packages.include" import="get_openssl,get_zlib"/>\ <%namespace file="packages.include" import="get_name"/>\
<%def name="to_windows_path(path)">${path.replace('/','\\')}</%def>\ <%def name="to_windows_path(path)">${path.replace('/','\\')}</%def>\
<% <%
build_from_project_file = set(['gpr', build_from_project_file = set(['gpr',
'gpr_test_util', 'gpr_test_util',
'grpc', 'grpc',
@ -48,159 +50,159 @@
'windows' in target.get('platforms', ['windows']) ] 'windows' in target.get('platforms', ['windows']) ]
c_test_targets = [ target for target in buildable_targets if target.build == 'test' and not target.language == 'c++' ] c_test_targets = [ target for target in buildable_targets if target.build == 'test' and not target.language == 'c++' ]
cxx_test_targets = [ target for target in buildable_targets if target.build == 'test' and target.language == 'c++' ] cxx_test_targets = [ target for target in buildable_targets if target.build == 'test' and target.language == 'c++' ]
%>\ %>\
# NMake file to build secondary gRPC targets on Windows. # NMake file to build secondary gRPC targets on Windows.
# Use grpc.sln to solution to build the gRPC libraries. # Use grpc.sln to solution to build the gRPC libraries.
OUT_DIR=test_bin OUT_DIR=test_bin
CC=cl.exe /nologo CC=cl.exe /nologo
LINK=link.exe /nologo LINK=link.exe /nologo
LIBTOOL=lib.exe /nologo /nodefaultlib LIBTOOL=lib.exe /nologo /nodefaultlib
REPO_ROOT=.. REPO_ROOT=..
OPENSSL_INCLUDES = .\packages\${get_openssl()}\build\native\include OPENSSL_INCLUDES = .\packages\${get_name(vsprojects, 'openssl')}\build\native\include
ZLIB_INCLUDES = .\packages\${get_zlib()}\build\native\include ZLIB_INCLUDES = .\packages\${get_name(vsprojects, 'zlib')}\build\native\include
INCLUDES=/I$(REPO_ROOT) /I$(REPO_ROOT)\include /I$(OPENSSL_INCLUDES) /I$(ZLIB_INCLUDES) INCLUDES=/I$(REPO_ROOT) /I$(REPO_ROOT)\include /I$(OPENSSL_INCLUDES) /I$(ZLIB_INCLUDES)
GFLAGS_INCLUDES = .\..\third_party\gflags\include GFLAGS_INCLUDES = .\..\third_party\gflags\include
GTEST_INCLUDES = .\..\third_party\gtest\include GTEST_INCLUDES = .\..\third_party\gtest\include
PROTOBUF_INCLUDES = .\..\third_party\protobuf\src PROTOBUF_INCLUDES = .\..\third_party\protobuf\src
CXX_INCLUDES=/I$(GFLAGS_INCLUDES) /I$(GTEST_INCLUDES) /I$(PROTOBUF_INCLUDES) CXX_INCLUDES=/I$(GFLAGS_INCLUDES) /I$(GTEST_INCLUDES) /I$(PROTOBUF_INCLUDES)
#_SCL_SECURE_NO_WARNINGS supresses a ton of "potentially unsafe use of std lib" warnings #_SCL_SECURE_NO_WARNINGS supresses a ton of "potentially unsafe use of std lib" warnings
DEFINES=/D WIN32 /D _LIB /D _USE_32BIT_TIME_T /D _UNICODE /D UNICODE /D _CRT_SECURE_NO_WARNINGS /D _SCL_SECURE_NO_WARNINGS DEFINES=/D WIN32 /D _LIB /D _USE_32BIT_TIME_T /D _UNICODE /D UNICODE /D _CRT_SECURE_NO_WARNINGS /D _SCL_SECURE_NO_WARNINGS
#important options: /TC vs. /TP: compile as C vs. compile as C++ #important options: /TC vs. /TP: compile as C vs. compile as C++
CFLAGS=/c $(INCLUDES) /Z7 /W3 /WX- /sdl $(DEFINES) /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Gd /TC /analyze- CFLAGS=/c $(INCLUDES) /Z7 /W3 /WX- /sdl $(DEFINES) /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Gd /TC /analyze-
CXXFLAGS=/c $(INCLUDES) $(CXX_INCLUDES) /Z7 /W3 /WX- /sdl $(DEFINES) /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Gd /TP /analyze- CXXFLAGS=/c $(INCLUDES) $(CXX_INCLUDES) /Z7 /W3 /WX- /sdl $(DEFINES) /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Gd /TP /analyze-
LFLAGS=/DEBUG /INCREMENTAL /SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT /MACHINE:X86 LFLAGS=/DEBUG /INCREMENTAL /SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT /MACHINE:X86
OPENSSL_LIBS=.\packages\${get_openssl()}\build\native\lib\v120\Win32\Debug\static\ssleay32.lib .\packages\${get_openssl()}\build\native\lib\v120\Win32\Debug\static\libeay32.lib OPENSSL_LIBS=.\packages\${get_name(vsprojects, 'openssl')}\build\native\lib\v120\Win32\Debug\static\ssleay32.lib .\packages\${get_name(vsprojects, 'openssl')}\build\native\lib\v120\Win32\Debug\static\libeay32.lib
WINSOCK_LIBS=ws2_32.lib WINSOCK_LIBS=ws2_32.lib
GENERAL_LIBS=advapi32.lib comdlg32.lib gdi32.lib kernel32.lib odbc32.lib odbccp32.lib ole32.lib oleaut32.lib shell32.lib user32.lib uuid.lib winspool.lib GENERAL_LIBS=advapi32.lib comdlg32.lib gdi32.lib kernel32.lib odbc32.lib odbccp32.lib ole32.lib oleaut32.lib shell32.lib user32.lib uuid.lib winspool.lib
ZLIB_LIBS=.\packages\${get_zlib()}\build\native\lib\v120\Win32\Debug\static\cdecl\zlib.lib ZLIB_LIBS=.\packages\${get_name(vsprojects, 'zlib')}\build\native\lib\v120\Win32\Debug\static\cdecl\zlib.lib
LIBS=$(OPENSSL_LIBS) $(ZLIB_LIBS) $(GENERAL_LIBS) $(WINSOCK_LIBS) LIBS=$(OPENSSL_LIBS) $(ZLIB_LIBS) $(GENERAL_LIBS) $(WINSOCK_LIBS)
#shlwapi.lib provides PathMatchSpec() for gflags in windows #shlwapi.lib provides PathMatchSpec() for gflags in windows
GFLAGS_LIBS=.\..\third_party\gflags\lib\Debug\gflags.lib shlwapi.lib GFLAGS_LIBS=.\..\third_party\gflags\lib\Debug\gflags.lib shlwapi.lib
GTEST_LIBS=.\..\third_party\gtest\msvc\gtest\Debug\gtestd.lib GTEST_LIBS=.\..\third_party\gtest\msvc\gtest\Debug\gtestd.lib
PROTOBUF_LIBS=.\..\third_party\protobuf\vsprojects\Debug\libprotobuf.lib PROTOBUF_LIBS=.\..\third_party\protobuf\vsprojects\Debug\libprotobuf.lib
CXX_LIBS=$(GFLAGS_LIBS) $(GTEST_LIBS) $(PROTOBUF_LIBS) CXX_LIBS=$(GFLAGS_LIBS) $(GTEST_LIBS) $(PROTOBUF_LIBS)
all: buildtests all: buildtests
tools: tools:
tools_c: tools_c:
tools_cxx: tools_cxx:
$(OUT_DIR): $(OUT_DIR):
mkdir $(OUT_DIR) mkdir $(OUT_DIR)
build_libs: \ build_libs: \
% for target in buildable_targets: % for target in buildable_targets:
% if target.build == 'private' or target.build == 'all': % if target.build == 'private' or target.build == 'all':
% if target.name in build_from_project_file: % if target.name in build_from_project_file:
build_${target.name} \ build_${target.name} \
% else: % else:
Debug\${target.name}.lib \ Debug\${target.name}.lib \
% endif % endif
% endif % endif
% endfor % endfor
buildtests: buildtests_c buildtests_cxx buildtests: buildtests_c buildtests_cxx
buildtests_c: \ buildtests_c: \
% for target in c_test_targets: % for target in c_test_targets:
${target.name}.exe \ ${target.name}.exe \
% endfor % endfor
echo All C tests built. echo All C tests built.
buildtests_cxx: \ buildtests_cxx: \
% for target in cxx_test_targets: % for target in cxx_test_targets:
${target.name}.exe \ ${target.name}.exe \
% endfor % endfor
echo All C++ tests built. echo All C++ tests built.
% for target in buildable_targets: % for target in buildable_targets:
## replace all .proto includes with .pb.cc / .grpc.pb.cc ## replace all .proto includes with .pb.cc / .grpc.pb.cc
%if target.src: %if target.src:
%for source in target.src: %for source in target.src:
%if source.endswith(".proto"): %if source.endswith(".proto"):
<% <%
src_name_parts = source.split(".") src_name_parts = source.split(".")
target.src.append(src_name_parts[0] + ".pb.cc") target.src.append(src_name_parts[0] + ".pb.cc")
target.src.append(src_name_parts[0] + ".grpc.pb.cc") target.src.append(src_name_parts[0] + ".grpc.pb.cc")
%>\ %>\
%endif %endif
%endfor %endfor
%endif %endif
## remove all .proto includes ## remove all .proto includes
<% <%
target.src = [item for item in target.src if not re.search('([^/]+)\.proto$', item)] target.src = [item for item in target.src if not re.search('([^/]+)\.proto$', item)]
%>\ %>\
%if target.name in build_from_project_file: %if target.name in build_from_project_file:
build_${target.name}: build_${target.name}:
msbuild grpc.sln /t:${target.name} /p:Configuration=Debug /p:Linkage-grpc_dependencies_zlib=static msbuild grpc.sln /t:${target.name} /p:Configuration=Debug /p:Linkage-grpc_dependencies_zlib=static
%else: %else:
%if target.build == 'private': %if target.build == 'private':
Debug\${target.name}.lib: \ Debug\${target.name}.lib: \
%else: %else:
${target.name}.exe: \ ${target.name}.exe: \
%for dep in target.get('deps', []): %for dep in target.get('deps', []):
%if dep in build_from_project_file: %if dep in build_from_project_file:
build_${dep} \ build_${dep} \
%else: %else:
Debug\${dep}.lib \ Debug\${dep}.lib \
%endif %endif
%endfor %endfor
%endif %endif
$(OUT_DIR) $(OUT_DIR)
echo Building ${target.name} echo Building ${target.name}
%if target.language == 'c++': %if target.language == 'c++':
$(CC) $(CXXFLAGS) /Fo:$(OUT_DIR)\ \ $(CC) $(CXXFLAGS) /Fo:$(OUT_DIR)\ \
%else: %else:
$(CC) $(CFLAGS) /Fo:$(OUT_DIR)\ \ $(CC) $(CFLAGS) /Fo:$(OUT_DIR)\ \
%endif %endif
%for source in target.src: %for source in target.src:
$(REPO_ROOT)\${to_windows_path(source)} \ $(REPO_ROOT)\${to_windows_path(source)} \
%endfor %endfor
%if not target.src: %if not target.src:
$(REPO_ROOT)\${to_windows_path('vsprojects/dummy.c')} \ $(REPO_ROOT)\${to_windows_path('vsprojects/dummy.c')} \
%endif %endif
%if target.build == 'private': %if target.build == 'private':
$(LIBTOOL) /OUT:"Debug\${target.name}.lib" \ $(LIBTOOL) /OUT:"Debug\${target.name}.lib" \
%else: %else:
$(LINK) $(LFLAGS) /OUT:"$(OUT_DIR)\${target.name}.exe" \ $(LINK) $(LFLAGS) /OUT:"$(OUT_DIR)\${target.name}.exe" \
%for dep in target.get('deps', []): %for dep in target.get('deps', []):
Debug\${dep}.lib \ Debug\${dep}.lib \
%endfor %endfor
%if target.language == 'c++': %if target.language == 'c++':
$(CXX_LIBS) \ $(CXX_LIBS) \
%endif %endif
$(LIBS) \ $(LIBS) \
%endif %endif
%if not target.src: %if not target.src:
$(OUT_DIR)\dummy.obj \ $(OUT_DIR)\dummy.obj \
%else: %else:
%for source in target.src: %for source in target.src:
%if re.search('([^/]+)\.c{1,2}$', source): %if re.search('([^/]+)\.c{1,2}$', source):
$(OUT_DIR)\${re.search('([^/]+)\.c{1,2}$', source).group(1)}.obj \ $(OUT_DIR)\${re.search('([^/]+)\.c{1,2}$', source).group(1)}.obj \
%endif %endif
%endfor %endfor
%endif %endif
%if target.build != 'private': %if target.build != 'private':
${target.name}: ${target.name}.exe ${target.name}: ${target.name}.exe
echo Running ${target.name} echo Running ${target.name}
$(OUT_DIR)\${target.name}.exe $(OUT_DIR)\${target.name}.exe
%endif %endif
%endif %endif
% endfor % endfor

@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ImportGroup Label="PropertySheets" />
<PropertyGroup Label="UserMacros" />
<PropertyGroup />
<ItemDefinitionGroup>
<ClCompile>
<AdditionalIncludeDirectories>$(SolutionDir)\..;$(SolutionDir)\..\include;$(SolutionDir)\..\third_party\protobuf\src;$(SolutionDir)\..\third_party\gtest\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_SCL_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;_UNICODE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<WarningLevel>EnableAllWarnings</WarningLevel>
</ClCompile>
<Link>
<AdditionalDependencies>grpc++_test_util.lib;grpc_test_util.lib;gpr_test_util.lib;gtestd.lib;gflags.lib;shlwapi.lib;gpr.lib;grpc.lib;grpc++.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(SolutionDir)\..\third_party\gtest\msvc\gtest\Debug;$(SolutionDir)\..\third_party\gflags\lib\Debug;$(SolutionDir)\..\Debug;$(SolutionDir)\..\packages\grpc.dependencies.openssl.${vspackages_dict['grpc.dependencies.openssl'].version}\build\native\lib\$(PlatformToolset)\$(Platform)\$(Configuration)\static;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
</Link>
</ItemDefinitionGroup>
<ItemGroup />
</Project>

@ -0,0 +1,16 @@
%YAML 1.2
--- |
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ImportGroup Label="PropertySheets" />
<PropertyGroup Label="UserMacros" />
<PropertyGroup />
<ItemDefinitionGroup>
<ClCompile>
<AdditionalIncludeDirectories>$(SolutionDir)\..;$(SolutionDir)\..\include;$(SolutionDir)\..\third_party\protobuf\src;${';'.join('$(SolutionDir)\\packages\\%s.%s\\build\\native\\include' % (p.name, p.version) for p in vspackages)};%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_SCL_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;_UNICODE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<WarningLevel>EnableAllWarnings</WarningLevel>
</ClCompile>
</ItemDefinitionGroup>
<ItemGroup />
</Project>

@ -1,2 +0,0 @@
<%namespace file="../vcxproj.filters_defs.include" import="gen_filters"/>\
${gen_filters('gpr', libs)}

@ -1,2 +0,0 @@
<%namespace file="../vcxproj_defs.include" import="gen_project"/>\
${gen_project('gpr', libs)}

@ -1,2 +0,0 @@
<%namespace file="../vcxproj_defs.include" import="gen_project"/>\
${gen_project('gpr_test_util', libs)}

@ -1,2 +0,0 @@
<%namespace file="../vcxproj.filters_defs.include" import="gen_filters"/>\
${gen_filters('grpc++', libs)}

@ -1,2 +0,0 @@
<%namespace file="../vcxproj_defs.include" import="gen_project"/>\
${gen_project('grpc++', libs)}

@ -1,2 +1,4 @@
<%namespace file="../vcxproj.filters_defs.include" import="gen_filters"/>\ %YAML 1.2
${gen_filters('grpc++_unsecure', libs)} --- |
<%namespace file="../vcxproj.filters_defs.include" import="gen_filters"/>\
${gen_filters('grpc++_unsecure', libs)}

@ -1,2 +1,4 @@
<%namespace file="../vcxproj_defs.include" import="gen_project"/>\ %YAML 1.2
${gen_project('grpc++_unsecure', libs)} --- |
<%namespace file="../vcxproj_defs.include" import="gen_project"/>\
${gen_project('grpc++_unsecure', libs)}

@ -0,0 +1,7 @@
%YAML 1.2
--- |
<%namespace file="sln_defs.include" import="gen_solution"/>\
<%
solution_projects = [p for p in vsprojects if p.build != 'protoc' and p.language in ['c', 'c++'] and not (p.language == 'c++' and p.build in ['private', 'test'])]
%>\
${gen_solution(solution_projects, use_dlls='yes')}

@ -1,5 +1,7 @@
<%namespace file="sln_defs.include" import="gen_solution"/>\ %YAML 1.2
<% --- |
solution_projects = [p for p in vsprojects if p.build != 'protoc' and p.language in ['c', 'c++']] <%namespace file="sln_defs.include" import="gen_solution"/>\
%>\ <%
${gen_solution(solution_projects, use_dlls='yes')} solution_projects = [p for p in vsprojects if p.build not in ['protoc', 'test'] and p.language in ['c', 'c++'] and p.vs_proj_dir == '.' and not (p.build == 'private' and p.language == 'c++')]
%>\
${gen_solution(solution_projects, use_dlls='yes')}

@ -1,2 +0,0 @@
<%namespace file="../vcxproj.filters_defs.include" import="gen_filters"/>\
${gen_filters('grpc', libs)}

@ -1,2 +0,0 @@
<%namespace file="../vcxproj_defs.include" import="gen_project"/>\
${gen_project('grpc', libs, packages=['openssl','zlib'])}

@ -1,2 +0,0 @@
<%namespace file="../packages.include" import="gen_packages_config"/>\
${gen_packages_config(['openssl','zlib'])}

@ -1,2 +1,4 @@
<%namespace file="../vcxproj_defs.include" import="gen_project"/>\ %YAML 1.2
${gen_project('grpc_cpp_plugin', targets, configuration_type='Application')} --- |
<%namespace file="../vcxproj_defs.include" import="gen_project"/>\
${gen_project('grpc_cpp_plugin', targets)}

@ -1,5 +1,7 @@
<%namespace file="sln_defs.include" import="gen_solution"/>\ %YAML 1.2
<% --- |
solution_projects = [p for p in vsprojects if p.build == 'all' and p.language in ['c', 'csharp']] <%namespace file="sln_defs.include" import="gen_solution"/>\
%>\ <%
${gen_solution(solution_projects, use_dlls='only')} solution_projects = [p for p in vsprojects if p.build == 'all' and p.language in ['c', 'csharp']]
%>\
${gen_solution(solution_projects, use_dlls='only')}

@ -1,2 +0,0 @@
<%namespace file="../vcxproj_defs.include" import="gen_project"/>\
${gen_project('grpc_csharp_ext', libs, configuration_type = 'DynamicLibrary', props=['zlib-dll'], packages=['openssl','zlib'])}

@ -1,2 +0,0 @@
<%namespace file="../packages.include" import="gen_packages_config"/>\
${gen_packages_config(['openssl','zlib'])}

@ -1,2 +1,4 @@
<%namespace file="../vcxproj_defs.include" import="gen_project"/>\ %YAML 1.2
${gen_project('grpc_csharp_plugin', targets, configuration_type='Application')} --- |
<%namespace file="../vcxproj_defs.include" import="gen_project"/>\
${gen_project('grpc_csharp_plugin', targets)}

@ -1,2 +1,4 @@
<%namespace file="../vcxproj_defs.include" import="gen_project"/>\ %YAML 1.2
${gen_project('grpc_objective_c_plugin', targets, configuration_type='Application')} --- |
<%namespace file="../vcxproj_defs.include" import="gen_project"/>\
${gen_project('grpc_objective_c_plugin', targets)}

@ -1,2 +0,0 @@
<%namespace file="../vcxproj_defs.include" import="gen_project"/>\
${gen_project('grpc_plugin_support', libs)}

@ -1,5 +1,7 @@
<%namespace file="sln_defs.include" import="gen_solution"/>\ %YAML 1.2
<% --- |
solution_projects = [p for p in vsprojects if p.build == 'protoc'] <%namespace file="sln_defs.include" import="gen_solution"/>\
%>\ <%
${gen_solution(solution_projects)} solution_projects = [p for p in vsprojects if p.build == 'protoc']
%>\
${gen_solution(solution_projects)}

@ -1,2 +1,4 @@
<%namespace file="../vcxproj_defs.include" import="gen_project"/>\ %YAML 1.2
${gen_project('grpc_python_plugin', targets, configuration_type='Application')} --- |
<%namespace file="../vcxproj_defs.include" import="gen_project"/>\
${gen_project('grpc_python_plugin', targets)}

@ -1,2 +1,4 @@
<%namespace file="../vcxproj_defs.include" import="gen_project"/>\ %YAML 1.2
${gen_project('grpc_ruby_plugin', targets, configuration_type='Application')} --- |
<%namespace file="../vcxproj_defs.include" import="gen_project"/>\
${gen_project('grpc_ruby_plugin', targets)}

@ -1,2 +0,0 @@
<%namespace file="../vcxproj_defs.include" import="gen_project"/>\
${gen_project('grpc_test_util', libs)}

@ -1,2 +0,0 @@
<%namespace file="../vcxproj_defs.include" import="gen_project"/>\
${gen_project('grpc_test_util_unsecure', libs)}

@ -1,2 +0,0 @@
<%namespace file="../vcxproj.filters_defs.include" import="gen_filters"/>\
${gen_filters('grpc_unsecure', libs)}

@ -1,2 +0,0 @@
<%namespace file="../vcxproj_defs.include" import="gen_project"/>\
${gen_project('grpc_unsecure', libs, packages=['zlib'])}

@ -1,2 +0,0 @@
<%namespace file="../packages.include" import="gen_packages_config"/>\
${gen_packages_config(['zlib'])}

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ImportGroup Label="PropertySheets" />
<PropertyGroup Label="UserMacros" />
<PropertyGroup />
<ItemDefinitionGroup>
<Link>
<AdditionalDependencies>ssleay32.lib;libeay32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(SolutionDir)\packages\grpc.dependencies.openssl.${vspackages_dict['grpc.dependencies.openssl'].version}\build\native\lib\$(PlatformToolset)\$(Platform)\$(Configuration)\static;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
</Link>
</ItemDefinitionGroup>
<ItemGroup />
</Project>

@ -1,54 +1,53 @@
<%! <%def name="get_name(vspackages, package)">${''.join('%s.%s' % (p.name, p.version) for p in vspackages if p.name == package)}</%def>
openssl_pkg_name = "grpc.dependencies.openssl"
openssl_pkg_version = "1.0.2.2"
zlib_pkg_name = "grpc.dependencies.zlib"
zlib_pkg_version = "1.2.8.9"
%>\
<%def name="get_openssl()">${openssl_pkg_name}.${openssl_pkg_version}</%def>\
<%def name="get_zlib()">${zlib_pkg_name}.${zlib_pkg_version}</%def>\
<%def name="gen_packages_config(packages)">\ <%def name="gen_packages_config(packages)">\
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<packages> <packages>
% if 'openssl' in packages: % for package in vspackages:
<package id="${openssl_pkg_name}" version="${openssl_pkg_version}" targetFramework="Native" /> % if packages == 'all' or package.name in packages:
<package id="${openssl_pkg_name}.redist" version="${openssl_pkg_version}" targetFramework="Native" /> <package id="${package.name}" version="${package.version}" targetFramework="Native" />
% if package.redist:
<package id="${package.name}.redist" version="${package.version}" targetFramework="Native" />
% endif % endif
% if 'zlib' in packages:
<package id="${zlib_pkg_name}" version="${zlib_pkg_version}" targetFramework="Native" />
<package id="${zlib_pkg_name}.redist" version="${zlib_pkg_version}" targetFramework="Native" />
% endif % endif
% endfor
</packages> </packages>
</%def>\ </%def>\
<%def name="gen_package_props(packages)">\ <%def name="gen_package_props(packages, repo_root)">\
% if 'openssl' in packages: % for package in vspackages:
<Import Project="..\packages\${openssl_pkg_name}.${openssl_pkg_version}\build\native\${openssl_pkg_name}.props" Condition="Exists('..\packages\${openssl_pkg_name}.${openssl_pkg_version}\build\native\${openssl_pkg_name}.props')" /> % if packages == 'all' or package.name in packages:
% endif % if package.props:
<Import Project="${repo_root}\vsprojects\packages\${package.name}.${package.version}\build\native\${package.name}.props" Condition="Exists('${repo_root}\vsprojects\packages\${package.name}.${package.version}\build\native\${package.version}.props')" />
% endif
% endif
% endfor
</%def>\ </%def>\
<%def name="gen_package_targets(packages)">\ <%def name="gen_package_targets(packages, repo_root)">\
% if 'zlib' in packages: % for package in vspackages:
<Import Project="..\packages\${zlib_pkg_name}.redist.${zlib_pkg_version}\build\native\${zlib_pkg_name}.redist.targets" Condition="Exists('..\packages\${zlib_pkg_name}.redist.${zlib_pkg_version}\build\native\${zlib_pkg_name}.redist.targets')" /> % if packages == 'all' or package.name in packages:
<Import Project="..\packages\${zlib_pkg_name}.${zlib_pkg_version}\build\native\${zlib_pkg_name}.targets" Condition="Exists('..\packages\${zlib_pkg_name}.${zlib_pkg_version}\build\native\${zlib_pkg_name}.targets')" /> % if package.redist:
%endif <Import Project="${repo_root}\vsprojects\packages\${package.name}.redist.${package.version}\build\native\${package.name}.redist.targets" Condition="Exists('${repo_root}\vsprojects\packages\${package.name}.redist.${package.version}\build\native\grpc.dependencies\${package.name}.targets')" />
% if 'openssl' in packages: % endif
<Import Project="..\packages\${openssl_pkg_name}.redist.${openssl_pkg_version}\build\native\${openssl_pkg_name}.redist.targets" Condition="Exists('..\packages\${openssl_pkg_name}.redist.${openssl_pkg_version}\build\native\${openssl_pkg_name}.redist.targets')" /> <Import Project="${repo_root}\vsprojects\packages\${package.name}.${package.version}\build\native\${package.name}.targets" Condition="Exists('${repo_root}\vsprojects\packages\${package.name}.${package.version}\build\native\grpc.dependencies\${package.name}.targets')" />
<Import Project="..\packages\${openssl_pkg_name}.${openssl_pkg_version}\build\native\${openssl_pkg_name}.targets" Condition="Exists('..\packages\${openssl_pkg_name}.${openssl_pkg_version}\build\native\${openssl_pkg_name}.targets')" />
% endif % endif
% endfor
</%def>\ </%def>\
<%def name="gen_package_ensure(packages)">\ <%def name="check_file_inner(file)"><Error Condition="!Exists('${file}')" Text="$([System.String]::Format('$(ErrorText)', '${file}')" /></%def>\
% if packages: <%def name="check_file(file, repo_root, package)">${check_file_inner(file % {'root':repo_root, 'name':package.name, 'version':package.version})}</%def>\
<%def name="gen_package_ensure(packages, repo_root)">\
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild"> <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup> <PropertyGroup>
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText> <ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
</PropertyGroup> </PropertyGroup>
% if 'zlib' in packages: % for package in vspackages:
<Error Condition="!Exists('..\packages\${zlib_pkg_name}.redist.${zlib_pkg_version}\build\native\${zlib_pkg_name}.redist.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\${zlib_pkg_name}.redist.${zlib_pkg_version}\build\native\${zlib_pkg_name}.redist.targets'))" /> % if packages == 'all' or package.name in packages:
<Error Condition="!Exists('..\packages\${zlib_pkg_name}.${zlib_pkg_version}\build\native\${zlib_pkg_name}.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\${zlib_pkg_name}.${zlib_pkg_version}\build\native\${zlib_pkg_name}.targets'))" /> % if package.redist:
%endif ${check_file('%(root)s\\vsprojects\\packages\\%(name)s.redist.%(version)s\\build\\native\\%(name)s.redist.targets', repo_root, package)}
% if 'openssl' in packages: % endif
<Error Condition="!Exists('..\packages\${openssl_pkg_name}.redist.${openssl_pkg_version}\build\native\${openssl_pkg_name}.redist.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\${openssl_pkg_name}.redist.${openssl_pkg_version}\build\native\${openssl_pkg_name}.redist.targets'))" /> % if package.props:
<Error Condition="!Exists('..\packages\${openssl_pkg_name}.${openssl_pkg_version}\build\native\${openssl_pkg_name}.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\${openssl_pkg_name}.${openssl_pkg_version}\build\native\${openssl_pkg_name}.props'))" /> ${check_file('%(root)s\\vsprojects\\packages\\%(name)s.%(version)s\\build\\native\\%(name)s.props', repo_root, package)}
<Error Condition="!Exists('..\packages\${openssl_pkg_name}.${openssl_pkg_version}\build\native\${openssl_pkg_name}.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\${openssl_pkg_name}.${openssl_pkg_version}\build\native\${openssl_pkg_name}.targets'))" /> % endif
%endif ${check_file('%(root)s\\vsprojects\\packages\\%(name)s.%(version)s\\build\\native\\%(name)s.targets', repo_root, package)}
% endif
% endfor
</Target> </Target>
%endif
</%def>\ </%def>\

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ImportGroup Label="PropertySheets" />
<PropertyGroup Label="UserMacros" />
<PropertyGroup />
<ItemDefinitionGroup>
<Link>
<AdditionalDependencies>libprotobuf.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(SolutionDir)\..\third_party\protobuf\cmake\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
</Link>
</ItemDefinitionGroup>
<ItemGroup />
</Project>

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ImportGroup Label="PropertySheets" />
<PropertyGroup Label="UserMacros" />
<PropertyGroup />
<ItemDefinitionGroup>
<Link>
<AdditionalDependencies>libprotoc.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(SolutionDir)\..\third_party\protobuf\cmake\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
</Link>
</ItemDefinitionGroup>
<ItemGroup />
</Project>

@ -14,7 +14,7 @@ MinimumVisualStudioVersion = 10.0.40219.1
cpp_proj_type = "{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}" cpp_proj_type = "{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}"
%>\ %>\
% for project in solution_projects: % for project in solution_projects:
Project("${cpp_proj_type}") = "${project.name}", "${project.name}\${project.name}.vcxproj", "${project.vs_project_guid}" Project("${cpp_proj_type}") = "${project.name}", "vcxproj\${project.vs_proj_dir}\${project.name}\${project.name}.vcxproj", "${project.vs_project_guid}"
ProjectSection(myProperties) = preProject ProjectSection(myProperties) = preProject
% if project.is_library: % if project.is_library:
lib = "True" lib = "True"
@ -53,7 +53,7 @@ Global
${project.vs_project_guid}.Debug|x64.ActiveCfg = Debug|x64 ${project.vs_project_guid}.Debug|x64.ActiveCfg = Debug|x64
${project.vs_project_guid}.Release|Win32.ActiveCfg = Release|Win32 ${project.vs_project_guid}.Release|Win32.ActiveCfg = Release|Win32
${project.vs_project_guid}.Release|x64.ActiveCfg = Release|x64 ${project.vs_project_guid}.Release|x64.ActiveCfg = Release|x64
% if project.get('dll', 'no') != 'only': % if project.get('dll', False) != 'only':
${project.vs_project_guid}.Debug|Win32.Build.0 = Debug|Win32 ${project.vs_project_guid}.Debug|Win32.Build.0 = Debug|Win32
${project.vs_project_guid}.Debug|x64.Build.0 = Debug|x64 ${project.vs_project_guid}.Debug|x64.Build.0 = Debug|x64
${project.vs_project_guid}.Release|Win32.Build.0 = Release|Win32 ${project.vs_project_guid}.Release|Win32.Build.0 = Release|Win32
@ -61,7 +61,7 @@ Global
% endif % endif
% endif % endif
% if use_dlls == 'yes': % if use_dlls == 'yes':
% if project.get('dll', 'no') == 'no': % if project.get('dll', False) == False:
${project.vs_project_guid}.Debug-DLL|Win32.ActiveCfg = Debug|Win32 ${project.vs_project_guid}.Debug-DLL|Win32.ActiveCfg = Debug|Win32
${project.vs_project_guid}.Debug-DLL|Win32.Build.0 = Debug|Win32 ${project.vs_project_guid}.Debug-DLL|Win32.Build.0 = Debug|Win32
${project.vs_project_guid}.Debug-DLL|x64.ActiveCfg = Debug|x64 ${project.vs_project_guid}.Debug-DLL|x64.ActiveCfg = Debug|x64
@ -82,7 +82,7 @@ Global
% endif % endif
% endif % endif
% if use_dlls == 'only': % if use_dlls == 'only':
% if project.get('dll', 'no') == 'yes': % if project.get('dll', False) == True:
${project.vs_project_guid}.Debug|Win32.ActiveCfg = Debug-DLL|Win32 ${project.vs_project_guid}.Debug|Win32.ActiveCfg = Debug-DLL|Win32
${project.vs_project_guid}.Debug|Win32.Build.0 = Debug-DLL|Win32 ${project.vs_project_guid}.Debug|Win32.Build.0 = Debug-DLL|Win32
${project.vs_project_guid}.Debug|x64.ActiveCfg = Debug-DLL|x64 ${project.vs_project_guid}.Debug|x64.ActiveCfg = Debug-DLL|x64

@ -5,7 +5,7 @@
def calc_to_filter(path): def calc_to_filter(path):
return '\\'.join(path.split('/')[:-1]) return '\\'.join(path.split('/')[:-1])
%>\ %>\
<%def name="get_repo_root()">..\..</%def>\ <%def name="get_repo_root(proj)">${'..\..\..' + ('\..' if proj.vs_proj_dir != '.' else '')}</%def>\
<%def name="to_windows_path(path)">${path.replace('/','\\')}</%def>\ <%def name="to_windows_path(path)">${path.replace('/','\\')}</%def>\
<%def name="to_filter(path)">${calc_to_filter(path)}</%def>\ <%def name="to_filter(path)">${calc_to_filter(path)}</%def>\
<%def name="filter_to_guid(proj, filter)">${re.sub('(........)(....)(....)(....)', r'\1-\2-\3-\4-', hashlib.md5(''.join([filter, proj])).hexdigest())}</%def>\ <%def name="filter_to_guid(proj, filter)">${re.sub('(........)(....)(....)(....)', r'\1-\2-\3-\4-', hashlib.md5(''.join([filter, proj])).hexdigest())}</%def>\
@ -17,7 +17,7 @@
% if project.get('src',[]): % if project.get('src',[]):
<ItemGroup> <ItemGroup>
% for src_name in project.src: % for src_name in project.src:
<ClCompile Include="${get_repo_root()}\${to_windows_path(src_name)}"> <ClCompile Include="${get_repo_root(project)}\${to_windows_path(src_name)}">
<Filter>${to_filter(src_name)}</Filter> <Filter>${to_filter(src_name)}</Filter>
</ClCompile> </ClCompile>
% endfor % endfor
@ -26,7 +26,7 @@
% if project.get('public_headers',[]): % if project.get('public_headers',[]):
<ItemGroup> <ItemGroup>
% for public_header in project.public_headers: % for public_header in project.public_headers:
<ClInclude Include="${get_repo_root()}\${to_windows_path(public_header)}"> <ClInclude Include="${get_repo_root(project)}\${to_windows_path(public_header)}">
<Filter>${to_filter(public_header)}</Filter> <Filter>${to_filter(public_header)}</Filter>
</ClInclude> </ClInclude>
% endfor % endfor
@ -35,7 +35,7 @@
% if project.get('headers',[]): % if project.get('headers',[]):
<ItemGroup> <ItemGroup>
% for header in project.headers: % for header in project.headers:
<ClInclude Include="${get_repo_root()}\${to_windows_path(header)}"> <ClInclude Include="${get_repo_root(project)}\${to_windows_path(header)}">
<Filter>${to_filter(header)}</Filter> <Filter>${to_filter(header)}</Filter>
</ClInclude> </ClInclude>
% endfor % endfor

@ -0,0 +1,18 @@
%YAML 1.2
---
foreach: vsprojects
output_name: ${selected.vs_proj_dir}/${selected.name}/${selected.name}.vcxproj
template: |
<%namespace file="vcxproj_defs.include" import="gen_project"/>\
${gen_project(selected.name, vsprojects)}
---
foreach: vsprojects
output_name: ${selected.vs_proj_dir}/${selected.name}/${selected.name}.vcxproj.filters
template: |
<%namespace file="vcxproj.filters_defs.include" import="gen_filters"/>\
${gen_filters(selected.name, vsprojects)}
---
output_name: grpc/packages.config
template: |
<%namespace file="packages.include" import="gen_packages_config"/>\
${gen_packages_config('all')}

@ -1,8 +1,7 @@
<%namespace file="packages.include" import="gen_package_props,gen_package_targets,gen_package_ensure"/>\ <%namespace file="packages.include" import="gen_package_props,gen_package_targets,gen_package_ensure"/>\
<%def name="get_repo_root()">..\..</%def>\
<%def name="to_windows_path(path)">${path.replace('/','\\')}</%def>\ <%def name="to_windows_path(path)">${path.replace('/','\\')}</%def>\
<%def name="get_subsystem(is_library)">${'Windows' if is_library else 'Console'}</%def>\ <%def name="get_subsystem(is_library)">${'Windows' if is_library else 'Console'}</%def>\
<%def name="gen_project(name, collection, configuration_type = None, project_guid = None, props = [], packages = [])">\ <%def name="gen_project(name, collection)">\
<% <%
target = None target = None
for p in vsprojects: for p in vsprojects:
@ -11,13 +10,8 @@
for t in collection: for t in collection:
if t.name == name: if t.name == name:
target = t target = t
if not configuration_type and target: props = project.vs_props
print target.name configuration_type = project.vs_config_type
if target.build == 'test' or target.build == 'tool':
configuration_type = 'Application'
if not configuration_type:
configuration_type = 'StaticLibrary'
if not project_guid:
project_guid = project.vs_project_guid project_guid = project.vs_project_guid
if target.build == 'test' and target.language == 'c++': if target.build == 'test' and target.language == 'c++':
props.extend(['cpptest']) props.extend(['cpptest'])
@ -29,13 +23,16 @@
else: else:
props.extend(['winsock']) props.extend(['winsock'])
props.extend(['global']) props.extend(['global'])
dll = project.get('dll', 'no') props = sorted(list(set(props)))
dll = project.get('dll', False)
packages = project.vs_packages
repo_root = '..\..\..' + ('\..' if project.vs_proj_dir != '.' else '')
%>\ %>\
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project DefaultTargets="Build" ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
${gen_package_props(packages)}\ ${gen_package_props(packages, repo_root)}\
<ItemGroup Label="ProjectConfigurations"> <ItemGroup Label="ProjectConfigurations">
% if dll == 'yes': % if dll and dll != 'only':
<ProjectConfiguration Include="Debug-DLL|Win32"> <ProjectConfiguration Include="Debug-DLL|Win32">
<Configuration>Debug-DLL</Configuration> <Configuration>Debug-DLL</Configuration>
<Platform>Win32</Platform> <Platform>Win32</Platform>
@ -94,7 +91,7 @@ ${gen_package_props(packages)}\
<WholeProgramOptimization>true</WholeProgramOptimization> <WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet> <CharacterSet>Unicode</CharacterSet>
</PropertyGroup> </PropertyGroup>
% if dll == 'yes': % if dll and dll != 'only':
<PropertyGroup Condition="'$(Configuration)'=='Debug-DLL'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)'=='Debug-DLL'" Label="Configuration">
<ConfigurationType>${configuration_type}</ConfigurationType> <ConfigurationType>${configuration_type}</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries> <UseDebugLibraries>true</UseDebugLibraries>
@ -113,31 +110,24 @@ ${gen_package_props(packages)}\
<ImportGroup Label="PropertySheets"> <ImportGroup Label="PropertySheets">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
% for prop in props: % for prop in props:
<Import Project="..\${prop}.props" /> <Import Project="${repo_root}\vsprojects\${prop}.props" />
% endfor % endfor
</ImportGroup> </ImportGroup>
<PropertyGroup Label="UserMacros" /> <PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)'=='Debug'"> % for config in ['Debug', 'Release']:# + (['Debug-DLL', 'Release-DLL'] if dll and dll != 'only' else []):
<PropertyGroup Condition="'$(Configuration)'=='${config}'">
<TargetName>${name}</TargetName> <TargetName>${name}</TargetName>
% if "zlib" in packages: % for package in vspackages:
<Linkage-grpc_dependencies_zlib>static</Linkage-grpc_dependencies_zlib> % if packages == 'all' or package.name in packages:
<Configuration-grpc_dependencies_zlib>Debug</Configuration-grpc_dependencies_zlib> % if package.get('linkage', None) is not None:
<Linkage-${package.name.replace('.', '_')}>${package.linkage}</Linkage-${package.name.replace('.', '_')}>
% endif % endif
% if "openssl" in packages: <Configuration-${package.name.replace('.', '_')}>Debug</Configuration-${package.name.replace('.', '_')}>
<Configuration-grpc_dependencies_openssl>Debug</Configuration-grpc_dependencies_openssl>
% endif
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)'=='Release'">
<TargetName>${name}</TargetName>
% if "zlib" in packages:
<Linkage-grpc_dependencies_zlib>static</Linkage-grpc_dependencies_zlib>
<Configuration-grpc_dependencies_zlib>Debug</Configuration-grpc_dependencies_zlib>
% endif
% if "openssl" in packages:
<Configuration-grpc_dependencies_openssl>Debug</Configuration-grpc_dependencies_openssl>
% endif % endif
% endfor
</PropertyGroup> </PropertyGroup>
% if dll == 'yes': % endfor
% if dll and dll != 'only':
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug-DLL|Win32'"> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug-DLL|Win32'">
<ClCompile> <ClCompile>
<PrecompiledHeader>NotUsing</PrecompiledHeader> <PrecompiledHeader>NotUsing</PrecompiledHeader>
@ -270,14 +260,14 @@ ${gen_package_props(packages)}\
% if project.get('public_headers',[]): % if project.get('public_headers',[]):
<ItemGroup> <ItemGroup>
% for public_header in project.public_headers: % for public_header in project.public_headers:
<ClInclude Include="${get_repo_root()}\${to_windows_path(public_header)}" /> <ClInclude Include="${repo_root}\${to_windows_path(public_header)}" />
% endfor % endfor
</ItemGroup> </ItemGroup>
% endif % endif
% if project.get('headers',[]): % if project.get('headers',[]):
<ItemGroup> <ItemGroup>
% for header in project.headers: % for header in project.headers:
<ClInclude Include="${get_repo_root()}\${to_windows_path(header)}" /> <ClInclude Include="${repo_root}\${to_windows_path(header)}" />
% endfor % endfor
</ItemGroup> </ItemGroup>
% endif % endif
@ -286,30 +276,30 @@ ${gen_package_props(packages)}\
% for src_name in project.src: % for src_name in project.src:
% if src_name.endswith(".proto"): % if src_name.endswith(".proto"):
<% src_name_parts = src_name.split(".") %>\ <% src_name_parts = src_name.split(".") %>\
<ClCompile Include="${get_repo_root()}\${to_windows_path(src_name_parts[0] + ".pb.cc")}"> <ClCompile Include="${repo_root}\${to_windows_path(src_name_parts[0] + ".pb.cc")}">
</ClCompile> </ClCompile>
<ClInclude Include="${get_repo_root()}\${to_windows_path(src_name_parts[0] + ".pb.h")}"> <ClInclude Include="${repo_root}\${to_windows_path(src_name_parts[0] + ".pb.h")}">
</ClInclude> </ClInclude>
<ClCompile Include="${get_repo_root()}\${to_windows_path(src_name_parts[0] + ".grpc.pb.cc")}"> <ClCompile Include="${repo_root}\${to_windows_path(src_name_parts[0] + ".grpc.pb.cc")}">
</ClCompile> </ClCompile>
<ClInclude Include="${get_repo_root()}\${to_windows_path(src_name_parts[0] + ".grpc.pb.h")}"> <ClInclude Include="${repo_root}\${to_windows_path(src_name_parts[0] + ".grpc.pb.h")}">
</ClInclude> </ClInclude>
% else: % else:
<ClCompile Include="${get_repo_root()}\${to_windows_path(src_name)}"> <ClCompile Include="${repo_root}\${to_windows_path(src_name)}">
</ClCompile> </ClCompile>
% endif % endif
% endfor % endfor
</ItemGroup> </ItemGroup>
% elif configuration_type != 'StaticLibrary': % elif configuration_type != 'StaticLibrary':
<ItemGroup> <ItemGroup>
<ClCompile Include="${get_repo_root()}\${to_windows_path('vsprojects/dummy.c')}"> <ClCompile Include="${repo_root}\${to_windows_path('vsprojects/dummy.c')}">
</ClCompile> </ClCompile>
</ItemGroup> </ItemGroup>
% endif % endif
% if project.get('deps',[]): % if project.get('deps',[]):
<ItemGroup> <ItemGroup>
% for dep in project.deps: % for dep in project.deps:
<ProjectReference Include="..\${dep}\${dep}.vcxproj"> <ProjectReference Include="${repo_root}\vsprojects\vcxproj\${vsproject_dict[dep].vs_proj_dir}\${dep}\${dep}.vcxproj">
<Project>${vsproject_dict[dep].vs_project_guid}</Project> <Project>${vsproject_dict[dep].vs_project_guid}</Project>
</ProjectReference> </ProjectReference>
% endfor % endfor
@ -322,8 +312,8 @@ ${gen_package_props(packages)}\
%endif %endif
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets"> <ImportGroup Label="ExtensionTargets">
${gen_package_targets(packages)}\ ${gen_package_targets(packages, repo_root)}\
</ImportGroup> </ImportGroup>
${gen_package_ensure(packages)}\ ${gen_package_ensure(packages, repo_root)}\
</Project> </Project>
</%def>\ </%def>\

@ -0,0 +1,14 @@
%YAML 1.2
--- |
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ImportGroup Label="PropertySheets" />
<PropertyGroup Label="UserMacros" />
<PropertyGroup />
<ItemDefinitionGroup>
<Link>
<AdditionalDependencies>ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
<ItemGroup />
</Project>

@ -0,0 +1,15 @@
%YAML 1.2
--- |
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ImportGroup Label="PropertySheets" />
<PropertyGroup Label="UserMacros" />
<PropertyGroup />
<ItemDefinitionGroup>
<Link>
<AdditionalDependencies>zlib.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(SolutionDir)\packages\grpc.dependencies.zlib.${vspackages_dict['grpc.dependencies.zlib'].version}\build\native\lib\$(PlatformToolset)\$(Platform)\$(Configuration)\dynamic\cdecl;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
</Link>
</ItemDefinitionGroup>
<ItemGroup />
</Project>

@ -0,0 +1,15 @@
%YAML 1.2
--- |
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ImportGroup Label="PropertySheets" />
<PropertyGroup Label="UserMacros" />
<PropertyGroup />
<ItemDefinitionGroup>
<Link>
<AdditionalDependencies>zlib.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(SolutionDir)\packages\grpc.dependencies.zlib.${vspackages_dict['grpc.dependencies.zlib'].version}\build\native\lib\$(PlatformToolset)\$(Platform)\$(Configuration)\static\cdecl;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
</Link>
</ItemDefinitionGroup>
<ItemGroup />
</Project>

@ -32,8 +32,8 @@
"""Generates the appropriate build.json data for all the end2end tests.""" """Generates the appropriate build.json data for all the end2end tests."""
import simplejson
import collections import collections
import yaml
TestOptions = collections.namedtuple('TestOptions', 'flaky') TestOptions = collections.namedtuple('TestOptions', 'flaky')
default_test_options = TestOptions(False) default_test_options = TestOptions(False)
@ -58,6 +58,7 @@ def main():
'headers': [ 'headers': [
'test/core/bad_client/bad_client.h' 'test/core/bad_client/bad_client.h'
], ],
'vs_proj_dir': 'test',
'deps': [ 'deps': [
'grpc_test_util_unsecure', 'grpc_test_util_unsecure',
'grpc_unsecure', 'grpc_unsecure',
@ -72,7 +73,7 @@ def main():
'language': 'c', 'language': 'c',
'secure': 'no', 'secure': 'no',
'src': ['test/core/bad_client/tests/%s.c' % t], 'src': ['test/core/bad_client/tests/%s.c' % t],
'flaky': 'invoke_large_request' in t, 'vs_proj_dir': 'test',
'deps': [ 'deps': [
'bad_client_test', 'bad_client_test',
'grpc_test_util_unsecure', 'grpc_test_util_unsecure',
@ -82,7 +83,7 @@ def main():
] ]
} }
for t in sorted(BAD_CLIENT_TESTS.keys())]} for t in sorted(BAD_CLIENT_TESTS.keys())]}
print simplejson.dumps(json, sort_keys=True, indent=2 * ' ') print yaml.dump(json)
if __name__ == '__main__': if __name__ == '__main__':

@ -32,8 +32,9 @@
"""Generates the appropriate build.json data for all the end2end tests.""" """Generates the appropriate build.json data for all the end2end tests."""
import simplejson import yaml
import collections import collections
import hashlib
FixtureOptions = collections.namedtuple('FixtureOptions', 'fullstack includes_proxy dns_resolver secure platforms ci_mac') FixtureOptions = collections.namedtuple('FixtureOptions', 'fullstack includes_proxy dns_resolver secure platforms ci_mac')
@ -42,22 +43,23 @@ socketpair_unsecure_fixture_options = default_unsecure_fixture_options._replace(
default_secure_fixture_options = default_unsecure_fixture_options._replace(secure=True) default_secure_fixture_options = default_unsecure_fixture_options._replace(secure=True)
uds_fixture_options = default_unsecure_fixture_options._replace(dns_resolver=False, platforms=['linux', 'mac', 'posix']) uds_fixture_options = default_unsecure_fixture_options._replace(dns_resolver=False, platforms=['linux', 'mac', 'posix'])
# maps fixture name to whether it requires the security library # maps fixture name to whether it requires the security library
END2END_FIXTURES = { END2END_FIXTURES = {
'chttp2_fake_security': default_secure_fixture_options._replace(ci_mac=False), 'h2_fakesec': default_secure_fixture_options._replace(ci_mac=False),
'chttp2_fullstack': default_unsecure_fixture_options, 'h2_full': default_unsecure_fixture_options,
'chttp2_fullstack_compression': default_unsecure_fixture_options, 'h2_compress': default_unsecure_fixture_options,
'chttp2_fullstack_uds_posix': uds_fixture_options, 'h2_uds': uds_fixture_options,
'chttp2_fullstack_uds_posix_with_poll': uds_fixture_options._replace(platforms=['linux']), 'h2_uds+poll': uds_fixture_options._replace(platforms=['linux']),
'chttp2_fullstack_with_poll': default_unsecure_fixture_options._replace(platforms=['linux']), 'h2_full+poll': default_unsecure_fixture_options._replace(platforms=['linux']),
'chttp2_fullstack_with_proxy': default_unsecure_fixture_options._replace(includes_proxy=True, ci_mac=False), 'h2_proxy': default_unsecure_fixture_options._replace(includes_proxy=True, ci_mac=False),
'chttp2_simple_ssl_fullstack': default_secure_fixture_options, 'h2_ssl': default_secure_fixture_options,
'chttp2_simple_ssl_fullstack_with_poll': default_secure_fixture_options._replace(platforms=['linux']), 'h2_ssl+poll': default_secure_fixture_options._replace(platforms=['linux']),
'chttp2_simple_ssl_fullstack_with_proxy': default_secure_fixture_options._replace(includes_proxy=True, ci_mac=False), 'h2_ssl_proxy': default_secure_fixture_options._replace(includes_proxy=True, ci_mac=False),
'chttp2_simple_ssl_with_oauth2_fullstack': default_secure_fixture_options._replace(ci_mac=False), 'h2_oauth2': default_secure_fixture_options._replace(ci_mac=False),
'chttp2_socket_pair': socketpair_unsecure_fixture_options._replace(ci_mac=False), 'h2_sockpair': socketpair_unsecure_fixture_options._replace(ci_mac=False),
'chttp2_socket_pair_one_byte_at_a_time': socketpair_unsecure_fixture_options._replace(ci_mac=False), 'h2_sockpair_1byte': socketpair_unsecure_fixture_options._replace(ci_mac=False),
'chttp2_socket_pair_with_grpc_trace': socketpair_unsecure_fixture_options, 'h2_sockpair+trace': socketpair_unsecure_fixture_options,
} }
TestOptions = collections.namedtuple('TestOptions', 'needs_fullstack needs_dns proxyable flaky secure') TestOptions = collections.namedtuple('TestOptions', 'needs_fullstack needs_dns proxyable flaky secure')
@ -67,7 +69,7 @@ connectivity_test_options = default_test_options._replace(needs_fullstack=True)
# maps test names to options # maps test names to options
END2END_TESTS = { END2END_TESTS = {
'bad_hostname': default_test_options, 'bad_hostname': default_test_options,
'cancel_after_accept_and_writes_closed': default_test_options, 'cancel_after_client_done': default_test_options,
'cancel_after_accept': default_test_options, 'cancel_after_accept': default_test_options,
'cancel_after_invoke': default_test_options, 'cancel_after_invoke': default_test_options,
'cancel_before_invoke': default_test_options, 'cancel_before_invoke': default_test_options,
@ -76,8 +78,8 @@ END2END_TESTS = {
'channel_connectivity': connectivity_test_options._replace(proxyable=False), 'channel_connectivity': connectivity_test_options._replace(proxyable=False),
'default_host': default_test_options._replace(needs_fullstack=True, needs_dns=True), 'default_host': default_test_options._replace(needs_fullstack=True, needs_dns=True),
'disappearing_server': connectivity_test_options, 'disappearing_server': connectivity_test_options,
'early_server_shutdown_finishes_inflight_calls': default_test_options, 'shutdown_finishes_calls': default_test_options,
'early_server_shutdown_finishes_tags': default_test_options, 'shutdown_finishes_tags': default_test_options,
'empty_batch': default_test_options, 'empty_batch': default_test_options,
'graceful_server_shutdown': default_test_options, 'graceful_server_shutdown': default_test_options,
'invoke_large_request': default_test_options, 'invoke_large_request': default_test_options,
@ -86,19 +88,19 @@ END2END_TESTS = {
'no_op': default_test_options, 'no_op': default_test_options,
'ping_pong_streaming': default_test_options, 'ping_pong_streaming': default_test_options,
'registered_call': default_test_options, 'registered_call': default_test_options,
'request_response_with_binary_metadata_and_payload': default_test_options, 'binary_metadata': default_test_options,
'request_response_with_metadata_and_payload': default_test_options, 'metadata': default_test_options,
'request_response_with_payload_and_call_creds': default_test_options._replace(secure=True), 'call_creds': default_test_options._replace(secure=True),
'request_response_with_payload': default_test_options, 'payload': default_test_options,
'request_response_with_trailing_metadata_and_payload': default_test_options, 'trailing_metadata': default_test_options,
'request_with_compressed_payload': default_test_options._replace(proxyable=False), 'compressed_payload': default_test_options._replace(proxyable=False),
'request_with_flags': default_test_options._replace(proxyable=False), 'request_with_flags': default_test_options._replace(proxyable=False),
'request_with_large_metadata': default_test_options, 'large_metadata': default_test_options,
'request_with_payload': default_test_options, 'request_with_payload': default_test_options,
'server_finishes_request': default_test_options, 'server_finishes_request': default_test_options,
'simple_delayed_request': connectivity_test_options, 'simple_delayed_request': connectivity_test_options,
'simple_request': default_test_options, 'simple_request': default_test_options,
'simple_request_with_high_initial_sequence_number': default_test_options, 'high_initial_seqno': default_test_options,
} }
@ -147,6 +149,7 @@ def main():
'platforms': [ 'linux', 'mac', 'posix' ] if f.endswith('_posix') else END2END_FIXTURES[f].platforms, 'platforms': [ 'linux', 'mac', 'posix' ] if f.endswith('_posix') else END2END_FIXTURES[f].platforms,
'deps': sec_deps if END2END_FIXTURES[f].secure else unsec_deps, 'deps': sec_deps if END2END_FIXTURES[f].secure else unsec_deps,
'headers': ['test/core/end2end/end2end_tests.h'], 'headers': ['test/core/end2end/end2end_tests.h'],
'vs_proj_dir': 'test',
} }
for f in sorted(END2END_FIXTURES.keys())] + [ for f in sorted(END2END_FIXTURES.keys())] + [
{ {
@ -157,7 +160,8 @@ def main():
'src': ['test/core/end2end/tests/%s.c' % t], 'src': ['test/core/end2end/tests/%s.c' % t],
'headers': ['test/core/end2end/tests/cancel_test_helpers.h', 'headers': ['test/core/end2end/tests/cancel_test_helpers.h',
'test/core/end2end/end2end_tests.h'], 'test/core/end2end/end2end_tests.h'],
'deps': sec_deps if END2END_TESTS[t].secure else unsec_deps 'deps': sec_deps if END2END_TESTS[t].secure else unsec_deps,
'vs_proj_dir': 'test',
} }
for t in sorted(END2END_TESTS.keys())] + [ for t in sorted(END2END_TESTS.keys())] + [
{ {
@ -168,7 +172,8 @@ def main():
"test/core/end2end/data/test_root_cert.c", "test/core/end2end/data/test_root_cert.c",
"test/core/end2end/data/server1_cert.c", "test/core/end2end/data/server1_cert.c",
"test/core/end2end/data/server1_key.c" "test/core/end2end/data/server1_key.c"
] ],
'vs_proj_dir': 'test',
} }
], ],
'targets': [ 'targets': [
@ -184,13 +189,14 @@ def main():
else without(END2END_FIXTURES[f].platforms, 'mac')), else without(END2END_FIXTURES[f].platforms, 'mac')),
'deps': [ 'deps': [
'end2end_fixture_%s' % f, 'end2end_fixture_%s' % f,
'end2end_test_%s' % t] + sec_deps 'end2end_test_%s' % t] + sec_deps,
'vs_proj_dir': 'test',
} }
for f in sorted(END2END_FIXTURES.keys()) for f in sorted(END2END_FIXTURES.keys())
for t in sorted(END2END_TESTS.keys()) for t in sorted(END2END_TESTS.keys())
if compatible(f, t)] + [ if compatible(f, t)] + [
{ {
'name': '%s_%s_unsecure_test' % (f, t), 'name': '%s_%s_nosec_test' % (f, t),
'build': 'test', 'build': 'test',
'language': 'c', 'language': 'c',
'secure': 'no', 'secure': 'no',
@ -202,11 +208,12 @@ def main():
else without(END2END_FIXTURES[f].platforms, 'mac')), else without(END2END_FIXTURES[f].platforms, 'mac')),
'deps': [ 'deps': [
'end2end_fixture_%s' % f, 'end2end_fixture_%s' % f,
'end2end_test_%s' % t] + unsec_deps 'end2end_test_%s' % t] + unsec_deps,
'vs_proj_dir': 'test',
} }
for f in sorted(END2END_FIXTURES.keys()) if not END2END_FIXTURES[f].secure for f in sorted(END2END_FIXTURES.keys()) if not END2END_FIXTURES[f].secure
for t in sorted(END2END_TESTS.keys()) if compatible(f, t) and not END2END_TESTS[t].secure]} for t in sorted(END2END_TESTS.keys()) if compatible(f, t) and not END2END_TESTS[t].secure]}
print simplejson.dumps(json, sort_keys=True, indent=2 * ' ') print yaml.dump(json)
if __name__ == '__main__': if __name__ == '__main__':

@ -33,7 +33,6 @@
#include "test/core/util/reconnect_server.h" #include "test/core/util/reconnect_server.h"
#include <arpa/inet.h>
#include <grpc/grpc.h> #include <grpc/grpc.h>
#include <grpc/support/alloc.h> #include <grpc/support/alloc.h>
#include <grpc/support/host_port.h> #include <grpc/support/host_port.h>
@ -42,6 +41,7 @@
#include <grpc/support/time.h> #include <grpc/support/time.h>
#include <string.h> #include <string.h>
#include "src/core/iomgr/endpoint.h" #include "src/core/iomgr/endpoint.h"
#include "src/core/iomgr/sockaddr.h"
#include "src/core/iomgr/tcp_server.h" #include "src/core/iomgr/tcp_server.h"
#include "test/core/util/port.h" #include "test/core/util/port.h"
@ -116,7 +116,7 @@ void reconnect_server_start(reconnect_server *server, int port) {
addr.sin_family = AF_INET; addr.sin_family = AF_INET;
addr.sin_port = htons(port); addr.sin_port = htons(port);
inet_pton(AF_INET, "0.0.0.0", &addr.sin_addr); memset(&addr.sin_addr, 0, sizeof(addr.sin_addr));
server->tcp_server = grpc_tcp_server_create(); server->tcp_server = grpc_tcp_server_create();
port_added = port_added =

@ -31,8 +31,6 @@
* *
*/ */
#include <sys/signal.h>
#include <cassert> #include <cassert>
#include <chrono> #include <chrono>
#include <memory> #include <memory>

@ -31,7 +31,6 @@
* *
*/ */
#include <unistd.h>
#include <list> #include <list>
#include <thread> #include <thread>
#include <deque> #include <deque>

@ -35,9 +35,6 @@
#include <functional> #include <functional>
#include <memory> #include <memory>
#include <mutex> #include <mutex>
#include <sys/time.h>
#include <sys/resource.h>
#include <sys/signal.h>
#include <thread> #include <thread>
#include <gflags/gflags.h> #include <gflags/gflags.h>

@ -31,8 +31,6 @@
* *
*/ */
#include <sys/signal.h>
#include <unistd.h>
#include <thread> #include <thread>
#include <gflags/gflags.h> #include <gflags/gflags.h>

@ -28,16 +28,16 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# produces cleaner build.json files # produces cleaner build.yaml files
import collections import collections
import json
import os import os
import sys import sys
import yaml
TEST = (os.environ.get('TEST', 'false') == 'true') TEST = (os.environ.get('TEST', 'false') == 'true')
_TOP_LEVEL_KEYS = ['settings', 'filegroups', 'libs', 'targets'] _TOP_LEVEL_KEYS = ['settings', 'filegroups', 'libs', 'targets', 'vspackages']
_VERSION_KEYS = ['major', 'minor', 'micro', 'build'] _VERSION_KEYS = ['major', 'minor', 'micro', 'build']
_ELEM_KEYS = [ _ELEM_KEYS = [
'name', 'name',
@ -50,6 +50,11 @@ _ELEM_KEYS = [
'src', 'src',
'deps'] 'deps']
def repr_ordered_dict(dumper, odict):
return dumper.represent_mapping(u'tag:yaml.org,2002:map', odict.items())
yaml.add_representer(collections.OrderedDict, repr_ordered_dict)
def rebuild_as_ordered_dict(indict, special_keys): def rebuild_as_ordered_dict(indict, special_keys):
outdict = collections.OrderedDict() outdict = collections.OrderedDict()
for key in sorted(indict.keys()): for key in sorted(indict.keys()):
@ -75,7 +80,7 @@ def clean_elem(indict):
for filename in sys.argv[1:]: for filename in sys.argv[1:]:
with open(filename) as f: with open(filename) as f:
js = json.load(f) js = yaml.load(f)
js = rebuild_as_ordered_dict(js, _TOP_LEVEL_KEYS) js = rebuild_as_ordered_dict(js, _TOP_LEVEL_KEYS)
js['settings']['version'] = rebuild_as_ordered_dict( js['settings']['version'] = rebuild_as_ordered_dict(
js['settings']['version'], _VERSION_KEYS) js['settings']['version'], _VERSION_KEYS)
@ -83,7 +88,7 @@ for filename in sys.argv[1:]:
if grp not in js: continue if grp not in js: continue
js[grp] = sorted([clean_elem(x) for x in js[grp]], js[grp] = sorted([clean_elem(x) for x in js[grp]],
key=lambda x: (x.get('language', '_'), x['name'])) key=lambda x: (x.get('language', '_'), x['name']))
output = json.dumps(js, indent = 2) output = yaml.dump(js, indent=2, width=80)
# massage out trailing whitespace # massage out trailing whitespace
lines = [] lines = []
for line in output.splitlines(): for line in output.splitlines():

@ -28,11 +28,11 @@
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
gen_build_json_dirs="test/core/end2end test/core/bad_client" gen_build_yaml_dirs="test/core/end2end test/core/bad_client"
gen_build_files="" gen_build_files=""
for gen_build_json in $gen_build_json_dirs for gen_build_yaml in $gen_build_yaml_dirs
do do
output_file=`mktemp /tmp/genXXXXXX` output_file=`mktemp /tmp/genXXXXXX`
$gen_build_json/gen_build_json.py > $output_file $gen_build_yaml/gen_build_yaml.py > $output_file
gen_build_files="$gen_build_files $output_file" gen_build_files="$gen_build_files $output_file"
done done

@ -40,7 +40,7 @@ cd `dirname $0`/../..
mako_renderer=tools/buildgen/mako_renderer.py mako_renderer=tools/buildgen/mako_renderer.py
if [ "x$TEST" != "x" ] ; then if [ "x$TEST" != "x" ] ; then
tools/buildgen/build-cleaner.py build.json tools/buildgen/build-cleaner.py build.yaml
fi fi
. tools/buildgen/generate_build_additions.sh . tools/buildgen/generate_build_additions.sh
@ -58,8 +58,8 @@ for dir in . ; do
out=${dir}/${file#$dir/templates/} # strip templates dir prefix out=${dir}/${file#$dir/templates/} # strip templates dir prefix
out=${out%.*} # strip template extension out=${out%.*} # strip template extension
echo "generating file: $out" echo "generating file: $out"
json_files="build.json $gen_build_files" yaml_files="build.yaml $gen_build_files"
data=`for i in $json_files ; do echo $i ; done | awk ' { printf "-d %s ", $0 } '` data=`for i in $yaml_files ; do echo $i ; done | awk ' { printf "-d %s ", $0 } '`
if [ "x$TEST" = "xtrue" ] ; then if [ "x$TEST" = "xtrue" ] ; then
actual_out=$out actual_out=$out
out=`mktemp /tmp/gentXXXXXX` out=`mktemp /tmp/gentXXXXXX`

@ -40,11 +40,11 @@ cd `dirname $0`/../..
mako_renderer=tools/buildgen/mako_renderer.py mako_renderer=tools/buildgen/mako_renderer.py
if [ "x$TEST" != "x" ] ; then if [ "x$TEST" != "x" ] ; then
tools/buildgen/build-cleaner.py build.json tools/buildgen/build-cleaner.py build.yaml
fi fi
. tools/buildgen/generate_build_additions.sh . tools/buildgen/generate_build_additions.sh
tools/buildgen/generate_projects.py build.json $gen_build_files tools/buildgen/generate_projects.py build.yaml $gen_build_files
rm $gen_build_files rm $gen_build_files

@ -38,14 +38,15 @@ Just a wrapper around the mako rendering library.
import getopt import getopt
import imp import imp
import os import os
import shutil
import sys import sys
from mako.lookup import TemplateLookup from mako.lookup import TemplateLookup
from mako.runtime import Context from mako.runtime import Context
from mako.template import Template from mako.template import Template
import simplejson
import bunch import bunch
import yaml
# Imports a plugin # Imports a plugin
@ -76,6 +77,7 @@ def main(argv):
got_output = False got_output = False
output_file = sys.stdout output_file = sys.stdout
plugins = [] plugins = []
output_name = None
try: try:
opts, args = getopt.getopt(argv, 'hm:d:o:p:') opts, args = getopt.getopt(argv, 'hm:d:o:p:')
@ -95,7 +97,7 @@ def main(argv):
showhelp() showhelp()
sys.exit(3) sys.exit(3)
got_output = True got_output = True
output_file = open(arg, 'w') output_name = arg
elif opt == '-m': elif opt == '-m':
if module_directory is not None: if module_directory is not None:
out('Got more than one cache directory') out('Got more than one cache directory')
@ -104,7 +106,7 @@ def main(argv):
module_directory = arg module_directory = arg
elif opt == '-d': elif opt == '-d':
dict_file = open(arg, 'r') dict_file = open(arg, 'r')
bunch.merge_json(json_dict, simplejson.loads(dict_file.read())) bunch.merge_json(json_dict, yaml.load(dict_file.read()))
dict_file.close() dict_file.close()
elif opt == '-p': elif opt == '-p':
plugins.append(import_plugin(arg)) plugins.append(import_plugin(arg))
@ -115,14 +117,51 @@ def main(argv):
for k, v in json_dict.items(): for k, v in json_dict.items():
dictionary[k] = bunch.to_bunch(v) dictionary[k] = bunch.to_bunch(v)
ctx = Context(output_file, **dictionary) cleared_dir = False
for arg in args: for arg in args:
got_input = True got_input = True
template = Template(filename=arg, with open(arg) as f:
srcs = list(yaml.load_all(f.read()))
for src in srcs:
if isinstance(src, basestring):
assert len(srcs) == 1
template = Template(src,
filename=arg,
module_directory=module_directory,
lookup=TemplateLookup(directories=['.']))
with open(output_name, 'w') as output_file:
template.render_context(Context(output_file, **dictionary))
else:
# we have optional control data: this template represents
# a directory
if not cleared_dir:
shutil.rmtree(output_name, ignore_errors=True)
cleared_dir = True
items = []
if 'foreach' in src:
for el in dictionary[src['foreach']]:
if 'cond' in src:
args = dict(dictionary)
args['selected'] = el
if not eval(src['cond'], {}, args):
continue
items.append(el)
assert items
else:
items = [None]
for item in items:
args = dict(dictionary)
args['selected'] = item
item_output_name = os.path.join(
output_name, Template(src['output_name']).render(**args))
if not os.path.exists(os.path.dirname(item_output_name)):
os.makedirs(os.path.dirname(item_output_name))
template = Template(src['template'],
filename=arg,
module_directory=module_directory, module_directory=module_directory,
lookup=TemplateLookup(directories=['.'])) lookup=TemplateLookup(directories=['.']))
template.render_context(ctx) with open(item_output_name, 'w') as output_file:
template.render_context(Context(output_file, **args))
if not got_input: if not got_input:
out('Got nothing to do') out('Got nothing to do')

@ -37,7 +37,7 @@ This fills in any optional attributes.
def mako_plugin(dictionary): def mako_plugin(dictionary):
"""The exported plugin code for expand_filegroups. """The exported plugin code for expand_filegroups.
The list of libs in the build.json file can contain "filegroups" tags. The list of libs in the build.yaml file can contain "filegroups" tags.
These refer to the filegroups in the root object. We will expand and These refer to the filegroups in the root object. We will expand and
merge filegroups on the src, headers and public_headers properties. merge filegroups on the src, headers and public_headers properties.

@ -29,7 +29,7 @@
"""Buildgen expand filegroups plugin. """Buildgen expand filegroups plugin.
This takes the list of libs from our json dictionary, This takes the list of libs from our yaml dictionary,
and expands any and all filegroup. and expands any and all filegroup.
""" """
@ -45,7 +45,7 @@ def excluded(filename, exclude_res):
def mako_plugin(dictionary): def mako_plugin(dictionary):
"""The exported plugin code for expand_filegroups. """The exported plugin code for expand_filegroups.
The list of libs in the build.json file can contain "filegroups" tags. The list of libs in the build.yaml file can contain "filegroups" tags.
These refer to the filegroups in the root object. We will expand and These refer to the filegroups in the root object. We will expand and
merge filegroups on the src, headers and public_headers properties. merge filegroups on the src, headers and public_headers properties.

@ -57,9 +57,22 @@ def mako_plugin(dictionary):
projects = [] projects = []
projects.extend(libs) projects.extend(libs)
projects.extend(targets) projects.extend(targets)
if dictionary.get('debug', False):
for target in projects: for target in projects:
if not target.get('vs_project_guid', None) and 'windows' in target.get('platforms', ['windows']): if 'build' in target and target['build'] == 'test':
default_test_dir = 'test'
else:
default_test_dir = '.'
if 'vs_config_type' not in target:
if 'build' in target and target['build'] == 'test':
target['vs_config_type'] = 'Application'
else:
target['vs_config_type'] = 'StaticLibrary'
if 'vs_packages' not in target:
target['vs_packages'] = []
if 'vs_props' not in target:
target['vs_props'] = []
target['vs_proj_dir'] = target.get('vs_proj_dir', default_test_dir)
if target.get('vs_project_guid', None) is None and 'windows' in target.get('platforms', ['windows']):
name = target['name'] name = target['name']
guid = re.sub('(........)(....)(....)(....)(.*)', guid = re.sub('(........)(....)(....)(....)(.*)',
r'{\1-\2-\3-\4-\5}', r'{\1-\2-\3-\4-\5}',
@ -74,5 +87,9 @@ def mako_plugin(dictionary):
project_dict = dict([(p['name'], p) for p in projects]) project_dict = dict([(p['name'], p) for p in projects])
packages = dictionary.get('vspackages', [])
packages_dict = dict([(p['name'], p) for p in packages])
dictionary['vsprojects'] = projects dictionary['vsprojects'] = projects
dictionary['vsproject_dict'] = project_dict dictionary['vsproject_dict'] = project_dict
dictionary['vspackages_dict'] = packages_dict

@ -29,7 +29,7 @@
"""Buildgen .proto files list plugin. """Buildgen .proto files list plugin.
This parses the list of targets from the json build file, and creates This parses the list of targets from the yaml build file, and creates
a list called "protos" that contains all of the proto file names. a list called "protos" that contains all of the proto file names.
""" """

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

@ -1,18 +1 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?> <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <ImportGroup Label="PropertySheets" /> <PropertyGroup Label="UserMacros" /> <PropertyGroup /> <ItemDefinitionGroup> <ClCompile> <AdditionalIncludeDirectories>$(SolutionDir)\..;$(SolutionDir)\..\include;$(SolutionDir)\..\third_party\protobuf\src;$(SolutionDir)\..\third_party\gtest\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <PreprocessorDefinitions>_SCL_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;_UNICODE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions> <WarningLevel>EnableAllWarnings</WarningLevel> </ClCompile> <Link> <AdditionalDependencies>grpc++_test_util.lib;grpc_test_util.lib;gpr_test_util.lib;gtestd.lib;gflags.lib;shlwapi.lib;gpr.lib;grpc.lib;grpc++.lib;%(AdditionalDependencies)</AdditionalDependencies> <AdditionalLibraryDirectories>$(SolutionDir)\..\third_party\gtest\msvc\gtest\Debug;$(SolutionDir)\..\third_party\gflags\lib\Debug;$(SolutionDir)\..\Debug;$(SolutionDir)\..\packages\grpc.dependencies.openssl.1.0.2.3\build\native\lib\$(PlatformToolset)\$(Platform)\$(Configuration)\static;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> </Link> </ItemDefinitionGroup> <ItemGroup /> </Project>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ImportGroup Label="PropertySheets" />
<PropertyGroup Label="UserMacros" />
<PropertyGroup />
<ItemDefinitionGroup>
<ClCompile>
<AdditionalIncludeDirectories>$(ProjectDir)\..\..;$(ProjectDir)\..\..\include;$(ProjectDir)\..\..\third_party\protobuf\src;$(ProjectDir)\..\..\third_party\gtest\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_SCL_SECURE_NO_WARNINGS;_CRT_SECURE_NO_WARNINGS;_UNICODE;UNICODE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<WarningLevel>EnableAllWarnings</WarningLevel>
</ClCompile>
<Link>
<AdditionalDependencies>grpc++_test_util.lib;grpc_test_util.lib;gpr_test_util.lib;gtestd.lib;gflags.lib;shlwapi.lib;gpr.lib;grpc.lib;grpc++.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(ProjectDir)\..\..\third_party\gtest\msvc\gtest\Debug;$(ProjectDir)\..\..\third_party\gflags\lib\Debug;$(ProjectDir)\..\Debug;$(ProjectDir)\..\packages\grpc.dependencies.openssl.1.0.2.2\build\native\lib\$(PlatformToolset)\$(Platform)\$(Configuration)\static;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
</Link>
</ItemDefinitionGroup>
<ItemGroup />
</Project>

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save