Type MethodMethodmodule
moduleNames(fromDumpPackageJSON:)
Returns the module names declared by a package manifest.
static func moduleNames(fromDumpPackageJSON json: String) -> [String]Parameters
jsonThe JSON output of
swift package dump-package.
Return Value
The names of the targets that are not tests or plugins, with hyphens replaced by underscores like Swift module names, or an empty array if the output cannot be read.