[NuGet] Removed NuGetLoader. NuGetResolver is only being called as part of main executable.

This commit is contained in:
Virgile Bello 2023-11-16 13:44:21 +09:00
Родитель 0cac13fedb
Коммит 80f09ad174
10 изменённых файлов: 52 добавлений и 114 удалений

Просмотреть файл

@ -308,8 +308,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Stride.Voxels", "..\sources
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "xunit.runner.stride", "..\sources\tests\xunit.runner.stride\xunit.runner.stride.csproj", "{D5B023BE-010F-44A8-ABF1-DB6F3BCEA392}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Stride.NuGetLoader", "..\sources\tools\Stride.NuGetLoader\Stride.NuGetLoader.csproj", "{7FA381C8-8EBE-4515-969D-01369CC47D0E}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Stride.Engine.NoAssets.Tests.Windows", "..\sources\engine\Stride.Engine.NoAssets.Tests\Stride.Engine.NoAssets.Tests.Windows.csproj", "{1C94168A-3C0D-4C6B-883B-91627D2EF3A1}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Stride.Importer.Assimp", "..\sources\tools\Stride.Importer.Assimp\Stride.Importer.Assimp.csproj", "{967BA05D-4AC4-4848-AEFD-894EF2309E4D}"
@ -326,6 +324,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Stride.VisualStudio.Command
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Stride.VisualStudio.Commands", "..\sources\tools\Stride.VisualStudio.Commands\Stride.VisualStudio.Commands.csproj", "{A7FC60AE-BB54-47D3-8787-788EEC65AD45}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Stride.NuGetResolver.UI", "..\sources\shared\Stride.NuGetResolver.UI\Stride.NuGetResolver.UI.csproj", "{79F7B3CE-A22F-426D-8DAB-2F692F167210}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -1365,18 +1365,6 @@ Global
{D5B023BE-010F-44A8-ABF1-DB6F3BCEA392}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{D5B023BE-010F-44A8-ABF1-DB6F3BCEA392}.Release|Win32.ActiveCfg = Release|Any CPU
{D5B023BE-010F-44A8-ABF1-DB6F3BCEA392}.Release|Win32.Build.0 = Release|Any CPU
{7FA381C8-8EBE-4515-969D-01369CC47D0E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7FA381C8-8EBE-4515-969D-01369CC47D0E}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7FA381C8-8EBE-4515-969D-01369CC47D0E}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{7FA381C8-8EBE-4515-969D-01369CC47D0E}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{7FA381C8-8EBE-4515-969D-01369CC47D0E}.Debug|Win32.ActiveCfg = Debug|Any CPU
{7FA381C8-8EBE-4515-969D-01369CC47D0E}.Debug|Win32.Build.0 = Debug|Any CPU
{7FA381C8-8EBE-4515-969D-01369CC47D0E}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7FA381C8-8EBE-4515-969D-01369CC47D0E}.Release|Any CPU.Build.0 = Release|Any CPU
{7FA381C8-8EBE-4515-969D-01369CC47D0E}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{7FA381C8-8EBE-4515-969D-01369CC47D0E}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{7FA381C8-8EBE-4515-969D-01369CC47D0E}.Release|Win32.ActiveCfg = Release|Any CPU
{7FA381C8-8EBE-4515-969D-01369CC47D0E}.Release|Win32.Build.0 = Release|Any CPU
{1C94168A-3C0D-4C6B-883B-91627D2EF3A1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1C94168A-3C0D-4C6B-883B-91627D2EF3A1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1C94168A-3C0D-4C6B-883B-91627D2EF3A1}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
@ -1461,6 +1449,18 @@ Global
{A7FC60AE-BB54-47D3-8787-788EEC65AD45}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{A7FC60AE-BB54-47D3-8787-788EEC65AD45}.Release|Win32.ActiveCfg = Release|Any CPU
{A7FC60AE-BB54-47D3-8787-788EEC65AD45}.Release|Win32.Build.0 = Release|Any CPU
{79F7B3CE-A22F-426D-8DAB-2F692F167210}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{79F7B3CE-A22F-426D-8DAB-2F692F167210}.Debug|Any CPU.Build.0 = Debug|Any CPU
{79F7B3CE-A22F-426D-8DAB-2F692F167210}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{79F7B3CE-A22F-426D-8DAB-2F692F167210}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{79F7B3CE-A22F-426D-8DAB-2F692F167210}.Debug|Win32.ActiveCfg = Debug|Any CPU
{79F7B3CE-A22F-426D-8DAB-2F692F167210}.Debug|Win32.Build.0 = Debug|Any CPU
{79F7B3CE-A22F-426D-8DAB-2F692F167210}.Release|Any CPU.ActiveCfg = Release|Any CPU
{79F7B3CE-A22F-426D-8DAB-2F692F167210}.Release|Any CPU.Build.0 = Release|Any CPU
{79F7B3CE-A22F-426D-8DAB-2F692F167210}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{79F7B3CE-A22F-426D-8DAB-2F692F167210}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{79F7B3CE-A22F-426D-8DAB-2F692F167210}.Release|Win32.ActiveCfg = Release|Any CPU
{79F7B3CE-A22F-426D-8DAB-2F692F167210}.Release|Win32.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@ -1575,7 +1575,6 @@ Global
{AD4FDC24-B64D-4ED7-91AA-62C9EDA12FA4} = {4C142567-C42B-40F5-B092-798882190209}
{66BE41FC-FC52-48D0-9C04-BCE8CC393020} = {4C142567-C42B-40F5-B092-798882190209}
{D5B023BE-010F-44A8-ABF1-DB6F3BCEA392} = {1AE1AC60-5D2F-4CA7-AE20-888F44551185}
{7FA381C8-8EBE-4515-969D-01369CC47D0E} = {1AE1AC60-5D2F-4CA7-AE20-888F44551185}
{1C94168A-3C0D-4C6B-883B-91627D2EF3A1} = {A7ED9F01-7D78-4381-90A6-D50E51C17250}
{967BA05D-4AC4-4848-AEFD-894EF2309E4D} = {6F473FA6-4F8B-4FBA-AE33-EE5AF997D50C}
{806AA078-6070-4BB6-B05B-6EE6B21B1CDE} = {6F473FA6-4F8B-4FBA-AE33-EE5AF997D50C}
@ -1584,6 +1583,7 @@ Global
{DF9172C0-DEA3-4DCE-8AF1-39439ACB4BCD} = {1AE1AC60-5D2F-4CA7-AE20-888F44551185}
{09E29A89-A6D7-45C9-B7BA-CA6D643C246F} = {DF9172C0-DEA3-4DCE-8AF1-39439ACB4BCD}
{A7FC60AE-BB54-47D3-8787-788EEC65AD45} = {DF9172C0-DEA3-4DCE-8AF1-39439ACB4BCD}
{79F7B3CE-A22F-426D-8DAB-2F692F167210} = {1AE1AC60-5D2F-4CA7-AE20-888F44551185}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {FF877973-604D-4EA7-B5F5-A129961F9EF2}

