initial commit

This commit is contained in:
Jo 2025-01-07 02:06:59 +01:00
parent 6715289efe
commit 788c3389af
37645 changed files with 2526849 additions and 80 deletions

View file

@ -0,0 +1,37 @@
using System;
using System.Collections.Generic;
using UnityEditor.Build.Content;
namespace UnityEditor.Build.Pipeline.Interfaces
{
/// <summary>
/// The extended data about an asset.
/// </summary>
[Serializable]
public class ExtendedAssetData
{
/// <summary>
/// List of object identifiers that are classified as asset representations (sub assets).
/// </summary>
public List<ObjectIdentifier> Representations { get; set; }
/// <summary>
/// Default constructor, initializes properties to defaults
/// </summary>
public ExtendedAssetData()
{
Representations = new List<ObjectIdentifier>();
}
}
/// <summary>
/// Base interface for the storing extended data about an asset.
/// </summary>
public interface IBuildExtendedAssetData : IContextObject
{
/// <summary>
/// Map of asset to extended data about an asset.
/// </summary>
Dictionary<GUID, ExtendedAssetData> ExtendedData { get; }
}
}

View file

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 892bac4397edc914d9ffa4cde040eb0b
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,79 @@
using System;
using System.Collections.Generic;
using UnityEditor.Build.Content;
using UnityEditor.Build.Pipeline.Utilities;
namespace UnityEditor.Build.Pipeline.Interfaces
{
/// <summary>
/// Base interface for the Build Caching
/// </summary>
public interface IBuildCache : IContextObject
{
/// <summary>
/// Gets a CacheEntry for an asset identified by its GUID.
/// </summary>
/// <param name="asset">GUID identifier for an asset from the Asset Database</param>
/// <param name="version">Version number of the system asking for an entry to distinguish it from previous incompatible entries. (Optional)</param>
/// <returns>CacheEntry representing current asset.</returns>
CacheEntry GetCacheEntry(GUID asset, int version = 1);
/// <summary>
/// Gets a CacheEntry for a file identified by its relative path.
/// </summary>
/// <param name="path">Relative path of a file on disk</param>
/// <param name="version">Version number of the system asking for an entry to distinguish it from previous incompatible entries. (Optional)</param>
/// <returns>CacheEntry representing a file on disk.</returns>
CacheEntry GetCacheEntry(string path, int version = 1);
/// <summary>
/// Gets a CacheEntry for an object identified by an Object Identifier.
/// </summary>
/// <param name="objectID">Object identifier for an object</param>
/// <param name="version">Version number of the system asking for an entry to distinguish it from previous incompatible entries. (Optional)</param>
/// <returns>CacheEntry representing an object identifier.</returns>
CacheEntry GetCacheEntry(ObjectIdentifier objectID, int version = 1);
/// <summary>
/// Gets a CacheEntry for a scripting type by a System.Type.
/// </summary>
/// <param name="type">System.Type for a scripting type</param>
/// <param name="version">Version number of the system asking for an entry to distinguish it from previous incompatible entries. (Optional)</param>
/// <returns>CacheEntry representing an object identifier.</returns>
CacheEntry GetCacheEntry(Type type, int version = 1);
/// <summary>
/// Checks if the CachedInfo passed in needs to be rebuilt
/// </summary>
/// <param name="info">Cached Info to check</param>
/// <returns><c>true</c> if the cached info needs to be rebuilt; otherwise, <c>false</c>.</returns>
bool HasAssetOrDependencyChanged(CachedInfo info);
/// <summary>
/// Returns the path where info data can be saved in the cache
/// </summary>
/// <param name="entry">Cache entry to get the path</param>
/// <returns>Path on disk where to save cached info</returns>
string GetCachedInfoFile(CacheEntry entry);
/// <summary>
/// Returns the path where artifact data can be saved in the cache
/// </summary>
/// <param name="entry">Cache entry to get the path</param>
/// <returns>Path on disk where to save cached artifacts</returns>
string GetCachedArtifactsDirectory(CacheEntry entry);
/// <summary>
/// Loads a set of CachedInfos from the cache
/// </summary>
/// <param name="entries">List of cache entries to load</param>
/// <param name="cachedInfos">Out list of cached infos loaded</param>
void LoadCachedData(IList<CacheEntry> entries, out IList<CachedInfo> cachedInfos);
/// <summary>
/// Saves a set of CachedInfos to the cache
/// </summary>
/// <param name="infos">List of cached infos to save</param>
void SaveCachedData(IList<CachedInfo> infos);
}
}

