Class ScriptsBuilder
Game scrips building service. Compiles user C# scripts into binary assemblies. Exposes many events used to track scripts compilation and reloading.
Inheritance
Inherited Members
Assembly: FlaxEngine.dll
File: Editor/Scripting/ScriptsBuilder.h
Syntax
public class ScriptsBuilder
Fields
OnCompilationEnd
Action called on compilation end, bool param is true if success, otherwise false
Declaration
public static Delegate<bool> OnCompilationEnd
Field Value
Delegate<bool>
|
OnCompilationFailed
Action called when compilation fails
Declaration
public static Action OnCompilationFailed
Field Value
Action
|
OnCompilationSuccess
Action called when compilation success
Declaration
public static Action OnCompilationSuccess
Field Value
Action
|
Methods
CheckForCompile()
Checks if need to compile source code. If so calls compilation.
Declaration
public static void CheckForCompile()
Compile()
Requests project source code compilation.
Declaration
public static void Compile()
FilterNamespaceText(String& value)
Filters the project namespace text value to be valid (remove whitespace characters and other invalid ones).
Declaration
public static void FilterNamespaceText(String& value)
Parameters
String
value
The in/out value. |
FindScript(const StringView& scriptName)
Tries to find a script type with the given name.
Declaration
public static MClass* FindScript(const StringView& scriptName)
Parameters
StringView
scriptName
The script full name. |
Returns
MClass
Found script type or null if missing or invalid name. |
GenerateProject(const StringView& customArgs=StringView::Empty)
Generates the project files.
Declaration
public static bool GenerateProject(const StringView& customArgs=StringView::Empty)
Parameters
StringView
customArgs
The additional Flax.Build tool invocation arguments. |
Returns
bool
True if failed, otherwise false. |
GetBinariesConfiguration(const Char*& target, const Char*& platform, const Char*& architecture, const Char*& configuration)
Declaration
public static void GetBinariesConfiguration(const Char*& target, const Char*& platform, const Char*& architecture, const Char*& configuration)
Parameters
Char
target
|
Char
platform
|
Char
architecture
|
Char
configuration
|
GetBinariesConfiguration(StringView& target, StringView& platform, StringView& architecture, StringView& configuration)
Declaration
public static void GetBinariesConfiguration(StringView& target, StringView& platform, StringView& architecture, StringView& configuration)
Parameters
StringView
target
|
StringView
platform
|
StringView
architecture
|
StringView
configuration
|
GetBuildToolPath()
Gets the full path to the Flax.Build app.
Declaration
public static String GetBuildToolPath()
Returns
String
|
GetCompilationsCount()
Gets amount of source code compile actions since Editor startup.
Declaration
public static int32 GetCompilationsCount()
Returns
int32
|
GetExistingEditors(int32* result, int32 count)
Declaration
public static void GetExistingEditors(int32* result, int32 count)
Parameters
int32
result
|
int32
count
|
IsCompiling()
Returns true if scripts are being now compiled/reloaded.
Declaration
public static bool IsCompiling()
Returns
bool
True if scripts are being compiled/reloaded now. |
IsReady()
Returns true if source code has been compiled and assemblies are ready to load.
Declaration
public static bool IsReady()
Returns
bool
True if assemblies are ready to load. |
IsSourceDirty()
Returns true if source code has been edited.
Declaration
public static bool IsSourceDirty()
Returns
bool
True if source code is dirty, otherwise false. |
IsSourceDirtyFor(const TimeSpan& timeout)
Returns true if source code has been edited and is dirty for given amount of time
Declaration
public static bool IsSourceDirtyFor(const TimeSpan& timeout)
Parameters
TimeSpan
timeout
Time to use for checking. |
Returns
bool
True if source code is dirty, otherwise false. |
IsSourceWorkspaceDirty()
Returns true if source code workspace has been edited (source file moved or deleted).
Declaration
public static bool IsSourceWorkspaceDirty()
Returns
bool
True if source code workspace is dirty, otherwise false. |
LastCompilationFailed()
Checks if last scripting building failed due to errors.
Declaration
public static bool LastCompilationFailed()
Returns
bool
True if last compilation result was a fail, otherwise false. |
MarkWorkspaceDirty()
Indicates that scripting directory has been modified so scripts need to be rebuild.
Declaration
public static void MarkWorkspaceDirty()
RunBuildTool(const StringView& args, const StringView& workingDir=StringView::Empty)
Invokes the Flax.Build tool in the current project workspace and waits for the process end (blocking). Prints the build tool output to the log. Can be invoked from any thread.
Declaration
public static bool RunBuildTool(const StringView& args, const StringView& workingDir=StringView::Empty)
Parameters
StringView
args
The Flax.Build tool invocation arguments. |
StringView
workingDir
The custom working directory. Use empty or null to execute build tool in the project folder. |
Returns
bool
True if failed, otherwise false. |