Skip to content

Commit

Permalink
refactor: last of the cookie-cutter versioned clients (#10940)
Browse files Browse the repository at this point in the history
  • Loading branch information
dbolduc committed Feb 23, 2023
1 parent 8b8ee14 commit 9f868bf
Show file tree
Hide file tree
Showing 264 changed files with 7,389 additions and 5,747 deletions.
Binary file modified ci/abi-dumps/google_cloud_cpp_osconfig.expected.abi.dump.gz
Binary file not shown.
Binary file modified ci/abi-dumps/google_cloud_cpp_translate.expected.abi.dump.gz
Binary file not shown.
Binary file modified ci/abi-dumps/google_cloud_cpp_webrisk.expected.abi.dump.gz
Binary file not shown.
Binary file not shown.
Binary file modified ci/abi-dumps/google_cloud_cpp_workflows.expected.abi.dump.gz
Binary file not shown.
19 changes: 14 additions & 5 deletions ci/etc/expected_install_directories
Original file line number Diff line number Diff line change
Expand Up @@ -365,9 +365,12 @@
./include/google/cloud/osconfig
./include/google/cloud/osconfig/agentendpoint
./include/google/cloud/osconfig/agentendpoint/v1
./include/google/cloud/osconfig/internal
./include/google/cloud/osconfig/agentendpoint/v1/internal
./include/google/cloud/osconfig/agentendpoint/v1/mocks
./include/google/cloud/osconfig/mocks
./include/google/cloud/osconfig/v1
./include/google/cloud/osconfig/v1/internal
./include/google/cloud/osconfig/v1/mocks
./include/google/cloud/oslogin
./include/google/cloud/oslogin/mocks
./include/google/cloud/oslogin/v1
Expand Down Expand Up @@ -515,9 +518,10 @@
./include/google/cloud/trace/v2/internal
./include/google/cloud/trace/v2/mocks
./include/google/cloud/translate
./include/google/cloud/translate/internal
./include/google/cloud/translate/mocks
./include/google/cloud/translate/v3
./include/google/cloud/translate/v3/internal
./include/google/cloud/translate/v3/mocks
./include/google/cloud/video
./include/google/cloud/video/livestream
./include/google/cloud/video/livestream/v1
Expand Down Expand Up @@ -557,19 +561,24 @@
./include/google/cloud/vpcaccess/v1/internal
./include/google/cloud/vpcaccess/v1/mocks
./include/google/cloud/webrisk
./include/google/cloud/webrisk/internal
./include/google/cloud/webrisk/mocks
./include/google/cloud/webrisk/v1
./include/google/cloud/webrisk/v1/internal
./include/google/cloud/webrisk/v1/mocks
./include/google/cloud/websecurityscanner
./include/google/cloud/websecurityscanner/internal
./include/google/cloud/websecurityscanner/mocks
./include/google/cloud/websecurityscanner/v1
./include/google/cloud/websecurityscanner/v1/internal
./include/google/cloud/websecurityscanner/v1/mocks
./include/google/cloud/workflows
./include/google/cloud/workflows/executions
./include/google/cloud/workflows/executions/v1
./include/google/cloud/workflows/internal
./include/google/cloud/workflows/executions/v1/internal
./include/google/cloud/workflows/executions/v1/mocks
./include/google/cloud/workflows/mocks
./include/google/cloud/workflows/v1
./include/google/cloud/workflows/v1/internal
./include/google/cloud/workflows/v1/mocks
./include/google/container
./include/google/container/v1
./include/google/devtools
Expand Down
21 changes: 14 additions & 7 deletions generator/generator_config.textproto
Original file line number Diff line number Diff line change
Expand Up @@ -1247,14 +1247,16 @@ service {
# OS Config
service {
service_proto_path: "google/cloud/osconfig/v1/osconfig_service.proto"
product_path: "google/cloud/osconfig"
product_path: "google/cloud/osconfig/v1"
forwarding_product_path: "google/cloud/osconfig"
initial_copyright_year: "2022"
retryable_status_codes: ["kUnavailable"]
}

service {
service_proto_path: "google/cloud/osconfig/agentendpoint/v1/agentendpoint.proto"
product_path: "google/cloud/osconfig"
product_path: "google/cloud/osconfig/agentendpoint/v1"
forwarding_product_path: "google/cloud/osconfig"
initial_copyright_year: "2022"
retryable_status_codes: ["kUnavailable"]
}
Expand Down Expand Up @@ -1715,7 +1717,8 @@ service {
# Translate
service {
service_proto_path: "google/cloud/translate/v3/translation_service.proto"
product_path: "google/cloud/translate"
product_path: "google/cloud/translate/v3"
forwarding_product_path: "google/cloud/translate"
initial_copyright_year: "2022"
retryable_status_codes: ["kUnavailable"]
}
Expand Down Expand Up @@ -1800,30 +1803,34 @@ service {
# Web Risk
service {
service_proto_path: "google/cloud/webrisk/v1/webrisk.proto"
product_path: "google/cloud/webrisk"
product_path: "google/cloud/webrisk/v1"
forwarding_product_path: "google/cloud/webrisk"
initial_copyright_year: "2022"
retryable_status_codes: ["kUnavailable"]
}

# Web Security Scanner
service {
service_proto_path: "google/cloud/websecurityscanner/v1/web_security_scanner.proto"
product_path: "google/cloud/websecurityscanner"
product_path: "google/cloud/websecurityscanner/v1"
forwarding_product_path: "google/cloud/websecurityscanner"
initial_copyright_year: "2022"
retryable_status_codes: ["kUnavailable"]
}

# Workflows
service {
service_proto_path: "google/cloud/workflows/v1/workflows.proto"
product_path: "google/cloud/workflows"
product_path: "google/cloud/workflows/v1"
forwarding_product_path: "google/cloud/workflows"
initial_copyright_year: "2022"
retryable_status_codes: ["kUnavailable"]
}

service {
service_proto_path: "google/cloud/workflows/executions/v1/executions.proto"
product_path: "google/cloud/workflows"
product_path: "google/cloud/workflows/executions/v1"
forwarding_product_path: "google/cloud/workflows"
initial_copyright_year: "2022"
retryable_status_codes: ["kUnavailable"]
}
30 changes: 21 additions & 9 deletions google/cloud/osconfig/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -16,25 +16,27 @@ package(default_visibility = ["//visibility:private"])

licenses(["notice"]) # Apache 2.0

service_dirs = [
"",
"agentendpoint/v1/",
"v1/",
]

src_dirs = service_dirs + [d + "internal/" for d in service_dirs]

filegroup(
name = "srcs",
srcs = glob([
"*.cc",
"internal/*.cc",
]),
srcs = glob([d + "*.cc" for d in src_dirs]),
)

filegroup(
name = "hdrs",
srcs = glob([
"*.h",
"internal/*.h",
]),
srcs = glob([d + "*.h" for d in src_dirs]),
)

filegroup(
name = "mocks",
srcs = glob(["mocks/*.h"]),
srcs = glob([d + "mocks/*.h" for d in service_dirs]),
)

cc_library(
Expand All @@ -59,3 +61,13 @@ cc_library(
"@com_google_googletest//:gtest",
],
)

[cc_test(
name = sample.replace("/", "_").replace(".cc", ""),
srcs = [sample],
tags = ["integration-test"],
deps = [
"//:osconfig",
"//google/cloud/testing_util:google_cloud_cpp_testing_private",
],
) for sample in glob([d + "samples/*.cc" for d in service_dirs])]
31 changes: 25 additions & 6 deletions google/cloud/osconfig/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,22 @@ include(GoogleapisConfig)
set(DOXYGEN_PROJECT_NAME "OS Config API C++ Client")
set(DOXYGEN_PROJECT_BRIEF "A C++ Client Library for the OS Config API")
set(DOXYGEN_PROJECT_NUMBER "${PROJECT_VERSION}")
set(DOXYGEN_EXCLUDE_SYMBOLS "internal" "osconfig_internal" "osconfig_testing"
"examples")
set(DOXYGEN_EXAMPLE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/samples
${CMAKE_CURRENT_SOURCE_DIR}/quickstart)
set(DOXYGEN_EXCLUDE_SYMBOLS "internal")
set(DOXYGEN_EXAMPLE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/quickstart")

unset(mocks_globs)
unset(source_globs)
set(service_dirs "" "agentendpoint/v1/" "v1/")
foreach (dir IN LISTS service_dirs)
string(REPLACE "/" "_" ns "${dir}")
list(APPEND source_globs "${dir}*.h" "${dir}*.cc" "${dir}internal/*")
list(APPEND mocks_globs "${dir}mocks/*.h")
list(APPEND DOXYGEN_EXCLUDE_SYMBOLS "osconfig_${ns}internal")
if (NOT dir STREQUAL "")
list(APPEND DOXYGEN_EXAMPLE_PATH
"${CMAKE_CURRENT_SOURCE_DIR}/${dir}samples")
endif ()
endforeach ()

include(GoogleCloudCppDoxygen)
google_cloud_cpp_doxygen_targets("osconfig" DEPENDS cloud-docs
Expand All @@ -47,7 +59,7 @@ target_link_libraries(google_cloud_cpp_osconfig_protos PUBLIC ${proto_deps})
file(
GLOB source_files
RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}"
"*.h" "*.cc" "internal/*.h" "internal/*.cc")
${source_globs})
list(SORT source_files)
add_library(google_cloud_cpp_osconfig ${source_files})
target_include_directories(
Expand Down Expand Up @@ -77,7 +89,7 @@ add_library(google-cloud-cpp::osconfig ALIAS google_cloud_cpp_osconfig)
file(
GLOB relative_mock_files
RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}"
"mocks/*.h")
${mocks_globs})
list(SORT relative_mock_files)
set(mock_files)
foreach (file IN LISTS relative_mock_files)
Expand Down Expand Up @@ -174,3 +186,10 @@ install(
COMPONENT google_cloud_cpp_development)

external_googleapis_install_pc("google_cloud_cpp_osconfig_protos")

# google-cloud-cpp::osconfig must be defined before we can add the samples.
foreach (dir IN LISTS service_dirs)
if (BUILD_TESTING AND GOOGLE_CLOUD_CPP_ENABLE_CXX_EXCEPTIONS)
google_cloud_cpp_add_samples_relative("osconfig" "${dir}samples/")
endif ()
endforeach ()
Loading

0 comments on commit 9f868bf

Please sign in to comment.