-
Notifications
You must be signed in to change notification settings - Fork 582
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace go-bindata with //go:embed from Go 1.16 #392
Changes from 1 commit
016d7ab
d4d2d94
9659d14
aa97016
d65d35b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
/.vagrant | ||
/.build | ||
/ui/.build | ||
/node_modules | ||
.DS_Store | ||
*.exe | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,24 +9,21 @@ endif | |
|
||
ALL: $(CMDS) | ||
|
||
ui: ui/bindata.go | ||
ui: ui/.build/ui | ||
|
||
node_modules: | ||
npm install | ||
|
||
$(GOPATH)/bin/houndd: ui/bindata.go $(SRCS) | ||
$(GOPATH)/bin/houndd: ui/.build/ui $(SRCS) | ||
go install github.com/hound-search/hound/cmds/houndd | ||
|
||
$(GOPATH)/bin/hound: ui/bindata.go $(SRCS) | ||
go install github.com/hound-search/hound/cmds/hound | ||
|
||
.build/bin/go-bindata: | ||
GOPATH=`pwd`/.build go get github.com/go-bindata/go-bindata/... | ||
|
||
ui/bindata.go: .build/bin/go-bindata node_modules $(wildcard ui/assets/**/*) | ||
rsync -r ui/assets/* .build/ui | ||
ui/.build/ui: node_modules $(wildcard ui/assets/**/*) | ||
mkdir -p ui/.build | ||
rsync -r ui/assets/* ui/.build/ui | ||
npx webpack $(WEBPACK_ARGS) | ||
$< -o $@ -pkg ui -prefix .build/ui -nomemcopy .build/ui/... | ||
Comment on lines
+23
to
-29
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe this rule needs some tuning for proper rebuilds. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you elaborate more on what you mean here? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'll try. Since |
||
|
||
dev: ALL | ||
npm install | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,7 @@ | ||
module github.com/hound-search/hound | ||
|
||
go 1.13 | ||
go 1.16 | ||
|
||
require ( | ||
github.com/blang/semver v3.5.1+incompatible | ||
github.com/go-bindata/go-bindata v3.1.2+incompatible // indirect | ||
) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,3 @@ | ||
github.com/blang/semver v1.1.0 h1:ol1rO7QQB5uy7umSNV7VAmLugfLRD+17sYJujRNYPhg= | ||
github.com/blang/semver v3.5.1+incompatible h1:cQNTCjp13qL8KC3Nbxr/y2Bqb63oX6wdnnjpJbkM4JQ= | ||
github.com/blang/semver v3.5.1+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk= | ||
github.com/go-bindata/go-bindata v1.0.0 h1:DZ34txDXWn1DyWa+vQf7V9ANc2ILTtrEjtlsdJRF26M= | ||
github.com/go-bindata/go-bindata v3.1.2+incompatible h1:5vjJMVhowQdPzjE1LdxyFF7YFTXg5IgGVW4gBr5IbvE= | ||
github.com/go-bindata/go-bindata v3.1.2+incompatible/go.mod h1:xK8Dsgwmeed+BBsSy2XTopBn/8uK2HWuGSnA11C3Joo= |
Large diffs are not rendered by default.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the original motivation around using bindata in the first place is so that we could ensure built static assets were present and usable immediately after
go install
, without requiring an additional build step / installingnode_modules
/ etc. I'm admittedly fuzzy about whether or not Go Modules have a post-build lifecycle step, but I think that context is important for this PR.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have had success with pkger.