MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / DeployFiles

Method DeployFiles

Source/Tools/Flax.Build/Build/Builder.cs:429–467  ·  view source on GitHub ↗
(TaskGraph graph, Target target, BuildOptions targetBuildOptions, string outputPath)

Source from the content-addressed store, hash-verified

427 }
428
429 private static void DeployFiles(TaskGraph graph, Target target, BuildOptions targetBuildOptions, string outputPath)
430 {
431 using (new ProfileEventScope("DeployFiles"))
432 {
433 foreach (var srcFile in targetBuildOptions.OptionalDependencyFiles.Where(File.Exists).Union(targetBuildOptions.DependencyFiles))
434 {
435 var dstFile = Path.Combine(outputPath, Path.GetFileName(srcFile));
436 graph.AddCopyFile(dstFile, srcFile);
437 }
438
439 if (targetBuildOptions.NugetPackageReferences.Any())
440 {
441 // Find all packages to deploy (incl. dependencies) and restore if needed
442 var nugetPath = Utilities.GetNugetPackagesPath();
443 Log.Verbose($"Deploying NuGet packages from {nugetPath}");
444 var restoreOnce = true;
445 var nugetFiles = new HashSet<string>();
446 foreach (var reference in targetBuildOptions.NugetPackageReferences)
447 {
448 var folder = reference.GetLibFolder(nugetPath);
449 if (!Directory.Exists(folder) && restoreOnce)
450 {
451 // Package binaries folder is missing so restore packages (incl. dependency packages)
452 RestoreNugetPackages(graph, target, targetBuildOptions);
453 restoreOnce = false;
454 }
455
456 DeployNuGetPackage(nugetPath, targetBuildOptions, nugetFiles, reference, folder);
457 }
458
459 // Copy libraries from all referenced packages to the output folder
460 foreach (var file in nugetFiles)
461 {
462 var dstFile = Path.Combine(outputPath, Path.GetFileName(file));
463 graph.AddCopyFile(dstFile, file);
464 }
465 }
466 }
467 }
468
469 private static void RestoreNugetPackages(TaskGraph graph, Target target, BuildOptions targetBuildOptions)
470 {

Callers

nothing calls this directly

Calls 9

WhereMethod · 0.80
GetFileNameMethod · 0.80
AddCopyFileMethod · 0.80
AnyMethod · 0.80
GetNugetPackagesPathMethod · 0.80
VerboseMethod · 0.80
GetLibFolderMethod · 0.80
UnionMethod · 0.45
ExistsMethod · 0.45

Tested by

no test coverage detected