-
Notifications
You must be signed in to change notification settings - Fork 110
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
Guidance on how to create our own Builder #745
Comments
If the It is a bit more annoying for users to have to list the separate files, but you can only share outputs if you don't need to see the outputs of the other builders (files cannot change once emitted).
The name you defined is You should just be able to do I can't answer why it wouldn't work on GitHub actions without more information - there is likely something misconfigured in the action (working dir, etc).
That doesn't make sense, something else is going on. The correct name based on the config above is either |
Hi, I am writing this seeking for help, since it's quite complicated to find resources on the best way to create Builders 🙂
For our project, we created our own Builder for a specific task. From an input file containing annotated elements, we'd like to obtain a
.rpc.dart
generated file. Then, we want to apply the retrofit builder on this generated file, to obtain the output, a generated file with.g.dart
extension.For this, we created
rpc_generator
usingsource_gen
. Thebuild.yaml
file looks like this:rpc_generator.dart
contains the following:Builder rpcBuilder(BuilderOptions options) => generatorFactoryBuilder(options);
And finally, the builder and generator themselves:
In local, we have this
build.yaml
file to call ourBuilder
on our files:My questions are the following:
PartBuilder
because we have to keep both outputs from ourBuilder
andretrofit
builder. But is it possible to do better for this task? Like have aSharedPartBuilder
that first generate a.g.dart
containing our generated code, then runretrofit
builder on this generated code and combine both outputs in a single.g.dart
file ?dart run build_runner build --delete-conflicting-outputs
in local, a warning appears:Warning: Configuring `rpc_generator:rpcBuilder` in target `data:data` but this is not a known Builder
. Yet, our files are generating correctly. However, when our CI launches the same command through GitHub Actions, the files are not generated. I do not understand why this warning is triggered and why thebuild_runner
behavior changes from local to remote ?build.yaml
file, we HAVE to call the builder like this:rpc_generator:rpcBuilder:
, otherwise the files are not generated if we only putrpc_generator:
. From what I understood, if the builder has the same name as its package, we should be able to callrpc_generator:
directly without having to specify the builder factory. Do you have an idea why this is happening?Thanks in advance for your help 🙂 I can provide more details if needed.
The text was updated successfully, but these errors were encountered: