-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
122 lines (95 loc) · 4.48 KB
/
Copy pathMakefile
File metadata and controls
122 lines (95 loc) · 4.48 KB
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
# Convenience wrapper around ./gradlew and the consumer-test / mock-server.
# Run `make` (no args) or `make help` for the target list.
CONSUMER_DIR := examples/consumer-test
MOCK_DIR := examples/mock-server
.DEFAULT_GOAL := help
# ---------------------------------------------------------------------------
# Help
# ---------------------------------------------------------------------------
.PHONY: help
help: ## Show this help
@awk 'BEGIN {FS = ":.*##"; printf "Usage:\n make \033[36m<target>\033[0m\n\nTargets:\n"} \
/^# ===/ { in_section = 1; next } \
/^[a-zA-Z_-]+:.*?##/ { printf " \033[36m%-22s\033[0m %s\n", $$1, $$2 } \
/^## ---/ { printf "\n\033[33m%s\033[0m\n", substr($$0, 5) }' $(MAKEFILE_LIST)
@echo ""
@echo "Typical workflow:"
@echo " make publish # publish SDK to mavenLocal"
@echo " make example-stocks # a resource example (live API, needs a token)"
@echo " make mock-server # in another terminal, then:"
@echo " make example-concurrency # a cross-cutting example (needs the mock server)"
# ---------------------------------------------------------------------------
## --- SDK build ---
# ---------------------------------------------------------------------------
.PHONY: build
build: ## Full build: unit tests + Spotless + JaCoCo (JDK 17)
./gradlew build
.PHONY: test
test: ## Unit tests only
./gradlew test
.PHONY: spotless
spotless: ## Apply code formatting
./gradlew spotlessApply
.PHONY: clean
clean: ## Clean all Gradle outputs (SDK + consumer-test)
./gradlew clean
cd $(CONSUMER_DIR) && ./gradlew clean
.PHONY: publish
publish: ## Publish SDK to ~/.m2 (prereq for any demo)
./gradlew publishToMavenLocal
# ---------------------------------------------------------------------------
## --- Mock server ---
# ---------------------------------------------------------------------------
.PHONY: mock-server
mock-server: ## Start the FastAPI mock server (blocks, Ctrl+C to stop)
cd $(MOCK_DIR) && ./run.sh
# ---------------------------------------------------------------------------
## --- Examples (need `make publish` first) ---
# ---------------------------------------------------------------------------
# Resource examples hit the LIVE API (need a token). The cross-cutting examples that show otherwise-
# invisible behavior (concurrency, retry, errors) drive the mock server — run `make mock-server`
# first for those. `make example-list` prints every runnable example with a one-line description.
.PHONY: example-list
example-list: ## List every runnable example with a description
cd $(CONSUMER_DIR) && ./gradlew tasks --group examples
# --- resource examples (live API) ---
.PHONY: example-utilities
example-utilities: ## utilities: health, quota, request echo (live)
cd $(CONSUMER_DIR) && ./gradlew runUtilities
.PHONY: example-stocks
example-stocks: ## stocks: candles, quote, batch quotes (live)
cd $(CONSUMER_DIR) && ./gradlew runStocks
.PHONY: example-options
example-options: ## options: lookup, expirations, chain, quote (live)
cd $(CONSUMER_DIR) && ./gradlew runOptions
.PHONY: example-funds
example-funds: ## funds: NAV candles (live)
cd $(CONSUMER_DIR) && ./gradlew runFunds
.PHONY: example-markets
example-markets: ## markets: open/closed calendar (live)
cd $(CONSUMER_DIR) && ./gradlew runMarkets
.PHONY: example-kotlin
example-kotlin: ## the same SDK from Kotlin: sync + async (live)
cd $(CONSUMER_DIR) && ./gradlew runKotlinQuickstart
# --- cross-cutting examples ---
.PHONY: example-sync-async
example-sync-async: ## sync vs async, parallel fan-out (live)
cd $(CONSUMER_DIR) && ./gradlew runSyncVsAsync
.PHONY: example-config
example-config: ## constructors, cascade, redaction, validation (offline)
cd $(CONSUMER_DIR) && ./gradlew runConfiguration
.PHONY: example-response
example-response: ## response wrapper: data, metadata, formats, saveToFile (live)
cd $(CONSUMER_DIR) && ./gradlew runResponseFormats
.PHONY: example-concurrency
example-concurrency: ## fan-out async + 50-permit cap, observed (needs mock-server)
cd $(CONSUMER_DIR) && ./gradlew runConcurrency
.PHONY: example-retry
example-retry: ## automatic retry + backoff + Retry-After (needs mock-server)
cd $(CONSUMER_DIR) && ./gradlew runRetry
.PHONY: example-errors
example-errors: ## the sealed exception hierarchy and how to handle it (needs mock-server)
cd $(CONSUMER_DIR) && ./gradlew runErrors
.PHONY: examples-mock
examples-mock: ## Run the three mock-server examples back-to-back (needs mock-server)
cd $(CONSUMER_DIR) && ./gradlew runConcurrency runRetry runErrors