# IShouldIncludeInBuildCallback

> Interface used by the Package Manager to request build information about packages.

## Definition

* **Type:** Interface
* **Namespace:** [UnityEditor.PackageManager](/engine/6000.5/script-reference/unityeditor/packagemanager.md)
* **Assembly:** UnityEditor.CoreModule

> **Warning:**
>
> **Deprecated.** IShouldIncludeInBuildCallback interface is deprecated and will be removed in a later version, use PluginImporter.SetIncludeInBuildDelegate instead.

```csharp
public interface IShouldIncludeInBuildCallback
```

## Remarks

During a build, the [IShouldIncludeInBuildCallback.ShouldIncludeInBuild](/engine/6000.5/script-reference/unityeditor/packagemanager/ishouldincludeinbuildcallback/shouldincludeinbuild.md) method is invoked on each managed plugin (DLL) inside the package whose name is [IShouldIncludeInBuildCallback.PackageName](/engine/6000.5/script-reference/unityeditor/packagemanager/ishouldincludeinbuildcallback/packagename.md).

Register your implementation with the Package Manager using RegisterShouldIncludeInBuildCallback. You can register only one implementation of this interface per package.

Consider using [PluginImporter.SetIncludeInBuildDelegate](/engine/6000.5/script-reference/unityeditor/pluginimporter/setincludeinbuilddelegate.md) for a simpler alternative.

```csharp
using UnityEngine;
using UnityEditor;
using UnityEditor.PackageManager;

[ExecuteInEditMode]
public class BuildCallbackExample : MonoBehaviour
{
    void Start()
    {
        Debug.Log("IShouldIncludeInBuildCallback example...");
        TestPluginInclusion();
    }

    void TestPluginInclusion()
    {
        var callback = new CustomPackageBuildCallback();

        Debug.Log($"Checking plugins for package: {callback.PackageName}");

        // Test with different plugin paths
        CheckPlugin(callback, "/Packages/com.mycompany.mypackage/Runtime/MyPlugin.dll");
        CheckPlugin(callback, "/Packages/com.mycompany.mypackage/Editor/MyEditorPlugin.dll");
    }

    void CheckPlugin(IShouldIncludeInBuildCallback callback, string pluginPath)
    {
        bool include = callback.ShouldIncludeInBuild(pluginPath);
        Debug.Log($"Include plugin {pluginPath}: {include}");
    }
}

public class CustomPackageBuildCallback : IShouldIncludeInBuildCallback
{
    public string PackageName => "com.mycompany.mypackage";

    public bool ShouldIncludeInBuild(string path)
    {
        // Example: Include only plugins with "Runtime" in their path
        return path.Contains("Runtime");
    }
}
```

**Related information**

[PluginImporter.SetIncludeInBuildDelegate](/engine/6000.5/script-reference/unityeditor/pluginimporter/setincludeinbuilddelegate.md)

## Properties

| Property                                                                                                               | Description       |
| ---------------------------------------------------------------------------------------------------------------------- | ----------------- |
| [PackageName](/engine/6000.5/script-reference/unityeditor/packagemanager/ishouldincludeinbuildcallback/packagename.md) | The package name. |

## Methods

| Method                                                                                                                                   | Description                                                |
| ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------- |
| [ShouldIncludeInBuild](/engine/6000.5/script-reference/unityeditor/packagemanager/ishouldincludeinbuildcallback/shouldincludeinbuild.md) | Determines whether to include a managed plugin in a build. |
