|
| 1 | +# Copyright 2025 Google LLC |
| 2 | +# |
| 3 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | +# you may not use this file except in compliance with the License. |
| 5 | +# You may obtain a copy of the License at |
| 6 | +# |
| 7 | +# https://www.apache.org/licenses/LICENSE-2.0 |
| 8 | +# |
| 9 | +# Unless required by applicable law or agreed to in writing, software |
| 10 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | +# See the License for the specific language governing permissions and |
| 13 | +# limitations under the License. |
| 14 | + |
| 15 | +.PHONY: all build clean test run-merchant run-credentials run-processor run-all help fmt lint |
| 16 | + |
| 17 | +all: fmt lint build |
| 18 | + |
| 19 | +build: |
| 20 | + @echo "Building all agents..." |
| 21 | + @mkdir -p bin |
| 22 | + @go build -o bin/merchant_agent ./cmd/merchant_agent |
| 23 | + @go build -o bin/credentials_provider_agent ./cmd/credentials_provider_agent |
| 24 | + @go build -o bin/merchant_payment_processor_agent ./cmd/merchant_payment_processor_agent |
| 25 | + @echo "Build complete!" |
| 26 | + |
| 27 | +clean: |
| 28 | + @echo "Cleaning build artifacts..." |
| 29 | + @rm -rf bin |
| 30 | + @echo "Clean complete!" |
| 31 | + |
| 32 | +test: |
| 33 | + @echo "Running tests..." |
| 34 | + @go test ./... |
| 35 | + |
| 36 | +fmt: |
| 37 | + @echo "Formatting code..." |
| 38 | + @go fmt ./... |
| 39 | + |
| 40 | +lint: |
| 41 | + @echo "Running linter..." |
| 42 | + @go vet ./... |
| 43 | + |
| 44 | +run-merchant: |
| 45 | + @echo "Starting Merchant Agent on port 8001..." |
| 46 | + @go run ./cmd/merchant_agent |
| 47 | + |
| 48 | +run-credentials: |
| 49 | + @echo "Starting Credentials Provider Agent on port 8002..." |
| 50 | + @go run ./cmd/credentials_provider_agent |
| 51 | + |
| 52 | +run-processor: |
| 53 | + @echo "Starting Merchant Payment Processor Agent on port 8003..." |
| 54 | + @go run ./cmd/merchant_payment_processor_agent |
| 55 | + |
| 56 | +run-all: |
| 57 | + @echo "Starting all agents..." |
| 58 | + @bash scenarios/a2a/human-present/cards/run.sh |
| 59 | + |
| 60 | +deps: |
| 61 | + @echo "Downloading dependencies..." |
| 62 | + @go mod download |
| 63 | + @go mod tidy |
| 64 | + |
| 65 | +help: |
| 66 | + @echo "Available targets:" |
| 67 | + @echo " make build - Build all agent binaries" |
| 68 | + @echo " make clean - Remove build artifacts" |
| 69 | + @echo " make test - Run tests" |
| 70 | + @echo " make fmt - Format code" |
| 71 | + @echo " make lint - Run linter" |
| 72 | + @echo " make deps - Download and tidy dependencies" |
| 73 | + @echo " make run-merchant - Run merchant agent" |
| 74 | + @echo " make run-credentials - Run credentials provider agent" |
| 75 | + @echo " make run-processor - Run payment processor agent" |
| 76 | + @echo " make run-all - Run all agents (background)" |
0 commit comments