 				return failure(CarthageError.ParseError(description: "expected file URL for built products directory, got \(productsDir)").error)
 			}
 		}
+}
+
+/// Calculates a URL against `BUILT_PRODUCTS_DIR` using a build setting that
+/// represents a relative path.
+private func URLWithPathRelativeToBuildProductsDirectory(pathSettingName: String, settings: Dictionary<String, String>) -> ColdSignal<NSURL> {
+	return URLToBuildProductsDirectory(settings)
 		// TODO: This should be a zip.
 		.combineLatestWith(valueForBuildSetting(pathSettingName, settings))
 		.map { (productsDirURL, path) in productsDirURL.URLByAppendingPathComponent(path) }

		.merge(identity)
}

/// Calculates a URL against `BUILT_PRODUCTS_DIR` using a build setting that
/// represents a relative path.
private func URLWithPathRelativeToBuildProductsDirectory(pathSettingName: String, settings: Dictionary<String, String>) -> ColdSignal<NSURL> {
	return valueForBuildSetting("BUILT_PRODUCTS_DIR", settings)
		.tryMap { productsDir -> Result<NSURL> in
			if let fileURL = NSURL.fileURLWithPath(productsDir, isDirectory: true) {

									.merge(identity)

								let sourceModulesURL = pathToModulesFolder(simulatorSettings)
									// TODO: This should be a zip.
									.combineLatestWith(URLToBuildProductsDirectory(simulatorSettings))
									.map { (modulesPath, productsURL) -> NSURL in
										return productsURL.URLByAppendingPathComponent(modulesPath)
									}

								let destinationModulesURL = pathToModulesFolder(deviceSettings)
