-
Notifications
You must be signed in to change notification settings - Fork 29.8k
Description
Use case
I own a library that uses pigeon library directly specifically the command runWithOptions. This library makes it possible to use pigeon with build_runner, therefore I make use of ScratchSpace. The problem is that, if an input file has PigeonOptions, the scratch space paths are overwritten with those defined in the input file. I would like if the function runWithOptions would have a flag to turn off the ability to overwrite with the PigeonOptions in the input file. This is because in my library, I already use those options in the input file to generate the paths to the scratch space
Proposal
I can see the solution to this being done in two different ways:
Proposal A
The merging of options could be moved to the run function and those options passed to runWithOptions
Proposal B
Have a flag in the function to prevent the merging of the options and the following code https://github.com/flutter/packages/blob/09888cbc304b152e69f8cd98261580765afb4b9f/packages/pigeon/lib/src/pigeon_lib.dart#L2682-L2685 can be put within that flag such that if true, then merging of the options is done
static Future<int> runWithOptions(
PigeonOptions options, {
List<GeneratorAdapter>? adapters,
String? sdkPath,
bool injectOverflowTypes = false,
bool flagToMergeOptions = true,
}) async {