func build()

in Sources/XCRemoteCache/Dependencies/PathDependenciesRemapperFactory.swift [28:46]


    func build(
        orderKeys: [String],
        envs: [String: String],
        customMappings: [String: String]
    ) throws -> StringDependenciesRemapper {
        let mappingMap = try envs.merging(customMappings) { _, _ in
            throw PathDependenciesRemapperFactoryError.mappingKeyDuplication
        }
        let mappingOrderKeys = orderKeys + customMappings.keys
        let mappings: [StringDependenciesRemapper.Mapping] = mappingOrderKeys.compactMap { key in
            guard let localURL: URL = mappingMap.readEnv(key: key) else {
                debugLog("\(key) ENV to map a dependency is not defined")
                return nil
            }
            infoLog("Found url to remapp: \(localURL). Remapping: \(localURL.standardized.path)")
            return StringDependenciesRemapper.Mapping(generic: "$(\(key))", local: localURL.standardized.path)
        }
        return StringDependenciesRemapper(mappings: mappings)
    }