Skip to content

Commit

Permalink
refactor : process build logic
Browse files Browse the repository at this point in the history
  • Loading branch information
gmhevinci committed Aug 3, 2024
1 parent f86ea04 commit b7b3750
Showing 1 changed file with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ public class DefaultBuildinFileSystemBuild : UnityEditor.Build.IPreprocessBuildW
/// </summary>
public void OnPreprocessBuild(UnityEditor.Build.Reporting.BuildReport report)
{
YooLogger.Log("Begin to create catalog file !");

string savePath = $"Assets/Resources/{YooAssetSettingsData.Setting.DefaultYooFolderName}";
DirectoryInfo saveDirectory = new DirectoryInfo(savePath);
if (saveDirectory.Exists)
Expand All @@ -24,8 +26,7 @@ public void OnPreprocessBuild(UnityEditor.Build.Reporting.BuildReport report)
DirectoryInfo rootDirectory = new DirectoryInfo(rootPath);
if (rootDirectory.Exists == false)
{
Debug.LogWarning($"Can not found StreamingAssets root directory : {rootPath}");
return;
throw new System.Exception($"Can not found StreamingAssets root directory : {rootPath}");
}

// 搜索所有Package目录
Expand All @@ -48,8 +49,7 @@ public static void CreateBuildinCatalogFile(string packageName, string pacakgeDi
string versionFilePath = $"{pacakgeDirectory}/{versionFileName}";
if (File.Exists(versionFilePath) == false)
{
Debug.LogWarning($"Can not found package version file : {versionFilePath}");
return;
throw new System.Exception($"Can not found package version file : {versionFilePath}");
}

packageVersion = FileUtility.ReadAllText(versionFilePath);
Expand All @@ -62,8 +62,7 @@ public static void CreateBuildinCatalogFile(string packageName, string pacakgeDi
string manifestFilePath = $"{pacakgeDirectory}/{manifestFileName}";
if (File.Exists(manifestFilePath) == false)
{
Debug.LogWarning($"Can not found package manifest file : {manifestFilePath}");
return;
throw new System.Exception($"Can not found package manifest file : {manifestFilePath}");
}

var binaryData = FileUtility.ReadAllBytes(manifestFilePath);
Expand Down

0 comments on commit b7b3750

Please sign in to comment.