1
0
mirror of https://github.com/schollz/cowyo.git synced 2023-08-10 21:13:00 +03:00

Merge pull request #115 from DanielHeath/split-bindata

Remove unused cgo and split debug/non-debug asset builds
This commit is contained in:
Zack 2018-02-18 11:34:39 -08:00 committed by GitHub
commit c78dec28eb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 1208 additions and 13 deletions

View File

@ -2,39 +2,49 @@
# make -j4 release
VERSION=$(shell git describe)
LDFLAGS=-ldflags "-s -w -X main.version=${VERSION} -X main.hotCodeReloading=false" -a -installsuffix cgo
LDFLAGS=-ldflags "-X main.version=${VERSION}"
.PHONY: build
build:
go-bindata static/... templates/...
build: bindata.go
go build ${LDFLAGS}
STATICFILES := $(wildcard static/*)
TEMPLATES := $(wildcard templates/*)
bindata.go: $(STATICFILES) $(TEMPLATES)
go-bindata -tags '!debug' static/... templates/...
bindata-debug.go: $(STATICFILES) $(TEMPLATES)
go-bindata -tags 'debug' -o bindata-debug.go -debug static/... templates/...
.PHONY: devel
devel: bindata-debug.go
go build -tags debug
.PHONY: quick
quick:
go-bindata -debug static/... templates/...
go build -ldflags "-X main.hotCodeReloading=true"
quick: bindata.go
go build
.PHONY: linuxarm
linuxarm:
linuxarm: bindata.go
env GOOS=linux GOARCH=arm go build ${LDFLAGS} -o dist/cowyo_linux_arm
#cd dist && upx --brute cowyo_linux_arm
.PHONY: linux32
linux32:
linux32: bindata.go
env GOOS=linux GOARCH=386 go build ${LDFLAGS} -o dist/cowyo_linux_32bit
#cd dist && upx --brute cowyo_linux_32bit
.PHONY: linux64
linux64:
linux64: bindata.go
env GOOS=linux GOARCH=amd64 go build ${LDFLAGS} -o dist/cowyo_linux_amd64
.PHONY: windows
windows:
windows: bindata.go
env GOOS=windows GOARCH=amd64 go build ${LDFLAGS} -o dist/cowyo_windows_amd64.exe
#cd dist && upx --brute cowyo_windows_amd64.exe
.PHONY: osx
osx:
osx: bindata.go
env GOOS=darwin GOARCH=amd64 go build ${LDFLAGS} -o dist/cowyo_osx_amd64
#cd dist && upx --brute cowyo_osx_amd64

1153
bindata-debug.go Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,6 @@
// Code generated by go-bindata.
// sources:
// static/.DS_Store
// static/css/base-min.css
// static/css/default.css
// static/css/github-markdown.css
@ -47,6 +48,8 @@
// templates/index.tmpl
// DO NOT EDIT!
// +build !debug
package main
import (
@ -112,6 +115,26 @@ func (fi bindataFileInfo) Sys() interface{} {
return nil
}
var _staticDs_store = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xec\xd8\x31\x0a\x02\x31\x10\x85\xe1\x37\x31\x45\xc0\x26\xa5\x65\x1a\x0f\xe0\x0d\xc2\xb2\x9e\xc0\x0b\x58\x78\x05\xfb\x1c\x5d\x96\x79\x60\x60\xd5\x4e\x8c\xcb\xfb\x40\xfe\x05\x37\x2a\x16\x31\x23\x00\x9b\xee\xb7\x13\x90\x01\x24\x78\x71\xc4\x4b\x89\x8f\x95\xd0\x5d\x1b\x5f\x43\x44\x44\x44\xc6\x66\x9e\xb4\xff\xf5\x07\x11\x91\xe1\x2c\xfb\x43\x61\x2b\xdb\xbc\xc6\xe7\x03\x1b\xbb\x35\x99\x2d\x6c\x65\x9b\xd7\x78\x5f\x60\x23\x9b\xd8\xcc\x16\xb6\xb2\xcd\xcb\x4d\xcb\x38\x7c\x18\xdf\xd9\x38\xa1\x18\xa7\x10\x2b\x6c\xfd\xce\x77\x23\xf2\xef\x76\x9e\xbc\xfc\xfe\x9f\xdf\xcf\xff\x22\xb2\x61\x16\xe7\xcb\x3c\x3d\x07\x82\xf5\x0d\x00\xae\xdd\xf5\xa7\x43\x40\xf0\x3f\x0b\x0f\xdd\x5a\x1d\x04\x44\x06\xf3\x08\x00\x00\xff\xff\x6a\x00\x88\x6d\x04\x18\x00\x00")
func staticDs_storeBytes() ([]byte, error) {
return bindataRead(
_staticDs_store,
"static/.DS_Store",
)
}
func staticDs_store() (*asset, error) {
bytes, err := staticDs_storeBytes()
if err != nil {
return nil, err
}
info := bindataFileInfo{name: "static/.DS_Store", size: 6148, mode: os.FileMode(420), modTime: time.Unix(1518738462, 0)}
a := &asset{bytes: bytes, info: info}
return a, nil
}
var _staticCssBaseMinCss = []byte("\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\x74\x56\xdd\x8e\xdc\x36\x0f\xbd\xdf\xa7\x70\x10\x04\x48\x02\xdb\xe3\xdd\xfd\x92\xfd\x20\xa3\x37\x4d\x83\x22\x45\x1a\x14\x48\x6f\x8a\xc5\x14\xa0\x25\x8e\xad\xae\x24\x0a\x12\x3d\x3b\xb3\x8e\xdf\xbd\x90\x3d\x3f\x9e\x74\x73\x35\x36\x45\x1e\x1e\xf1\x90\xf4\xac\xde\xbe\xb8\xfa\xa3\x0f\x98\x6d\xab\xf2\x7d\x79\x73\xf5\x81\xfc\x3e\xe8\xb6\xe3\xec\xa6\xba\xbe\xcd\xfe\x82\x8e\xe8\xc5\xd5\x67\x2d\xd1\x45\x54\x59\xef\x14\x86\x8c\x3b\xcc\x7e\xfe\xfa\x4b\x76\x30\x97\x57\x1d\xb3\x8f\x62\xb5\x6a\x35\x77\x7d\x53\x4a\xb2\xab\x7d\x8a\x5c\xf9\x3e\xe0\xaa\x31\xd4\xac\x2c\x44\xc6\xb0\xfa\xfc\xe9\xc3\xc7\x2f\x5f\x3f\x96\x56\x5d\xbd\x5d\x5d\xa5\xec\x8e\x82\x05\xa3\x9f\xb0\x94\x31\x66\xdb\xbf\x6f\xcb\x2a\xfb\x96\xfd\xfe\xe9\xcf\x23\x7c\xf6\x2d\x6b\x35\x97\x9a\x56\x27\xd7\x05\xcd\xd7\xf2\x4d\xf6\x45\x4b\x32\x10\xb3\x5f\xc1\x18\x68\x3b\x0c\x19\x38\x95\xfd\x46\x0e\xb8\x03\x97\x7d\x41\x30\x87\x6c\xd9\x77\xd9\x6e\xcb\xaa\xbc\x7d\x2e\xdd\xf1\x1a\x0e\x27\xe8\xd5\x65\xdc\xdb\x95\xb6\x6d\x6e\xb0\x45\xa7\x86\x86\x82\xc2\x20\xaa\x71\x7e\xcf\x59\xe5\xdc\x0d\x1e\x94\xd2\xae\x15\xd5\xd8\xb1\x35\xc3\x86\x1c\x17\x1b\xb0\xda\xec\x45\x04\x17\x8b\x88\x41\x6f\xea\xc2\xc6\x82\x71\xc7\x45\xd4\x4f\x58\x80\xfa\xa7\x8f\x2c\xae\xab\xea\x55\x5d\x3c\x62\xf3\xa0\xf9\xf9\xd3\xb1\x21\xb5\x1f\x2c\x84\x56\x3b\x51\x8d\x10\x58\x4b\x83\x39\x44\xad\x30\x57\xc8\xa0\x4d\xcc\x37\xba\x95\xe0\x59\x93\x4b\x8f\x7d\xc0\x7c\x43\xc4\x18\xf2\x0e\x41\xa5\x9f\x36\x50\xef\x73\x0b\xda\xe5\x16\x5d\x9f\x3b\xd8\xe6\x11\xe5\x14\x11\x7b\x6b\x21\xec\x07\xa5\xa3\x37\xb0\x17\x8d\x21\xf9\x30\x42\xaf\x34\xe5\x12\xdc\x16\x62\xee\x03\xb5\x01\x63\xcc\xb7\x5a\x21\x9d\x3c\xb5\x33\xda\x61\x31\x05\xd4\x5b\x4c\xd4\xc0\x14\x60\x74\xeb\x44\x03\x11\xd3\xe9\x0c\x24\x1c\xf1\xeb\x7b\x49\x8e\x03\x99\xb8\x7e\x73\x82\x70\xe4\xb0\xee\x30\xe9\x2b\xaa\xf1\xbe\xd3\x4a\xa1\x5b\xe7\x8c\xd6\x1b\x60\xbc\xf0\x1b\x61\x68\x40\x3e\xa4\xbb\x38\x55\x48\x32\x14\x04\x07\x70\xd1\x43\x40\xc7\x23\x08\x90\xac\xb7\x98\x83\xe8\x68\x8b\x61\xa0\x9e\x13\x85\x54\xb6\xa6\x09\xf7\xac\xd9\xe0\xfa\x20\x62\xd1\x10\x33\x59\x71\xed\x77\x99\x22\x66\x54\x63\x93\x93\xe7\xb9\x52\x91\x03\xb9\x76\x96\xf2\x71\x66\x77\x57\x55\xa3\xda\xb8\xd9\x16\x79\x6f\x50\x68\x06\xa3\xe5\xd8\x5d\x1f\x8c\xfa\x09\xc5\x0d\xda\xfa\xa0\x56\xf9\xfe\x0e\x6d\x56\x8d\x16\xc2\xc3\x82\xb9\x78\xb9\xd9\x54\xf5\x4c\xff\x65\x55\x55\x63\xb4\x60\xcc\x02\xe2\xff\xd5\xab\x31\xf6\x4d\x1e\x7b\xbf\xb0\xde\xbd\x7b\x55\x4f\xe5\x3e\x56\xab\xf6\x14\x75\x52\x50\x04\x34\x90\x2e\xfe\x43\x0d\x12\x12\x93\x17\x45\xf9\x0e\x6d\xc2\x1e\x0e\xb7\x2f\xca\x9b\xc9\xb2\x6d\x27\x85\x44\x20\xe2\x37\x43\x2a\xde\xc6\xd0\xa3\x98\xe5\x18\xe7\x9e\x3a\x36\xe1\x35\xda\xec\x7f\x95\xdf\x8d\x5d\x18\x1a\xda\x25\x76\xa9\xfb\x93\xb8\xe8\xb8\x68\x68\x77\x16\xd4\x07\xcc\x53\x5b\x43\x40\x38\xc3\x42\xcf\x34\x4a\x52\x98\x3f\x34\x2a\x4f\x3e\x11\xac\xbf\x18\x1c\x4b\x8e\xa2\x07\x89\xf9\xe9\xa9\x3e\xd7\xe2\x1a\xed\xd8\xf4\xcc\xe4\x72\xed\x7c\xcf\x0b\xe1\xd0\xa0\xe4\x73\xce\xb9\xcc\xda\x75\x18\x34\x4f\x08\xa7\x97\xd3\x4c\xcd\x48\x67\x7a\x5b\x1d\x75\x63\xf0\x98\x61\x86\x1c\xa6\xe9\x9c\xda\x6d\x43\xc1\xce\x0d\x79\xf0\x48\x63\x9f\x4d\x44\xee\x79\xef\xf1\xa7\xd9\xbc\xce\x17\xa6\x80\x11\xf9\xc2\x12\xfb\xc6\x6a\x5e\x0f\xc7\xe9\x07\xef\x11\x02\x38\x89\x62\x8e\xaf\x65\x1f\x22\x05\xe1\x49\x3b\xc6\x70\x48\x76\xaf\x74\x84\xc6\xa0\x5a\x2f\xd3\x9e\x8c\xc3\x21\x48\xe1\x06\x7a\xc3\x87\x20\x21\x0a\x4b\x4f\xc5\x86\x64\x1f\x0b\xed\x1c\x86\x99\xc9\x7f\xed\xa7\x15\x57\x9f\xb7\xda\xe4\x3a\x2c\x7b\x6f\x5e\x91\xe3\xe2\x36\xb2\x43\xf9\xd0\xd0\xee\xf2\xd2\xa0\x34\xad\x97\x4d\x72\x9a\xbd\xdd\xf7\xf8\x73\x84\xeb\x6d\x83\x61\x2d\xc4\xb1\x2a\x13\xa9\x22\x7a\xed\x8a\xa5\xe0\x3f\xf0\xa6\x9e\x2f\xbd\x87\x03\xe1\xa9\xe3\x96\xc5\x47\x08\xb2\x7b\xb6\xf8\x49\xe7\x8d\x46\xa3\xea\xe7\x9b\xfb\x19\x98\x33\x81\xd9\x50\xc8\x84\x64\x9e\x61\xfc\xa3\x00\x85\x92\x02\xa4\x61\x7e\x8e\xd2\xd4\x6b\x13\xa7\x88\x7c\x54\x28\x2d\xae\x48\x46\xab\x2c\x6a\xb3\xc5\x70\xea\xe7\xec\xc6\x9f\xab\x5b\xde\xbe\x43\x9b\x95\xef\x6f\xa6\x9f\xbb\x34\xec\x9c\x3a\xe5\xb8\x05\x25\x19\x03\x3e\xa2\x38\x3e\xd4\x87\x83\x34\x72\xb3\x3c\xe5\xbc\x05\xf2\xe3\x72\xbe\xd8\xc9\x2f\xb4\xf5\x14\x18\x1c\x8f\x65\xfa\x07\x50\x68\xdb\x0e\x16\x76\xc5\xa3\x56\xdc\xcd\xdf\xb7\x85\x06\xf5\xe5\x47\xe6\xdf\x00\x00\x00\xff\xff\x96\xa4\xc2\xf8\x93\x08\x00\x00")
func staticCssBaseMinCssBytes() ([]byte, error) {
@ -787,7 +810,7 @@ func staticJsCowyoJs() (*asset, error) {
return nil, err
}
info := bindataFileInfo{name: "static/js/cowyo.js", size: 12332, mode: os.FileMode(420), modTime: time.Unix(1517975251, 0)}
info := bindataFileInfo{name: "static/js/cowyo.js", size: 12332, mode: os.FileMode(420), modTime: time.Unix(1518738836, 0)}
a := &asset{bytes: bytes, info: info}
return a, nil
}
@ -1007,7 +1030,7 @@ func templatesIndexTmpl() (*asset, error) {
return nil, err
}
info := bindataFileInfo{name: "templates/index.tmpl", size: 11940, mode: os.FileMode(493), modTime: time.Unix(1517964700, 0)}
info := bindataFileInfo{name: "templates/index.tmpl", size: 11940, mode: os.FileMode(493), modTime: time.Unix(1518738836, 0)}
a := &asset{bytes: bytes, info: info}
return a, nil
}
@ -1064,6 +1087,7 @@ func AssetNames() []string {
// _bindata is a table, holding each asset generator, mapped to its name.
var _bindata = map[string]func() (*asset, error){
"static/.DS_Store": staticDs_store,
"static/css/base-min.css": staticCssBaseMinCss,
"static/css/default.css": staticCssDefaultCss,
"static/css/github-markdown.css": staticCssGithubMarkdownCss,
@ -1152,6 +1176,7 @@ type bintree struct {
}
var _bintree = &bintree{nil, map[string]*bintree{
"static": &bintree{nil, map[string]*bintree{
".DS_Store": &bintree{staticDs_store, map[string]*bintree{}},
"css": &bintree{nil, map[string]*bintree{
"base-min.css": &bintree{staticCssBaseMinCss, map[string]*bintree{}},
"default.css": &bintree{staticCssDefaultCss, map[string]*bintree{}},

7
debug.go Normal file
View File

@ -0,0 +1,7 @@
// +build debug
package main
func init() {
hotTemplateReloading = true
}