gobot.io/x/gobot@v1.16.0/Makefile (about)

     1  .PHONY: test race cover robeaux examples test_with_coverage fmt_check
     2  
     3  excluding_vendor := $(shell go list ./... | grep -v /vendor/)
     4  
     5  # Run tests on all non-vendor directories
     6  test:
     7  	go test -v $(excluding_vendor)
     8  
     9  # Run tests with race detection on all non-vendor directories
    10  race:
    11  	go test -race $(excluding_vendor)
    12  
    13  # Check for code well-formedness
    14  fmt_check:
    15  	./ci/format.sh
    16  
    17  # Test and generate coverage
    18  test_with_coverage:
    19  	./ci/test.sh
    20  
    21  robeaux:
    22  ifeq (,$(shell which go-bindata))
    23  	$(error robeaux not built! https://github.com/jteeuwen/go-bindata is required to build robeaux assets )
    24  endif
    25  	cd api ; \
    26  	npm install robeaux ; \
    27  	cp -r node_modules/robeaux robeaux-tmp ; \
    28  	cd robeaux-tmp ; \
    29  	rm Makefile package.json README.markdown ; \
    30  	touch css/fonts.css ; \
    31  	echo "Updating robeaux..." ; \
    32  	go-bindata -pkg="robeaux" -o robeaux.go -ignore=\\.git ./... ; \
    33  	mv robeaux.go ../robeaux ; \
    34  	cd .. ; \
    35  	rm -rf robeaux-tmp/ ; \
    36  	rm -rf node_modules/ ; \
    37  	go fmt ./robeaux/robeaux.go ; \
    38  
    39  EXAMPLES := $(shell ls examples/*.go | sed -e 's/examples\///')
    40  
    41  examples:
    42  	for example in $(EXAMPLES) ; do \
    43  		go build -o /tmp/$$example examples/$$example ; \
    44  	done ; \