View file

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 717b55fbf36106b449169defda0705c7
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,93 @@
using System;
using System.Collections.Generic;
using UnityEditor.Build.Content;
using UnityEditor.Build.Pipeline.Tasks;
namespace UnityEditor.Build.Pipeline.Interfaces
{
#if UNITY_2019_3_OR_NEWER
/// <summary>
/// Custom Content struct mapping a source asset to a processor to generate custom data for that asset.
/// </summary>
[Serializable]
public struct CustomContent : IEquatable<CustomContent>
{
/// <summary>
/// Input Asset for custom content
/// </summary>
public GUID Asset { get; set; }
/// <summary>
/// Processor function to run to convert the input asset to the custom content
/// </summary>
public Action<GUID, CalculateCustomDependencyData> Processor;
/// <summary>
/// IEquatable<CustomContent> Equals operator to handle generic collections
/// </summary>
/// <param name="other">Other CustomContent object to compare against.</param>
/// <returns></returns>
public bool Equals(CustomContent other)
{
return Asset == other.Asset && Processor == other.Processor;
}
}
/// <summary>
/// Base interface for storing the list of Custom Assets generated during the Scriptable Build Pipeline.
/// </summary>
public interface ICustomAssets : IContextObject
{
/// <summary>
/// List of Custom Assets to include.
/// </summary>
List<GUID> Assets { get; }
}
#endif
/// <summary>
/// Base interface for feeding Assets to the Scriptable Build Pipeline.
/// </summary>
public interface IBuildContent : IContextObject
{
/// <summary>
/// List of Assets to include.
/// </summary>
List<GUID> Assets { get; }
/// <summary>
/// List of Scenes to include.
/// </summary>
List<GUID> Scenes { get; }
#if UNITY_2019_3_OR_NEWER
/// <summary>
/// List of custom content to be included in asset bundles.
/// </summary>
List<CustomContent> CustomAssets { get; }
#endif
}
/// <summary>
/// Base interface for feeding Assets with explicit Asset Bundle layout to the Scriptable Build Pipeline.
/// </summary>
public interface IBundleBuildContent : IBuildContent
{
/// <summary>
/// Specific layout of asset bundles to assets or scenes.
/// </summary>
Dictionary<string, List<GUID>> BundleLayout { get; }
#if UNITY_2019_3_OR_NEWER
/// <summary>
/// Additional list of raw files to add to an asset bundle
/// </summary>
Dictionary<string, List<ResourceFile>> AdditionalFiles { get; }
#endif
/// <summary>
/// Custom loading identifiers to use for Assets or Scenes.
/// </summary>
Dictionary<GUID, string> Addresses { get; }
}
}

