summaryrefslogtreecommitdiffhomepage
path: root/magefile.go
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <[email protected]>2017-10-21 16:19:04 +0200
committerBjørn Erik Pedersen <[email protected]>2017-10-21 19:30:23 +0200
commitf711b170e4bb286ffa544dfdb48cff4e8f74497f (patch)
tree139ada6f2276c248a71480156a18ce234520959b /magefile.go
parent9536f7cd05c745cff51d23de696d92c3ae4bcfa9 (diff)
downloadhugo-f711b170e4bb286ffa544dfdb48cff4e8f74497f.tar.gz
hugo-f711b170e4bb286ffa544dfdb48cff4e8f74497f.zip
Update magefile to use Go Dep
See #3988
Diffstat (limited to 'magefile.go')
-rw-r--r--magefile.go32
1 files changed, 16 insertions, 16 deletions
diff --git a/magefile.go b/magefile.go
index 89bbd7481..25cf75cb0 100644
--- a/magefile.go
+++ b/magefile.go
@@ -32,14 +32,14 @@ func init() {
}
}
-func govendor() error {
- return sh.Run(goexe, "get", "github.com/kardianos/govendor")
+func getDep() error {
+ return sh.Run(goexe, "get", "-u", "github.com/golang/dep/cmd/dep")
}
-// Install govendor and sync Hugo's vendored dependencies
+// Install Go Dep and sync Hugo's vendored dependencies
func Vendor() error {
- mg.Deps(govendor)
- return sh.Run("govendor", "sync", packageName)
+ mg.Deps(getDep)
+ return sh.Run("dep", "ensure")
}
// Build hugo binary
@@ -103,19 +103,19 @@ func Check() {
// Run tests in 32-bit mode
func Test386() error {
- return sh.RunWith(map[string]string{"GOARCH": "386"}, "govendor", "test", "+local")
+ return sh.RunWith(map[string]string{"GOARCH": "386"}, goexe, "test", "./...")
}
// Run tests
func Test() error {
- mg.Deps(govendor)
- return sh.Run("govendor", "test", "+local")
+ mg.Deps(getDep)
+ return sh.Run(goexe, "test", "./...")
}
// Run tests with race detector
func TestRace() error {
- mg.Deps(govendor)
- return sh.Run("govendor", "test", "-race", "+local")
+ mg.Deps(getDep)
+ return sh.Run(goexe, "test", "-race", "./...")
}
// Run gofmt linter
@@ -159,8 +159,8 @@ func Fmt() error {
var pkgPrefixLen = len("github.com/gohugoio/hugo")
func hugoPackages() ([]string, error) {
- mg.Deps(govendor)
- s, err := sh.Output("govendor", "list", "-no-status", "+local")
+ mg.Deps(getDep)
+ s, err := sh.Output(goexe, "list", "./...")
if err != nil {
return nil, err
}
@@ -194,8 +194,8 @@ func Lint() error {
// Run go vet linter
func Vet() error {
- mg.Deps(govendor)
- if err := sh.Run("govendor", "vet", "+local"); err != nil {
+ mg.Deps(getDep)
+ if err := sh.Run(goexe, "vet", "./..."); err != nil {
return fmt.Errorf("error running govendor: %v", err)
}
return nil
@@ -203,7 +203,7 @@ func Vet() error {
// Generate test coverage report
func TestCoverHTML() error {
- mg.Deps(govendor)
+ mg.Deps(getDep)
const (
coverAll = "coverage-all.out"
cover = "coverage.out"
@@ -221,7 +221,7 @@ func TestCoverHTML() error {
return err
}
for _, pkg := range pkgs {
- if err := sh.Run("govendor", "test", "-coverprofile="+cover, "-covermode=count", pkg); err != nil {
+ if err := sh.Run(goexe, "test", "-coverprofile="+cover, "-covermode=count", pkg); err != nil {
return err
}
b, err := ioutil.ReadFile(cover)