Просмотреть файл

@ -15,7 +15,7 @@
<StrideAssemblyProcessor>true</StrideAssemblyProcessor>
<StrideAssemblyProcessorOptions>--auto-module-initializer</StrideAssemblyProcessorOptions>
<StrideLocalized>true</StrideLocalized>
<StrideNuGetResolverUX>true</StrideNuGetResolverUX>
<StrideNuGetResolverUI>true</StrideNuGetResolverUI>
<StrideSTAThreadOnMain>true</StrideSTAThreadOnMain>
<UseWPF>true</UseWPF>
<EnableDefaultPageItems>false</EnableDefaultPageItems>
@ -107,11 +107,9 @@
<PropertyGroup>
<TargetsForTfmSpecificBuildOutput>_StrideIncludeExtraAssemblies;$(TargetsForTfmSpecificBuildOutput)</TargetsForTfmSpecificBuildOutput>
</PropertyGroup>
<Target Name="_StrideIncludeExtraAssemblies">
<ItemGroup>
<BuildOutputInPackage Include="$(OutputPath)Mono.Cecil.dll" />
<BuildOutputInPackage Include="$(OutputPath)Stride.Core.AssemblyProcessor.*" />
</ItemGroup>
</Target>

Просмотреть файл

@ -0,0 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0-windows</TargetFramework>
<Nullable>enable</Nullable>
<UseWPF>true</UseWPF>
<ImplicitUsings>enable</ImplicitUsings>
<StrideBuildTags>WindowsTools</StrideBuildTags>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="NuGet.Common" Version="6.4.2" />
</ItemGroup>
</Project>

Просмотреть файл

