22#
33# Orchestrates both Smithy spec and Go SDK
44
5- .PHONY : all check clean help provenance-sync provenance-check sync-status
5+ .PHONY : all check clean help provenance-sync provenance-check sync-status bump sync-api-version sync-api-version-check
66
77# Default: run all checks
88all : check
@@ -23,14 +23,15 @@ smithy-mapper:
2323 @echo " ==> Building Smithy OpenAPI mapper..."
2424 cd spec/smithy-bare-arrays && ./gradlew publishToMavenLocal --quiet
2525
26- # Build OpenAPI from Smithy (also regenerates behavior model)
26+ # Build OpenAPI from Smithy (also regenerates behavior model + syncs API version )
2727smithy-build : behavior-model smithy-mapper
2828 @echo " ==> Building OpenAPI from Smithy..."
2929 cd spec && smithy build
3030 cp spec/build/smithy/openapi/openapi/Basecamp.openapi.json openapi.json
3131 @echo " ==> Post-processing OpenAPI for Go types..."
3232 ./scripts/enhance-openapi-go-types.sh
3333 @echo " Updated openapi.json"
34+ @$(MAKE ) sync-api-version
3435
3536# Check that openapi.json is up to date
3637smithy-check : smithy-validate smithy-mapper
@@ -120,6 +121,34 @@ sync-status:
120121 --jq ' [.files[] | select(.filename | startswith("app/controllers/"))] | if length == 0 then " (no changes in app/controllers/)" else .[] | " " + .status[:1] + " " + .filename end' ; \
121122 fi
122123
124+ # ------------------------------------------------------------------------------
125+ # Version management
126+ # ------------------------------------------------------------------------------
127+
128+ # Bump SDK version across all languages: make bump VERSION=x.y.z
129+ bump :
130+ ifndef VERSION
131+ $(error VERSION is required. Usage: make bump VERSION=x.y.z)
132+ endif
133+ @./scripts/bump-version.sh $(VERSION)
134+
135+ # Sync API_VERSION constants from openapi.json info.version
136+ sync-api-version :
137+ @./scripts/sync-api-version.sh
138+
139+ # Check that API_VERSION constants match openapi.json info.version
140+ sync-api-version-check :
141+ @echo " ==> Checking API version freshness..."
142+ @API_VER=$$(jq -r '.info.version' openapi.json ) && \
143+ ok=true && \
144+ grep -q " const APIVersion = \" $$ API_VER\" " go/pkg/basecamp/version.go || ok=false && \
145+ grep -q " export const API_VERSION = \" $$ API_VER\" " typescript/src/client.ts || ok=false && \
146+ grep -q " API_VERSION = \" $$ API_VER\" " ruby/lib/basecamp/version.rb || ok=false && \
147+ grep -q " const val API_VERSION = \" $$ API_VER\" " kotlin/sdk/src/commonMain/kotlin/com/basecamp/sdk/BasecampConfig.kt || ok=false && \
148+ grep -q " public static let apiVersion = \" $$ API_VER\" " swift/Sources/Basecamp/BasecampConfig.swift || ok=false && \
149+ if [ " $$ ok" = false ]; then echo " ERROR: API_VERSION constants are out of date. Run 'make sync-api-version'" && exit 1; fi
150+ @echo " API version constants are up to date"
151+
123152# ------------------------------------------------------------------------------
124153# Go SDK targets (delegates to go/Makefile)
125154# ------------------------------------------------------------------------------
@@ -344,7 +373,7 @@ swift-clean:
344373# ------------------------------------------------------------------------------
345374
346375# Run all checks (Smithy + Go + TypeScript + Ruby + Kotlin + Swift + Behavior Model + Conformance + Provenance)
347- check : smithy-check behavior-model-check provenance-check go-check-drift kt-check-drift go-check ts-check rb-check kt-check swift-check conformance
376+ check : smithy-check behavior-model-check provenance-check sync-api-version-check go-check-drift kt-check-drift go-check ts-check rb-check kt-check swift-check conformance
348377 @echo " ==> All checks passed"
349378
350379# Clean all build artifacts
@@ -422,6 +451,11 @@ help:
422451 @echo " provenance-check Verify Go embedded provenance is up to date"
423452 @echo " sync-status Show upstream changes since last spec sync"
424453 @echo " "
454+ @echo " Version:"
455+ @echo " bump VERSION=x.y.z Bump SDK version across all languages"
456+ @echo " sync-api-version Sync API_VERSION from openapi.json"
457+ @echo " sync-api-version-check Verify API_VERSION constants are up to date"
458+ @echo " "
425459 @echo " Combined:"
426460 @echo " check Run all checks (Smithy + Go + TypeScript + Ruby + Swift + Conformance + Provenance)"
427461 @echo " clean Remove all build artifacts"
0 commit comments