public sealed class Sandbox.Compiler
Given a folder of .cs files, this will produce (and load) an assembly
Related Guides
Broader workflow and conceptual references connected to this API.
By default, async tasks in s&box run on the main thread. They operate a lot like coroutines, making them the perfect replacement.
Just like Subgraphs, you can also create your own custom Nodes with C# (and shader code) to be used in Shader Graphs.
We prevent access to classes and functions that could be used maliciously by whitelisting what can be used.
Methods
Showing 12 methods
public void AddReference(string referenceName)
Add a reference to this compiler. This might be a system dll, or an assembly name from a fellow compiler.
public void AddSourcePath(string fullPath)
Add an extra source path. Useful for situations where you want to combine multiple addons into one.
public int DependencyIndex(int depth = 0)
Parameters
depth: Default: 0
public virtual sealed void Dispose()
public Sandbox.Compiler.Configuration GetConfiguration()
public bool HasReference(string referenceName, bool deep = False)
Returns true if `Sandbox.Compiler._references` contains the given reference assembly name. If `deep` is true, referenced compilers are searched too.
Parameters
deep: Default: False
public void MarkForRecompile()
Recompile this as soon as is appropriate
public void NotifyFastHotload(System.Version fastHotloadedVersion)
public void SetConfiguration(Sandbox.Compiler.Configuration newConfig)
public static Microsoft.CodeAnalysis.SyntaxTree StripDisabledTextTrivia(Microsoft.CodeAnalysis.SyntaxTree tree)
Strips out disabled text trivia from the syntax tree. This is stuff like `#if false` blocks that are not compiled.
public void UpdateFromArchive(Sandbox.CodeArchive a)
Fill this compiler from a code archive
public void WatchForChanges()
Watch the filesystem for changes to our c# files, and trigger a recompile if they change.
No results match this filter.
Properties
Showing 12 properties
public string Sandbox.Compiler.AssemblyName { get; set; }
Generated assembly name, without an extension. This will be "package.{Name}".
public Microsoft.CodeAnalysis.Emit.EmitResult Sandbox.Compiler.BuildResult { get; set; }
Results for the assembly build. This can contain warnings or errors.
public bool Sandbox.Compiler.BuildSuccess { get; set; }
Accesses Output.Successful
public Microsoft.CodeAnalysis.Diagnostic[] Sandbox.Compiler.Diagnostics { get; set; }
A list of warnings and errors created by the last build
public Sandbox.BaseFileSystem Sandbox.Compiler.FileSystem { get; set; }
An aggregate of all the filesystem this compiler has
public System.Text.StringBuilder Sandbox.Compiler.GeneratedCode { get; set; }
Global namespaces
public Sandbox.CompileGroup Sandbox.Compiler.Group { get; set; }
Each compiler must belong to a compile group
public bool Sandbox.Compiler.IsBuilding { get; set; }
Is this compiler currently building?
public string Sandbox.Compiler.Name { get; set; }
Name of the project this compiler was created for. This could be something like "base" or "org.ident".
public bool Sandbox.Compiler.NeedsBuild { get; set; }
Returns true if this compiler is pending a build, or currently building.
public Sandbox.CompilerOutput Sandbox.Compiler.Output { get; set; }
The output from the previous build
public bool Sandbox.Compiler.UseAbsoluteSourcePaths { get; set; }
During development we use absolute source paths so that debugging works better. In a packed/release build it's good to use relative paths instead, just to avoid exposing the builder's file system.
No results match this filter.
Metadata
| Field | Value |
|---|---|
| Namespace | Sandbox |
| Type | class |
| Assembly | Sandbox.Compiling |
| Doc ID | T:Sandbox.Compiler |