View file

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 431079301da72b74cba77e88c2af37ba
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,138 @@
using System;
namespace UnityEditor.Build.Pipeline.Interfaces
{
/// <summary>
/// Base interface for all objects that can be stored in <see cref="IBuildContext"/>.
/// </summary>
public interface IContextObject {}
/// <summary>
/// Base interface that handles processing the callbacks after script building step.
/// </summary>
public interface IScriptsCallback : IContextObject
{
/// <summary>
/// Processes all the callbacks after script building step.
/// </summary>
/// <param name="parameters">Parameters passed into the build pipeline.</param>
/// <param name="results">Results from the script building step.</param>
/// <returns>Return code from processing the callbacks.</returns>
ReturnCode PostScripts(IBuildParameters parameters, IBuildResults results);
}
/// <summary>
/// Base interface for handling running the callbacks after dependency calculation step.
/// </summary>
public interface IDependencyCallback : IContextObject
{
/// <summary>
/// Processes all the callbacks after dependency calculation step.
/// </summary>
/// <param name="parameters">Parameters passed into the build pipeline.</param>
/// <param name="dependencyData">Results from the dependency calculation step.</param>
/// <returns>Return code from processing the callbacks.</returns>
ReturnCode PostDependency(IBuildParameters parameters, IDependencyData dependencyData);
}
/// <summary>
/// Base interface for handling running the callbacks after packing step.
/// </summary>
public interface IPackingCallback : IContextObject
{
/// <summary>
/// Processes all the callbacks after packing step.
/// </summary>
/// <param name="parameters">Parameters passed into the build pipeline.</param>
/// <param name="dependencyData">Results from the dependency calculation step.</param>
/// <param name="writeData">Results from the packing step.</param>
/// <returns>Return code from processing the callbacks.</returns>
ReturnCode PostPacking(IBuildParameters parameters, IDependencyData dependencyData, IWriteData writeData);
}
/// <summary>
/// Base interface for handling running the callbacks after writing step.
/// </summary>
public interface IWritingCallback : IContextObject
{
/// <summary>
/// Processes all the callbacks after writing step.
/// </summary>
/// <param name="parameters">Parameters passed into the build pipeline.</param>
/// <param name="dependencyData">Results from the dependency calculation step.</param>
/// <param name="writeData">Results from the packing step.</param>
/// <param name="results">Results from the writing step.</param>
/// <returns>Return code from processing the callbacks.</returns>
ReturnCode PostWriting(IBuildParameters parameters, IDependencyData dependencyData, IWriteData writeData, IBuildResults results);
}
/// <summary>
/// Base interface for build data container system
/// </summary>
public interface IBuildContext
{
/// <summary>
/// Checks the build context for existence of a data that is of the specified type.
/// </summary>
/// <typeparam name="T">Type of data to check for existence.</typeparam>
/// <returns><c>true</c> if the context contains specified type of data; otherwise, <c>false</c>.</returns>
bool ContainsContextObject<T>() where T : IContextObject;
/// <summary>
/// Checks the build context for existence of a data that is of the specified type.
/// </summary>
/// <param name="type">Type of data to check for existence.</param>
/// <returns><c>true</c> if the context contains specified type of data; otherwise, <c>false</c>.</returns>
bool ContainsContextObject(Type type);
/// <summary>
/// Gets the data of the specified type contained in the build context.
/// </summary>
/// <typeparam name="T">Type of data to return.</typeparam>
/// <returns>The type of data specified.</returns>
T GetContextObject<T>() where T : IContextObject;
/// <summary>
/// Gets the data of the specified type contained in the build context.
/// </summary>
/// <param name="type">Type of data to return.</param>
/// <returns>The type of data specified.</returns>
IContextObject GetContextObject(Type type);
/// <summary>
/// Adds the data of the specified type to the build context.
/// </summary>
/// <typeparam name="T">Type of data to add.</typeparam>
/// <param name="contextObject">Object holding the data to add.</param>
void SetContextObject<T>(IContextObject contextObject) where T : IContextObject;
/// <summary>
/// Adds the data of the specified type to the build context.
/// </summary>
/// <param name="type">Type of data to add.</param>
/// <param name="contextObject">Object holding the data to add.</param>
void SetContextObject(Type type, IContextObject contextObject);
/// <summary>
/// Adds the data to the build context. Type will be inferred using Reflection.
/// </summary>
/// <param name="contextObject">Object holding the data to add.</param>
void SetContextObject(IContextObject contextObject);
/// <summary>
/// Tries to get the data of the specified type contained in the build context.
/// </summary>
/// <typeparam name="T">Type of data to return.</typeparam>
/// <param name="contextObject">The object holding the data to be returned if found.</param>
/// <returns><c>true</c> if the context was able to returned the specified data; otherwise, <c>false</c>.</returns>
bool TryGetContextObject<T>(out T contextObject) where T : IContextObject;
/// <summary>
/// Tries to get the data of the specified type contained in the build context.
/// </summary>
/// <param name="type">Type of data to return.</param>
/// <param name="contextObject">The object holding the data to be returned if found.</param>
/// <returns><c>true</c> if the context was able to returned the specified data; otherwise, <c>false</c>.</returns>
bool TryGetContextObject(Type type, out IContextObject contextObject);
}
}

