FlexFramework.FlexCompiler

Compilation.BuildHelper

Fields

ExecutingAssemblies

Runtime(Assembly-CSharp) and editor(Assembly-CSharp-Editor) executing assemblies of current application.

Properties

None

Methods

GetLibraryAssemblies(UnityEditor.ApiCompatibilityLevel apiCompatibilityLevel)

Get system assemblies.

Parameters:

  • apiCompatibilityLevel: API level.

Returns: Assembly locations.

GetLibraryAssemblies()

Get system assemblies.

Returns: Assembly locations.

GetUnityAssemblies()

Get Unity engine assemblies.

Returns: Assembly locations.

GetPrecompiledAssemblies()

Get precompiled assemblies.

Returns: Assembly locations.

GetLoadedAssemblies()

Get loaded assemblies.

Returns: Assembly locations.

GetReferencedAssemblies()

Get referenced assemblies.

Returns: Assembly locations.

GetApiCompatibilityLevel()

Get current API compatibility level.

Returns: Current API compatibility level.

GetPreprocessorSymbols()

Get current preprocessor directives.

Returns: Current preprocessor directives.

Compilation.BuildSettings

Fields

encoding

Encoding name

See List of Encodings for more information.

languageVersion

Language version

reportDiagnostic

General diagnostic level

optimizationLevel

Optimization level

nullableContextOptions

Set nullable context, or nullable warnings

overflowCheck

Generate overflow checks

allowUnsafe

Allow 'unsafe' code

deterministic

Produce byte-for-byte equivalent output from the same input source

warningLevel

Warning level

references

Referenced libs

symbols

Preprocessor directives

Properties

None

Methods

GetDefaultReferences()

Get default references

Returns: References

GetDefaultSymbols()

Get default symbols

Returns: Symbols

ToParserOptions()

Get parser options

Returns: CSharp parser options

ToCompilationOptions()

Get compilation options

Returns: CSharp compilation options

GetEncoding()

Get text encoding

Returns: Text encoding

WithOverride(Action func)

Get new settings with the given modification action

Parameters:

  • func: Modification action

Returns: New build settings

Compilation.BuildTask

Fields

None

Properties

Sources

Source file paths

Settings

Build settings

Methods

Create(IEnumerable sources)

Create build task

Parameters:

  • sources: Source file paths

Returns: New task

WithSettings(BuildSettings settings)

Create build task

Parameters:

  • settings: Build settings

Returns: New task

Build(String assemblyName)

Build compilation

Parameters:

  • assemblyName: Output assembly file name

Returns: Compilation

Editor.ScriptFlags

Fields

Default

Both runtime and editor scripts

Runtime

Runtime scripts only

Editor

Editor scripts only

Properties

None

Methods

GetSelected(ScriptFlags flags)

Get selected CSharp scripts

Parameters:

  • flags: Script flags

Returns: Selected script paths

GetSelected()

Get selected CSharp scripts

Returns: Selected script paths

GetScripts(IEnumerable paths)

Get all CSharp scripts(include nested) within the given paths

Parameters:

  • paths: Search paths

Returns: Script paths

Integration.ExtensionContext

Fields

Extensions

Loaded extensions

IsGlobal

Check if this context is global

Methods

Load(Boolean force)

Load extensions

Parameters:

  • force: Force reload

Sort()

Sort extensions

Get(String id)

Get extension by id

Type parameters:

  • T: Extension type

Parameters:

  • id: Extension id

Returns: Matching extension or null

Each(Action func)

Invoke a function on each extension of the given type

Type parameters:

  • T: Extension type

Parameters:

  • func: Function

First(Func<T,Boolean> func)

Find the first extension of the given type that matches the condition

Type parameters:

  • T: Extension type

Parameters:

  • func: Match function

Returns:

Pipe<T,R>(T seed, Func<T,T,T> func)

Aggregate on each extension of the given type

Type parameters:

  • T: Extension type
  • R: Return type

Parameters:

  • seed: Initial value
  • func: Function

Returns: Pipe result

Integration.IAssemblyPatcher

Fields

None

Properties

None

Methods

PatchAssembly(Stream assemblyStream, CSharpCompilation compilation)

Patch assembly stream

Parameters:

  • assemblyStream: Assembly stream
  • compilation: Compilation

Returns: New assembly stream

Integration.ICompilationPatcher

Fields

None

Properties

None

Methods

PatchCompilation(CSharpCompilation compilation, BuildTask task)

Patch compilation

Parameters:

  • compilation: Compilation
  • task: Build task

Returns: New compilation

Integration.ICompilationReporter

Fields

None

Properties

None

Methods

Report(EmitResult result, CSharpCompilation compilation)

Report compilation result

Parameters:

  • result: Compilation result
  • compilation: Compilation

Integration.IConfigProvider

Fields

None

Properties

None

