Make go flags customisable (#46)
This commit is contained in:
		
							parent
							
								
									1a5f1bc2d2
								
							
						
					
					
						commit
						43220fefbf
					
				
					 1 changed files with 7 additions and 5 deletions
				
			
		
							
								
								
									
										12
									
								
								Makefile
									
										
									
									
									
								
							
							
						
						
									
										12
									
								
								Makefile
									
										
									
									
									
								
							|  | @ -2,6 +2,8 @@ GO ?= $(shell command -v go 2> /dev/null) | ||||||
| NPM ?= $(shell command -v npm 2> /dev/null) | NPM ?= $(shell command -v npm 2> /dev/null) | ||||||
| CURL ?= $(shell command -v curl 2> /dev/null) | CURL ?= $(shell command -v curl 2> /dev/null) | ||||||
| MANIFEST_FILE ?= plugin.json | MANIFEST_FILE ?= plugin.json | ||||||
|  | GO_TEST_FLAGS ?= -race | ||||||
|  | GO_BUILD_FLAGS ?= | ||||||
| MM_UTILITIES_DIR ?= ../mattermost-utilities | MM_UTILITIES_DIR ?= ../mattermost-utilities | ||||||
| 
 | 
 | ||||||
| export GO111MODULE=on | export GO111MODULE=on | ||||||
|  | @ -81,9 +83,9 @@ golint: | ||||||
| server: | server: | ||||||
| ifneq ($(HAS_SERVER),) | ifneq ($(HAS_SERVER),) | ||||||
| 	mkdir -p server/dist; | 	mkdir -p server/dist; | ||||||
| 	cd server && env GOOS=linux GOARCH=amd64 $(GO) build -o dist/plugin-linux-amd64; | 	cd server && env GOOS=linux GOARCH=amd64 $(GO) build $(GO_BUILD_FLAGS) -o dist/plugin-linux-amd64; | ||||||
| 	cd server && env GOOS=darwin GOARCH=amd64 $(GO) build -o dist/plugin-darwin-amd64; | 	cd server && env GOOS=darwin GOARCH=amd64 $(GO) build $(GO_BUILD_FLAGS) -o dist/plugin-darwin-amd64; | ||||||
| 	cd server && env GOOS=windows GOARCH=amd64 $(GO) build -o dist/plugin-windows-amd64.exe; | 	cd server && env GOOS=windows GOARCH=amd64 $(GO) build $(GO_BUILD_FLAGS) -o dist/plugin-windows-amd64.exe; | ||||||
| endif | endif | ||||||
| 
 | 
 | ||||||
| ## Ensures NPM dependencies are installed without having to run this all the time.
 | ## Ensures NPM dependencies are installed without having to run this all the time.
 | ||||||
|  | @ -151,7 +153,7 @@ endif | ||||||
| .PHONY: test | .PHONY: test | ||||||
| test: webapp/.npminstall | test: webapp/.npminstall | ||||||
| ifneq ($(HAS_SERVER),) | ifneq ($(HAS_SERVER),) | ||||||
| 	$(GO) test -race -v ./server/... | 	$(GO) test -v $(GO_TEST_FLAGS) ./server/... | ||||||
| endif | endif | ||||||
| ifneq ($(HAS_WEBAPP),) | ifneq ($(HAS_WEBAPP),) | ||||||
| 	cd webapp && $(NPM) run fix; | 	cd webapp && $(NPM) run fix; | ||||||
|  | @ -161,7 +163,7 @@ endif | ||||||
| .PHONY: coverage | .PHONY: coverage | ||||||
| coverage: webapp/.npminstall | coverage: webapp/.npminstall | ||||||
| ifneq ($(HAS_SERVER),) | ifneq ($(HAS_SERVER),) | ||||||
| 	$(GO) test -race -coverprofile=server/coverage.txt ./server/... | 	$(GO) test $(GO_TEST_FLAGS) -coverprofile=server/coverage.txt ./server/... | ||||||
| 	$(GO) tool cover -html=server/coverage.txt | 	$(GO) tool cover -html=server/coverage.txt | ||||||
| endif | endif | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Reference in a new issue