this repo has no description
www.jonmsterling.com/01HC/
1// SPDX-FileCopyrightText: 2025 The Project Pterodactyl Developers
2//
3// SPDX-License-Identifier: MPL-2.0
4
5import Foundation
6import TSCBasic
7import llbuild2fx
8
9extension Keys {
10 struct UnitMapOfSourceTree: BuildKey {
11 typealias ValueType = UnitMap
12 let sourceTreeId: LLBDataID
13
14 func computeValue(_ ctx: BuildContext<Self>) async throws -> UnitMap {
15 let sourceTree = try await LLBCASFileTree.load(id: sourceTreeId, in: ctx)
16 var units: [UnitName: UnitInfo] = [:]
17 try await sourceTree.traverse(root: .root, in: ctx) { path, blobID, directoryEntry in
18 let unitName = UnitName.fromPath(path)
19 units[unitName] = UnitInfo(path: path, blobId: blobID)
20 }
21
22 return UnitMap(units: units)
23 }
24 }
25}