Methods

ReadConfig(String config)

Read config string

Parameters:

  • config: Config string

WriteConfig()

Serialize config to string

Returns: Config string

Integration.IGUIProvider

Fields

None

Properties

Icon

Extension icon. Return null to use default icon.

Website

Extension support website. Return null if there is no website.

Methods

OnGUI()

Draw extension UI

Integration.InternalUtility

Fields

None

Properties

None

Methods

CompareVersion(String a, String b)

Compare two version strings.

Parameters:

  • a: Version string
  • b: Version string

Returns:

positive if a > b; negative if a < b; 0 if a == b; the number indicates from which position(major,minor,patch,build) the comparison ends

Exceptions: ArgumentException

Integration.IPdbPatcher

Fields

None

Properties

None

Methods

PatchPdb(Stream pdbStream, CSharpCompilation compilation)

Patch Pdb stream

Parameters:

  • pdbStream: Pdb stream
  • compilation: Compilation

Returns: New Pdb stream

Integration.ITaskPatcher

Fields

None

Properties

None

Methods

PatchTask(BuildTask task)

Patch build task

Parameters:

  • task: Build task

Returns: New task

Integration.IXmlDocPatcher

Fields

None

Properties

None

Methods

PatchXmlDoc(Stream xmlDocStream, CSharpCompilation compilation)

Patch Xml documentation stream

Parameters:

  • xmlDocStream: Xml documentation stream
  • compilation: Compilation

Returns: New Xml documentation stream

Integration.Project

Fields

sources

Source files

buildSettings

Compilation settings

assemblyName

Assembly name

assemblyOutput

Assembly output path

xmlOutput

Xml document output path

pdbOutput

Pdb output path

Properties

None

Methods

Create()

Create an empty project

Returns: Project

Create(Stream stream)

Create project from the given stream

Parameters:

  • stream: Stream

Returns: Project

Create(String file)

Create project from the given file path

Parameters:

  • file: File path

Returns: Project

IsEmpty()

Check if this project is empty.

Returns: True if this project is empty

IsValid(Project project)

Check if this project is valid.

Parameters:

  • project: Project

Returns: True if this project is valid

AddSources(IEnumerable sources)

Add source files to this project.

Parameters:

  • sources: Sources to add

CreateTask()

Create task from project.

Returns: New task

Exceptions: InvalidOperationException

CreateCompilation(BuildTask task)

Create compilation from project and task.

Parameters:

  • task: Build task

Returns: New compilation

Exceptions: InvalidOperationException, MissingFieldException

Build(CSharpCompilation compilation)

Build project.

Parameters:

  • compilation: CSharpCompilation

Returns: Build result

Exceptions: MissingFieldException, InvalidOperationException

Write(Stream stream)

Write project to the given stream

Parameters:

  • stream: Stream

Write(String file)

Write project to the given file path

Parameters:

  • file: File path

Integration.GlobalExtensions

Fields

None

Properties

Instance

Singleton instance

Methods

Save()

Save extension settings

Integration.IExtension

Fields

None

Properties

ID

Extension unique ID

Name

Extension display name

Methods

OnActivate()

On extension being activated

OnDeactivate()

On extension being deactivated

Integration.IProjectReader

Fields

None

Properties

FileExtension

Supported file extension. Use comma to separate multiple extensions.

Methods

Read(String file)

Read project from file path

Parameters:

  • file: File path

Returns: Project

Integration.ExtensionSource

Fields

None

Properties

None

Methods

Initialize()

Initialize context

DisableExtension(String id)

Disable extension by ID

Parameters:

  • id: Extension ID

EnableExtension(String id)

Enable extension by ID

Parameters:

  • id: Extension ID

ConfigExtension(String id, String config)

Set extension config (not persisted)

Parameters:

  • id: Extension ID
  • config: Config

SortExtension(String id, Int32 sort)

Sort extension

Parameters:

  • id: Extension ID
  • sort: Sort index

SortExtension(IEnumerable<ValueTuple<String,Int32>> sorts)

Sort multiple extensions

Parameters:

  • sorts: A tuple list in the form of (id, sort)

ListExtensions()

Get list of enabled extension IDs

Returns: Extension IDs

Integration.GlobalExtension

None

Integration.IGlobalExtension

None

Integration.IInternalExtension

Fields

Enabled

Extension enabled or not

Sort

Extension sort

Properties

None

Methods

None

Integration.ILocalExtension

None

Integration.IProjectWriter

Fields

None

Properties

FileExtension

Supported file extension. Use comma to separate multiple extensions.

Methods

Write(Project project, String file)

Save

Parameters:

  • project: Project
  • file: Output file path

Integration.LocalExtension

Fields

None

Properties

None

Methods

LocalExtension(Project project)

Initialize extension with project

Parameters:

  • project: Project
Previous
Extension Development