View file

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: ef728e637accb8d46ad52f863653cf75
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,211 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.CompilerServices;
using UnityEditor.Build.Content;
using UnityEditor.Build.Pipeline.Utilities;
[assembly: InternalsVisibleTo("Unity.Addressables.Editor.Tests")]
namespace UnityEditor.Build.Pipeline.Interfaces
{
/// <summary>
/// Describes the level of a log entry
/// </summary>
public enum LogLevel
{
/// <summary>
/// The entry is reporting an error.
/// </summary>
Error,
/// <summary>
/// The entry is reporting an warning.
/// </summary>
Warning,
/// <summary>
/// The entry is reporting general information.
/// </summary>
Info,
/// <summary>
/// The entry is reporting verbose information.
/// </summary>
Verbose
}
/// <summary>
/// Interface for monitoring the build process. Several tasks will log details of their progress through this interface.
/// See the [Build Logging](https://docs.unity3d.com/Packages/com.unity.scriptablebuildpipeline@latest/index.html?subfolder=/manual/BuildLogger.html) documentation for more details.
/// </summary>
public interface IBuildLogger : IContextObject
{
/// <summary>
/// Adds details to the active build step
/// </summary>
/// <param name="level">The log level of this entry.</param>
/// <param name="msg">The message to add.</param>
void AddEntry(LogLevel level, string msg);
/// <summary>
/// Should be called when beginning a build step.
/// </summary>
/// <param name="level">The log level of this step.</param>
/// <param name="stepName">A name associated with the step. It is recommended that this name does not include specific context about the step; dynamic context should be added under the step as an entry.</param>
/// <param name="subStepsCanBeThreaded">True if within this build step the IBuildLogger will be used on multiple threads.</param>
void BeginBuildStep(LogLevel level, string stepName, bool subStepsCanBeThreaded);
/// <summary>
/// Ends the build step.
/// </summary>
void EndBuildStep();
}
internal enum DeferredEventType
{
Begin,
End,
Info
}
internal struct DeferredEvent
{
public LogLevel Level;
public DeferredEventType Type;
public double Time;
public string Name;
public string Context;
}
internal interface IDeferredBuildLogger
{
void HandleDeferredEventStream(IEnumerable<DeferredEvent> events);
}
/// <summary>
/// Helper class to define a scope with a using statement
/// </summary>
public struct ScopedBuildStep : IDisposable
{
IBuildLogger m_Logger;
internal ScopedBuildStep(LogLevel level, string stepName, IBuildLogger logger, bool multiThreaded, string context)
{
m_Logger = logger;
m_Logger?.BeginBuildStep(level, stepName, multiThreaded);
if (!string.IsNullOrEmpty(context))
m_Logger?.AddEntrySafe(level, context);
}
/// <inheritdoc/>
void IDisposable.Dispose()
{
m_Logger?.EndBuildStep();
}
}
#if UNITY_2020_2_OR_NEWER || ENABLE_DETAILED_PROFILE_CAPTURING
internal struct ProfileCaptureScope : IDisposable
{
IBuildLogger m_Logger;
public ProfileCaptureScope(IBuildLogger logger, ProfileCaptureOptions options)
{
m_Logger = ScriptableBuildPipeline.useDetailedBuildLog ? logger : null;
ContentBuildInterface.StartProfileCapture(options);
}
public void Dispose()
{
ContentBuildProfileEvent[] events = ContentBuildInterface.StopProfileCapture();
if (m_Logger == null)
return;
IDeferredBuildLogger dLog = (IDeferredBuildLogger)m_Logger;
IEnumerable<DeferredEvent> dEvents = events.Select(i =>
{
var e = new DeferredEvent();
e.Level = LogLevel.Verbose;
BuildLoggerExternsions.ConvertNativeEventName(i.Name, out e.Name, out e.Context);
e.Time = (double)i.TimeMicroseconds / (double)1000;
e.Type = BuildLoggerExternsions.ConvertToDeferredType(i.Type);
return e;
});
dLog.HandleDeferredEventStream(dEvents);
}
}
#endif
/// <summary>
/// Contains extension methods for the IBuildLogger interface
/// </summary>
public static class BuildLoggerExternsions
{
/// <summary>
/// Adds details to the active build step
/// </summary>
/// <param name="log">The build log.</param>
/// <param name="level">The log level of this entry.</param>
/// <param name="msg">The message to add.</param>
public static void AddEntrySafe(this IBuildLogger log, LogLevel level, string msg)
{
if (log != null)
{
log.AddEntry(level, msg);
}
}
/// <summary>
/// Begins a new build step and returns an ScopedBuildStep which will end the build step when disposed. It is recommended to use this in conjunction with the using statement.
/// </summary>
/// <param name="log">The build log.</param>
/// <param name="level">The log level of this step.</param>
/// <param name="stepName">A name associated with the step.</param>
/// <param name="multiThreaded">True if within this build step the IBuildLogger will be used on multiple threads.</param>
/// <returns>Returns a ScopedBuildStep that will end the build step when it is disposed.</returns>
public static ScopedBuildStep ScopedStep(this IBuildLogger log, LogLevel level, string stepName, bool multiThreaded = false)
{
return new ScopedBuildStep(level, stepName, log, multiThreaded, null);
}
/// <summary>
/// Begins a new build step and returns an ScopedBuildStep which will end the build step when disposed. It is recommended to use this in conjunction with the using statement.
/// </summary>
/// <param name="log">The build log.</param>
/// <param name="level">The log level of this step.</param>
/// <param name="stepName">A name associated with the step.</param>
/// <param name="context">Adds an entry message the build step. This allows attaching specific context data without changing the stepName.</param>
/// <returns>Returns a ScopedBuildStep that will end the build step when it is disposed.</returns>
public static ScopedBuildStep ScopedStep(this IBuildLogger log, LogLevel level, string stepName, string context)
{
return new ScopedBuildStep(level, stepName, log, false, context);
}
#if UNITY_2020_2_OR_NEWER || ENABLE_DETAILED_PROFILE_CAPTURING
internal static DeferredEventType ConvertToDeferredType(ProfileEventType type)
{
if (type == ProfileEventType.Begin) return DeferredEventType.Begin;
if (type == ProfileEventType.End) return DeferredEventType.End;
if (type == ProfileEventType.Info) return DeferredEventType.Info;
throw new Exception("Unknown type");
}
const string k_WriteFile = "Write file:";
const string k_WriteObject = "Write object - ";
internal static void ConvertNativeEventName(string nativeName, out string eventName, out string eventContext)
{
eventName = nativeName;
eventContext = "";
if (nativeName.StartsWith(k_WriteFile, StringComparison.Ordinal))
{
eventName = "Write File";
eventContext = nativeName.Substring(k_WriteFile.Length);
}
else if (nativeName.StartsWith(k_WriteObject, StringComparison.Ordinal))
{
eventName = "Write Object";
eventContext = nativeName.Substring(k_WriteObject.Length);
}
if (eventContext.Any(c => c == '"'))
eventContext = eventContext.Replace("\"", "\\\"");
}
#endif
}
}