@ -77,7 +77,7 @@ namespace Stride.Core.Assets
var logger = new Logger();
#if STRIDE_NUGET_RESOLVER_UX
#if STRIDE_NUGET_RESOLVER_UI
var dialogNotNeeded = new TaskCompletionSource<bool>();
var dialogClosed = new TaskCompletionSource<bool>();
@ -160,7 +160,7 @@ namespace Stride.Core.Assets
}
catch (Exception e)
{
#if STRIDE_NUGET_RESOLVER_UX
#if STRIDE_NUGET_RESOLVER_UI
logger.LogError($@"Error restoring NuGet packages: {e}");
dialogClosed.Task.Wait();
#else
@ -181,7 +181,7 @@ namespace Stride.Core.Assets
}
finally
{
#if STRIDE_NUGET_RESOLVER_UX
#if STRIDE_NUGET_RESOLVER_UI
dialogNotNeeded.TrySetResult(true);
#endif
SynchronizationContext.SetSynchronizationContext(previousSynchronizationContext);

Просмотреть файл

@ -12,36 +12,28 @@
<Compile Include="$(MSBuildThisFileDirectory)NuGetModuleInitializer.cs" />
<Compile Include="$(MSBuildThisFileDirectory)NuGetAssemblyResolver.cs" />
<Compile Include="$(MSBuildThisFileDirectory)RestoreHelper.cs" />
<Compile Include="$(MSBuildThisFileDirectory)SplashScreenWindow.xaml.cs" Condition="'$(StrideNuGetResolverUX)' == 'true'">
<DependentUpon>SplashScreenWindow.xaml</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<Page Include="$(MSBuildThisFileDirectory)SplashScreenWindow.xaml" Condition="'$(StrideNuGetResolverUX)' == 'true'">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<ProjectReference Condition="'$(StrideNuGetResolverUI)' == 'true'" Include="$(MSBuildThisFileDirectory)..\Stride.NuGetResolver.UI\Stride.NuGetResolver.UI.csproj" PrivateAssets="all" />
</ItemGroup>
<!-- Some targets so that referencing projects include a tools folder with executables-->
<PropertyGroup>
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.config;.loaderdata</AllowedOutputExtensionsInPackageBuildOutputFolder>
<UseWPF Condition="'$(StrideNuGetResolverUX)' == 'true'">true</UseWPF>
<DefineConstants Condition="'$(StrideNuGetResolverUX)' == 'true'">STRIDE_NUGET_RESOLVER_UX;$(DefineConstants)</DefineConstants>
<TargetsForTfmSpecificBuildOutput>_StrideIncludeNuGetResolverDependencies;$(TargetsForTfmSpecificBuildOutput)</TargetsForTfmSpecificBuildOutput>
<TargetsForTfmSpecificBuildOutput Condition="'$(StrideNuGetResolverUI)' == 'true'">_StrideIncludeNuGetResolverUI;$(TargetsForTfmSpecificBuildOutput)</TargetsForTfmSpecificBuildOutput>
<AllowedOutputExtensionsInPackageBuildOutputFolder>$(AllowedOutputExtensionsInPackageBuildOutputFolder);.config;.exe</AllowedOutputExtensionsInPackageBuildOutputFolder>
<UseWPF Condition="'$(StrideNuGetResolverUI)' == 'true'">true</UseWPF>
<DefineConstants Condition="'$(StrideNuGetResolverUI)' == 'true'">STRIDE_NUGET_RESOLVER_UI;$(DefineConstants)</DefineConstants>
</PropertyGroup>
<Target Name="_StridePackageNuGetLoader" AfterTargets="CopyFilesToOutputDirectory">
<PropertyGroup>
<_StrideNuGetLoaderWindowsDesktop Condition="'$(_MicrosoftNetSdkWindowsDesktop)' == 'true'">true</_StrideNuGetLoaderWindowsDesktop>
<_StrideNuGetLoaderApplicationIcon Condition="'$(ApplicationIcon)' != ''">$(MSBuildProjectDirectory)\$(ApplicationIcon)</_StrideNuGetLoaderApplicationIcon>
</PropertyGroup>
<!-- Build NuGetLoader project, using same application icon and same Sdk (so that WinForms/WPF can also work) -->
<MSBuild Projects="$(SolutionDir)..\sources\tools\Stride.NuGetLoader\Stride.NuGetLoader.csproj" Properties="Configuration=$(Configuration);OutputType=$(OutputType);ApplicationIcon=$(_StrideNuGetLoaderApplicationIcon);StrideApplicationName=$(AssemblyName);StrideNuGetLoaderWindowsDesktop=$(_StrideNuGetLoaderWindowsDesktop);StrideSTAThreadOnMain=$(StrideSTAThreadOnMain);StrideNuGetResolverUX=$(StrideNuGetResolverUX)" />
<!-- Write a small data file containing package and version to use for loader (let's not rely on NuGet layout/files such as .nuspec file in case it changes in the future) -->
<WriteLinesToFile File="$(OutputPath)Stride.NuGetLoader.loaderdata" Lines="$(PackageId)/$(PackageVersion)" Overwrite="true" />
<PropertyGroup>
</PropertyGroup>
<Target Name="_StrideIncludeNuGetResolverDependencies">
<ItemGroup>
<None Include="$(OutputPath)Stride.NuGetLoader.loaderdata" Pack="true" PackagePath="tools\$(TargetFramework)\" />
<None Include="$(SolutionDir)..\sources\tools\Stride.NuGetLoader\bin\$(Configuration)\$(AssemblyName)\$(TargetFramework)\*.*" Pack="true" PackagePath="tools\$(TargetFramework)\" />
<!-- Rename Stride.NuGetLoader.exe into the expected application name -->
<None Update="@(BuildOutputInPackage->'%(Identity)')" Condition="'%(Filename)%(Extension)' == 'Stride.NuGetLoader.exe'" Pack="true" PackagePath="tools\$(TargetFramework)\$(AssemblyName).exe" />
<BuildOutputInPackage Include="$(OutputPath)$(AssemblyName).exe" />
<BuildOutputInPackage Include="$(OutputPath)NuGet*.dll" />
<BuildOutputInPackage Include="$(OutputPath)Newtonsoft.Json.dll" />
</ItemGroup>
</Target>
<Target Name="_StrideIncludeNuGetResolverUI">
<ItemGroup>
<BuildOutputInPackage Include="$(OutputPath)Stride.NuGetResolver.UI.dll" />
</ItemGroup>
</Target>
</Project>

Просмотреть файл

@ -8,7 +8,7 @@
<StrideBuildTags>WindowsTools</StrideBuildTags>
<StrideAssemblyProcessor>true</StrideAssemblyProcessor>
<StrideAssemblyProcessorOptions>--auto-module-initializer</StrideAssemblyProcessorOptions>
<StrideNuGetResolverUX>true</StrideNuGetResolverUX>
<StrideNuGetResolverUI>true</StrideNuGetResolverUI>
<UseWindowsForms>true</UseWindowsForms>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)' == 'Debug'">

Просмотреть файл

@ -1,27 +0,0 @@
using System;
using System.IO;
using System.Linq;
using System.Reflection;
using Stride.Core.Assets;
namespace Stride.NuGetLoader
{
class Program
{
#if STRIDE_STA_THREAD_ATTRIBUTE_ON_MAIN
[STAThread]
#endif
static void Main(string[] args)
{
// Get loader data (text file, format is "PackageName/PackageId")
var loaderDataFile = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "Stride.NuGetLoader.loaderdata");
var loaderData = File.ReadLines(loaderDataFile).First().Split('/');
var packageName = loaderData[0];
var packageVersion = loaderData[1];
NuGetAssemblyResolver.SetupNuGet(packageName, packageVersion);
AppDomain.CurrentDomain.ExecuteAssemblyByName(packageName, args);
}
}
}

