-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
51 lines (41 loc) · 1.62 KB
/
Copy pathMakefile
File metadata and controls
51 lines (41 loc) · 1.62 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
# Braintrust coding-agent plugins monorepo.
#
# Each plugin under src/plugins/<agent>/ provides:
# build.sh <target_dir> assemble the agent's distribution tree
# validate.sh <target> sanity-check a built tree
# publish.sh deploy it (push to dist repo, npm/vsce publish, ...)
#
# Targets fan out over every plugin dir:
# make build build all plugins into dist/<agent>
# make build-codex build just one
# make test build then validate all
# make publish publish all (DRY_RUN=1 to test without pushing)
# make publish-codex publish just one
SHELL := /bin/bash
PLUGINS := $(notdir $(wildcard src/plugins/*))
DIST := dist
# Internal target lists. NOTE: deliberately NOT named PUBLISH_TARGETS — that is
# the user-facing env var (the plugin->repo map) and a makefile var of the same
# name would shadow it in recipe subshells.
BUILD_RULES := $(addprefix build-,$(PLUGINS))
PUBLISH_RULES := $(addprefix publish-,$(PLUGINS))
.PHONY: build test publish clean $(BUILD_RULES) $(PUBLISH_RULES)
build: $(BUILD_RULES)
# Static pattern rule (reliable across make versions for phony fan-out).
$(BUILD_RULES): build-%:
@echo "==> build $*"
@src/plugins/$*/build.sh "$(DIST)/$*"
test: build
@for p in $(PLUGINS); do \
echo "==> validate $$p"; \
src/plugins/$$p/validate.sh "$(DIST)/$$p"; \
done
# Deploy every plugin named in the PUBLISH_TARGETS env var map. Fails if unset.
publish:
@scripts/publish.sh
# Publish a single plugin, e.g. DIST_REPO=owner/name make publish-codex
$(PUBLISH_RULES): publish-%:
@echo "==> publish $*"
@src/plugins/$*/publish.sh
clean:
@rm -rf "$(DIST)"