|
|
|
@ -38,7 +38,7 @@ namespace Avalonia.Build.Tasks |
|
|
|
{ |
|
|
|
// To simplify incremental build checks, copy the input files to the expected output locations even if the Xaml compiler didn't do anything.
|
|
|
|
CopyAndTouch(AssemblyFile.ItemSpec, outputPath); |
|
|
|
CopyAndTouch(Path.ChangeExtension(AssemblyFile.ItemSpec, ".pdb"), Path.ChangeExtension(outputPath, ".pdb")); |
|
|
|
CopyAndTouch(Path.ChangeExtension(AssemblyFile.ItemSpec, ".pdb"), Path.ChangeExtension(outputPath, ".pdb"), false); |
|
|
|
|
|
|
|
if (!string.IsNullOrEmpty(refOutputPath)) |
|
|
|
{ |
|
|
|
@ -49,8 +49,18 @@ namespace Avalonia.Build.Tasks |
|
|
|
return res.Success; |
|
|
|
} |
|
|
|
|
|
|
|
private static void CopyAndTouch(string source, string destination) |
|
|
|
private static void CopyAndTouch(string source, string destination, bool shouldExist = true) |
|
|
|
{ |
|
|
|
if (!File.Exists(source)) |
|
|
|
{ |
|
|
|
if (shouldExist) |
|
|
|
{ |
|
|
|
throw new FileNotFoundException($"Could not copy file '{source}'. File does not exist."); |
|
|
|
} |
|
|
|
|
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
File.Copy(source, destination, overwrite: true); |
|
|
|
File.SetLastWriteTimeUtc(destination, DateTime.UtcNow); |
|
|
|
} |
|
|
|
|