Skip to content

Commit

Permalink
[Build-System] Improve build time on Windows: Do not download a pre-c…
Browse files Browse the repository at this point in the history
…ompiled binary if it's found in a folder pointed by the FreeSWITCHBuildCachePath environment variable.
  • Loading branch information
andywolk committed Dec 7, 2022
1 parent 62d3e52 commit 4454ea5
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion w32/downloadpackage.task
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,14 @@ using System.Diagnostics;
Uri uri = new Uri(package);
string urifilename = Path.GetFileName(uri.LocalPath);
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
{
var syncObject = new State
Expand Down

0 comments on commit 4454ea5

Please sign in to comment.