BuildScript_ForProject.cs 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. using UnityEditor;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Diagnostics;
  5. using System.Text;
  6. public partial class BuildScript
  7. {
  8. /*--------------------------------------------------------------------------------*/
  9. const string standartDefinedSymbols = "NO_GPGS;CROSS_PLATFORM_INPUT;UNITY;DEBUG_HUD";
  10. const string slackSymbol = "SLACK";
  11. const string realserverSymbol = "REALSERVER";
  12. const string nameProduct = "ANTM";
  13. const string bundleId_Android = "com.Emortal.AntmFullGame";
  14. const string bundleId_iOS_Stable = "com.Emortal.ANTMGAME";
  15. const string bundleId_iOS_Unstable = "com.Emortal.ANTMGAME_Unstable";
  16. //const string DISPLAYED_VERISON_FILE = projectPath + @"\Assets\Resources\versionDisplayed.txt";
  17. //const string GLOBAL_VERISON_FILE = projectPath + @"version.txt";
  18. const string KEY_STORE_PASS = "ANTM123";
  19. static string[] commandLineArgs = null;
  20. static string revisionAsString = "";
  21. static int revisionAsInt;
  22. static string pathProject = "";
  23. static string pathTarget = "";
  24. static string SVN_LOGIN_ARGS = "--username BotUser --password Viewsonica";
  25. /*--------------------------------------------------------------------------------*/
  26. static BuildTarget buildTarget = BuildTarget.NoTarget; // will be changed to Android or iOS
  27. static bool isUnstable;
  28. static bool isRelease;
  29. static readonly BuildOptions RELEASE_MODE = BuildOptions.None;
  30. static readonly BuildOptions DEVELOPMENT_MODE = BuildOptions.Development | BuildOptions.AllowDebugging;
  31. static UnityEngine.StackTraceLogType stackTraceOriginal;
  32. static void SetCommonSettings(BuildTarget _target)
  33. {
  34. stackTraceOriginal = UnityEngine.Application.stackTraceLogType;
  35. UnityEngine.Application.stackTraceLogType = UnityEngine.StackTraceLogType.None; // disable stack trace as it's meaningless and annoying for our build logs
  36. //UnityEngine.Application.logMessageReceivedThreaded += OnLogDuringBuild;
  37. // for ANTM
  38. Facebook.Unity.Settings.FacebookSettings.SelectedAppIndex = _target == BuildTarget.iOS ? 1 : 0;
  39. SetCommonSettings_ForAnyProject(_target);
  40. }
  41. static void OnBuildDone(bool successfulBuild)
  42. {
  43. UnityEngine.Application.stackTraceLogType = stackTraceOriginal; // restore original setting
  44. // this is always true: if(!UnityEngine.Application.isEditor)
  45. {
  46. //EditorApplication.Exit(successfulBuild ? 0 : 1); // this ensures java.exe is killed (which unity spawns for android builds) so that gitlab runner understands the job is done
  47. }
  48. }
  49. }