mirror of
https://github.com/Facepunch/sbox-public.git
synced 2025-12-23 22:48:07 -05:00
Set Sandbox.Engine as default project (#3579)
* Also get rid of unused method in Project.Solution.cs
This commit is contained in:
@@ -50,7 +50,7 @@
|
||||
<Project Path="Mounting/Sandbox.Mounting/Sandbox.Mounting.csproj" />
|
||||
</Folder>
|
||||
<Folder Name="/Engine/Tier1/">
|
||||
<Project Path="Sandbox.Engine/Sandbox.Engine.csproj" />
|
||||
<Project Path="Sandbox.Engine/Sandbox.Engine.csproj" DefaultStartup="true" />
|
||||
</Folder>
|
||||
<Folder Name="/Engine/Tier2/">
|
||||
<Project Path="Sandbox.AppSystem/Sandbox.AppSystem.csproj" />
|
||||
|
||||
@@ -299,67 +299,4 @@ public sealed partial class Project
|
||||
|
||||
return project;
|
||||
}
|
||||
|
||||
async Task<string[]> FindReferences( string packageIdent )
|
||||
{
|
||||
//
|
||||
// If we have this package locally installed, then use that one
|
||||
//
|
||||
var localAddon = Project.FindByIdent( packageIdent );
|
||||
if ( localAddon != null && localAddon.Active )
|
||||
{
|
||||
return new[] { $"{packageIdent}" };
|
||||
}
|
||||
|
||||
//
|
||||
// Is this a valid package name etc?
|
||||
//
|
||||
if ( !Package.TryParseIdent( packageIdent, out var parts ) )
|
||||
return null;
|
||||
|
||||
//
|
||||
// Find the package with the dll and download it
|
||||
//
|
||||
var package = await Package.Fetch( packageIdent, false );
|
||||
if ( package == null || package.Revision == null ) return null;
|
||||
|
||||
// download the manifest
|
||||
await package.Revision.DownloadManifestAsync( default );
|
||||
|
||||
EngineFileSystem.Root.CreateDirectory( "/.source2/references" );
|
||||
|
||||
|
||||
// PAINDAY: Remove legacy check
|
||||
var dlls = package.Revision.Manifest.Files.Where( x => x.Path == ".assembly" || (x.Path.EndsWith( ".dll" ) && x.Path != ".assembly/dynamic.base.dll") ).ToArray();
|
||||
|
||||
// This is fine/normal - this package has no assemblies
|
||||
if ( !dlls.Any() ) return null;
|
||||
|
||||
List<string> assemblies = new List<string>();
|
||||
|
||||
foreach ( var dll in dlls )
|
||||
{
|
||||
var filename = $"{package.Org.Ident}.{package.Ident}.{package.Revision.VersionId}.{dll.Crc}.dll";
|
||||
|
||||
string dllPath = $"/.source2/references/{filename}";
|
||||
dllPath = EngineFileSystem.Root.GetFullPath( dllPath );
|
||||
|
||||
//
|
||||
// Have we already got this dll? Just use it then dummy
|
||||
//
|
||||
if ( System.IO.File.Exists( dllPath ) )
|
||||
{
|
||||
assemblies.Add( dllPath );
|
||||
continue;
|
||||
}
|
||||
|
||||
// WTF WTF WHAT THE FUCK
|
||||
var gameDll = await Sandbox.Utility.Web.GrabFile( $"{dll.Url}", default );
|
||||
Log.Trace( $"Caching Referenced assembly for {packageIdent}.." );
|
||||
System.IO.File.WriteAllBytes( dllPath, gameDll );
|
||||
assemblies.Add( dllPath );
|
||||
}
|
||||
|
||||
return assemblies.ToArray();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user