Skip to content

Removing false duplicates for platform #96

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 10, 2025
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions Package.resolved

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,8 @@ private extension SwiftPackageFileAnalyzer {
listOfChanges += consistent.compactMap { platformName in
guard
let newPlatform = new.first(where: { $0.name == platformName }),
let oldPlatform = old.first(where: { $0.name == platformName })
let oldPlatform = old.first(where: { $0.name == platformName }),
newPlatform.description != oldPlatform.description
else { return nil }

return "Changed from \(oldPlatform.description) to \(newPlatform.description)"
Expand Down
18 changes: 13 additions & 5 deletions Tests/UnitTests/SwiftPackageFileAnalyzerTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,11 @@ class SwiftPackageFileAnalyzerTests: XCTestCase {
packageDescription = SwiftPackageDescription(
defaultLocalization: "en-us",
name: "New Name",
platforms: [.init(name: "iOS", version: "15.0"), .init(name: "visionOS", version: "1.0")],
platforms: [
.init(name: "iOS", version: "15.0"),
.init(name: "macOS", version: "10.0"),
.init(name: "visionOS", version: "1.0")
],
products: [
.init(name: "New Library", targets: ["New Target"]),
.init(name: "Some Library", targets: ["Some Target", "New Target"])
Expand All @@ -98,7 +102,11 @@ class SwiftPackageFileAnalyzerTests: XCTestCase {
packageDescription = SwiftPackageDescription(
defaultLocalization: "nl-nl",
name: "Old Name",
platforms: [.init(name: "iOS", version: "12.0"), .init(name: "macOS", version: "10.0")],
platforms: [
.init(name: "iOS", version: "12.0"),
.init(name: "macOS", version: "10.0"),
.init(name: "driverKit", version: "1.0")
],
products: [
.init(name: "Old Library", targets: ["Old Target"]),
.init(name: "Some Library", targets: ["Some Target", "Old Target"])
Expand Down Expand Up @@ -166,14 +174,14 @@ class SwiftPackageFileAnalyzerTests: XCTestCase {
),
.init(
changeType: .modification(
oldDescription: "platforms: [.iOS(12.0), .macOS(10.0)]",
newDescription: "platforms: [.iOS(15.0), .visionOS(1.0)]"
oldDescription: "platforms: [.iOS(12.0), .macOS(10.0), .driverKit(1.0)]",
newDescription: "platforms: [.iOS(15.0), .macOS(10.0), .visionOS(1.0)]"
),
parentPath: "Package.swift",
listOfChanges: [
"Added .visionOS(1.0)",
"Changed from .iOS(12.0) to .iOS(15.0)",
"Removed .macOS(10.0)"
"Removed .driverKit(1.0)"
]
),
.init(
Expand Down
Loading