validateIncludedPackages static method
void
validateIncludedPackages(
- Iterable<
Pubspec> includedPackagePubspecs, { - required SupportedDartSdkPolicy? supportedSdkPolicy,
Validates that the included packages are compatible with Serverpod Cloud.
supportedSdkPolicy is the Dart SDK version policy of Serverpod Cloud,
fetched from the server, or null if it could not be fetched.
See TenantProjectPubspec.projectDependencyIssues.
Throws WorkspaceException if any issues are found.
Implementation
static void validateIncludedPackages(
final Iterable<Pubspec> includedPackagePubspecs, {
required final SupportedDartSdkPolicy? supportedSdkPolicy,
}) {
final List<String> issues = [];
for (final pubspec in includedPackagePubspecs) {
final includedPackageValidator = TenantProjectPubspec(pubspec);
issues.addAll(
includedPackageValidator.projectDependencyIssues(
supportedSdkPolicy: supportedSdkPolicy,
requireServerpod: false,
),
);
}
if (issues.isNotEmpty) {
TenantProject._throwWorkspaceException(messages: issues);
}
}