private static void Build(string platform) { using (BuildToolKernel builder = new BuildToolKernel(platform)) { builder.BuildAll(); } }
private static void Build() { #if ENABLE_BUILD_LOG Debug.Log("Building..."); #endif EditorPrefs.DeleteKey(DelayedBuildKey); #if !ENABLE_BUILD_LOG NoesisSettings.ClearLog(); #endif BuildToolKernel.BuildBegin(); foreach (string platform in NoesisSettings.ActivePlatforms) { Build(platform); } UpdateNoesisGUIPaths(); #if ENABLE_BUILD_LOG Debug.Log("Building [done]"); #endif }
private static void OnAssetDeleted(string asset) { if (asset.StartsWith("Assets/StreamingAssets")) { return; } #if ENABLE_BUILD_LOG Debug.Log(" - " + asset); #endif BuildToolKernel.RemoveAsset(asset); }
private static int GetNumAssets() { int numAssets = BuildToolKernel.ReadAssets().Count; if (numAssets == 0) { // approximate with number of xamls files numAssets = Directory.GetFiles( UnityEngine.Application.dataPath, "*.xaml", SearchOption.AllDirectories).Length; } return(numAssets); }
private static void OnAssetMoved(string from, string to, ref bool doBuild) { #if ENABLE_BUILD_LOG Debug.Log(from + " -> " + to); #endif string extension = System.IO.Path.GetExtension(from).ToLower(); if (IsFont(extension)) { BuildToolKernel.RenameAsset(from, to); } OnAssetDeleted(from); OnAssetAdded(to, ref doBuild); }
public static void RebuildActivePlatforms(string progressTitle) { try { string[] activePlatforms = ActivePlatforms; string platform = ""; float platformProgress = 0.0f; float platformDelta = 1.0f / (GetNumAssets() * (activePlatforms.Length + 1)); float progress = 0.0f; float deltaProgress = 1.0f / (activePlatforms.Length + 1); EditorUtility.DisplayProgressBar(progressTitle, "Cleaning...", 0.0f); BuildToolKernel.BuildBegin(); BuildToolKernel.Clean(); Action <String> action = s => { EditorUtility.DisplayProgressBar(progressTitle, "[" + platform + "] " + s + "...", progress + platformProgress); platformProgress = Math.Min(platformProgress + platformDelta, deltaProgress); }; BuildToolKernel.BuildEvent += action; foreach (string activePlatform in activePlatforms) { platformProgress = 0.0f; progress += deltaProgress; platform = activePlatform; Build(platform); } BuildToolKernel.BuildEvent -= action; EditorUtility.DisplayProgressBar(progressTitle, "Done.", 1.0f); } finally { EditorUtility.ClearProgressBar(); } }
private static void OnAssetAdded(string asset, ref bool doBuild) { if (asset.StartsWith("Assets/StreamingAssets")) { return; } #if ENABLE_BUILD_LOG Debug.Log(" + " + asset); #endif string extension = System.IO.Path.GetExtension(asset).ToLower(); if (extension == ".xaml") { BuildToolKernel.AddAsset(asset); doBuild = true; } else if (extension == ".cs") { TouchCodeBehind(asset, ref doBuild); } else { // Normally the build process is only fired if any tracked resource is modified. But when there are errors // pending to be fixed, the tracker of resources may be incomplete and we have to build inconditionally if (BuildToolKernel.PendingErrors()) { if (IsFont(extension) || IsImage(extension)) { doBuild = true; } } else if (BuildToolKernel.AssetExists(asset)) { doBuild = true; } } }