Skip to content
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

Embed static content to binary #47

Closed
4 of 7 tasks
at15 opened this issue Aug 13, 2016 · 6 comments
Closed
4 of 7 tasks

Embed static content to binary #47

at15 opened this issue Aug 13, 2016 · 6 comments
Milestone

Comments

@at15
Copy link
Member

at15 commented Aug 13, 2016

Decided to use rice for embedding assets

-- old content --
This issue is split from #15. Static content is needed for both web interface and generator.

There are two choices

go-bindata

rice

@at15 at15 mentioned this issue Aug 13, 2016
10 tasks
@at15
Copy link
Member Author

at15 commented Aug 13, 2016

I think rice has a cleaner api

at15 added a commit that referenced this issue Aug 13, 2016
- add a simple test for using rice
@at15
Copy link
Member Author

at15 commented Aug 20, 2016

Test files are not build by go, thus call for FindBox in *_test.go won't be found by rice cli

go build -o Ayi
rice append -i github.com/dyweb/Ayi/util/embed --exec Ayi
no calls to rice.FindBox() or rice.MustFindBox() found in import path `github.com/dyweb/Ayi/util/embed`
Error setting zip offset: exit status 13

But how to add multiple import paths?

@at15
Copy link
Member Author

at15 commented Aug 20, 2016

For the zip problem

  • run zip -A Ayi get
$ zip -A Ayi
        zip warning: central dir not where expected - could not adjust offsets
        zip warning: (try -FF)

zip error: Zip file structure invalid (Ayi)

@at15
Copy link
Member Author

at15 commented Aug 20, 2016

From GeertJohan/go.rice#4

You can currently do this by using rice --import-path append --exec alpaca.exe. But that will only allow you to append/embed one package.

Doing a recursive find in all imported packages is something I thought about before.. Simply finding boxes recursively in packages probably won't work since rice allows relative paths, and so you might get multiple different folders with the same name (e.g. templates folder in different packages). It'll probably require some breaking changes in the way a package is appended/embedded and loaded during execution. Maybe need to append with full (absolute) path's to avoid duplicates.
I hope the rice with --import-path will solve your problem. I'll add 'finding boxes in imported packages' to the TODO list.

but multiple packages is supported, by calling -i multiple times? and I need to rename the boxes with prefixes, like app-web-assets, app-generator-assets

at15 added a commit that referenced this issue Aug 20, 2016
- append zip got problem on windows for zip -A, but the binary is still
  working
- boxes need to have different names, haven't tried different packages
  with same box name, like `package web assets, package git assets`
at15 added a commit to at15/go.rice that referenced this issue Aug 20, 2016
- For dyweb/Ayi#47
- TODO: detect runtime os and only disable it on windows
@at15
Copy link
Member Author

at15 commented Aug 20, 2016

I disabled zip -A and is currently using my own fork https://github.com/at15/go.rice , though it's better to detect OS, but I don't have test environment, so just make sure windows is working.

at15 added a commit that referenced this issue Aug 21, 2016
using the feature/ignore branch of at15/go.rice. The pattern is not
fully supported, though it's up and running now.
@at15
Copy link
Member Author

at15 commented Apr 11, 2018

use gommon/noodle, which support .noodleignore dyweb/gommon#47

@at15 at15 closed this as completed Apr 11, 2018
@at15 at15 added this to the 0.2.0 milestone Apr 11, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant