Skip to content

Commit 30acc3c

Browse files
authored
impl(generator): generate ud samples (#15657)
1 parent a1c2b09 commit 30acc3c

File tree

505 files changed

+12210
-44
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

505 files changed

+12210
-44
lines changed

bazel/gapic.bzl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ def cc_gapic_library(name, service_dirs = [], googleapis_deps = [], additional_d
8282
tags = ["integration-test"],
8383
deps = [
8484
"//:" + name,
85+
"//:universe_domain",
8586
"//google/cloud/testing_util:google_cloud_cpp_testing_private",
8687
],
8788
) for sample in native.glob([d + "samples/*_samples.cc" for d in service_dirs])]
Binary file not shown.

ci/cloudbuild/builds/check-api.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@ if [ "${GOOGLE_CLOUD_CPP_CHECK_API:-}" ]; then
3131
readonly ENABLED_FEATURES="${GOOGLE_CLOUD_CPP_CHECK_API}"
3232
IFS=',' read -ra library_list <<<"${GOOGLE_CLOUD_CPP_CHECK_API}"
3333
else
34-
readonly ENABLED_FEATURES="__ga_libraries__,opentelemetry"
34+
readonly ENABLED_FEATURES="__ga_libraries__,opentelemetry,universe_domain"
3535
mapfile -t library_list < <(cmake -P cmake/print-ga-libraries.cmake 2>&1)
3636
# These libraries are not "features", but they are part of the public API
37-
library_list+=("common" "grpc_utils")
37+
library_list+=("common" "grpc_utils" "universe_domain")
3838
# This is a GA library, not included in __ga_libraries__
3939
library_list+=("opentelemetry")
4040
fi
@@ -67,7 +67,7 @@ function check_abi() {
6767

6868
local shortlib="${library#google_cloud_cpp_}"
6969
local public_headers="${prefix}/include/google/cloud/${shortlib}"
70-
if [[ "${shortlib}" == "common" || "${shortlib}" == "grpc_utils" || "${shortlib}" == "oauth2" ]]; then
70+
if [[ "${shortlib}" == "common" || "${shortlib}" == "grpc_utils" || "${shortlib}" == "universe_domain" || "${shortlib}" == "oauth2" ]]; then
7171
# These are special and share their header location.
7272
public_headers="${prefix}/include/google/cloud"
7373
elif [[ "${shortlib}" == "storage_grpc" ]]; then

ci/cloudbuild/builds/cmake-install.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,7 @@ expected_dirs+=(
164164
./lib64/cmake/google_cloud_cpp_rest_protobuf_internal
165165
./lib64/cmake/google_cloud_cpp_storage_grpc
166166
./lib64/cmake/google_cloud_cpp_storage_grpc_mocks
167+
./lib64/cmake/google_cloud_cpp_universe_domain
167168
./lib64/pkgconfig
168169
)
169170

ci/cloudbuild/builds/lib/features.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ function features::always_build() {
4242
opentelemetry
4343
# Enable storage_grpc in most builds.
4444
storage_grpc
45+
# Samples require universe domain support.
46+
universe_domain
4547
)
4648
printf "%s\n" "${list[@]}" | sort -u
4749
}
@@ -63,6 +65,7 @@ function features::_internal_extra() {
6365
local list=(
6466
experimental-bigquery_rest
6567
opentelemetry
68+
universe_domain
6669
)
6770
printf "%s\n" "${list[@]}"
6871
}

ci/cloudbuild/builds/publish-docs.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ elif [[ "${LIBRARIES}" == "all_bar_compute" ]]; then
3535
ENABLED_FEATURES="${ENABLED_FEATURES},-compute"
3636
else
3737
mapfile -t FEATURE_LIST < <(printf '%s' "${LIBRARIES}")
38-
ENABLED_FEATURES="compute"
38+
ENABLED_FEATURES="compute,universe_domain"
3939
fi
4040

4141
doc_args=(

ci/lib/shard.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,13 @@ readonly DEFAULT_SHARD=(
3636
bigtable
3737
spanner
3838
logging
39+
universe_domain
3940
)
4041

4142
readonly BIGQUERY_SHARD=(
4243
bigquery
4344
experimental-bigquery_rest
45+
universe_domain
4446
)
4547

4648
readonly PUBSUB_SHARD=(
@@ -51,6 +53,7 @@ readonly PUBSUB_SHARD=(
5153
# IAM is included because it has hand-crafted tests and/or examples and is
5254
# required by Pub/Sub
5355
iam
56+
universe_domain
5457
)
5558

5659
readonly STORAGE_SHARD=(
@@ -66,6 +69,7 @@ readonly STORAGE_SHARD=(
6669
readonly TOOLS_SHARD=(
6770
generator
6871
docfx
72+
universe_domain
6973
)
7074

7175
function shard::cmake_features() {

cmake/GoogleCloudCppCommon.cmake

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -132,12 +132,16 @@ function (google_cloud_cpp_add_samples_relative library path)
132132
google_cloud_cpp_add_executable(target "${library}" "${source}")
133133
if (TARGET google-cloud-cpp::${library})
134134
target_link_libraries(
135-
"${target}" PRIVATE google-cloud-cpp::${library}
136-
google_cloud_cpp_testing)
135+
"${target}"
136+
PRIVATE google-cloud-cpp::${library}
137+
google-cloud-cpp::universe_domain
138+
google_cloud_cpp_testing)
137139
elseif (TARGET google-cloud-cpp::experimental-${library})
138140
target_link_libraries(
139-
"${target}" PRIVATE google-cloud-cpp::experimental-${library}
140-
google_cloud_cpp_testing)
141+
"${target}"
142+
PRIVATE google-cloud-cpp::experimental-${library}
143+
google-cloud-cpp::universe_domain
144+
google_cloud_cpp_testing)
141145
endif ()
142146
google_cloud_cpp_add_common_options("${target}")
143147
add_test(NAME "${target}" COMMAND "${target}")

generator/integration_tests/BUILD.bazel

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,7 @@ filegroup(
145145
tags = ["integration-test"],
146146
deps = [
147147
":google_cloud_cpp_generator_golden",
148+
"//:universe_domain",
148149
"//google/cloud/testing_util:google_cloud_cpp_testing_private",
149150
],
150151
) for sample in glob(["golden/v1/samples/*.cc"])]

generator/integration_tests/CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,9 @@ foreach (fname IN LISTS samples_cc)
131131
target_link_libraries(
132132
${target}
133133
PRIVATE google_cloud_cpp_generator_golden_testing
134-
google_cloud_cpp_generator_golden google_cloud_cpp_testing
134+
google_cloud_cpp_generator_golden
135+
google_cloud_cpp_universe_domain
136+
google_cloud_cpp_testing
135137
google_cloud_cpp_testing_grpc)
136138
google_cloud_cpp_add_common_options(${target})
137139
add_test(NAME ${target} COMMAND ${target})

0 commit comments

Comments
 (0)