Change method name from add to restore.
This commit is contained in:
@@ -150,7 +150,7 @@ namespace Flax.Build
|
||||
{
|
||||
var path = Path.Combine(nugetPath, reference.Name, reference.Version, "lib", reference.Framework, $"{reference.Name}.dll");
|
||||
if (!File.Exists(path))
|
||||
Utilities.AddNugetPackage(graph, target, reference);
|
||||
Utilities.RestoreNugetPackages(graph, target);
|
||||
var dstFile = Path.Combine(outputPath, Path.GetFileName(path));
|
||||
graph.AddCopyFile(dstFile, path);
|
||||
}
|
||||
|
||||
@@ -1065,7 +1065,7 @@ namespace Flax.Build
|
||||
{
|
||||
var path = Path.Combine(nugetPath, reference.Name, reference.Version, "lib", reference.Framework, $"{reference.Name}.dll");
|
||||
if (!File.Exists(path))
|
||||
Utilities.AddNugetPackage(graph, target, reference);
|
||||
Utilities.RestoreNugetPackages(graph, target);
|
||||
var dstFile = Path.Combine(outputPath, Path.GetFileName(path));
|
||||
graph.AddCopyFile(dstFile, path);
|
||||
}
|
||||
@@ -1278,7 +1278,7 @@ namespace Flax.Build
|
||||
{
|
||||
var path = Path.Combine(nugetPath, reference.Name, reference.Version, "lib", reference.Framework, $"{reference.Name}.dll");
|
||||
if (!File.Exists(path))
|
||||
Utilities.AddNugetPackage(graph, target, reference);
|
||||
Utilities.RestoreNugetPackages(graph, target);
|
||||
var dstFile = Path.Combine(outputPath, Path.GetFileName(path));
|
||||
graph.AddCopyFile(dstFile, path);
|
||||
}
|
||||
|
||||
@@ -42,18 +42,17 @@ namespace Flax.Build
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Downloads a nuget package.
|
||||
/// Restores a targets nuget packages.
|
||||
/// </summary>
|
||||
/// <param name="graph">The task graph.</param>
|
||||
/// <param name="target">The target.</param>
|
||||
/// <param name="dotNetPath">The dotnet path.</param>
|
||||
/// <param name="package"></param>
|
||||
public static void AddNugetPackage(Graph.TaskGraph graph, Target target, NativeCpp.NugetPackage package)
|
||||
public static void RestoreNugetPackages(Graph.TaskGraph graph, Target target)
|
||||
{
|
||||
var dotNetPath = GetDotNetPath();
|
||||
var task = graph.Add<Graph.Task>();
|
||||
task.WorkingDirectory = target.FolderPath;
|
||||
task.InfoMessage = $"Add Nuget Package: {package.Name}, Version {package.Version}";
|
||||
task.InfoMessage = $"Restoring Nuget Packages for {target.Name}";
|
||||
task.CommandPath = dotNetPath;
|
||||
task.CommandArguments = $"restore";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user