#!/usr/bin/make -f

#export DH_GOLANG_GO_GENERATE := 1

export DH_GOLANG_EXCLUDES := \
  benchmark \
  credentials/tls/certprovider/meshca/internal/meshca_experimental \
  examples \
  interop/alts \
  interop \
  profiling \
  security/advancedtls \
  security/authorization \
  stress \
  test/tools \
  xds

export DH_GOLANG_INSTALL_EXTRA = regenerate.sh

%:
	dh $@ --buildsystem=golang --with=golang --builddirectory=_build

#override_dh_auto_configure:
#	dh_auto_configure
### Build integrity: remove generated .pb.go files whenever possible:
#	-find _build \
#            -not -path '*/binarylog/grpc_binarylog_v1/*' \
#            -not -path '*/reflection/*' \
#            -type f -name '*.pb.go' -delete -printf 'removed %p\n'

override_dh_auto_test:
	DH_GOLANG_EXCLUDES="$(DH_GOLANG_EXCLUDES) internal/resolver/dns internal/proto/grpc_service_config" \
	dh_auto_test -- -short
