-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
## [0.0.8-preview] - 2018-03-27 - Test rename & meta file cleanup - Added documentation for shared classes / structs - Updated inconsistent interface / class names - Added missing parameter to IBuildParameters - Ran spell check - Moved IWriteOperation to Interfaces - Update IWriteOperation properties to PascalCase - Added IWriteOperation documentation
- Loading branch information
Unity Technologies
committed
Mar 26, 2018
1 parent
55813ab
commit 979bfea
Showing
80 changed files
with
1,908 additions
and
1,197 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
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> | ||
/// Returns the relative directory path where dependency data can be cached for a specified cacheEntry. | ||
/// </summary> | ||
/// <param name="cacheEntry">Valid CacheEntry to get directory path.</param> | ||
/// <returns>Relative directory path.</returns> | ||
string GetDependencyCacheDirectory(CacheEntry cacheEntry); | ||
|
||
/// <summary> | ||
/// Returns the relative directory path where artifact data can be cached for a specified cacheEntry. | ||
/// </summary> | ||
/// <param name="cacheEntry">Valid CacheEntry to get directory path.</param> | ||
/// <returns>Relative directory path.</returns> | ||
string GetArtifactCacheDirectory(CacheEntry cacheEntry); | ||
|
||
/// <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> | ||
/// <returns>CacheEntry representing current asset.</returns> | ||
CacheEntry GetCacheEntry(GUID asset); | ||
|
||
/// <summary> | ||
/// Validates a cacheEntry and its dependencies. | ||
/// </summary> | ||
/// <param name="cacheEntry">The entry in the cache to validate.</param> | ||
/// <returns><c>true</c> if the cacheEntry is valid; otherwise, <c>false</c>.</returns> | ||
bool IsCacheEntryValid(CacheEntry cacheEntry); | ||
|
||
/// <summary> | ||
/// Tries to load from the cache generated dependency and usage data for a specified Assets's cacheEntry. | ||
/// </summary> | ||
/// <param name="cacheEntry">The entry to load dependency data.</param> | ||
/// <param name="info">The Asset's generated dependency data to load. Parameter will not be chanced if data was unable to be loaded.</param> | ||
/// <param name="usage">The Asset's generated usage data to load. Parameter will not be chanced if data was unable to be loaded.</param> | ||
/// <returns><c>true</c> if the cache was able to load the specified data; otherwise, <c>false</c>.</returns> | ||
bool TryLoadFromCache(CacheEntry cacheEntry, ref AssetLoadInfo info, ref BuildUsageTagSet usage); | ||
|
||
/// <summary> | ||
/// Tries to load from the cache generated dependency and usage data for a specified Scene's cacheEntry. | ||
/// </summary> | ||
/// <param name="cacheEntry">The entry to load dependency data.</param> | ||
/// <param name="info">The Scene's generated dependency data to load.</param> | ||
/// <param name="usage">The Scene's generated usage data to load.</param> | ||
/// <returns><c>true</c> if the cache was able to load the specified data; otherwise, <c>false</c>.</returns> | ||
bool TryLoadFromCache(CacheEntry cacheEntry, ref SceneDependencyInfo info, ref BuildUsageTagSet usage); | ||
|
||
/// <summary> | ||
/// Tries to load from the cache generated data for a specified cacheEntry. | ||
/// </summary> | ||
/// <typeparam name="T">The type of results data to load.</typeparam> | ||
/// <param name="cacheEntry">The entry to load data.</param> | ||
/// <param name="results">The generated data to load.</param> | ||
/// <returns><c>true</c> if the cache was able to load the specified data; otherwise, <c>false</c>.</returns> | ||
bool TryLoadFromCache<T>(CacheEntry cacheEntry, ref T results); | ||
|
||
/// <summary> | ||
/// Tries to load from the cache generated data for a specified cacheEntry. | ||
/// </summary> | ||
/// <typeparam name="T1">The first type of results data to load.</typeparam> | ||
/// <typeparam name="T2">The second type of results data to cache.</typeparam> | ||
/// <param name="cacheEntry">The entry to load data.</param> | ||
/// <param name="results1">The first generated data to load.</param> | ||
/// <param name="results2">The second generated data to load.</param> | ||
/// <returns><c>true</c> if the cache was able to load the specified data; otherwise, <c>false</c>.</returns> | ||
bool TryLoadFromCache<T1, T2>(CacheEntry cacheEntry, ref T1 results1, ref T2 results2); | ||
|
||
/// <summary> | ||
/// Tries to cache an Asset's cacheEntry and its generated dependency and usage data. | ||
/// </summary> | ||
/// <param name="cacheEntry">The entry for caching dependency data.</param> | ||
/// <param name="info">The Asset's generated dependency data to cache.</param> | ||
/// <param name="usage">The Asset's generated usage data to cache.</param> | ||
/// <returns><c>true</c> if the cache was able to save the specified data; otherwise, <c>false</c>.</returns> | ||
bool TrySaveToCache(CacheEntry cacheEntry, AssetLoadInfo info, BuildUsageTagSet usage); | ||
|
||
/// <summary> | ||
/// Tries to cache a Scene's cacheEntry and its generated dependency and usage data. | ||
/// </summary> | ||
/// <param name="cacheEntry">The entry for caching dependency data.</param> | ||
/// <param name="info">The Scene's generated dependency data to cache.</param> | ||
/// <param name="usage">The Scene's generated usage data to cache.</param> | ||
/// <returns><c>true</c> if the cache was able to save the specified data; otherwise, <c>false</c>.</returns> | ||
bool TrySaveToCache(CacheEntry cacheEntry, SceneDependencyInfo info, BuildUsageTagSet usage); | ||
|
||
/// <summary> | ||
/// Tries to cache generated data for the specified cacheEntry. | ||
/// </summary> | ||
/// <typeparam name="T">The type of results data to cache.</typeparam> | ||
/// <param name="cacheEntry">The entry for caching data.</param> | ||
/// <param name="results">The generated data to cache.</param> | ||
/// <returns><c>true</c> if the cache was able to save the specified data; otherwise, <c>false</c>.</returns> | ||
bool TrySaveToCache<T>(CacheEntry cacheEntry, T results); | ||
|
||
/// <summary> | ||
/// Tries to cache generated data for the specified cacheEntry. | ||
/// </summary> | ||
/// <typeparam name="T1">The first type of results data to cache.</typeparam> | ||
/// <typeparam name="T2">The second type of results data to cache.</typeparam> | ||
/// <param name="cacheEntry">The entry for caching data.</param> | ||
/// <param name="results1">The first generated data to cache.</param> | ||
/// <param name="results2">The second generated data to cache.</param> | ||
/// <returns><c>true</c> if the cache was able to save the specified data; otherwise, <c>false</c>.</returns> | ||
bool TrySaveToCache<T1, T2>(CacheEntry cacheEntry, T1 results1, T2 results2); | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
.../Tasks/GenerateReleaseAutoPacking.cs.meta → Editor/Interfaces/IBuildCache.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,36 @@ | ||
using System.Collections.Generic; | ||
|
||
namespace UnityEditor.Build.Interfaces | ||
namespace UnityEditor.Build.Pipeline.Interfaces | ||
{ | ||
/// <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; } | ||
} | ||
|
||
public interface IBundleContent : IBuildContent | ||
|
||
/// <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; } | ||
|
||
/// <summary> | ||
/// Custom loading identifiers to use for Assets or Scenes. | ||
/// </summary> | ||
Dictionary<GUID, string> Addresses { get; } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,123 @@ | ||
using System; | ||
|
||
namespace UnityEditor.Build.Interfaces | ||
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="buildParameters">Parameters passed into the build pipeline.</param> | ||
/// <param name="buildResults">Results from the script building step.</param> | ||
/// <returns>Return code from processing the callbacks.</returns> | ||
ReturnCodes PostScripts(IBuildParameters buildParameters, IBuildResults buildResults); | ||
} | ||
|
||
|
||
/// <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="buildParameters">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> | ||
ReturnCodes PostDependency(IBuildParameters buildParameters, 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="buildParameters">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> | ||
ReturnCodes PostPacking(IBuildParameters buildParameters, 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="buildParameters">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="buildResults">Results from the writing step.</param> | ||
/// <returns>Return code from processing the callbacks.</returns> | ||
ReturnCodes PostWriting(IBuildParameters buildParameters, IDependencyData dependencyData, IWriteData writeData, IBuildResults buildResults); | ||
} | ||
|
||
/// <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 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; | ||
} | ||
} |
Oops, something went wrong.