Просмотреть файл

@ -1,40 +0,0 @@
<Project>
<Import Project="Sdk.props" Sdk="Microsoft.NET.Sdk" />
<PropertyGroup>
<OutputType Condition="'$(OutputType)' == ''">Exe</OutputType>
<TargetFramework>net8.0-windows7.0</TargetFramework>
<UseWpf>true</UseWpf>
<UseWindowsForms>true</UseWindowsForms>
<IntermediateOutputPath>obj\$(Configuration)\$(StrideApplicationName)</IntermediateOutputPath>
<OutputPath>bin\$(Configuration)\$(StrideApplicationName)</OutputPath>
<DefineConstants Condition="'$(StrideNuGetResolverUX)' == 'true'">STRIDE_NUGET_RESOLVER_UX;$(DefineConstants)</DefineConstants>
<GenerateAssemblyFileVersionAttribute>false</GenerateAssemblyFileVersionAttribute>
<GenerateAssemblyInformationalVersionAttribute>false</GenerateAssemblyInformationalVersionAttribute>
<GenerateAssemblyVersionAttribute>false</GenerateAssemblyVersionAttribute>
<DefineConstants Condition="'$(StrideSTAThreadOnMain)' == 'true'">STRIDE_STA_THREAD_ATTRIBUTE_ON_MAIN;$(DefineConstants)</DefineConstants>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="NuGet.PackageManagement" Version="6.4.2" />
<PackageReference Include="NuGet.Resolver" Version="6.4.2" />
<PackageReference Include="NuGet.Commands" Version="6.4.2" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.1" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\..\shared\SharedAssemblyInfo.cs" Link="Properties\SharedAssemblyInfo.cs" />
<Compile Include="..\..\shared\Stride.NuGetResolver\NuGetAssemblyResolver.cs" Link="NuGetAssemblyResolver.cs" />
<Compile Include="..\..\shared\Stride.NuGetResolver\RestoreHelper.cs" Link="RestoreHelper.cs" />
</ItemGroup>
<ItemGroup Condition="'$(StrideNuGetLoaderWindowsDesktop)' == 'true'">
<Compile Include="..\..\shared\Stride.NuGetResolver\SplashScreenWindow.xaml.cs" Link="SplashScreenWindow.xaml.cs" />
<Page Include="..\..\shared\Stride.NuGetResolver\SplashScreenWindow.xaml" Link="SplashScreenWindow.xaml">
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
<Import Project="Sdk.targets" Sdk="Microsoft.NET.Sdk" />
</Project>