-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
# Changelog All notable changes to this package will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). ## [0.0.5-preview] - 2018-02-08 - Initial submission for package distribution
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Changelog | ||
All notable changes to this package will be documented in this file. | ||
|
||
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) | ||
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). | ||
|
||
|
||
## [0.0.5-preview] - 2018-02-08 | ||
- Initial submission for package distribution | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# Unity scriptablebuildpipeline | ||
|
||
scriptablebuildpipeline info placeholder | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
using System.Diagnostics; | ||
using UnityEditor.Build.Interfaces; | ||
using UnityEditor.Build.Utilities; | ||
|
||
namespace UnityEditor.Build.AssetBundle | ||
{ | ||
public static class ContentPipeline | ||
{ | ||
public const string kTempBuildPath = "Temp/ContentBuildData"; | ||
|
||
public static BuildCallbacks BuildCallbacks = new BuildCallbacks(); | ||
|
||
public static ReturnCodes BuildContentPacks(IBuildParameters buildParameters, IBuildContent buildContent, out IBuildResults result) | ||
{ | ||
var buildTimer = new Stopwatch(); | ||
buildTimer.Start(); | ||
|
||
ReturnCodes exitCode; | ||
result = new BuildBuildResults(); | ||
|
||
using (var progressTracker = new ProgressTracker()) | ||
{ | ||
using (var buildCleanup = new BuildStateCleanup(buildParameters.TempOutputFolder)) | ||
{ | ||
var buildContext = new BuildContext(buildParameters, buildContent, result, progressTracker); | ||
buildContext.SetContextObject(new PrefabPackedIdentifiers()); | ||
buildContext.SetContextObject(new BuildDependencyData()); | ||
buildContext.SetContextObject(new BuildWriteData()); | ||
buildContext.SetContextObject(BuildCallbacks); | ||
|
||
var pipeline = DefaultBuildTasks.Create(DefaultBuildTasks.Presets.AutopackReleaseContent, buildParameters.ScriptInfo == null); | ||
exitCode = BuildTasksRunner.Validate(pipeline, buildContext); | ||
if (exitCode >= ReturnCodes.Success) | ||
exitCode = BuildTasksRunner.Run(pipeline, buildContext); | ||
} | ||
} | ||
|
||
buildTimer.Stop(); | ||
if (exitCode >= ReturnCodes.Success) | ||
BuildLogger.Log("Build Content successful in: {0:c}", buildTimer.Elapsed); | ||
else if (exitCode == ReturnCodes.Canceled) | ||
BuildLogger.LogWarning("Build Content canceled in: {0:c}", buildTimer.Elapsed); | ||
else | ||
BuildLogger.LogError("Build Content failed in: {0:c}. Error: {1}.", buildTimer.Elapsed, exitCode); | ||
|
||
return exitCode; | ||
} | ||
|
||
public static ReturnCodes BuildAssetBundles(IBuildParameters buildParameters, IBundleContent bundleContent, out IBundleBuildResults result) | ||
{ | ||
var buildTimer = new Stopwatch(); | ||
buildTimer.Start(); | ||
|
||
ReturnCodes exitCode; | ||
result = new BundleBuildResults(); | ||
|
||
using (var progressTracker = new ProgressTracker()) | ||
{ | ||
using (var buildCleanup = new BuildStateCleanup(buildParameters.TempOutputFolder)) | ||
{ | ||
var buildContext = new BuildContext(buildParameters, bundleContent, result, progressTracker); | ||
buildContext.SetContextObject(new Unity5PackedIdentifiers()); | ||
buildContext.SetContextObject(new BuildDependencyData()); | ||
buildContext.SetContextObject(new BundleWriteData()); | ||
buildContext.SetContextObject(BuildCallbacks); | ||
|
||
var pipeline = DefaultBuildTasks.Create(DefaultBuildTasks.Presets.AssetBundleCompatible, buildParameters.ScriptInfo == null); | ||
exitCode = BuildTasksRunner.Validate(pipeline, buildContext); | ||
if (exitCode >= ReturnCodes.Success) | ||
exitCode = BuildTasksRunner.Run(pipeline, buildContext); | ||
} | ||
} | ||
|
||
buildTimer.Stop(); | ||
if (exitCode >= ReturnCodes.Success) | ||
BuildLogger.Log("Build Asset Bundles successful in: {0:c}", buildTimer.Elapsed); | ||
else if (exitCode == ReturnCodes.Canceled) | ||
BuildLogger.LogWarning("Build Asset Bundles canceled in: {0:c}", buildTimer.Elapsed); | ||
else | ||
BuildLogger.LogError("Build Asset Bundles failed in: {0:c}. Error: {1}.", buildTimer.Elapsed, exitCode); | ||
|
||
return exitCode; | ||
} | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
using System.Collections.Generic; | ||
|
||
namespace UnityEditor.Build.Interfaces | ||
{ | ||
public interface IBuildContent : IContextObject | ||
{ | ||
List<GUID> Assets { get; } | ||
List<GUID> Scenes { get; } | ||
} | ||
|
||
public interface IBundleContent : IBuildContent | ||
{ | ||
Dictionary<string, List<GUID>> BundleLayout { get; } | ||
Dictionary<GUID, string> Addresses { get; } | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
using System; | ||
|
||
namespace UnityEditor.Build.Interfaces | ||
{ | ||
public interface IContextObject { } | ||
|
||
public interface IScriptsCallback : IContextObject | ||
{ | ||
ReturnCodes PostScripts(IBuildParameters buildParameters, IBuildResults buildResults); | ||
} | ||
|
||
public interface IDependencyCallback : IContextObject | ||
{ | ||
ReturnCodes PostDependency(IBuildParameters buildParameters, IDependencyData dependencyData); | ||
} | ||
|
||
public interface IPackingCallback : IContextObject | ||
{ | ||
ReturnCodes PostPacking(IBuildParameters buildParameters, IDependencyData dependencyData, IWriteData writeData); | ||
} | ||
|
||
public interface IWritingCallback : IContextObject | ||
{ | ||
ReturnCodes PostWriting(IBuildParameters buildParameters, IDependencyData dependencyData, IWriteData writeData, IBuildResults buildResults); | ||
} | ||
|
||
public interface IBuildContext | ||
{ | ||
bool ContainsContextObject<T>() where T : IContextObject; | ||
bool ContainsContextObject(Type type); | ||
|
||
T GetContextObject<T>() where T : IContextObject; | ||
IContextObject GetContextObject(Type type); | ||
|
||
void SetContextObject<T>(IContextObject contextObject) where T : IContextObject; | ||
void SetContextObject(IContextObject contextObject); | ||
|
||
bool TryGetContextObject<T>(out T contextObject) where T : IContextObject; | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
using UnityEditor.Experimental.Build.AssetBundle; | ||
using UnityEditor.Experimental.Build.Player; | ||
using UnityEngine; | ||
|
||
namespace UnityEditor.Build.Interfaces | ||
{ | ||
//public interface IScriptParameters : IContextObject | ||
//{ | ||
// BuildTarget Target { get; set; } | ||
// BuildTargetGroup Group { get; set; } | ||
// ScriptCompilationOptions ScriptOptions { get; set; } | ||
|
||
// ScriptCompilationSettings GetScriptCompilationSettings(); | ||
//} | ||
|
||
//public interface IContentParameters : IContextObject | ||
//{ | ||
// BuildTarget Target { get; set; } | ||
// BuildTargetGroup Group { get; set; } | ||
// TypeDB ScriptInfo { get; set; } | ||
|
||
// BuildSettings GetContentBuildSettings(); | ||
|
||
// BuildCompression GetCompressionForIdentifier(string identifier); | ||
//} | ||
|
||
|
||
public interface IBuildParameters : IContextObject//IScriptParameters, IContentParameters | ||
{ | ||
BuildTarget Target { get; set; } | ||
BuildTargetGroup Group { get; set; } | ||
|
||
TypeDB ScriptInfo { get; set; } | ||
|
||
ScriptCompilationOptions ScriptOptions { get; set; } | ||
|
||
string OutputFolder { get; set; } | ||
string TempOutputFolder { get; } | ||
bool UseCache { get; set; } | ||
|
||
string GetTempOrCacheBuildPath(Hash128 hash); | ||
|
||
BuildSettings GetContentBuildSettings(); | ||
|
||
BuildCompression GetCompressionForIdentifier(string identifier); | ||
|
||
ScriptCompilationSettings GetScriptCompilationSettings(); | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
using System.Collections.Generic; | ||
using UnityEditor.Experimental.Build.AssetBundle; | ||
using UnityEditor.Experimental.Build.Player; | ||
|
||
namespace UnityEditor.Build.Interfaces | ||
{ | ||
public interface IBuildResults : IContextObject | ||
{ | ||
ScriptCompilationResult ScriptResults { get; set; } | ||
Dictionary<string, WriteResult> WriteResults { get; } | ||
} | ||
|
||
public interface IBundleBuildResults : IBuildResults | ||
{ | ||
Dictionary<string, BundleDetails> BundleInfos { get; } | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
using System; | ||
|
||
namespace UnityEditor.Build.Interfaces | ||
{ | ||
public interface IBuildTask | ||
{ | ||
int Version { get; } | ||
|
||
Type[] RequiredContextTypes { get; } | ||
|
||
ReturnCodes Run(IBuildContext context); | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
using System.Collections.Generic; | ||
using UnityEditor.Experimental.Build.AssetBundle; | ||
|
||
namespace UnityEditor.Build.Interfaces | ||
{ | ||
public interface IDependencyData : IContextObject | ||
{ | ||
Dictionary<GUID, AssetLoadInfo> AssetInfo { get; } | ||
Dictionary<GUID, BuildUsageTagSet> AssetUsage { get; } | ||
|
||
Dictionary<GUID, SceneDependencyInfo> SceneInfo { get; } | ||
Dictionary<GUID, BuildUsageTagSet> SceneUsage { get; } | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.