prepare static method
ProjectFilePreparer
prepare(
- Directory projectDirectory, {
- required TenantProjectPubspec tenantProjectPubspec,
- String? scloudDirPath,
Analyzes the tenant project structure, creates bespoke deployment files, and compiles the list of paths whose contents are to be included. In a workspace, the .scloudignore file is also created in the project's package when it has none.
Specify scloudDirPath to override the default scloud directory path.
Returns a ProjectFilePreparer object to be used to filter project files.
If no workspace root is found, or the preparation fails, error messages will be logged and WorkspaceException is thrown.
Implementation
static ProjectFilePreparer prepare(
Directory projectDirectory, {
required TenantProjectPubspec tenantProjectPubspec,
String? scloudDirPath,
}) {
final String projectPackageName = _getPackageName(projectDirectory);
if (!tenantProjectPubspec.isWorkspaceResolved()) {
return ProjectFilePreparer(
isWorkspace: false,
rootDirectory: projectDirectory,
scloudDir: Directory(scloudDirPath ?? ScloudIgnore.scloudDirName),
includedSubPaths: const ['.'],
includedPackagePaths: [],
projectPackageName: projectPackageName,
);
}
return _prepareWorkspace(
projectDirectory,
projectPackageName: projectPackageName,
projectDirFilename: _scloudServerDirFilename,
validateIncludedPackages: WorkspaceProjectLogic.validateIncludedPackages,
pubGetCommand: 'dart pub get',
keepFlutterEnvironment: false,
writePackageScloudIgnore: true,
scloudDirPath: scloudDirPath,
);
}