# RegisterExternalBuild(ExternalBuildInfo)

> Registers a build performed by an external build pipeline in the build history.

## Definition

* **Type:** Method
* **Namespace:** [UnityEditor.Build](/engine/6000.7/script-reference/unityeditor/build.md)
* **Assembly:** UnityEditor.CoreModule

```csharp
public static string RegisterExternalBuild(ExternalBuildInfo buildInfo)
```

### Parameters

**** (\[ExternalBuildInfo]\(/engine/6000.7/script-reference/unityeditor/build/externalbuildinfo)): The description of the external build.

### Returns

| Type                                                           | Description                                 |
| -------------------------------------------------------------- | ------------------------------------------- |
| [string](https://learn.microsoft.com/dotnet/api/system.string) | The path of the new build report directory. |

### Remarks

Call this method from the main thread when a build performed outside the Unity build pipeline has finished, to make it appear in the build history and the **Build Analysis** window alongside Player and Content Directory builds.

### Examples

```csharp
using System;
using System.IO;
using UnityEditor;
using UnityEditor.Build;
using UnityEditor.Build.Reporting;
using UnityEngine;

public class RegisterExternalBuildExample
{
    [MenuItem("Example/BuildHistory/Register External Build")]
    static public void RegisterExternalBuild()
    {
        // Record a build performed by an external build pipeline in the build history,
        // so it appears in the Build Analysis window alongside other builds.
        var buildInfo = new ExternalBuildInfo
        {
            BuildSessionGUID = GUID.Generate(),
            BuildName = "MyExternalBuild",
            BuildType = BuildType.AssetBundle,
            BuildResult = BuildResult.Succeeded,
            BuildStartedAt = DateTimeOffset.UtcNow,
            Platform = EditorUserBuildSettings.activeBuildTarget,
            TotalTime = TimeSpan.FromSeconds(1.5),
            TotalSizeBytes = 1024 * 1024,
            OutputPath = "Builds/MyExternalBuild",
            // Lets the Build Analysis window offer this package when it is not installed to draw the report.
            ProducerPackage = "com.example.mypipeline",
        };

        string buildReportDirectory = BuildHistory.RegisterExternalBuild(buildInfo);

        // Add extra files describing the build to the returned directory;
        // retrieve them later with BuildHistory.TryGetFilePath().
        File.WriteAllText(Path.Combine(buildReportDirectory, "MyExternalPipelineData.json"), "{}");

        Debug.Log($"Registered external build in the build history at: {buildReportDirectory}");
    }
}
```