View file

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 4f04442bb071fe8438a7e40408a9bada
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,130 @@
using UnityEditor.Build.Content;
using UnityEditor.Build.Player;
using UnityEngine;
namespace UnityEditor.Build.Pipeline.Interfaces
{
#if UNITY_2018_3_OR_NEWER
using BuildCompression = UnityEngine.BuildCompression;
#else
using BuildCompression = UnityEditor.Build.Content.BuildCompression;
#endif
/// <summary>
/// Base interface for the parameters container
/// </summary>
public interface IBuildParameters : IContextObject
{
/// <summary>
/// Target build platform. <seealso cref="BuildTarget"/>
/// </summary>
BuildTarget Target { get; set; }
/// <summary>
/// Target build platform group. <seealso cref="BuildTargetGroup"/>
/// </summary>
BuildTargetGroup Group { get; set; }
/// <summary>
/// The set of build flags to use for building content.
/// </summary>
ContentBuildFlags ContentBuildFlags { get; set; }
/// <summary>
/// Scripting type information to use when building content.
/// Setting this to a previously cached value will prevent the default script compiling step.
/// </summary>
TypeDB ScriptInfo { get; set; }
/// <summary>
/// Script compilation options to use for the script compiling step.
/// </summary>
ScriptCompilationOptions ScriptOptions { get; set; }
/// <summary>
/// Temporary location to be used for artifacts generated during the build but are not part of the final output.
/// </summary>
string TempOutputFolder { get; set; }
/// <summary>
/// Location to be used for compiled scripts generated during the build.
/// </summary>
string ScriptOutputFolder { get; set; }
/// <summary>
/// Enables the use of the build cache if set to true.
/// </summary>
bool UseCache { get; set; }
/// <summary>
/// Enables and specifies the cache server to use.
/// </summary>
string CacheServerHost { get; set; }
/// <summary>
/// The port for the cache server to use
/// </summary>
int CacheServerPort { get; set; }
/// <summary>
/// Writes out a link.xml file to the output folder to use with Unity managed code stripping.
/// </summary>
bool WriteLinkXML { get; set; }
#if NONRECURSIVE_DEPENDENCY_DATA
/// <summary>
/// Calculates and build asset bundles using Non-Recursive Dependency calculation methods.
/// This approach helps reduce asset bundle rebuilds and runtime memory consumption.
/// </summary>
bool NonRecursiveDependencies { get; set; }
#endif
/// <summary>
/// Constructs and returns the BuildSettings struct to use for content building.
/// </summary>
/// <returns>Returns the BuildSettings struct to use for content building.</returns>
BuildSettings GetContentBuildSettings();
/// <summary>
/// Returns the output folder to use for the specified identifier.
/// </summary>
/// <param name="identifier">Identifier used to identify which output folder to use.</param>
/// <returns>Returns the output folder to use for the specified identifier.</returns>
string GetOutputFilePathForIdentifier(string identifier);
/// <summary>
/// Constructs and returns the BuildCompression struct to use for the specified identifier.
/// </summary>
/// <param name="identifier">Identifier used to construct the BuildCompression struct.</param>
/// <returns>Returns the BuildCompression struct to use for a specific identifier.</returns>
BuildCompression GetCompressionForIdentifier(string identifier);
/// <summary>
/// Constructs and returns the ScriptCompilationSettings struct to use for script compiling.
/// </summary>
/// <returns>Returns the ScriptCompilationSettings struct to use for script compiling.</returns>
ScriptCompilationSettings GetScriptCompilationSettings();
}
/// <summary>
/// Base interface for the parameters container for building bundles.
/// </summary>
public interface IBundleBuildParameters : IBuildParameters
{
/// <summary>
/// Append the hash of the AssetBundle content to the file name.
/// </summary>
bool AppendHash { get; set; }
/// <summary>
/// Packs assets in bundles contiguously based on the ordering of the source asset which results in improved asset loading times.
/// </summary>
bool ContiguousBundles { get; set; }
/// <summary>
/// Assume sub Assets have no visible asset representations (are not visible in the Project view) which results in improved build times.
/// Sub Assets in the built bundles cannot be accessed by AssetBundle.LoadAsset&lt;T&gt; or AssetBundle.LoadAllAssets&lt;T&gt;.
/// </summary>
bool DisableVisibleSubAssetRepresentations { get; set; }
}
}

