SanderMertens/bake

Question: does Bake support generated headers and source files?

njlr opened this issue · 1 comments

njlr commented

Example would be Protobuf.

Yes, any header that is in the project include folder can be included by your application, and any source file in the src folder will be built.

If you want bake to also generate the files from, for example, a .proto file, you need to write a bake plugin. This is an example driver that generates code based on a .corto file: https://github.com/cortoproject/bake-corto

Drivers in bake are package projects that start with bake., so you can create a new driver with this command:

bake new bake.proto --package

When you built the driver, you can activate it for a project, by adding it to your project.json like this:

{
    "id": "my_app",
    "type": "package",
    "value": {
    },
    "proto": {
        "file": "my_messages.proto"
    }
}

If you end up doing something like this, let me know! This (proto support) would be great to add to the main repo.