regen-gapic: export SetGoogleClientInfo in places that need it

This is a no-op with the monolithic generator but microgenerator will need this to work.

The (S|s)etGoogleClientInfo function is meant to be used only by manual
cloud clients to add version information. If the API has no manual
clients, exporting the function adds unnecessary clutter and confusion.

In the monolithic generator, we have the "domain_layer_location" GAPIC config (the
name is rather cryptic and I cannot recall its origin) that points to
the manual client. The generator has the logic to export the function if
and only if the config is not empty.

Now that microgenerators read only the proto annotations and not GAPIC
config, we don't have access to domain_layer_location anymore, but we
still don't want to unconditionally export this function. Thus, this CL
adds a small tool to post-process.

Change-Id: I9e275c594d1e0ef86a9c7d01eb75dd36a6fe8a4d
Reviewed-on: https://code-review.googlesource.com/c/36770
Reviewed-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jean de Klerk <deklerk@google.com>
diff --git a/regen-gapic.sh b/regen-gapic.sh
index ba06c0f..438d0e8 100755
--- a/regen-gapic.sh
+++ b/regen-gapic.sh
@@ -84,11 +84,20 @@
     dir=${modified%/*.*}
     find . -path "*/$dir/doc.go" -exec sed -i.backup -e "s/^const versionClient.*/const versionClient = \"$ver\"/" '{}' +
   done
-  find $GOPATH/src/cloud.google.com/go/ -name '*.backup' -delete
 popd
 
-#go list cloud.google.com/go/... | grep apiv | xargs go test
 
-#go test -short cloud.google.com/go/...
+HASMANUAL=(
+errorreporting/apiv1beta1
+firestore/apiv1beta1
+logging/apiv2
+longrunning/autogen
+pubsub/apiv1
+spanner/apiv1
+trace/apiv1
+)
+for dir in "${HASMANUAL[@]}"; do
+	find "$GOPATH/src/cloud.google.com/go/$dir" -name '*.go' -exec sed -i.backup -e 's/setGoogleClientInfo/SetGoogleClientInfo/g' '{}' '+'
+done
 
-#echo "googleapis version: $(git rev-parse HEAD)"
+find $GOPATH/src/cloud.google.com/go/ -name '*.backup' -delete