Update AssetBundleBuilder

移除对增量更新初次无法构建的限制
pull/28/head
hevinci 2022-07-22 12:55:20 +08:00
parent 1370ffb3bb
commit 2d5854ed58
1 changed files with 15 additions and 15 deletions

View File

@ -42,23 +42,23 @@ namespace YooAsset.Editor
if (buildMode == EBuildMode.IncrementalBuild) if (buildMode == EBuildMode.IncrementalBuild)
{ {
// 检测历史版本是否存在 // 检测历史版本是否存在
if (AssetBundleBuilderHelper.HasAnyPackageVersion(buildParameters.Parameters.BuildTarget, buildParameters.Parameters.OutputRoot) == false) if (AssetBundleBuilderHelper.HasAnyPackageVersion(buildParameters.Parameters.BuildTarget, buildParameters.Parameters.OutputRoot))
throw new Exception("没有发现任何历史版本,请尝试强制重建"); {
// 检测构建版本是否合法
int maxPackageVersion = AssetBundleBuilderHelper.GetMaxPackageVersion(buildParameters.Parameters.BuildTarget, buildParameters.Parameters.OutputRoot);
if (buildParameters.Parameters.BuildVersion <= maxPackageVersion)
throw new Exception("构建版本不能小于历史版本");
// 检测构建版本是否合法 // 检测补丁包是否已经存在
int maxPackageVersion = AssetBundleBuilderHelper.GetMaxPackageVersion(buildParameters.Parameters.BuildTarget, buildParameters.Parameters.OutputRoot); string packageDirectory = buildParameters.GetPackageDirectory();
if (buildParameters.Parameters.BuildVersion <= maxPackageVersion) if (Directory.Exists(packageDirectory))
throw new Exception("构建版本不能小于历史版本"); throw new Exception($"补丁包已经存在:{packageDirectory}");
// 检测补丁包是否已经存在 // 检测内置资源分类标签是否一致
string packageDirectory = buildParameters.GetPackageDirectory(); var oldPatchManifest = AssetBundleBuilderHelper.GetOldPatchManifest(buildParameters.PipelineOutputDirectory);
if (Directory.Exists(packageDirectory)) if (buildParameters.Parameters.BuildinTags != oldPatchManifest.BuildinTags)
throw new Exception($"补丁包已经存在:{packageDirectory}"); throw new Exception($"增量更新时内置资源标签必须一致:{buildParameters.Parameters.BuildinTags} != {oldPatchManifest.BuildinTags}");
}
// 检测内置资源分类标签是否一致
var oldPatchManifest = AssetBundleBuilderHelper.GetOldPatchManifest(buildParameters.PipelineOutputDirectory);
if (buildParameters.Parameters.BuildinTags != oldPatchManifest.BuildinTags)
throw new Exception($"增量更新时内置资源标签必须一致:{buildParameters.Parameters.BuildinTags} != {oldPatchManifest.BuildinTags}");
} }
// 如果是强制重建 // 如果是强制重建