From e1b7895e50192ee41faa15f11929e4d81fa1c04e Mon Sep 17 00:00:00 2001 From: Thomas Boerger Date: Mon, 24 Aug 2015 15:22:27 +0200 Subject: [PATCH] Implemented go-bindata into makefile --- make.go | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/make.go b/make.go index 6ee80bfcb..990d851ab 100644 --- a/make.go +++ b/make.go @@ -13,6 +13,8 @@ import ( "os/exec" "path/filepath" "strings" + + "github.com/jteeuwen/go-bindata" ) var ( @@ -28,6 +30,7 @@ var steps = map[string]step{ "json": json, "embed": embed, "vet": vet, + "bindata": bindat, "build": build, "test": test, "image": image, @@ -76,6 +79,29 @@ func json() error { return nil } +// bindata step generates go-bindata package. +func bindat() error { + var paths = []struct { + input string + recursive bool + }{ + {"cmd/drone-server/static", true}, + } + + c := bindata.NewConfig() + c.Output = "cmd/drone-server/drone_bindata.go" + c.Input = make([]bindata.InputConfig, len(paths)) + + for i, path := range paths { + c.Input[i] = bindata.InputConfig{ + Path: path.input, + Recursive: path.recursive, + } + } + + return bindata.Translate(c) +} + // build step creates the application binaries. func build() error { var bins = []struct {