Skip to content

Commit

Permalink
[Build] Output nupkg in bin\packages
Browse files Browse the repository at this point in the history
  • Loading branch information
xen2 committed Nov 27, 2018
1 parent be22cdf commit aea71ef
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 17 deletions.
5 changes: 0 additions & 5 deletions sources/assets/Xenko.Core.Packages/NugetStore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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`.
Expand Down
21 changes: 21 additions & 0 deletions sources/shared/Xenko.NuGetResolver/NuGetAssemblyResolver.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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) =>
{
Expand Down Expand Up @@ -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();
Expand Down
12 changes: 0 additions & 12 deletions sources/shared/Xenko.NuGetResolver/RestoreHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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>();
Expand Down Expand Up @@ -51,9 +49,6 @@ public static List<string> ListAssemblies(RestoreRequest request, RestoreResult
{
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.
Expand Down Expand Up @@ -134,12 +129,5 @@ public static List<string> ListAssemblies(RestoreRequest request, RestoreResult
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();
}
}
}
1 change: 1 addition & 0 deletions sources/targets/Xenko.Core.GlobalSettings.targets
Original file line number Diff line number Diff line change
Expand Up @@ -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 -->
Expand Down

0 comments on commit aea71ef

Please sign in to comment.