Added verbose cs compilation.

This commit is contained in:
Maplewheels
2026-03-29 00:30:18 -04:00
parent bcec409618
commit f1808d9231
3 changed files with 26 additions and 15 deletions
@@ -6,6 +6,7 @@ using System.Diagnostics.CodeAnalysis;
using System.Reflection;
using System.Runtime.CompilerServices;
using Barotrauma.LuaCs;
using FluentResults;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;
@@ -74,20 +75,19 @@ public interface IAssemblyLoaderService : IService
/// AssemblyManager class.
/// </summary>
/// <param name="assemblyName"><c>[NotNull]</c>Name reference of the assembly.
/// <para><b>[IMPORTANT]</b> This is used to reference this assembly as the true name will be forced if
/// publicized assemblies are not used (InternalsVisibleTo Attrib).</para>
/// Must be supplied for in-memory assemblies.
/// <para>Must be unique to all other assemblies explicitly loaded using this context.</para></param>
/// <para><b>[IMPORTANT]</b> This is used to reference this assembly as the true name will be forced if
/// publicized assemblies are not used (InternalsVisibleTo Attrib).</para>
/// Must be supplied for in-memory assemblies.
/// <para>Must be unique to all other assemblies explicitly loaded using this context.</para></param>
/// <param name="compileWithInternalAccess">Forces the assembly name to <see cref="InternalsAccessAssemblyName"/> and grants access to <c>internal</c>.</param>
/// <para><b>[IMPORTANT]</b>Cannot be null or empty if <see cref="compileWithInternalAccess"/> is false.</para></param>
/// <param name="syntaxTrees"><c>[NotNull]</c>Syntax trees to compile into the assembly.</param>
/// <param name="metadataReferences">All <c>MetadataReference<c/>s to be used for compilation.
/// [IMPORTANT] This method builds metadata from loaded assemblies, only supply your own if you have in-memory
/// images not managed by the AssemblyManager class.</param>
/// [IMPORTANT] This method builds metadata from loaded assemblies, only supply your own if you have in-memory
/// images not managed by the AssemblyManager class.</param>
/// <param name="compilationOptions"><c>[NotNull]</c>CSharp compilation options. This method automatically adds the 'IgnoreAccessChecks' property for compilation.</param>
/// <para><b>[IMPORTANT]</b>Cannot be null or empty if <see cref="compileWithInternalAccess"/> is false.</para></param>
/// <returns>Success state of the operation.</returns>
public FluentResults.Result<Assembly> CompileScriptAssembly(
[NotNull] string assemblyName,
public Result<Assembly> CompileScriptAssembly([NotNull] string assemblyName,
bool compileWithInternalAccess,
ImmutableArray<SyntaxTree> syntaxTrees,
ImmutableArray<MetadataReference> metadataReferences,