public static void OnPostProcessBuild(BuildTarget target, string path) { Debug.Log("PostProcessing Build.."); string buildNum = ShowBuild.GetBuildNumber(); var buildname = Path.GetFileNameWithoutExtension(path); var targetdir = Directory.GetParent(path); var dataDir = targetdir.FullName + Path.DirectorySeparatorChar + buildname + "_Data" + Path.DirectorySeparatorChar; File.WriteAllText(dataDir + "build", buildNum.ToString()); Debug.Log("Build number set: " + buildNum); }
private static void Build(BuildName type, EditorBuildSettingsScene[] scenes = null, string windowBuildName = null) { string fileName = "JLR_" + type.ToString() + "_" + ShowBuild.GetBuildNumber(); if (windowBuildName != null) { fileName += "_" + windowBuildName; } string savePath = EditorUtility.SaveFilePanel("Save Build", Application.dataPath, fileName, "exe"); Build(type, savePath, scenes, windowBuildName); }
void Start() { buildString = buildString + ShowBuild.GetBuildNumber() + " " + ShowBuild.GetBuildType(); }
private static void BuildConsole() { string savePath = EditorUtility.SaveFilePanel("Save Build", Application.dataPath, "JLR_CONSOLE_" + ShowBuild.GetBuildNumber(), "exe"); BuildConsole(savePath); }
private void BuildAndDropBox() { EditorBuildSettingsScene[] scenes = new EditorBuildSettingsScene[] { new EditorBuildSettingsScene("Assets/Scenes/Loader.unity", true), new EditorBuildSettingsScene("Assets/Scenes/NewCarSelect_2.unity", true), new EditorBuildSettingsScene("Assets/Scenes/Environment_Yosemite.unity", true), new EditorBuildSettingsScene("Assets/Scenes/Environment_PCH.unity", true), new EditorBuildSettingsScene("Assets/Scenes/Environment_SanFrancisco02.unity", true) }; //clear spot for it var path = "Temp/deploy/"; string deployId = "JLR_" + ShowBuild.GetBuildNumber(); FileUtil.DeleteFileOrDirectory(path); Directory.CreateDirectory(path + deployId + "/"); path = path + deployId + "/"; //Debug.Log(path + "JLR_MAIN.exe"); //Debug.Log(path + "JLR_CONSOLE.exe"); BuildConsole(path + "JLR_CONSOLE.exe"); while (!File.Exists(path + "JLR_CONSOLE_Data/BUILD_COMPLETE")) { //waiting } Debug.Log("Start build player"); SetCustomSettings(); Build(BuildName.CUSTOM, path + "JLR_MAIN.exe", scenes, curWindowMode == BuildWindowMode.DEFAULT ? null : curWindowMode.ToString()); while (!File.Exists(path + "JLR_MAIN_Data/BUILD_COMPLETE")) { //waiting } var dbFile = Path.Combine(System.Environment.GetFolderPath(System.Environment.SpecialFolder.LocalApplicationData), "Dropbox\\info.json"); var dbInfop = JsonUtility.FromJson <DropBoxInfoParent>(File.ReadAllText(dbFile)); Debug.Log("dbpath: " + File.ReadAllText(dbFile)); Debug.Log("DROPBOX: " + dbInfop.personal.path); var proc1 = new System.Diagnostics.ProcessStartInfo(); proc1.UseShellExecute = true; proc1.WorkingDirectory = Directory.GetParent(path).ToString(); var root = Directory.GetParent(Application.dataPath); string dbPath = ""; if (dbInfop.business == null || string.IsNullOrEmpty(dbInfop.business.path)) { dbPath = dbInfop.personal.path; } else { dbPath = dbInfop.business.path; } dbPath = Path.Combine(dbPath, "14015_JLR"); Debug.Log("root:" + root); proc1.FileName = @"cmd.exe"; proc1.Arguments = "/C powershell -File " + root + "/Deploy.ps1 " + dbPath + "/" + deployId + ".zip " + "../" + deployId + "/"; Debug.Log(proc1.Arguments); proc1.WindowStyle = System.Diagnostics.ProcessWindowStyle.Normal; System.Diagnostics.Process.Start(proc1); }