Skip to content

Commit

Permalink
cleanup: move google/cloud/examples/ to examples/ (#9304)
Browse files Browse the repository at this point in the history
We decided to separate the libraries from the examples that use more
than one library.
  • Loading branch information
coryan authored Jun 18, 2022
1 parent 40b66c4 commit b39b353
Show file tree
Hide file tree
Showing 19 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -362,7 +362,7 @@ if (GOOGLE_CLOUD_CPP_ENABLE_EXAMPLES
AND iam IN_LIST GOOGLE_CLOUD_CPP_ENABLE
AND spanner IN_LIST GOOGLE_CLOUD_CPP_ENABLE
AND storage IN_LIST GOOGLE_CLOUD_CPP_ENABLE)
add_subdirectory(google/cloud/examples)
add_subdirectory(examples)
endif ()

# Obsolete / retired flags and options. Removing them just cleans up a bit of
Expand Down
4 changes: 2 additions & 2 deletions ci/cloudbuild/builds/coverage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,15 @@ export CXX=g++
# Explicitly list the patterns that match hand-crafted code. Excluding the
# generated code results in a longer list and more maintenance.
instrumented_patterns=(
"/examples[/:]"
"/generator[/:]"
"/google/cloud:"
"/google/cloud/testing_util:"
"/google/cloud/bigtable[/:]"
"/google/cloud/examples[/:]"
"/google/cloud/pubsub[/:]"
"/google/cloud/pubsublite[/:]"
"/google/cloud/spanner[/:]"
"/google/cloud/storage[/:]"
"/generator[/:]"
)
instrumentation_filter="$(printf ",%s" "${instrumented_patterns[@]}")"
instrumentation_filter="${instrumentation_filter:1}"
Expand Down
2 changes: 1 addition & 1 deletion ci/cloudbuild/builds/integration-production.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ mapfile -t args < <(bazel::common_args)
bazel test "${args[@]}" --test_tag_filters=-integration-test ...

excluded_rules=(
"-//examples:grpc_credential_types"
"-//google/cloud/bigtable/examples:bigtable_grpc_credentials"
"-//google/cloud/storage/examples:storage_service_account_samples"
"-//google/cloud/storage/tests:service_account_integration_test"
"-//google/cloud/examples:grpc_credential_types"
"-//google/cloud/storage/tests:grpc_integration_test"
)

Expand Down
2 changes: 1 addition & 1 deletion ci/cloudbuild/builds/lib/integration.sh
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ function integration::bazel_with_emulators() {
"--test_env=GOOGLE_CLOUD_CPP_TEST_HELLO_WORLD_HTTP_URL=${hello_world_http}" \
"--test_env=GOOGLE_CLOUD_CPP_TEST_HELLO_WORLD_GRPC_URL=${hello_world_grpc}" \
"--test_env=GOOGLE_CLOUD_CPP_TEST_HELLO_WORLD_SERVICE_ACCOUNT=${GOOGLE_CLOUD_CPP_TEST_HELLO_WORLD_SERVICE_ACCOUNT}" \
//google/cloud/examples/...
//examples/...

local bazel_output_base
if echo "${args[@]}" | grep -w -q -- "--config=msan"; then
Expand Down
2 changes: 1 addition & 1 deletion cmake/GoogleCloudCppCommon.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ elseif (GOOGLE_CLOUD_CPP_GENERATE_DOXYGEN)
# found here
"${PROJECT_BINARY_DIR}/external/googleapis"
# Proto files generated by the examples are found here
"${PROJECT_BINARY_DIR}/google/cloud/examples"
"${PROJECT_BINARY_DIR}/examples"
# Any additional includes that the library needs
${GOOGLE_CLOUD_CPP_DOXYGEN_EXTRA_INCLUDES})
set(DOXYGEN_GENERATE_LATEX NO)
Expand Down
2 changes: 1 addition & 1 deletion google/cloud/examples/BUILD.bazel → examples/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ cc_test(
timeout = "long",
srcs = ["grpc_credential_types.cc"],
copts = [
"-I$(GENDIR)/google/cloud/examples",
"-I$(GENDIR)/examples",
],
tags = [
"integration-test",
Expand Down
File renamed without changes.
6 changes: 3 additions & 3 deletions google/cloud/examples/README.md → examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ We use Docker to create an image with our "Greeter" service:

```shell
docker build -t "gcr.io/${GOOGLE_CLOUD_PROJECT}/hello-world-grpc:latest" \
-f google/cloud/examples/hello_world_grpc/Dockerfile \
google/cloud/examples/hello_world_grpc
-f examples/hello_world_grpc/Dockerfile \
examples/hello_world_grpc
```

### Push the Docker image to GCR
Expand Down Expand Up @@ -95,7 +95,7 @@ and use it from Cloud Run.
pack build --builder gcr.io/buildpacks/builder:latest \
--env "GOOGLE_FUNCTION_SIGNATURE_TYPE=http" \
--env "GOOGLE_FUNCTION_TARGET=HelloWorldHttp" \
--path "google/cloud/examples/hello_world_http/" \
--path "examples/hello_world_http/" \
"gcr.io/${GOOGLE_CLOUD_PROJECT}/hello-world-http"
```

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit b39b353

Please sign in to comment.