Projects
Create a project
Upon opening the FlexCompiler project window for the first time, a new empty project is automatically created.
To initiate a new project after making modifications, simply click New Project located at the bottom-left corner of the project window. Please note that any current changes will be discarded. To preserve the alterations, refer to Export a Project.
The last accessed project will be restored upon reopening the project window, even if it wasn't saved previously.
Export a project
To export a project, click "Export Project" at the bottom-right corner of the project window. The export option will only be enabled when the sources panel is not empty.
While editing a project, changes are automatically saved but only temporarily (in cache) until the project is exported. The original project file remains unchanged unless overwritten during export. Thus, exporting is necessary to persist changes made to an imported project.
Import a project
At any time, you can click "Import Project" at the bottom-center of the project window to import an existing project. Please be aware that any current changes will be discarded. To retain modifications, follow the instructions in Export a Project.
Project file
The FlexCompiler project file (with extension ".fcxml") is an XML document containing all the necessary information and instructions for building your project. This allows for manual editing without the GUI editor.
Project
The Project element serves as the root element of every project file, featuring a version
attribute that specifies the project file format version.
<Project version="2.0">
</Project>
Environment
The Environment element contains the project's environment information.
<Environment>
<UnityVersion>2021.3.29f1c1</UnityVersion>
<ContentsPath>C:/Program Files/Unity/Hub/Editor/2021.3.29f1c1/Editor/Data</ContentsPath>
<WorkingDirectory>C:/Users/Admin/Documents/Projects/MyUnityProject</WorkingDirectory>
</Environment>
UnityVersion
This element specifies the current version of the Unity Editor in which the project is created.
ContentsPath
This element specifies the installation directory path of the current Unity Editor for resolving assemblies.
WorkingDirectory
This element specifies the base directory path of the project, aiding in resolving relative paths within the project file.
Input
The Input element contains all source files of the project.
<Input>
<Path>Assets\Editor\MyScript.cs</Path>
</Input>
Path
The Path element points to an absolute or relative path of a C# source file.
Output
The Output element contains information regarding one or more compilation output files.
<Output>
<AssemblyPath>C:\Users\Admin\Desktop\MyUnityProject.dll</AssemblyPath>
<XmlPath>C:\Users\Admin\Desktop\MyUnityProject.xml</XmlPath>
<PdbPath>C:\Users\Admin\Desktop\MyUnityProject.pdb</PdbPath>
</Output>
AssemblyPath
Specifies the DLL assembly output path.
XmlPath
Optional XML document output path.
PdbPath
Optional PDB file output path.
BuildSettings
The BuildSettings element contains compiler options. Refer to the API for a comprehensive reference.
<BuildSettings>
<TextEncoding>utf-8</TextEncoding>
<LanguageVersion>Latest</LanguageVersion>
<ReportDiagnostic>Default</ReportDiagnostic>
<OptimizationLevel>Release</OptimizationLevel>
<NullableContext>Disable</NullableContext>
<OverflowCheck>false</OverflowCheck>
<AllowUnsafe>false</AllowUnsafe>
<Deterministic>true</Deterministic>
<WarningLevel>0</WarningLevel>
</BuildSettings>
Extensions
The Extensions element comprises declarations of all enabled extensions. They are called one by one with each lifecycle hook. For further details, consult Extensions and API.
<Extensions>
<Extension id="com.flexframework.flexcompiler.cecil" />
<Extension id="com.flexframework.flexcompiler.obfuscator">
<Config><![CDATA[{"namingStrategy":0,"filteringStrategy":0,"configFile":""}]]>==</Config>
</Extension>
</Extensions>
Extension
The Extension element must have an id
attribute referencing the declared extension. The optional Config
child element contains base64 encoded json configuration text for the extension. The configuration content is dependent on the extension specification.