Skip to content
Permalink
Browse files

[Build] Output nupkg in bin\packages

  • Loading branch information
xen2 committed Nov 27, 2018
1 parent be22cdf commit aea71ef4fb4f254fe992ae4d274d4820e97f5858
@@ -66,8 +66,6 @@ public NugetStore(string rootDirectory)
settings = NuGet.Configuration.Settings.LoadDefaultSettings(null);

// Add dev source
Directory.CreateDirectory(Environment.ExpandEnvironmentVariables(DevSource));
CheckPackageSource("Xenko Dev", NuGet.Configuration.Settings.ApplyEnvironmentTransform(DevSource));
CheckPackageSource("Xenko", DefaultPackageSource);

InstallPath = SettingsUtility.GetGlobalPackagesFolder(settings);
@@ -87,15 +85,12 @@ public NugetStore(string rootDirectory)

private void CheckPackageSource(string name, string url)
{
var settingsPackageSources = settings.GetSettingValues("packageSources", true);
settings.AddOrUpdate("packageSources", new SourceItem(name, url));
settings.SaveToDisk();
}

private readonly NugetSourceRepositoryProvider sourceRepositoryProvider;

public string DevSource { get; } = @"%LocalAppData%\Xenko\NugetDev";

/// <summary>
/// Path where all packages are installed.
/// Usually `InstallPath = RootDirectory/RepositoryPath`.
@@ -34,6 +34,21 @@ internal static void __Initialize__()
if (Assembly.GetEntryAssembly() != null)
return;

// Make sure our nuget local store is added to nuget config
var folder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
string xenkoFolder = null;
while (folder != null)
{
if (File.Exists(Path.Combine(folder, @"build\Xenko.sln")))
{
xenkoFolder = folder;
var settings = NuGet.Configuration.Settings.LoadDefaultSettings(null);
CheckPackageSource(settings, $"Xenko Dev {xenkoFolder}", Path.Combine(xenkoFolder, @"bin\packages"));
break;
}
folder = Path.GetDirectoryName(folder);
}

// Note: we perform nuget restore inside the assembly resolver rather than top level module ctor (otherwise it freezes)
AppDomain.CurrentDomain.AssemblyResolve += (sender, eventArgs) =>
{
@@ -70,6 +85,12 @@ internal static void __Initialize__()
};
}

private static void CheckPackageSource(ISettings settings, string name, string url)
{
settings.AddOrUpdate("packageSources", new SourceItem(name, url));
settings.SaveToDisk();
}

public class Logger : ILogger
{
private object logLock = new object();
@@ -21,8 +21,6 @@ namespace Xenko.Core.Assets
{
static class RestoreHelper
{
public const string DevSource = @"%LocalAppData%\Xenko\NugetDev";

public static List<string> ListAssemblies(RestoreRequest request, RestoreResult result)
{
var assemblies = new List<string>();
@@ -51,9 +49,6 @@ public static async Task<(RestoreRequest, RestoreResult)> Restore(ILogger logger
{
var settings = NuGet.Configuration.Settings.LoadDefaultSettings(null);

// Make sure our nuget local store is added to config
CheckPackageSource(settings, "Xenko Dev", NuGet.Configuration.Settings.ApplyEnvironmentTransform(DevSource));

var packageSourceProvider = new PackageSourceProvider(settings);

// not sure what these do, but it was in the NuGet command line.
@@ -134,12 +129,5 @@ public static async Task<(RestoreRequest, RestoreResult)> Restore(ILogger logger
return (mainResult.SummaryRequest.Request, mainResult.Result);
}
}

private static void CheckPackageSource(ISettings settings, string name, string url)
{
var settingsPackageSources = settings.GetSettingValues("packageSources", true);
settings.AddOrUpdate("packageSources", new SourceItem(name, url));
settings.SaveToDisk();
}
}
}
@@ -21,6 +21,7 @@
<Copyright>Copyright © Xenko contributors and Silicon Studio Corp.</Copyright>
<Authors>Xenko contributors;Silicon Studio Corp.</Authors>
<PackageTags>Xenko;3D;gamedev;Game Engine;engine;games;D3D;OpenGL;Vulkan</PackageTags>
<PackageOutputPath>$(MSBuildThisFileDirectory)..\..\bin\packages</PackageOutputPath>
</PropertyGroup>

<!--Import Local Pre Settings for the solution being loaded -->

0 comments on commit aea71ef

Please sign in to comment.
You can’t perform that action at this time.