dvDevClientCompatibility function
DVDevClientRefusal?
dvDevClientCompatibility({
- required DVDevClientManifest shell,
- required DVDevClientManifest bundle,
Null when a shell built from shell can run a bundle needing bundle.
Implementation
DVDevClientRefusal? dvDevClientCompatibility({
required DVDevClientManifest shell,
required DVDevClientManifest bundle,
}) {
if (shell.target != bundle.target) {
// Plugin lists are per platform, so two manifests for different targets
// can agree by accident and still leave a native call unbound.
return DVDevClientRefusal(
code: dvDevClientMissingBinding,
message:
'This bundle was resolved for ${bundle.target} and this shell '
'was built for ${shell.target}; its bindings were never compared '
'against what this shell has.',
);
}
final Set<String> has = shell.bindings.toSet();
final List<String> missing = <String>[
for (final String binding in bundle.normalizedBindings)
if (!has.contains(binding)) binding,
];
if (missing.isEmpty) return null;
return DVDevClientRefusal(
code: dvDevClientMissingBinding,
missing: missing,
message:
'This bundle needs ${missing.join(', ')}, which this shell was '
'not built with. A native change needs a rebuilt shell: run '
'`dartvel build ${shell.target} --profile development` and install it.',
);
}