Skip to content

Commit 6d7ac51

Browse files
committed
schema: make fs.go dynamic
the schema-fs is needed dynamically and should be generated as such. Further, it is often a tidious cause of rebasing. Therefore, just make it generated everytime and not even managed in git. Signed-off-by: Vincent Batts <[email protected]>
1 parent 00850ec commit 6d7ac51

File tree

3 files changed

+220
-78
lines changed

3 files changed

+220
-78
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
/oci-validate-examples
22
output
3+
schema/fs.go

Makefile

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -75,13 +75,15 @@ $(OUTPUT_DIRNAME)/$(DOC_FILENAME).html: $(DOC_FILES) $(FIGURE_FILES)
7575
ls -sh $(shell readlink -f $@)
7676
endif
7777

78-
validate-examples:
78+
validate-examples: schema/fs.go
7979
go test -run TestValidate ./schema
8080

81-
schema-fs:
81+
schema/fs.go: $(wildcard schema/*.json) schema/gen.go
8282
@echo "generating schema fs"
8383
@cd schema && printf "%s\n\n%s\n" "$$(cat ../.header)" "$$(go generate)" > fs.go
8484

85+
schema-fs: schema/fs.go
86+
8587
check-license:
8688
@echo "checking license headers"
8789
@./.tool/check-license
@@ -90,14 +92,12 @@ lint:
9092
@echo "checking lint"
9193
@./.tool/lint
9294

93-
test:
95+
test: schema/fs.go
9496
go test -race -cover $(shell go list ./... | grep -v /vendor/)
9597

9698
img/%.png: img/%.dot
9799
dot -Tpng $^ > $@
98100

99-
.PHONY: .gitvalidation
100-
101101
# When this is running in travis, it will only check the travis commit range
102102
.gitvalidation:
103103
@which git-validation > /dev/null 2>/dev/null || (echo "ERROR: git-validation not found. Consider 'make install.tools' target" && false)
@@ -107,8 +107,6 @@ else
107107
git-validation -v -run DCO,short-subject,dangling-whitespace -range $(EPOCH_TEST_COMMIT)..HEAD
108108
endif
109109

110-
.PHONY: install.tools
111-
112110
install.tools: .install.gitvalidation .install.glide .install.glide-vc
113111

114112
.install.gitvalidation:
@@ -121,12 +119,15 @@ install.tools: .install.gitvalidation .install.glide .install.glide-vc
121119
go get -u github.com/sgotti/glide-vc
122120

123121
clean:
124-
rm -rf *~ $(OUTPUT_DIRNAME)
122+
rm -rf *~ $(OUTPUT_DIRNAME) schema/fs.go
125123

126124
.PHONY: \
127125
validate-examples \
128126
check-license \
129127
clean \
130128
lint \
131129
docs \
132-
test
130+
test \
131+
schema/fs.go \
132+
install.tools \
133+
.gitvalidation

0 commit comments

Comments
 (0)