INNER CODE UNIT · Swift

sourceHashFile

skiptools/skip · Plugins/SkipPlugin/SkipPlugin.swift:256

                var sourceHashFile = URL(fileURLWithPath: outputFolder.string, isDirectory: true).appendingPathComponent(moduleLinkTarget + sourcehashExtension, isDirectory: false)
                // turn the module name into a sourcehash file name
                // need to standardize the path to remove ../../ elements form the symlinks, otherwise the input and output paths don't match and Xcode will re-build everything each time
                sourceHashFile = sourceHashFile.standardized
                    .deletingLastPathComponent()
                    .appendingPathComponent(sourceHashDot + sourceHashFile.lastPathComponent, isDirectory: false)
                //Diagnostics.warning("sourceHashFile: outputFolder=\(outputFolder.string) moduleLinkTarget=\(moduleLinkTarget) -> \(sourceHashFile)")

                // output a .sourcehash file contains all the input files, so the transpile will be re-run when any of the input sources have changed
                let sourceHashFilePath = Path(sourceHashFile.path)
                inputFiles.append(sourceHashFilePath)
                //Diagnostics.remark("add sourcehash input for \(depTarget.name): \(sourceHashFilePath.string)", file: sourceHashFilePath.string)
            }
        }

        // due to FB12969712 https://github.com/apple/swift-package-manager/issues/6816 , we cannot trust the list of input files sent to the plugin because Xcode caches them onces and doesn't change them when the package source file list changes (unless first manually running: File -> Packages -> Reset Package Caches)
        // so instead we just pass the targets folder to the skip tool, and rely on it the tool to walk the file system and determine which files have changed or been renamed
        //let inputSources = target.sourceFiles // source file list will be built by walking the --project flag instead

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…