buildDslResourcesPayloadJson function
Dispatches to one of the resource payload builders used by the CLI and MCP.
Implementation
Map<String, dynamic> buildDslResourcesPayloadJson(
FFProject project, {
String? libraryName,
String? libraryComponentName,
String? matchQuery,
Map<String, FFProject> libraryProjects = const {},
}) {
if (libraryComponentName != null && matchQuery != null) {
throw ArgumentError(
'--library-component and --match are mutually exclusive.',
);
}
return libraryComponentName != null
? buildDslLibraryComponentResolutionJson(
project,
componentName: libraryComponentName,
libraryName: libraryName,
libraryProjects: libraryProjects,
)
: matchQuery != null
? buildDslClosestResourceMatchJson(
project,
query: matchQuery,
libraryProjects: libraryProjects,
)
: buildDslResourceInventoryJson(
project,
libraryProjects: libraryProjects,
);
}