Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Prompt plugin authors to add Swift Package Manager compatibility to their plugin #148222

@vashworth

Description

@vashworth
  • When detected that a flutter project is a plugin example app that has a podspec but doesn't have a Package.swift, prompt the user to add Swift Package Manager compatibility and point to documentation with instructions on how to do that.

/// Expected path to the plugin's Package.swift. Returns null if the plugin
/// does not support the [platform] or the [platform] is not iOS or macOS.
String? pluginSwiftPackageManifestPath(
FileSystem fileSystem,
String platform,
) {
final String? platformDirectoryName = _darwinPluginDirectoryName(platform);
if (platformDirectoryName == null) {
return null;
}
return fileSystem.path.join(
path,
platformDirectoryName,
name,
'Package.swift',
);
}
/// Expected path to the plugin's podspec. Returns null if the plugin does
/// not support the [platform] or the [platform] is not iOS or macOS.
String? pluginPodspecPath(FileSystem fileSystem, String platform) {
final String? platformDirectoryName = _darwinPluginDirectoryName(platform);
if (platformDirectoryName == null) {
return null;
}
return fileSystem.path.join(path, platformDirectoryName, '$name.podspec');
}

bool get hasExampleApp => _exampleDirectory(directory).existsSync();

FlutterProject get example => FlutterProject(
_exampleDirectory(directory),
_exampleManifest,
FlutterManifest.empty(logger: globals.logger),
);

bool get isPlugin => manifest.isPlugin;

Metadata

Metadata

Assignees

Labels

P2Important issues not at the top of the work listteam-iosOwned by iOS platform teamtoolAffects the "flutter" command-line tool. See also t: labels.triaged-iosTriaged by iOS platform team

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions