-
Notifications
You must be signed in to change notification settings - Fork 48
/
GNUmakefile
37 lines (30 loc) · 1.34 KB
/
GNUmakefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
default: test
acctest: fmt
cd ./sdk/ && ACCTEST=1 go test -count=1 -race -v ./... -run '^TestAcc' && cd ../
fmt: tools
@echo "==> Fixing source code with gofmt..."
find . -name '*.go' | grep -v vendor | xargs gofmt -s -w
imports: tools
@echo "==> Fixing source code with goimports..."
goimports -w ./microsoft-graph
goimports -w ./resource-manager
goimports -w ./sdk
prepare:
@echo "==> Preparing the repository to be updated.."
@echo "==> 1. Resource Manager - Removing all existing generated files"
find ./resource-manager/ -maxdepth 1 -mindepth 1 -type d -exec rm -rf '{}' \;
@echo "==> 2. Resource Manager - Re-creating the directory structure in preparation"
mkdir -p ./resource-manager/
# TODO: enable Microsoft Graph support prior to enabling generation of that SDK
#@echo "==> 3. Microsoft Graph - Removing all existing generated files"
#find ./microsoft-graph/ -maxdepth 1 -mindepth 1 -type d -exec rm -rf '{}' \;
#@echo "==> 4. Microsoft Graph - Re-creating the directory structure in preparation"
#mkdir -p ./microsoft-graph/
test: fmt
cd ./sdk/ && go test -short -v ./... && cd ../
cd ./resource-manager/ && go test -v ./... && cd ../
cd ./microsoft-graph/ && go test -v ./... && cd ../
tools:
@echo "==> installing required tooling..."
go install golang.org/x/tools/cmd/goimports@latest
.PHONY: fmt imports prepare test tools