-
Notifications
You must be signed in to change notification settings - Fork 135
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
Build a gallium
tool to build and bundle projects
#15
Comments
I like this proposal a lot. I think a unified I wonder if the solution is to just have what you described as Thanks for writing this up! Are you thinking of working on this? |
@alexflint great! I'm definitely up for working on this :)
Checking-in generated code would actually be better for API changes than asking users to code the We would generate the code with a big comment saying they must never edit it by hand. The idea is to allow them to build and bundle the app regardless of whether they have the gallium app installed or with version they have installed. If they wanted to upgrade gallium, they would need to re-generate the code.
My worry about keeping the generated code outside of the repo is reproducible builds. I would like somebody to checkout my gallium-based app and be able to build it regardless of whether they have the gallium app installed.
There's two different things here in my opinion:
That would always be a possibility, yes. |
i disagree here. I feel that codegen is for much later, and there is little point doing it until the actual code is working. Then if you do want to do codegen, dont reinvent the wheel. Use goa. |
@joeblew99 generating the When talking about codegen here I'm referring to templated code, rather than DSLs. You would write code against an API rather than a DSL. Regarding |
@ernesto-jimenez thanks for the answer. so can you point me to an example of where we DO or WOULD gen the main ?. I think i generalised in my answer, and now i want to see the exact context. Curious :) |
thanks @ernesto-jimenez |
The project has a couple of important requirements:
runtime.LockOSThread
andgallium.Loop
on themain
functionmenu
example only works when run from a bundle.Instead of having people create their own
main
files, it might be helpful to have a CLI to manage both compilation and bundling.The UX would be something like this:
github.com/alexflint/gallium/examples/menu/menu.go
Building the application
As part of the build, it will create a temporary
main
package with amain.go
file from a template similar to this:Once generated, it will build the binary and bundle it and produce a ready
menu.app
.Beyond not having to deal with thread locking and initialising the loop, we can check whether the returned satisfies other gallium interfaces to build more elaborate main files.
DefaultMenus() []gallium.Menu
returning the default menu for the appConfig() gallium.Config
could return information used to setup your app or your bundle. Would probably have some information like the one contained in cordova's (phonegap) config.xml.The CLI could also evolve to offer other features:
It should also have a command to generate all the Go code needed to build and bundle the app with within the same repo. Everything that would be required to build the app without the
cli
, so it can be committed to the repo.The text was updated successfully, but these errors were encountered: