github.com/asifdxtreme/cli@v6.1.3-0.20150123051144-9ead8700b4ae+incompatible/makefile (about)

     1  GODEPS = $(realpath ./Godeps/_workspace)
     2  GOPATH := $(GODEPS):$(GOPATH)
     3  PATH := $(GODEPS)/bin:$(PATH)
     4  
     5  # target: all - Run tests and generate binary
     6  all: test build
     7  
     8  # target: help - Display targets
     9  help:
    10  	@egrep "^# target:" [Mm]akefile | sort -
    11  
    12  # target: clean - Cleans build artifacts
    13  clean:
    14  	echo Cleaning build artifacts...
    15  	go clean
    16  	echo
    17  
    18  # target: generate-language-resource - Creates language resource file
    19  generate-language-resource:
    20  	echo Generating i18n resource file
    21  	go-bindata \
    22  		-pkg resources \
    23  		-ignore ".go" \
    24  		-o cf/resources/i18n_resources.go \
    25  		cf/i18n/resources/... cf/i18n/test_fixtures/...
    26  	echo
    27  
    28  # target: fmt - Formats go code
    29  fmt format:
    30  	echo Formatting Packages...
    31  	go fmt ./cf/... ./testhelpers/... ./generic/... ./main/... ./glob/... ./words/... 
    32  	echo
    33  
    34  # target: test - Runs CLI tests
    35  test: clean generate-language-resource format
    36  	echo Testing packages:
    37  	LC_ALL="en_US.UTF-8" \
    38  		go test ./cf/... ./generic/... -parallel 4 $(TEST_ARG)
    39  	echo
    40  	$(MAKE) vet
    41  
    42  # target: ginkgo - Runs CLI tests with ginkgo command
    43  ginkgo: clean generate-language-resource format
    44  	echo Testing packages:
    45  	LC_ALL="en_US.UTF-8" \
    46  		ginkgo -p cf/* generic
    47  	echo
    48  	$(MAKE) vet
    49  
    50  # target: vet - Vets CLI for issues
    51  vet:
    52  	echo Vetting packages for potential issues...
    53  	go tool vet cf/.
    54  	echo
    55  
    56  # target: build - Build CLI binary
    57  build: format generate-language-resource
    58  	echo Generating Binary...
    59  	mkdir -p out
    60  	go build -o out/cf ./main
    61  	echo
    62  
    63  # target: install-dev-tools - Installs dev tools needed to work on the CLI
    64  install-dev-tools:
    65  	@echo Installing development tools into $(GODEPS)
    66  	go get github.com/onsi/ginkgo/ginkgo
    67  	go get github.com/onsi/gomega
    68  	go get golang.org/x/tools/cmd/vet
    69  	go get github.com/jteeuwen/go-bindata/...
    70  
    71  .PHONY: all help clean generate-language-resource fmt format test ginkgo vet build install-dev-tools
    72  .SILENT: all help clean generate-language-resource fmt format test ginkgo vet build