View file

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: e18580a7226c3b34c9fa7fdb324edfe6
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,56 @@
using System;
using System.Collections.Generic;
using UnityEditor.Build.Content;
using UnityEditor.Build.Player;
using UnityEngine;
using UnityEngine.Build.Pipeline;
namespace UnityEditor.Build.Pipeline.Interfaces
{
public struct AssetResultData
{
public GUID Guid;
public Hash128 Hash;
public List<ObjectIdentifier> IncludedObjects;
public List<ObjectIdentifier> ReferencedObjects;
public Dictionary<ObjectIdentifier, Type[]> ObjectTypes;
}
/// <summary>
/// Base interface for the build results container
/// </summary>
public interface IBuildResults : IContextObject
{
/// <summary>
/// Results from the script compiling step.
/// </summary>
ScriptCompilationResult ScriptResults { get; set; }
/// <summary>
/// Map of serialized file name to results for built content.
/// </summary>
Dictionary<string, WriteResult> WriteResults { get; }
/// <summary>
/// Map of serialized file name to additional metadata associated with the write result.
/// </summary>
Dictionary<string, SerializedFileMetaData> WriteResultsMetaData { get; }
/// <summary>
/// Map of Asset data included in this build
/// </summary>
Dictionary<GUID, AssetResultData> AssetResults { get; }
}
/// <summary>
/// Extended interface for Asset Bundle build results container.
/// <seealso cref="IBuildResults"/>
/// </summary>
public interface IBundleBuildResults : IBuildResults
{
/// <summary>
/// Map of Asset Bundle name to details about the built bundle.
/// </summary>
Dictionary<string, BundleDetails> BundleInfos { get; }
}
}

View file

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 87c4ff2c85dcb524685caba3bb22110c
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,34 @@
using System;
using System.Collections.Generic;
using UnityEditor.Build.Content;
namespace UnityEditor.Build.Pipeline.Interfaces
{
/// <summary>
/// The importer data about a sprite asset.
/// </summary>
[Serializable]
public class SpriteImporterData
{
/// <summary>
/// Property if this sprite asset is packed by the sprite packer.
/// </summary>
public bool PackedSprite { get; set; }
/// <summary>
/// Object identifier of the source texture for the sprite.
/// </summary>
public ObjectIdentifier SourceTexture { get; set; }
}
/// <summary>
/// Base interface for the storing sprite importer data for sprite assets.
/// </summary>
public interface IBuildSpriteData : IContextObject
{
/// <summary>
/// Map of sprite asset to importer data.
/// </summary>
Dictionary<GUID, SpriteImporterData> ImporterData { get; }
}
}

