Makefile (19315B)
1 # Lint rules to ignore 2 LINTIGNORESINGLEFIGHT='internal/sync/singleflight/singleflight.go:.+error should be the last type' 3 LINT_IGNORE_S3MANAGER_INPUT='feature/s3/manager/upload.go:.+struct field SSEKMSKeyId should be SSEKMSKeyID' 4 5 UNIT_TEST_TAGS= 6 BUILD_TAGS=-tags "example,codegen,integration,ec2env,perftest" 7 8 SMITHY_GO_SRC ?= $(shell pwd)/../smithy-go 9 10 SDK_MIN_GO_VERSION ?= 1.15 11 12 EACHMODULE_FAILFAST ?= true 13 EACHMODULE_FAILFAST_FLAG=-fail-fast=${EACHMODULE_FAILFAST} 14 15 EACHMODULE_CONCURRENCY ?= 1 16 EACHMODULE_CONCURRENCY_FLAG=-c ${EACHMODULE_CONCURRENCY} 17 18 EACHMODULE_SKIP ?= 19 EACHMODULE_SKIP_FLAG=-skip="${EACHMODULE_SKIP}" 20 21 EACHMODULE_FLAGS=${EACHMODULE_CONCURRENCY_FLAG} ${EACHMODULE_FAILFAST_FLAG} ${EACHMODULE_SKIP_FLAG} 22 23 # SDK's Core and client packages that are compatible with Go 1.9+. 24 SDK_CORE_PKGS=./aws/... ./internal/... 25 SDK_CLIENT_PKGS=./service/... 26 SDK_COMPA_PKGS=${SDK_CORE_PKGS} ${SDK_CLIENT_PKGS} 27 28 # SDK additional packages that are used for development of the SDK. 29 SDK_EXAMPLES_PKGS= 30 SDK_ALL_PKGS=${SDK_COMPA_PKGS} ${SDK_EXAMPLES_PKGS} 31 32 RUN_NONE=-run NONE 33 RUN_INTEG=-run '^TestInteg_' 34 35 CODEGEN_RESOURCES_PATH=$(shell pwd)/codegen/smithy-aws-go-codegen/src/main/resources/software/amazon/smithy/aws/go/codegen 36 CODEGEN_API_MODELS_PATH=$(shell pwd)/codegen/sdk-codegen/aws-models 37 ENDPOINTS_JSON=${CODEGEN_RESOURCES_PATH}/endpoints.json 38 ENDPOINT_PREFIX_JSON=${CODEGEN_RESOURCES_PATH}/endpoint-prefix.json 39 40 LICENSE_FILE=$(shell pwd)/LICENSE.txt 41 42 SMITHY_GO_VERSION ?= 43 PRE_RELEASE_VERSION ?= 44 RELEASE_MANIFEST_FILE ?= 45 RELEASE_CHGLOG_DESC_FILE ?= 46 47 REPOTOOLS_VERSION ?= latest 48 REPOTOOLS_MODULE = github.com/awslabs/aws-go-multi-module-repository-tools 49 REPOTOOLS_CMD_ANNOTATE_STABLE_GEN = ${REPOTOOLS_MODULE}/cmd/annotatestablegen@${REPOTOOLS_VERSION} 50 REPOTOOLS_CMD_MAKE_RELATIVE = ${REPOTOOLS_MODULE}/cmd/makerelative@${REPOTOOLS_VERSION} 51 REPOTOOLS_CMD_CALCULATE_RELEASE = ${REPOTOOLS_MODULE}/cmd/calculaterelease@${REPOTOOLS_VERSION} 52 REPOTOOLS_CMD_UPDATE_REQUIRES = ${REPOTOOLS_MODULE}/cmd/updaterequires@${REPOTOOLS_VERSION} 53 REPOTOOLS_CMD_UPDATE_MODULE_METADATA = ${REPOTOOLS_MODULE}/cmd/updatemodulemeta@${REPOTOOLS_VERSION} 54 REPOTOOLS_CMD_GENERATE_CHANGELOG = ${REPOTOOLS_MODULE}/cmd/generatechangelog@${REPOTOOLS_VERSION} 55 REPOTOOLS_CMD_CHANGELOG = ${REPOTOOLS_MODULE}/cmd/changelog@${REPOTOOLS_VERSION} 56 REPOTOOLS_CMD_TAG_RELEASE = ${REPOTOOLS_MODULE}/cmd/tagrelease@${REPOTOOLS_VERSION} 57 REPOTOOLS_CMD_EDIT_MODULE_DEPENDENCY = ${REPOTOOLS_MODULE}/cmd/editmoduledependency@${REPOTOOLS_VERSION} 58 59 REPOTOOLS_CALCULATE_RELEASE_VERBOSE ?= false 60 REPOTOOLS_CALCULATE_RELEASE_VERBOSE_FLAG=-v=${REPOTOOLS_CALCULATE_RELEASE_VERBOSE} 61 62 REPOTOOLS_CALCULATE_RELEASE_ADDITIONAL_ARGS ?= 63 64 ifneq ($(PRE_RELEASE_VERSION),) 65 REPOTOOLS_CALCULATE_RELEASE_ADDITIONAL_ARGS += -preview=${PRE_RELEASE_VERSION} 66 endif 67 68 .PHONY: all 69 all: generate unit 70 71 ################### 72 # Code Generation # 73 ################### 74 .PHONY: generate smithy-generate smithy-build smithy-build-% smithy-clean smithy-go-publish-local format \ 75 gen-config-asserts gen-repo-mod-replace gen-mod-replace-smithy gen-mod-dropreplace-smithy-% gen-aws-ptrs tidy-modules-% \ 76 add-module-license-files sync-models sync-endpoints-model sync-endpoints.json clone-v1-models gen-internal-codegen \ 77 sync-api-models copy-attributevalue-feature min-go-version-% update-requires smithy-annotate-stable \ 78 update-module-metadata download-modules-% 79 80 generate: smithy-generate update-requires gen-repo-mod-replace update-module-metadata smithy-annotate-stable \ 81 gen-config-asserts gen-internal-codegen copy-attributevalue-feature gen-mod-dropreplace-smithy-. min-go-version-. \ 82 tidy-modules-. add-module-license-files gen-aws-ptrs format 83 84 smithy-generate: 85 cd codegen && ./gradlew clean build -Plog-tests && ./gradlew clean 86 87 smithy-build: 88 cd codegen && ./gradlew clean build -Plog-tests 89 90 smithy-build-%: 91 @# smithy-build- command that uses the pattern to define build filter that 92 @# the smithy API model service id starts with. Strips off the 93 @# "smithy-build-". 94 @# 95 @# e.g. smithy-build-com.amazonaws.rds 96 @# e.g. smithy-build-com.amazonaws.rds#AmazonRDSv19 97 cd codegen && \ 98 SMITHY_GO_BUILD_API="$(subst smithy-build-,,$@)" ./gradlew clean build -Plog-tests 99 100 smithy-annotate-stable: 101 go run ${REPOTOOLS_CMD_ANNOTATE_STABLE_GEN} 102 103 smithy-clean: 104 cd codegen && ./gradlew clean 105 106 smithy-go-publish-local: 107 rm -rf /tmp/smithy-go-local 108 git clone https://github.com/aws/smithy-go /tmp/smithy-go-local 109 make -C /tmp/smithy-go-local smithy-clean smithy-publish-local 110 111 format: 112 gofmt -w -s . 113 114 gen-config-asserts: 115 @echo "Generating SDK config package implementor assertions" 116 cd config \ 117 && go mod tidy \ 118 && go generate 119 120 gen-internal-codegen: 121 @echo "Generating internal/codegen" 122 cd internal/codegen \ 123 && go generate 124 125 gen-repo-mod-replace: 126 @echo "Generating go.mod replace for repo modules" 127 go run ${REPOTOOLS_CMD_MAKE_RELATIVE} 128 129 gen-mod-replace-smithy-%: 130 @# gen-mod-replace-smithy- command that uses the pattern to define build filter that 131 @# for modules to add replace to. Strips off the "gen-mod-replace-smithy-". 132 @# 133 @# SMITHY_GO_SRC environment variable is the path to add replace to 134 @# 135 @# e.g. gen-mod-replace-smithy-service_ssooidc 136 cd ./internal/repotools/cmd/eachmodule \ 137 && go run . -p $(subst _,/,$(subst gen-mod-replace-smithy-,,$@)) ${EACHMODULE_FLAGS} \ 138 "go mod edit -replace github.com/aws/smithy-go=${SMITHY_GO_SRC}" 139 140 gen-mod-dropreplace-smithy-%: 141 @# gen-mod-dropreplace-smithy- command that uses the pattern to define build filter that 142 @# for modules to add replace to. Strips off the "gen-mod-dropreplace-smithy-". 143 @# 144 @# e.g. gen-mod-dropreplace-smithy-service_ssooidc 145 cd ./internal/repotools/cmd/eachmodule \ 146 && go run . -p $(subst _,/,$(subst gen-mod-dropreplace-smithy-,,$@)) ${EACHMODULE_FLAGS} \ 147 "go mod edit -dropreplace github.com/aws/smithy-go" 148 149 gen-aws-ptrs: 150 cd aws && go generate 151 152 tidy-modules-%: 153 @# tidy command that uses the pattern to define the root path that the 154 @# module testing will start from. Strips off the "tidy-modules-" and 155 @# replaces all "_" with "/". 156 @# 157 @# e.g. tidy-modules-internal_protocoltest 158 cd ./internal/repotools/cmd/eachmodule \ 159 && go run . -p $(subst _,/,$(subst tidy-modules-,,$@)) ${EACHMODULE_FLAGS} \ 160 "go mod tidy" 161 162 download-modules-%: 163 @# download command that uses the pattern to define the root path that the 164 @# module testing will start from. Strips off the "download-modules-" and 165 @# replaces all "_" with "/". 166 @# 167 @# e.g. download-modules-internal_protocoltest 168 cd ./internal/repotools/cmd/eachmodule \ 169 && go run . -p $(subst _,/,$(subst download-modules-,,$@)) ${EACHMODULE_FLAGS} \ 170 "go mod download all" 171 172 add-module-license-files: 173 cd internal/repotools/cmd/eachmodule && \ 174 go run . -skip-root \ 175 "cp $(LICENSE_FILE) ." 176 177 sync-models: sync-endpoints-model sync-api-models 178 179 sync-endpoints-model: sync-endpoints.json 180 181 sync-endpoints.json: 182 [[ ! -z "${ENDPOINTS_MODEL}" ]] && cp ${ENDPOINTS_MODEL} ${ENDPOINTS_JSON} || echo "ENDPOINTS_MODEL not set, must not be empty" 183 184 clone-v1-models: 185 rm -rf /tmp/aws-sdk-go-model-sync 186 git clone https://github.com/aws/aws-sdk-go.git --depth 1 /tmp/aws-sdk-go-model-sync 187 188 sync-api-models: 189 cd internal/repotools/cmd/syncAPIModels && \ 190 go run . \ 191 -m ${API_MODELS} \ 192 -o ${CODEGEN_API_MODELS_PATH} 193 194 copy-attributevalue-feature: 195 cd ./feature/dynamodbstreams/attributevalue && \ 196 find . -name "*.go" | grep -v "doc.go" | xargs -I % rm % && \ 197 find ../../dynamodb/attributevalue -name "*.go" | grep -v "doc.go" | xargs -I % cp % . && \ 198 ls *.go | grep -v "convert.go" | grep -v "doc.go" | \ 199 xargs -I % sed -i.bk -E 's:github.com/aws/aws-sdk-go-v2/(service|feature)/dynamodb:github.com/aws/aws-sdk-go-v2/\1/dynamodbstreams:g' % && \ 200 ls *.go | grep -v "convert.go" | grep -v "doc.go" | \ 201 xargs -I % sed -i.bk 's:DynamoDB:DynamoDBStreams:g' % && \ 202 ls *.go | grep -v "doc.go" | \ 203 xargs -I % sed -i.bk 's:dynamodb\.:dynamodbstreams.:g' % && \ 204 sed -i.bk 's:streams\.:ddbtypes.:g' "convert.go" && \ 205 sed -i.bk 's:ddb\.:streams.:g' "convert.go" && \ 206 sed -i.bk 's:ddbtypes\.:ddb.:g' "convert.go" &&\ 207 sed -i.bk 's:Streams::g' "convert.go" && \ 208 rm -rf ./*.bk && \ 209 go mod tidy && \ 210 gofmt -w -s . && \ 211 go test . 212 213 min-go-version-%: 214 cd ./internal/repotools/cmd/eachmodule \ 215 && go run . -p $(subst _,/,$(subst min-go-version-,,$@)) ${EACHMODULE_FLAGS} \ 216 "go mod edit -go=${SDK_MIN_GO_VERSION}" 217 218 update-requires: 219 go run ${REPOTOOLS_CMD_UPDATE_REQUIRES} 220 221 update-module-metadata: 222 go run ${REPOTOOLS_CMD_UPDATE_MODULE_METADATA} 223 224 ################ 225 # Unit Testing # 226 ################ 227 .PHONY: unit unit-race unit-test unit-race-test unit-race-modules-% unit-modules-% build build-modules-% \ 228 go-build-modules-% test test-race-modules-% test-modules-% cachedep cachedep-modules-% api-diff-modules-% 229 230 unit: lint unit-modules-. 231 unit-race: lint unit-race-modules-. 232 233 unit-test: test-modules-. 234 unit-race-test: test-race-modules-. 235 236 unit-race-modules-%: 237 @# unit command that uses the pattern to define the root path that the 238 @# module testing will start from. Strips off the "unit-race-modules-" and 239 @# replaces all "_" with "/". 240 @# 241 @# e.g. unit-race-modules-internal_protocoltest 242 cd ./internal/repotools/cmd/eachmodule \ 243 && go run . -p $(subst _,/,$(subst unit-race-modules-,,$@)) ${EACHMODULE_FLAGS} \ 244 "go vet ${BUILD_TAGS} --all ./..." \ 245 "go test ${BUILD_TAGS} ${RUN_NONE} ./..." \ 246 "go test -timeout=1m ${UNIT_TEST_TAGS} -race -cpu=4 ./..." 247 248 249 unit-modules-%: 250 @# unit command that uses the pattern to define the root path that the 251 @# module testing will start from. Strips off the "unit-modules-" and 252 @# replaces all "_" with "/". 253 @# 254 @# e.g. unit-modules-internal_protocoltest 255 cd ./internal/repotools/cmd/eachmodule \ 256 && go run . -p $(subst _,/,$(subst unit-modules-,,$@)) ${EACHMODULE_FLAGS} \ 257 "go vet ${BUILD_TAGS} --all ./..." \ 258 "go test ${BUILD_TAGS} ${RUN_NONE} ./..." \ 259 "go test -timeout=1m ${UNIT_TEST_TAGS} ./..." 260 261 build: build-modules-. 262 263 build-modules-%: 264 @# build command that uses the pattern to define the root path that the 265 @# module testing will start from. Strips off the "build-modules-" and 266 @# replaces all "_" with "/". 267 @# 268 @# e.g. build-modules-internal_protocoltest 269 cd ./internal/repotools/cmd/eachmodule \ 270 && go run . -p $(subst _,/,$(subst build-modules-,,$@)) ${EACHMODULE_FLAGS} \ 271 "go test ${BUILD_TAGS} ${RUN_NONE} ./..." 272 273 go-build-modules-%: 274 @# build command that uses the pattern to define the root path that the 275 @# module testing will start from. Strips off the "build-modules-" and 276 @# replaces all "_" with "/". 277 @# 278 @# Validates that all modules in the repo have buildable Go files. 279 @# 280 @# e.g. go-build-modules-internal_protocoltest 281 cd ./internal/repotools/cmd/eachmodule \ 282 && go run . -p $(subst _,/,$(subst go-build-modules-,,$@)) ${EACHMODULE_FLAGS} \ 283 "go build ${BUILD_TAGS} ./..." 284 285 test: test-modules-. 286 287 test-race-modules-%: 288 @# Test command that uses the pattern to define the root path that the 289 @# module testing will start from. Strips off the "test-race-modules-" and 290 @# replaces all "_" with "/". 291 @# 292 @# e.g. test-race-modules-internal_protocoltest 293 cd ./internal/repotools/cmd/eachmodule \ 294 && go run . -p $(subst _,/,$(subst test-race-modules-,,$@)) ${EACHMODULE_FLAGS} \ 295 "go test -timeout=1m ${UNIT_TEST_TAGS} -race -cpu=4 ./..." 296 297 test-modules-%: 298 @# Test command that uses the pattern to define the root path that the 299 @# module testing will start from. Strips off the "test-modules-" and 300 @# replaces all "_" with "/". 301 @# 302 @# e.g. test-modules-internal_protocoltest 303 cd ./internal/repotools/cmd/eachmodule \ 304 && go run . -p $(subst _,/,$(subst test-modules-,,$@)) ${EACHMODULE_FLAGS} \ 305 "go test -timeout=1m ${UNIT_TEST_TAGS} ./..." 306 307 cachedep: cachedep-modules-. 308 309 cachedep-modules-%: 310 @# build command that uses the pattern to define the root path that the 311 @# module caching will start from. Strips off the "cachedep-modules-" and 312 @# replaces all "_" with "/". 313 @# 314 @# e.g. cachedep-modules-internal_protocoltest 315 cd ./internal/repotools/cmd/eachmodule \ 316 && go run . -p $(subst _,/,$(subst cachedep-modules-,,$@)) ${EACHMODULE_FLAGS} \ 317 "go mod download" 318 319 api-diff-modules-%: 320 @# Command that uses the pattern to define the root path that the 321 @# module testing will start from. Strips off the "api-diff-modules-" and 322 @# replaces all "_" with "/". 323 @# 324 @# Requires golang.org/x/exp/cmd/gorelease to be available in the GOPATH. 325 @# 326 @# e.g. api-diff-modules-internal_protocoltest 327 cd ./internal/repotools/cmd/eachmodule \ 328 && go run . -p $(subst _,/,$(subst api-diff-modules-,,$@)) \ 329 -fail-fast=true \ 330 -c 1 \ 331 -skip="internal/repotools" \ 332 "$$(go env GOPATH)/bin/gorelease" 333 334 ############## 335 # CI Testing # 336 ############## 337 .PHONY: ci-test ci-test-no-generate ci-test-generate-validate 338 339 ci-test: generate unit-race ci-test-generate-validate 340 ci-test-no-generate: unit-race 341 342 ci-test-generate-validate: 343 @echo "CI test validate no generated code changes" 344 git update-index --assume-unchanged go.mod go.sum 345 git add . -A 346 gitstatus=`git diff --cached --ignore-space-change`; \ 347 echo "$$gitstatus"; \ 348 if [ "$$gitstatus" != "" ] && [ "$$gitstatus" != "skipping validation" ]; then echo "$$gitstatus"; exit 1; fi 349 git update-index --no-assume-unchanged go.mod go.sum 350 351 ci-lint: ci-lint-. 352 353 ci-lint-%: 354 @# Run golangci-lint command that uses the pattern to define the root path that the 355 @# module check will start from. Strips off the "ci-lint-" and 356 @# replaces all "_" with "/". 357 @# 358 @# e.g. ci-lint-internal_protocoltest 359 cd ./internal/repotools/cmd/eachmodule \ 360 && go run . -p $(subst _,/,$(subst ci-lint-,,$@)) \ 361 -fail-fast=false \ 362 -c 1 \ 363 -skip="internal/repotools" \ 364 "golangci-lint run" 365 366 ci-lint-install: 367 @# Installs golangci-lint at GoPATH. 368 @# This should be used to run golangci-lint locally. 369 @# 370 go install github.com/golangci/golangci-lint/cmd/golangci-lint@latest 371 372 ####################### 373 # Integration Testing # 374 ####################### 375 .PHONY: integration integ-modules-% cleanup-integ-buckets 376 377 integration: integ-modules-service 378 379 integ-modules-%: 380 @# integration command that uses the pattern to define the root path that 381 @# the module testing will start from. Strips off the "integ-modules-" and 382 @# replaces all "_" with "/". 383 @# 384 @# e.g. test-modules-service_dynamodb 385 cd ./internal/repotools/cmd/eachmodule \ 386 && go run . -p $(subst _,/,$(subst integ-modules-,,$@)) ${EACHMODULE_FLAGS} \ 387 "go test -timeout=10m -tags "integration" -v ${RUN_INTEG} -count 1 ./..." 388 389 cleanup-integ-buckets: 390 @echo "Cleaning up SDK integration resources" 391 go run -tags "integration" ./internal/awstesting/cmd/bucket_cleanup/main.go "aws-sdk-go-integration" 392 393 ############## 394 # Benchmarks # 395 ############## 396 .PHONY: bench bench-modules-% 397 398 bench: bench-modules-. 399 400 bench-modules-%: 401 @# benchmark command that uses the pattern to define the root path that 402 @# the module testing will start from. Strips off the "bench-modules-" and 403 @# replaces all "_" with "/". 404 @# 405 @# e.g. bench-modules-service_dynamodb 406 cd ./internal/repotools/cmd/eachmodule \ 407 && go run . -p $(subst _,/,$(subst bench-modules-,,$@)) ${EACHMODULE_FLAGS} \ 408 "go test -timeout=10m -bench . --benchmem ${BUILD_TAGS} ${RUN_NONE} ./..." 409 410 411 ##################### 412 # Release Process # 413 ##################### 414 .PHONY: preview-release pre-release-validation release 415 416 ls-changes: 417 go run ${REPOTOOLS_CMD_CHANGELOG} ls 418 419 preview-release: 420 go run ${REPOTOOLS_CMD_CALCULATE_RELEASE} ${REPOTOOLS_CALCULATE_RELEASE_VERBOSE_FLAG} ${REPOTOOLS_CALCULATE_RELEASE_ADDITIONAL_ARGS} 421 422 pre-release-validation: 423 @if [[ -z "${RELEASE_MANIFEST_FILE}" ]]; then \ 424 echo "RELEASE_MANIFEST_FILE is required to specify the file to write the release manifest" && false; \ 425 fi 426 @if [[ -z "${RELEASE_CHGLOG_DESC_FILE}" ]]; then \ 427 echo "RELEASE_CHGLOG_DESC_FILE is required to specify the file to write the release notes" && false; \ 428 fi 429 430 release: pre-release-validation 431 go run ${REPOTOOLS_CMD_CALCULATE_RELEASE} -o ${RELEASE_MANIFEST_FILE} ${REPOTOOLS_CALCULATE_RELEASE_VERBOSE_FLAG} ${REPOTOOLS_CALCULATE_RELEASE_ADDITIONAL_ARGS} 432 go run ${REPOTOOLS_CMD_UPDATE_REQUIRES} -release ${RELEASE_MANIFEST_FILE} 433 go run ${REPOTOOLS_CMD_UPDATE_MODULE_METADATA} -release ${RELEASE_MANIFEST_FILE} 434 go run ${REPOTOOLS_CMD_GENERATE_CHANGELOG} -release ${RELEASE_MANIFEST_FILE} -o ${RELEASE_CHGLOG_DESC_FILE} 435 go run ${REPOTOOLS_CMD_CHANGELOG} rm -all 436 go run ${REPOTOOLS_CMD_TAG_RELEASE} -release ${RELEASE_MANIFEST_FILE} 437 438 ############## 439 # Repo Tools # 440 ############## 441 .PHONY: install-repotools 442 443 install-repotools: 444 go install ${REPOTOOLS_MODULE}/cmd/changelog@${REPOTOOLS_VERSION} 445 446 set-smithy-go-version: 447 @if [[ -z "${SMITHY_GO_VERSION}" ]]; then \ 448 echo "SMITHY_GO_VERSION is required to update SDK's smithy-go module dependency version" && false; \ 449 fi 450 go run ${REPOTOOLS_CMD_EDIT_MODULE_DEPENDENCY} -s "github.com/aws/smithy-go" -v "${SMITHY_GO_VERSION}" 451 452 ################## 453 # Linting/Verify # 454 ################## 455 .PHONY: verify lint vet vet-modules-% sdkv1check 456 457 verify: lint vet sdkv1check 458 459 lint: 460 @echo "go lint SDK and vendor packages" 461 @lint=`golint ./...`; \ 462 dolint=`echo "$$lint" | grep -E -v \ 463 -e ${LINT_IGNORE_S3MANAGER_INPUT} \ 464 -e ${LINTIGNORESINGLEFIGHT}`; \ 465 echo "$$dolint"; \ 466 if [ "$$dolint" != "" ]; then exit 1; fi 467 468 vet: vet-modules-. 469 470 vet-modules-%: 471 cd ./internal/repotools/cmd/eachmodule \ 472 && go run . -p $(subst _,/,$(subst vet-modules-,,$@)) ${EACHMODULE_FLAGS} \ 473 "go vet ${BUILD_TAGS} --all ./..." 474 475 sdkv1check: 476 @echo "Checking for usage of AWS SDK for Go v1" 477 @sdkv1usage=`go list -test -f '''{{ if not .Standard }}{{ range $$_, $$name := .Imports }} * {{ $$.ImportPath }} -> {{ $$name }}{{ print "\n" }}{{ end }}{{ range $$_, $$name := .TestImports }} *: {{ $$.ImportPath }} -> {{ $$name }}{{ print "\n" }}{{ end }}{{ end}}''' ./... | sort -u | grep '''/aws-sdk-go/'''`; \ 478 echo "$$sdkv1usage"; \ 479 if [ "$$sdkv1usage" != "" ]; then exit 1; fi 480 481 list-deps: list-deps-. 482 483 list-deps-%: 484 @# command that uses the pattern to define the root path that the 485 @# module testing will start from. Strips off the "list-deps-" and 486 @# replaces all "_" with "/". 487 @# 488 @# Trim output to only include stdout for list of dependencies only. 489 @# make list-deps 2>&- 490 @# 491 @# e.g. list-deps-internal_protocoltest 492 @cd ./internal/repotools/cmd/eachmodule \ 493 && go run . -p $(subst _,/,$(subst list-deps-,,$@)) ${EACHMODULE_FLAGS} \ 494 "go list -m all | grep -v 'github.com/aws/aws-sdk-go-v2'" | sort -u 495 496 ################### 497 # Sandbox Testing # 498 ################### 499 .PHONY: sandbox-tests sandbox-build-% sandbox-run-% sandbox-test-% update-aws-golang-tip 500 501 sandbox-tests: sandbox-test-go1.15 sandbox-test-go1.16 sandbox-test-go1.17 sandbox-test-gotip 502 503 sandbox-build-%: 504 @# sandbox-build-go1.17 505 @# sandbox-build-gotip 506 docker build \ 507 -f ./internal/awstesting/sandbox/Dockerfile.test.$(subst sandbox-build-,,$@) \ 508 -t "aws-sdk-go-$(subst sandbox-build-,,$@)" . 509 sandbox-run-%: sandbox-build-% 510 @# sandbox-run-go1.17 511 @# sandbox-run-gotip 512 docker run -i -t "aws-sdk-go-$(subst sandbox-run-,,$@)" bash 513 sandbox-test-%: sandbox-build-% 514 @# sandbox-test-go1.17 515 @# sandbox-test-gotip 516 docker run -t "aws-sdk-go-$(subst sandbox-test-,,$@)" 517 518 update-aws-golang-tip: 519 docker build --no-cache=true -f ./internal/awstesting/sandbox/Dockerfile.golang-tip -t "aws-golang:tip" .