Build Server Integration |
In this guide, we give an overview of how to handle source control and how to automate the import process, e.g. for a build server.
This topic contains the following sections:
Everything below the folder Assets\ArticyImporter\Content\Generated can be regenerated from the plugin with an import.
Therefore, this folder does not need to be in the repository. There are some exceptions you can learn more about in the limitations and special cases sections.
You can start an import by calling ImportArticyExport(Boolean).
Don’t forget that the script calling this method must be placed inside a folder called Editor, because it is calling an editor-only method.
Note |
---|
•When using -batchmode it is required to use -ignoreCompilerErrors. |
You can use the delegate importStateChanged to get informed of the current state of the import.
using UnityEditor; using Articy.Unity.Editor.Utils; [InitializeOnLoad] static class MyEditorScript { static MyEditorScript() { ArticyEditorUtility.importStateChanged += ArticyImportStateChanged; } static void ArticyImportStateChanged(ArticyImportState aState) { if (aState == ArticyImportState.Started) { // import has just been started. } else if (aState == ArticyImportState.Succeeded) { // import finished successfully. } else if (aState == ArticyImportState.Failed) { // import failed. } } }
Two different files appear inside the root of your Unity project, which can be used to check the current state of the import.
It is not possible to perform a full import of all articy:draft data when Unity got started in batch mode without the -ignoreCompilerErrors command line argument. Furthermore using the -articyQuit command line argument must be used instead of -quit.
This has two reasons:
When the C# files that the plugin generates are missing, it leads to compilation errors in most cases. Unity quits itself due to the compilation errors before the plugin generates the missing C# files.
If you open your project in a state without compilation errors, then it still won’t work, because during a full import of the articy:draft data the plugin needs to wait for two recompiles. Unity will quit itself after the first recompile.
For Unity Cloud Build it is required to commit all generated files and to call PrepareForCloudBuild on the build server in or as the pre-export method.