View file

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: fb4c2e00689dfb34985500f260df63cb
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,20 @@
namespace UnityEditor.Build.Pipeline.Interfaces
{
/// <summary>
/// Base interface of all build tasks.
/// </summary>
public interface IBuildTask
{
/// <summary>
/// Version identifier for the build task.
/// Primarily for caching.
/// </summary>
int Version { get; }
/// <summary>
/// Run task method
/// </summary>
/// <returns>Return code with status information about success or failure causes.</returns>
ReturnCode Run();
}
}

View file

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 8f2c2ad6904ea9147a43a79fccd94ca1
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,16 @@
using System.Collections.Generic;
using UnityEditor.Build.Content;
namespace UnityEditor.Build.Pipeline.Interfaces
{
/// <summary>
/// Optional interface used for overriding the location where specific objects will be serialized
/// </summary>
public interface IBundleExplictObjectLayout : IContextObject
{
/// <summary>
/// Map listing object identifiers and their new bundle location
/// </summary>
Dictionary<ObjectIdentifier, string> ExplicitObjectLocation { get; }
}
}

View file

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 1a78160a9be3bdf4d9397ca7b0466850
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,47 @@
using System.Collections.Generic;
using UnityEditor.Build.Content;
using UnityEngine;
namespace UnityEditor.Build.Pipeline.Interfaces
{
/// <summary>
/// Base interface for the dependency data container
/// </summary>
public interface IDependencyData : IContextObject
{
/// <summary>
/// Map of Asset to dependency data.
/// </summary>
Dictionary<GUID, AssetLoadInfo> AssetInfo { get; }
/// <summary>
/// Map of Asset to usage data.
/// </summary>
Dictionary<GUID, BuildUsageTagSet> AssetUsage { get; }
/// <summary>
/// Map of Scene to dependency data.
/// </summary>
Dictionary<GUID, SceneDependencyInfo> SceneInfo { get; }
/// <summary>
/// Map of Scene to usage data.
/// </summary>
Dictionary<GUID, BuildUsageTagSet> SceneUsage { get; }
/// <summary>
/// Map of Asset or Scene to pre-calculated dependency hash for caching.
/// </summary>
Dictionary<GUID, Hash128> DependencyHash { get; }
/// <summary>
/// Reusable cache for calculating usage tags
/// </summary>
BuildUsageCache DependencyUsageCache { get; }
/// <summary>
/// BuildUsageTagGlobal value from GraphicsSettings
/// </summary>
BuildUsageTagGlobal GlobalUsage { get; set; }
}
}

View file

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: a99d07c2f0fab1e4f8623f5913408df5
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,24 @@
using UnityEditor.Build.Content;
namespace UnityEditor.Build.Pipeline.Interfaces
{
/// <summary>
/// Base interface for the generating deterministic identifiers for different parts of the build pipeline.
/// </summary>
public interface IDeterministicIdentifiers : IContextObject
{
/// <summary>
/// Generates a deterministic internal file name from the passed in name.
/// </summary>
/// <param name="name">Name identifier for internal file name generation</param>
/// <returns>Deterministic file name.</returns>
string GenerateInternalFileName(string name);
/// <summary>
/// Generates a deterministic id for a given object in the build.
/// </summary>
/// <param name="objectID">Object identifier to for id generation.</param>
/// <returns><c>long</c> representing the id of the objectID.</returns>
long SerializationIndexFromObjectIdentifier(ObjectIdentifier objectID);
}
}

View file

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: f2f62872d2484231aa95c2eb9feb8326
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
using UnityEditor.Build.Content;
//TODO: Remove this when we make this interface public
[assembly: InternalsVisibleTo("Unity.Addressables.Editor", AllInternalsVisible = true)]
namespace UnityEditor.Build.Pipeline.Interfaces
{
/// <summary>
/// Base interface for the dependency data container
/// </summary>
internal interface IObjectDependencyData : IContextObject
{
/// <summary>
/// Dependencies of a given object
/// </summary>
Dictionary<ObjectIdentifier, List<ObjectIdentifier>> ObjectDependencyMap { get; }
}
}

