diff --git a/Assets/YooAsset/Editor/AssetBundleBuilder/AssetBundleBuilder.cs b/Assets/YooAsset/Editor/AssetBundleBuilder/AssetBundleBuilder.cs
index 2079263..f97d019 100644
--- a/Assets/YooAsset/Editor/AssetBundleBuilder/AssetBundleBuilder.cs
+++ b/Assets/YooAsset/Editor/AssetBundleBuilder/AssetBundleBuilder.cs
@@ -86,7 +86,6 @@ namespace YooAsset.Editor
var buildResult = BuildRunner.Run(pipeline, _buildContext);
if (buildResult.Success)
{
- buildResult.OutputPackageCRC = buildParametersContext.OutputPackageCRC;
buildResult.OutputPackageDirectory = buildParametersContext.GetPackageOutputDirectory();
Debug.Log($"{buildParameters.BuildMode} pipeline build succeed !");
}
diff --git a/Assets/YooAsset/Editor/AssetBundleBuilder/AssetBundleBuilderHelper.cs b/Assets/YooAsset/Editor/AssetBundleBuilder/AssetBundleBuilderHelper.cs
index 9a271ad..9bc885f 100644
--- a/Assets/YooAsset/Editor/AssetBundleBuilder/AssetBundleBuilderHelper.cs
+++ b/Assets/YooAsset/Editor/AssetBundleBuilder/AssetBundleBuilderHelper.cs
@@ -75,9 +75,9 @@ namespace YooAsset.Editor
///
/// 加载补丁清单文件
///
- internal static PatchManifest LoadPatchManifestFile(string fileDirectory, string packageName, string packageCRC)
+ internal static PatchManifest LoadPatchManifestFile(string fileDirectory, string packageName, string packageVersion)
{
- string filePath = $"{fileDirectory}/{YooAssetSettingsData.GetPatchManifestFileName(packageName, packageCRC)}";
+ string filePath = $"{fileDirectory}/{YooAssetSettingsData.GetPatchManifestFileName(packageName, packageVersion)}";
if (File.Exists(filePath) == false)
{
throw new System.Exception($"Not found patch manifest file : {filePath}");
diff --git a/Assets/YooAsset/Editor/AssetBundleBuilder/AssetBundleBuilderWindow.cs b/Assets/YooAsset/Editor/AssetBundleBuilder/AssetBundleBuilderWindow.cs
index 1882945..55bf293 100644
--- a/Assets/YooAsset/Editor/AssetBundleBuilder/AssetBundleBuilderWindow.cs
+++ b/Assets/YooAsset/Editor/AssetBundleBuilder/AssetBundleBuilderWindow.cs
@@ -255,7 +255,8 @@ namespace YooAsset.Editor
buildParameters.BuildTarget = _buildTarget;
buildParameters.BuildPipeline = AssetBundleBuilderSettingData.Setting.BuildPipeline;
buildParameters.BuildMode = AssetBundleBuilderSettingData.Setting.BuildMode;
- buildParameters.BuildPackage = AssetBundleBuilderSettingData.Setting.BuildPackage;
+ buildParameters.PackageName = AssetBundleBuilderSettingData.Setting.BuildPackage;
+ buildParameters.PackageVersion = GetDefaultPackageVersion();
buildParameters.VerifyBuildingResult = true;
buildParameters.EncryptionServices = CreateEncryptionServicesInstance();
buildParameters.CompressOption = AssetBundleBuilderSettingData.Setting.CompressOption;
@@ -276,6 +277,11 @@ namespace YooAsset.Editor
EditorUtility.RevealInFinder(buildResult.OutputPackageDirectory);
}
}
+ private string GetDefaultPackageVersion()
+ {
+ int totalMinutes = DateTime.Now.Hour * 60 + DateTime.Now.Minute;
+ return DateTime.Now.ToString("yyyy-MM-dd") + "-" + totalMinutes;
+ }
// 构建包裹相关
private int GetDefaultPackageIndex(string packageName)
diff --git a/Assets/YooAsset/Editor/AssetBundleBuilder/AssetBundleSimulateBuilder.cs b/Assets/YooAsset/Editor/AssetBundleBuilder/AssetBundleSimulateBuilder.cs
index 1ffb531..0b93fac 100644
--- a/Assets/YooAsset/Editor/AssetBundleBuilder/AssetBundleSimulateBuilder.cs
+++ b/Assets/YooAsset/Editor/AssetBundleBuilder/AssetBundleSimulateBuilder.cs
@@ -14,14 +14,15 @@ namespace YooAsset.Editor
buildParameters.OutputRoot = defaultOutputRoot;
buildParameters.BuildTarget = EditorUserBuildSettings.activeBuildTarget;
buildParameters.BuildMode = EBuildMode.SimulateBuild;
- buildParameters.BuildPackage = packageName;
+ buildParameters.PackageName = packageName;
+ buildParameters.PackageVersion = "Simulate";
AssetBundleBuilder builder = new AssetBundleBuilder();
var buildResult = builder.Run(buildParameters);
if (buildResult.Success)
{
- string pipelineOutputDirectory = AssetBundleBuilderHelper.MakePipelineOutputDirectory(buildParameters.OutputRoot, buildParameters.BuildPackage, buildParameters.BuildTarget, buildParameters.BuildMode);
- string manifestFileName = YooAssetSettingsData.GetPatchManifestFileName(buildParameters.BuildPackage, buildResult.OutputPackageCRC);
+ string pipelineOutputDirectory = AssetBundleBuilderHelper.MakePipelineOutputDirectory(buildParameters.OutputRoot, buildParameters.PackageName, buildParameters.BuildTarget, buildParameters.BuildMode);
+ string manifestFileName = YooAssetSettingsData.GetPatchManifestFileName(buildParameters.PackageName, buildParameters.PackageVersion);
string manifestFilePath = $"{pipelineOutputDirectory}/{manifestFileName}";
return manifestFilePath;
}
diff --git a/Assets/YooAsset/Editor/AssetBundleBuilder/BuildParameters.cs b/Assets/YooAsset/Editor/AssetBundleBuilder/BuildParameters.cs
index ad79097..d1ab9d6 100644
--- a/Assets/YooAsset/Editor/AssetBundleBuilder/BuildParameters.cs
+++ b/Assets/YooAsset/Editor/AssetBundleBuilder/BuildParameters.cs
@@ -57,14 +57,14 @@ namespace YooAsset.Editor
public EBuildMode BuildMode;
///
- /// 构建的Package名称
+ /// 构建的包裹名称
///
- public string BuildPackage;
+ public string PackageName;
///
- /// 人类可读的版本信息
+ /// 构建的包裹版本
///
- public string HumanReadableVersion;
+ public string PackageVersion;
///
diff --git a/Assets/YooAsset/Editor/AssetBundleBuilder/BuildParametersContext.cs b/Assets/YooAsset/Editor/AssetBundleBuilder/BuildParametersContext.cs
index 96a1ca1..d751f33 100644
--- a/Assets/YooAsset/Editor/AssetBundleBuilder/BuildParametersContext.cs
+++ b/Assets/YooAsset/Editor/AssetBundleBuilder/BuildParametersContext.cs
@@ -11,30 +11,12 @@ namespace YooAsset.Editor
private string _pipelineOutputDirectory = string.Empty;
private string _packageOutputDirectory = string.Empty;
- private string _outputPackageCRC = string.Empty;
///
/// 构建参数
///
public BuildParameters Parameters { private set; get; }
- ///
- /// 构建输出的包裹清单哈希值
- ///
- public string OutputPackageCRC
- {
- get
- {
- if (string.IsNullOrEmpty(_outputPackageCRC))
- throw new Exception("Output package file CRC32 is empty !");
- return _outputPackageCRC;
- }
- set
- {
- _outputPackageCRC = value;
- }
- }
-
public BuildParametersContext(BuildParameters parameters)
{
@@ -49,7 +31,7 @@ namespace YooAsset.Editor
{
if (string.IsNullOrEmpty(_pipelineOutputDirectory))
{
- _pipelineOutputDirectory = AssetBundleBuilderHelper.MakePipelineOutputDirectory(Parameters.OutputRoot, Parameters.BuildPackage, Parameters.BuildTarget, Parameters.BuildMode);
+ _pipelineOutputDirectory = AssetBundleBuilderHelper.MakePipelineOutputDirectory(Parameters.OutputRoot, Parameters.PackageName, Parameters.BuildTarget, Parameters.BuildMode);
}
return _pipelineOutputDirectory;
}
@@ -61,7 +43,7 @@ namespace YooAsset.Editor
{
if (string.IsNullOrEmpty(_packageOutputDirectory))
{
- _packageOutputDirectory = $"{Parameters.OutputRoot}/{Parameters.BuildPackage}/{Parameters.BuildTarget}/{OutputPackageCRC}";
+ _packageOutputDirectory = $"{Parameters.OutputRoot}/{Parameters.PackageName}/{Parameters.BuildTarget}/{Parameters.PackageVersion}";
}
return _packageOutputDirectory;
}
diff --git a/Assets/YooAsset/Editor/AssetBundleBuilder/BuildReport/BuildReport.cs b/Assets/YooAsset/Editor/AssetBundleBuilder/BuildReport/BuildReport.cs
index 1f9feab..556e424 100644
--- a/Assets/YooAsset/Editor/AssetBundleBuilder/BuildReport/BuildReport.cs
+++ b/Assets/YooAsset/Editor/AssetBundleBuilder/BuildReport/BuildReport.cs
@@ -1,6 +1,7 @@
using System;
using System.Collections;
using System.Collections.Generic;
+using System.IO;
using UnityEngine;
namespace YooAsset.Editor
@@ -56,6 +57,9 @@ namespace YooAsset.Editor
public static void Serialize(string savePath, BuildReport buildReport)
{
+ if (File.Exists(savePath))
+ File.Delete(savePath);
+
string json = JsonUtility.ToJson(buildReport, true);
FileUtility.CreateFile(savePath, json);
}
diff --git a/Assets/YooAsset/Editor/AssetBundleBuilder/BuildReport/ReportSummary.cs b/Assets/YooAsset/Editor/AssetBundleBuilder/BuildReport/ReportSummary.cs
index babdfa9..180fe40 100644
--- a/Assets/YooAsset/Editor/AssetBundleBuilder/BuildReport/ReportSummary.cs
+++ b/Assets/YooAsset/Editor/AssetBundleBuilder/BuildReport/ReportSummary.cs
@@ -44,9 +44,14 @@ namespace YooAsset.Editor
public EBuildMode BuildMode;
///
- /// 构建包裹
+ /// 构建包裹名称
///
- public string BuildPackage;
+ public string BuildPackageName;
+
+ ///
+ /// 构建包裹版本
+ ///
+ public string BuildPackageVersion;
///
/// 启用可寻址资源定位
diff --git a/Assets/YooAsset/Editor/AssetBundleBuilder/BuildSystem/BuildResult.cs b/Assets/YooAsset/Editor/AssetBundleBuilder/BuildSystem/BuildResult.cs
index 2f52e51..c47623d 100644
--- a/Assets/YooAsset/Editor/AssetBundleBuilder/BuildSystem/BuildResult.cs
+++ b/Assets/YooAsset/Editor/AssetBundleBuilder/BuildSystem/BuildResult.cs
@@ -25,10 +25,5 @@ namespace YooAsset.Editor
/// 输出的补丁包目录
///
public string OutputPackageDirectory;
-
- ///
- /// 输出的包裹清单哈希值
- ///
- public string OutputPackageCRC;
}
}
\ No newline at end of file
diff --git a/Assets/YooAsset/Editor/AssetBundleBuilder/BuildTasks/TaskCopyBuildinFiles.cs b/Assets/YooAsset/Editor/AssetBundleBuilder/BuildTasks/TaskCopyBuildinFiles.cs
index eaa2c2e..33df614 100644
--- a/Assets/YooAsset/Editor/AssetBundleBuilder/BuildTasks/TaskCopyBuildinFiles.cs
+++ b/Assets/YooAsset/Editor/AssetBundleBuilder/BuildTasks/TaskCopyBuildinFiles.cs
@@ -26,11 +26,11 @@ namespace YooAsset.Editor
ECopyBuildinFileOption option = buildParametersContext.Parameters.CopyBuildinFileOption;
string packageOutputDirectory = buildParametersContext.GetPackageOutputDirectory();
string streamingAssetsDirectory = AssetBundleBuilderHelper.GetStreamingAssetsFolderPath();
- string buildPackageName = buildParametersContext.Parameters.BuildPackage;
- string outputPackageCRC = buildParametersContext.OutputPackageCRC;
+ string buildPackageName = buildParametersContext.Parameters.PackageName;
+ string buildPackageVersion = buildParametersContext.Parameters.PackageVersion;
// 加载补丁清单
- PatchManifest patchManifest = AssetBundleBuilderHelper.LoadPatchManifestFile(packageOutputDirectory, buildPackageName, outputPackageCRC);
+ PatchManifest patchManifest = AssetBundleBuilderHelper.LoadPatchManifestFile(packageOutputDirectory, buildPackageName, buildPackageVersion);
// 清空流目录
if (option == ECopyBuildinFileOption.ClearAndCopyAll || option == ECopyBuildinFileOption.ClearAndCopyByTags)
@@ -40,7 +40,7 @@ namespace YooAsset.Editor
// 拷贝补丁清单文件
{
- string manifestFileName = YooAssetSettingsData.GetPatchManifestFileName(buildPackageName, outputPackageCRC);
+ string manifestFileName = YooAssetSettingsData.GetPatchManifestFileName(buildPackageName, buildPackageVersion);
string sourcePath = $"{packageOutputDirectory}/{manifestFileName}";
string destPath = $"{streamingAssetsDirectory}/{manifestFileName}";
EditorTools.CopyFile(sourcePath, destPath, true);
diff --git a/Assets/YooAsset/Editor/AssetBundleBuilder/BuildTasks/TaskCreatePatchManifest.cs b/Assets/YooAsset/Editor/AssetBundleBuilder/BuildTasks/TaskCreatePatchManifest.cs
index 6866388..618f0c5 100644
--- a/Assets/YooAsset/Editor/AssetBundleBuilder/BuildTasks/TaskCreatePatchManifest.cs
+++ b/Assets/YooAsset/Editor/AssetBundleBuilder/BuildTasks/TaskCreatePatchManifest.cs
@@ -31,15 +31,15 @@ namespace YooAsset.Editor
patchManifest.FileVersion = YooAssetSettings.PatchManifestFileVersion;
patchManifest.EnableAddressable = buildMapContext.EnableAddressable;
patchManifest.OutputNameStyle = (int)buildParameters.OutputNameStyle;
- patchManifest.PackageName = buildParameters.BuildPackage;
- patchManifest.HumanReadableVersion = buildParameters.HumanReadableVersion;
+ patchManifest.PackageName = buildParameters.PackageName;
+ patchManifest.PackageVersion = buildParameters.PackageVersion;
patchManifest.BundleList = GetAllPatchBundle(context);
patchManifest.AssetList = GetAllPatchAsset(context, patchManifest);
// 更新Unity内置资源包的引用关系
if (buildParameters.BuildPipeline == EBuildPipeline.ScriptableBuildPipeline)
{
- if(buildParameters.BuildMode == EBuildMode.IncrementalBuild)
+ if (buildParameters.BuildMode == EBuildMode.IncrementalBuild)
{
var buildResultContext = context.GetContextObject();
UpdateBuiltInBundleReference(patchManifest, buildResultContext.Results);
@@ -47,24 +47,19 @@ namespace YooAsset.Editor
}
// 创建补丁清单文件
- string manifestFileTempName = YooAssetSettingsData.GetPatchManifestTempFileName(buildParameters.BuildPackage);
- string manifestFileTempPath = $"{pipelineOutputDirectory}/{manifestFileTempName}";
- BuildRunner.Log($"创建补丁清单文件:{manifestFileTempPath}");
- PatchManifest.Serialize(manifestFileTempPath, patchManifest);
-
- // 计算补丁清单文件的CRC32
- buildParametersContext.OutputPackageCRC = HashUtility.FileCRC32(manifestFileTempPath);
-
- // 补丁清单文件重命名
- string manifestFileName = YooAssetSettingsData.GetPatchManifestFileName(buildParameters.BuildPackage, buildParametersContext.OutputPackageCRC);
+ string manifestFileName = YooAssetSettingsData.GetPatchManifestFileName(buildParameters.PackageName, buildParameters.PackageVersion);
string manifestFilePath = $"{pipelineOutputDirectory}/{manifestFileName}";
- EditorTools.FileMoveTo(manifestFileTempPath, manifestFilePath);
+ PatchManifest.Serialize(manifestFilePath, patchManifest);
+ BuildRunner.Log($"创建补丁清单文件:{manifestFilePath}");
// 创建静态版本文件
- string staticVersionFileName = YooAssetSettingsData.GetStaticVersionFileName(buildParameters.BuildPackage);
- string staticVersionFilePath = $"{pipelineOutputDirectory}/{staticVersionFileName}";
+ string staticVersionFileName = YooAssetSettingsData.GetStaticVersionFileName(buildParameters.PackageName);
+ string staticVersionFilePath = $"{pipelineOutputDirectory}/{staticVersionFileName}";
+ StaticVersion staticVersion = new StaticVersion();
+ staticVersion.PackageVersion = buildParameters.PackageVersion;
+ staticVersion.ManifestCRC = HashUtility.FileCRC32(manifestFilePath);
+ StaticVersion.Serialize(staticVersionFilePath, staticVersion);
BuildRunner.Log($"创建静态版本文件:{staticVersionFilePath}");
- FileUtility.CreateFile(staticVersionFilePath, buildParametersContext.OutputPackageCRC);
}
///
@@ -81,7 +76,7 @@ namespace YooAsset.Editor
{
// NOTE:检测路径长度不要超过260字符。
string filePath = $"{buildParametersContext.GetPipelineOutputDirectory()}/{bundleInfo.BundleName}";
- if(filePath.Length >= 260)
+ if (filePath.Length >= 260)
throw new Exception($"The output bundle name is too long {filePath.Length} chars : {filePath}");
var bundleName = bundleInfo.BundleName;
diff --git a/Assets/YooAsset/Editor/AssetBundleBuilder/BuildTasks/TaskCreatePatchPackage.cs b/Assets/YooAsset/Editor/AssetBundleBuilder/BuildTasks/TaskCreatePatchPackage.cs
index 6d13fea..6c12520 100644
--- a/Assets/YooAsset/Editor/AssetBundleBuilder/BuildTasks/TaskCreatePatchPackage.cs
+++ b/Assets/YooAsset/Editor/AssetBundleBuilder/BuildTasks/TaskCreatePatchPackage.cs
@@ -28,7 +28,7 @@ namespace YooAsset.Editor
// 拷贝Report文件
{
- string reportFileName = YooAssetSettingsData.GetReportFileName(buildParameters.BuildPackage, buildParametersContext.OutputPackageCRC);
+ string reportFileName = YooAssetSettingsData.GetReportFileName(buildParameters.PackageName, buildParameters.PackageVersion);
string sourcePath = $"{pipelineOutputDirectory}/{reportFileName}";
string destPath = $"{packageOutputDirectory}/{reportFileName}";
EditorTools.CopyFile(sourcePath, destPath, true);
@@ -36,7 +36,7 @@ namespace YooAsset.Editor
// 拷贝补丁清单文件
{
- string manifestFileName = YooAssetSettingsData.GetPatchManifestFileName(buildParameters.BuildPackage, buildParametersContext.OutputPackageCRC);
+ string manifestFileName = YooAssetSettingsData.GetPatchManifestFileName(buildParameters.PackageName, buildParameters.PackageVersion);
string sourcePath = $"{pipelineOutputDirectory}/{manifestFileName}";
string destPath = $"{packageOutputDirectory}/{manifestFileName}";
EditorTools.CopyFile(sourcePath, destPath, true);
@@ -44,7 +44,7 @@ namespace YooAsset.Editor
// 拷贝静态版本文件
{
- string versionFileName = YooAssetSettingsData.GetStaticVersionFileName(buildParameters.BuildPackage);
+ string versionFileName = YooAssetSettingsData.GetStaticVersionFileName(buildParameters.PackageName);
string sourcePath = $"{pipelineOutputDirectory}/{versionFileName}";
string destPath = $"{packageOutputDirectory}/{versionFileName}";
EditorTools.CopyFile(sourcePath, destPath, true);
@@ -86,7 +86,7 @@ namespace YooAsset.Editor
// 拷贝所有补丁文件
int progressValue = 0;
- PatchManifest patchManifest = AssetBundleBuilderHelper.LoadPatchManifestFile(pipelineOutputDirectory, buildParameters.BuildPackage, buildParametersContext.OutputPackageCRC);
+ PatchManifest patchManifest = AssetBundleBuilderHelper.LoadPatchManifestFile(pipelineOutputDirectory, buildParameters.PackageName, buildParameters.PackageVersion);
int patchFileTotalCount = patchManifest.BundleList.Count;
foreach (var patchBundle in patchManifest.BundleList)
{
diff --git a/Assets/YooAsset/Editor/AssetBundleBuilder/BuildTasks/TaskCreateReport.cs b/Assets/YooAsset/Editor/AssetBundleBuilder/BuildTasks/TaskCreateReport.cs
index 4a1eb3e..d4380a5 100644
--- a/Assets/YooAsset/Editor/AssetBundleBuilder/BuildTasks/TaskCreateReport.cs
+++ b/Assets/YooAsset/Editor/AssetBundleBuilder/BuildTasks/TaskCreateReport.cs
@@ -29,7 +29,7 @@ namespace YooAsset.Editor
var buildParameters = buildParametersContext.Parameters;
string pipelineOutputDirectory = buildParametersContext.GetPipelineOutputDirectory();
- PatchManifest patchManifest = AssetBundleBuilderHelper.LoadPatchManifestFile(pipelineOutputDirectory, buildParameters.BuildPackage, buildParametersContext.OutputPackageCRC);
+ PatchManifest patchManifest = AssetBundleBuilderHelper.LoadPatchManifestFile(pipelineOutputDirectory, buildParameters.PackageName, buildParameters.PackageVersion);
BuildReport buildReport = new BuildReport();
// 概述信息
@@ -45,7 +45,8 @@ namespace YooAsset.Editor
buildReport.Summary.BuildTarget = buildParameters.BuildTarget;
buildReport.Summary.BuildPipeline = buildParameters.BuildPipeline;
buildReport.Summary.BuildMode = buildParameters.BuildMode;
- buildReport.Summary.BuildPackage = buildParameters.BuildPackage;
+ buildReport.Summary.BuildPackageName = buildParameters.PackageName;
+ buildReport.Summary.BuildPackageVersion = buildParameters.PackageVersion;
buildReport.Summary.EnableAddressable = buildMapContext.EnableAddressable;
buildReport.Summary.UniqueBundleName = buildMapContext.UniqueBundleName;
@@ -101,13 +102,9 @@ namespace YooAsset.Editor
buildReport.BundleInfos.Add(reportBundleInfo);
}
- // 删除旧文件
- string fileName = YooAssetSettingsData.GetReportFileName(buildParameters.BuildPackage, buildParametersContext.OutputPackageCRC);
- string filePath = $"{pipelineOutputDirectory}/{fileName}";
- if (File.Exists(filePath))
- File.Delete(filePath);
-
// 序列化文件
+ string fileName = YooAssetSettingsData.GetReportFileName(buildParameters.PackageName, buildParameters.PackageVersion);
+ string filePath = $"{pipelineOutputDirectory}/{fileName}";
BuildReport.Serialize(filePath, buildReport);
BuildRunner.Log($"资源构建报告文件创建完成:{filePath}");
}
diff --git a/Assets/YooAsset/Editor/AssetBundleBuilder/BuildTasks/TaskGetBuildMap.cs b/Assets/YooAsset/Editor/AssetBundleBuilder/BuildTasks/TaskGetBuildMap.cs
index da19d6a..2cc5396 100644
--- a/Assets/YooAsset/Editor/AssetBundleBuilder/BuildTasks/TaskGetBuildMap.cs
+++ b/Assets/YooAsset/Editor/AssetBundleBuilder/BuildTasks/TaskGetBuildMap.cs
@@ -13,7 +13,7 @@ namespace YooAsset.Editor
void IBuildTask.Run(BuildContext context)
{
var buildParametersContext = context.GetContextObject();
- var buildMapContext = BuildMapCreater.CreateBuildMap(buildParametersContext.Parameters.BuildMode, buildParametersContext.Parameters.BuildPackage);
+ var buildMapContext = BuildMapCreater.CreateBuildMap(buildParametersContext.Parameters.BuildMode, buildParametersContext.Parameters.PackageName);
context.SetContextObject(buildMapContext);
BuildRunner.Log("构建内容准备完毕!");
diff --git a/Assets/YooAsset/Editor/AssetBundleBuilder/BuildTasks/TaskPrepare.cs b/Assets/YooAsset/Editor/AssetBundleBuilder/BuildTasks/TaskPrepare.cs
index b09bf5a..718cfbb 100644
--- a/Assets/YooAsset/Editor/AssetBundleBuilder/BuildTasks/TaskPrepare.cs
+++ b/Assets/YooAsset/Editor/AssetBundleBuilder/BuildTasks/TaskPrepare.cs
@@ -19,8 +19,10 @@ namespace YooAsset.Editor
// 检测构建参数合法性
if (buildParameters.BuildTarget == BuildTarget.NoTarget)
throw new Exception("请选择目标平台");
- if (string.IsNullOrEmpty(buildParameters.BuildPackage))
+ if (string.IsNullOrEmpty(buildParameters.PackageName))
throw new Exception("包裹名称不能为空");
+ if(string.IsNullOrEmpty(buildParameters.PackageVersion))
+ throw new Exception("包裹版本不能为空");
if (buildParameters.BuildMode != EBuildMode.SimulateBuild)
{
@@ -40,6 +42,11 @@ namespace YooAsset.Editor
throw new Exception("首包资源标签不能为空!");
}
+ // 检测包裹输出目录是否存在
+ string packageOutputDirectory = buildParametersContext.GetPackageOutputDirectory();
+ if (Directory.Exists(packageOutputDirectory))
+ throw new Exception($"本次构建的补丁目录已经存在:{packageOutputDirectory}");
+
// 保存改动的资源
AssetDatabase.SaveAssets();
}
@@ -47,7 +54,7 @@ namespace YooAsset.Editor
if (buildParameters.BuildMode == EBuildMode.ForceRebuild)
{
// 删除平台总目录
- string platformDirectory = $"{buildParameters.OutputRoot}/{buildParameters.BuildPackage}/{buildParameters.BuildTarget}";
+ string platformDirectory = $"{buildParameters.OutputRoot}/{buildParameters.PackageName}/{buildParameters.BuildTarget}";
if (EditorTools.DeleteDirectory(platformDirectory))
{
BuildRunner.Log($"删除平台总目录:{platformDirectory}");
diff --git a/Assets/YooAsset/Editor/AssetBundleReporter/VisualViewers/ReporterSummaryViewer.cs b/Assets/YooAsset/Editor/AssetBundleReporter/VisualViewers/ReporterSummaryViewer.cs
index 443f16e..c78b4c4 100644
--- a/Assets/YooAsset/Editor/AssetBundleReporter/VisualViewers/ReporterSummaryViewer.cs
+++ b/Assets/YooAsset/Editor/AssetBundleReporter/VisualViewers/ReporterSummaryViewer.cs
@@ -66,7 +66,8 @@ namespace YooAsset.Editor
_items.Add(new ItemWrapper("构建平台", $"{buildReport.Summary.BuildTarget}"));
_items.Add(new ItemWrapper("构建管线", $"{buildReport.Summary.BuildPipeline}"));
_items.Add(new ItemWrapper("构建模式", $"{buildReport.Summary.BuildMode}"));
- _items.Add(new ItemWrapper("构建包裹", $"{buildReport.Summary.BuildPackage}"));
+ _items.Add(new ItemWrapper("包裹名称", buildReport.Summary.BuildPackageName));
+ _items.Add(new ItemWrapper("包裹版本", buildReport.Summary.BuildPackageVersion));
_items.Add(new ItemWrapper("启用可寻址资源定位", $"{buildReport.Summary.EnableAddressable}"));
_items.Add(new ItemWrapper("资源包名唯一化", $"{buildReport.Summary.UniqueBundleName}"));