#!/usr/bin/make -f

# ld/example_test.go replaces the HTTP transport with one serving
# w3c.github.io and schema.org from ld/testdata when CI=true; otherwise two
# Example tests fetch those documents from the network.
export CI := true

GOSRC := debian/golang-github-piprate-json-gold-dev/usr/share/gocode/src/github.com/piprate/json-gold

%:
	dh $@ --builddirectory=debian/_build --buildsystem=golang --with=golang

# ld/testdata (the W3C JSON-LD test suite) stays installed: autopkgtest runs
# the tests from the installed sources. Its Ruby scripts only regenerate the
# suite's vocabulary and manifests and are not needed to run it.
# ld/earl.jsonld is the conformance report the tests write.
execute_after_dh_auto_install:
	rm $(GOSRC)/ld/testdata/mk_vocab.rb \
	   $(GOSRC)/ld/testdata/normalization/mk_vocab.rb \
	   $(GOSRC)/ld/testdata/normalization/mk_manifest.rb \
	   $(GOSRC)/ld/earl.jsonld
