mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[migrator] Add -api-diff-data-dir option to override the default location for the migrator's platform + version specific api diff json files
This is useful for testing the migrator with different versions of the api diff data.
This commit is contained in:
@@ -956,9 +956,16 @@ static bool ParseMigratorArgs(MigratorOptions &Opts,
|
||||
auto &Triple = LangOpts.Target;
|
||||
bool isSwiftVersion3 = LangOpts.isSwiftVersion3();
|
||||
|
||||
llvm::SmallString<128> basePath;
|
||||
if (auto DataDir = Args.getLastArg(OPT_api_diff_data_dir)) {
|
||||
basePath = DataDir->getValue();
|
||||
} else {
|
||||
basePath = ResourcePath;
|
||||
llvm::sys::path::append(basePath, "migrator");
|
||||
}
|
||||
|
||||
bool Supported = true;
|
||||
llvm::SmallString<128> dataPath(ResourcePath);
|
||||
llvm::sys::path::append(dataPath, "migrator");
|
||||
llvm::SmallString<128> dataPath(basePath);
|
||||
|
||||
if (Triple.isMacOSX())
|
||||
llvm::sys::path::append(dataPath,
|
||||
@@ -975,8 +982,7 @@ static bool ParseMigratorArgs(MigratorOptions &Opts,
|
||||
else
|
||||
Supported = false;
|
||||
if (Supported) {
|
||||
llvm::SmallString<128> authoredDataPath(ResourcePath);
|
||||
llvm::sys::path::append(authoredDataPath, "migrator");
|
||||
llvm::SmallString<128> authoredDataPath(basePath);
|
||||
llvm::sys::path::append(authoredDataPath,
|
||||
getScriptFileName("overlay", isSwiftVersion3));
|
||||
// Add authored list first to take higher priority.
|
||||
|
||||
Reference in New Issue
Block a user