[Build-System] Improve build time on Windows: Do not download a pre-compiled binary if it's found in a folder pointed by the FreeSWITCHBuildCachePath environment variable.

This commit is contained in:
Andrey Volk 2022-12-07 23:31:51 +03:00
parent 62d3e52cf9
commit 4454ea58fd
1 changed files with 7 additions and 0 deletions

View File

@ -100,7 +100,14 @@ using System.Diagnostics;
Uri uri = new Uri(package); Uri uri = new Uri(package);
string urifilename = Path.GetFileName(uri.LocalPath); string urifilename = Path.GetFileName(uri.LocalPath);
string output = Path.Combine(outputfolder ?? librarypath, (outputfilename ?? urifilename)); string output = Path.Combine(outputfolder ?? librarypath, (outputfilename ?? urifilename));
string cachedir = Environment.GetEnvironmentVariable("FreeSWITCHBuildCachePath") ?? "";
string cached_file = cachedir != "" ? Path.Combine(cachedir, (outputfilename ?? urifilename)) : "";
if (cached_file != "" && File.Exists(cached_file)) {
Log.LogMessage(MessageImportance.High,
"Found package in cache \"" + cached_file + "\".");
File.Copy(cached_file, output);
} else
//if (!File.Exists(output)) // Uncomment to skip download if exists //if (!File.Exists(output)) // Uncomment to skip download if exists
{ {
var syncObject = new State var syncObject = new State