Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 15 additions & 5 deletions Sources/SWBWindowsPlatform/Plugin.swift
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,23 @@ struct WindowsPlatformExtension: PlatformInfoExtension {
}

let platformsPath = context.developerPath.path.join("Platforms")
return try context.fs.listdir(platformsPath).compactMap { version in
let versionedPlatformsPath = platformsPath.join(version)
guard context.fs.isDirectory(versionedPlatformsPath) else {
return nil
let platformDirName = "Windows.platform"
return try context.fs.listdir(platformsPath).compactMap { versionOrPlatform in
let windowsInfoPlistPath: Path
let version: String
if versionOrPlatform == platformDirName {
windowsInfoPlistPath = platformsPath.join(platformDirName).join("Info.plist")
version = "0.0.0"
} else {
let versionedPlatformsPath = platformsPath.join(versionOrPlatform)
guard context.fs.isDirectory(versionedPlatformsPath) else {
return nil
}

windowsInfoPlistPath = versionedPlatformsPath.join(platformDirName).join("Info.plist")
version = versionOrPlatform
}

let windowsInfoPlistPath = versionedPlatformsPath.join("Windows.platform").join("Info.plist")
guard context.fs.exists(windowsInfoPlistPath) else {
return nil
}
Expand Down
Loading