Skip to content

Commit

Permalink
Merge branch 'main' into improve-resolve-build-products-performance
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryu0118 committed Jul 11, 2024
2 parents 1bb3d13 + 61c5bab commit b378923
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions Sources/ScipioKit/DescriptionPackage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ struct DescriptionPackage {
}

extension DescriptionPackage {
func resolveBuildProducts() throws -> [BuildProduct] {
func resolveBuildProducts() throws -> OrderedSet<BuildProduct> {
let resolver = BuildProductsResolver(descriptionPackage: self)
return try resolver.resolveBuildProducts()
}
Expand Down Expand Up @@ -186,7 +186,6 @@ struct BuildProduct: Hashable, Sendable {
}
}


private final class BuildProductsResolver {
private var buildProductsCache: [BuildProduct: Set<BuildProduct>] = [:]
let descriptionPackage: DescriptionPackage
Expand All @@ -195,7 +194,7 @@ private final class BuildProductsResolver {
self.descriptionPackage = descriptionPackage
}

func resolveBuildProducts() throws -> [BuildProduct] {
func resolveBuildProducts() throws -> OrderedSet<BuildProduct> {
let targetsToBuild = try targetsToBuild()
var products = try targetsToBuild.flatMap(resolveBuildProduct(from:))

Expand Down Expand Up @@ -232,7 +231,7 @@ private final class BuildProductsResolver {
}
}

return products.reversed()
return OrderedSet(products.reversed())
}

private func targetsToBuild() throws -> [ScipioResolvedModule] {
Expand Down

0 comments on commit b378923

Please sign in to comment.