View file

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: c07ce938101b77544a5df7d58f37aa97
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,32 @@
namespace UnityEditor.Build.Pipeline.Interfaces
{
/// <summary>
/// Base interface for the build progress tracker
/// </summary>
public interface IProgressTracker : IContextObject
{
/// <summary>
/// Number of build tasks to run
/// </summary>
int TaskCount { get; set; }
/// <summary>
/// Current 0.0f to 1.0f progress though the TaskCount
/// </summary>
float Progress { get; }
/// <summary>
/// Increments and updated the title of the progress bar.
/// </summary>
/// <param name="taskTitle">The title to display on the progress bar.</param>
/// <returns><c>false</c> if the build should not continue due to user interaction with the progress bar; otherwise, <c>true</c>.</returns>
bool UpdateTask(string taskTitle);
/// <summary>
/// Updates the secondary information display of the progress bar.
/// </summary>
/// <param name="taskInfo">The secondary information to display on the progress bar.</param>
/// <returns><c>false</c> if the build should not continue due to user interaction with the progress bar; otherwise, <c>true</c>.</returns>
bool UpdateInfo(string taskInfo);
}
}

View file

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: e25b76d1a8a87c641894e4694a750cd8
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,48 @@
using System.Collections.Generic;
using UnityEditor.Build.Content;
namespace UnityEditor.Build.Pipeline.Interfaces
{
/// <summary>
/// Base interface for the write data container.
/// </summary>
public interface IWriteData : IContextObject
{
/// <summary>
/// Map of asset to file dependencies.
/// First dependency in the list is the main file for an asset.
/// </summary>
Dictionary<GUID, List<string>> AssetToFiles { get; }
/// <summary>
/// Map of file to list of objects in that file
/// </summary>
Dictionary<string, List<ObjectIdentifier>> FileToObjects { get; }
/// <summary>
/// List of all write operations to serialize data to disk
/// </summary>
List<IWriteOperation> WriteOperations { get; }
}
/// <summary>
/// Extended interface for Asset Bundle write data container.
/// </summary>
public interface IBundleWriteData : IWriteData
{
/// <summary>
/// Map of file name to bundle name
/// </summary>
Dictionary<string, string> FileToBundle { get; }
/// <summary>
/// Map of file name to calculated usage set
/// </summary>
Dictionary<string, BuildUsageTagSet> FileToUsageSet { get; }
/// <summary>
/// Map of file name to calculated object references
/// </summary>
Dictionary<string, BuildReferenceMap> FileToReferenceMap { get; }
}
}

View file

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: a8092de151d449b0962952fe68a54dd9
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View file

@ -0,0 +1,57 @@
using UnityEditor.Build.Content;
using UnityEditor.Build.Pipeline.Utilities;
using UnityEngine;
namespace UnityEditor.Build.Pipeline.Interfaces
{
/// <summary>
/// Base interface for wrapping the different low level WriteSerializeFile API around a common high level Write function
/// </summary>
public interface IWriteOperation
{
/// <summary>
/// The specific write command containing the details about what to write to disk.
/// <seealso cref="WriteCommand"/>
/// </summary>
WriteCommand Command { get; set; }
/// <summary>
/// The specific usage data for objects in the write command.
/// <seealso cref="BuildUsageTagSet"/>
/// </summary>
BuildUsageTagSet UsageSet { get; set; }
/// <summary>
/// The specific reference data for objects in the write command.
/// <seealso cref="BuildReferenceMap"/>
/// </summary>
BuildReferenceMap ReferenceMap { get; set; }
/// <summary>
/// The hash that represents the unique set of input dependencies for caching this write command.
/// </summary>
Hash128 DependencyHash { get; set; }
/// <summary>
/// Write function that wraps the low level WriteSerializeFile APIs that takes the common minimum set of parameters.
/// </summary>
/// <param name="outputFolder">The location to write data to disk.</param>
/// <param name="settings">The build settings to use for writing data.</param>
/// <param name="globalUsage">The global usage to use for writing data.</param>
/// <returns>The write results struct containing details about what was written to disk</returns>
WriteResult Write(string outputFolder, BuildSettings settings, BuildUsageTagGlobal globalUsage);
/// <summary>
/// Optimized hash function for use with the Build Cache system.
/// </summary>
/// <returns>Unique hash for the contents of this write operation.</returns>
Hash128 GetHash128();
/// <summary>
/// Optimized hash function for use with the Build Cache system.
/// </summary>
/// <param name="log">The build log.</param>
/// <returns>Unique hash for the contents of this write operation.</returns>
Hash128 GetHash128(IBuildLogger log);
}
}

View file

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 7df65588254d9194cb3fb45879168954
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: