From 362fc5c2ff15cb73b3c8e053c6c97b3d2110f207 Mon Sep 17 00:00:00 2001 From: Frédéric Guillot Date: Fri, 28 Dec 2018 13:58:01 -0800 Subject: Add -mod=vendor in Makefile --- Makefile | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 24a0c50..ad007a9 100644 --- a/Makefile +++ b/Makefile @@ -5,6 +5,8 @@ LD_FLAGS := "-s -w -X 'miniflux.app/version.Version=$(VERSION)' -X 'miniflux.app PKG_LIST := $(shell go list ./... | grep -v /vendor/) DB_URL := postgres://postgres:postgres@localhost/miniflux_test?sslmode=disable +export GO111MODULE=on + .PHONY: generate .PHONY: miniflux .PHONY: linux-amd64 @@ -19,7 +21,7 @@ DB_URL := postgres://postgres:postgres@localhost/miniflux_test?sslmode=disable .PHONY: build run clean test lint integration-test clean-integration-test generate: - @ go generate + @ go generate -mod=vendor miniflux: generate @ go build -mod=vendor -ldflags=$(LD_FLAGS) -o $(APP) main.go @@ -54,13 +56,13 @@ windows-amd64: generate build: linux-amd64 linux-armv8 linux-armv7 linux-armv6 linux-armv5 darwin-amd64 freebsd-amd64 openbsd-amd64 windows-amd64 run: generate - @ go run main.go -debug + @ go run -mod=vendor main.go -debug clean: @ rm -f $(APP)-* $(APP) test: - go test -cover -race -count=1 ./... + go test -mod=vendor -cover -race -count=1 ./... lint: @ golint -set_exit_status ${PKG_LIST} @@ -68,12 +70,12 @@ lint: integration-test: psql -U postgres -c 'drop database if exists miniflux_test;' psql -U postgres -c 'create database miniflux_test;' - DATABASE_URL=$(DB_URL) go run main.go -migrate - DATABASE_URL=$(DB_URL) ADMIN_USERNAME=admin ADMIN_PASSWORD=test123 go run main.go -create-admin - go build -o miniflux-test main.go + DATABASE_URL=$(DB_URL) go run -mod=vendor main.go -migrate + DATABASE_URL=$(DB_URL) ADMIN_USERNAME=admin ADMIN_PASSWORD=test123 go run -mod=vendor main.go -create-admin + go build -mod=vendor -o miniflux-test main.go DATABASE_URL=$(DB_URL) ./miniflux-test -debug >/tmp/miniflux.log 2>&1 & echo "$$!" > "/tmp/miniflux.pid" while ! echo exit | nc localhost 8080; do sleep 1; done >/dev/null - go test -v -tags=integration -count=1 miniflux.app/tests || cat /tmp/miniflux.log + go test -mod=vendor -v -tags=integration -count=1 miniflux.app/tests || cat /tmp/miniflux.log clean-integration-test: @ kill -9 `cat /tmp/miniflux.pid` -- cgit v1.2.3