| 
									
										
										
										
											2024-01-06 05:46:25 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | namespace Guru.Editor | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  |     using UnityEngine; | 
					
						
							|  |  |  |     public enum AppBuilderType | 
					
						
							|  |  |  |     { | 
					
						
							|  |  |  |         Editor = 0, | 
					
						
							|  |  |  |         Jenkins, | 
					
						
							| 
									
										
										
										
											2024-01-08 02:50:02 +00:00
										 |  |  |         Others, | 
					
						
							| 
									
										
										
										
											2024-01-06 05:46:25 +00:00
										 |  |  |     } | 
					
						
							|  |  |  |      | 
					
						
							|  |  |  |     public class AppBuildParam | 
					
						
							|  |  |  |     { | 
					
						
							| 
									
										
										
										
											2024-03-06 09:43:55 +00:00
										 |  |  |         public const string TargetNameAndroid = "Android"; | 
					
						
							|  |  |  |         public const string TargetNameIOS = "iOS"; | 
					
						
							|  |  |  |          | 
					
						
							| 
									
										
										
										
											2024-01-08 02:50:02 +00:00
										 |  |  |         //------------ Basic ---------------- | 
					
						
							| 
									
										
										
										
											2024-03-31 14:08:39 +00:00
										 |  |  |         public bool IsBuildRelease = false; // 是否构建发布包体 | 
					
						
							|  |  |  |         public bool IsBuildShowLog = false; // 是否显示日志 | 
					
						
							| 
									
										
										
										
											2024-01-08 02:50:02 +00:00
										 |  |  |         public AppBuilderType BuilderType; // 构建类型 | 
					
						
							|  |  |  |         public string BuildVersion = ""; // 构建版本号, 填写后会依据此版本设置应用的 Version | 
					
						
							|  |  |  |         public bool AutoSetBuildNumber = true; // 自动设置构建号, 可参考 Guru的SDK 接入说明文档 | 
					
						
							|  |  |  |         public bool UseGuruCerts = true; // 是否使用 Guru 的证书打包 | 
					
						
							| 
									
										
										
										
											2024-03-06 09:43:55 +00:00
										 |  |  |         public string TargetName = ""; | 
					
						
							| 
									
										
										
										
											2024-01-08 02:50:02 +00:00
										 |  |  |         //------------ Android ---------------- | 
					
						
							|  |  |  |         public bool IsBuildAAB; // 是否构建 AAB 包体 ( GooglePlay 发布专用 ) | 
					
						
							|  |  |  |         public bool IsBuildSymbols = false; // 是否需要构建 Symbols.zip 文件 ( GooglePlay 发布专用 ) | 
					
						
							|  |  |  |         public int AndroidTargetVersion = 0; // Android SDK 版本设置 ( GooglePlay 发布专用 ) | 
					
						
							|  |  |  |         public bool AndroidUseMinify = false; // 是否开启 Android 的代码混淆和保护文件 | 
					
						
							|  |  |  |         public bool DebugWithMono = true; // 是否使用 Mono 编译项目 ( Android Debug包专用 ) | 
					
						
							| 
									
										
										
										
											2024-03-31 07:50:50 +00:00
										 |  |  |         public string AndroidKeystorePath = ""; // Android KeyStore 文件名 | 
					
						
							|  |  |  |         public string AndroidKeystorePass = ""; // Android KeyStore 文件名 | 
					
						
							|  |  |  |         public string AndroidAlias = ""; // Android KeyStore 文件名 | 
					
						
							|  |  |  |         public string AndroidAliasPass = ""; // Android KeyStore 文件名 | 
					
						
							| 
									
										
										
										
											2024-01-08 02:50:02 +00:00
										 |  |  |         //------------ iOS ---------------- | 
					
						
							|  |  |  |         public string IOSTargetVersion = ""; // IOS SDK 版本设置 ( iOS 发布专用 ) | 
					
						
							|  |  |  |         public string IOSTeamId = ""; // IOS 打包 TeamId ( iOS 使用专用的开发证书后开启 ) | 
					
						
							|  |  |  |         public string CompanyName = ""; // 发布厂商的名称 | 
					
						
							| 
									
										
										
										
											2024-03-06 10:56:29 +00:00
										 |  |  |         //------------ Publish ------------- | 
					
						
							|  |  |  |         public bool AutoPublish = false; | 
					
						
							|  |  |  |         public string PgyerAPIKey = ""; | 
					
						
							| 
									
										
										
										
											2024-01-08 02:50:02 +00:00
										 |  |  |          | 
					
						
							|  |  |  |          | 
					
						
							| 
									
										
										
										
											2024-01-06 05:46:25 +00:00
										 |  |  | 		     | 
					
						
							|  |  |  |         public override string ToString() | 
					
						
							|  |  |  |         { | 
					
						
							|  |  |  |             return $"build params: \n{JsonUtility.ToJson(this, true)}"; | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2024-03-06 09:43:55 +00:00
										 |  |  |         public static AppBuildParam Build(bool isRelease, AppBuilderType builderType = AppBuilderType.Editor, string version = "", bool autoBuildNumber = true, string companyName = "",   | 
					
						
							|  |  |  |             string targetName = "", bool buildShowLog = false, bool useGuruCerts = true,  | 
					
						
							| 
									
										
										
										
											2024-01-06 05:46:25 +00:00
										 |  |  |             bool buildSymbols = false,  bool buildAAB = false, bool useMinify = false,  int androidTargetVersion = 0, bool debugWithMono = true, | 
					
						
							|  |  |  |             string iOSTargetVersion = "", string iOSTeamId = "") | 
					
						
							|  |  |  |         { | 
					
						
							|  |  |  |             return new AppBuildParam() | 
					
						
							|  |  |  |             { | 
					
						
							| 
									
										
										
										
											2024-03-06 09:43:55 +00:00
										 |  |  |                 TargetName = targetName, | 
					
						
							| 
									
										
										
										
											2024-01-06 05:46:25 +00:00
										 |  |  |                 IsBuildRelease = isRelease, | 
					
						
							|  |  |  |                 IsBuildShowLog = buildShowLog, | 
					
						
							|  |  |  |                 BuilderType = builderType, | 
					
						
							|  |  |  |                 BuildVersion = version, | 
					
						
							|  |  |  |                 AutoSetBuildNumber = autoBuildNumber, | 
					
						
							|  |  |  |                 IsBuildAAB = buildAAB, | 
					
						
							|  |  |  |                 IsBuildSymbols = buildSymbols, | 
					
						
							|  |  |  |                 AndroidTargetVersion = androidTargetVersion, | 
					
						
							|  |  |  |                 AndroidUseMinify = useMinify, | 
					
						
							|  |  |  |                 DebugWithMono = debugWithMono, | 
					
						
							|  |  |  |                 IOSTargetVersion = iOSTargetVersion, | 
					
						
							|  |  |  |                 IOSTeamId = iOSTeamId, | 
					
						
							|  |  |  |                 CompanyName = companyName, | 
					
						
							|  |  |  |                 UseGuruCerts = useGuruCerts, | 
					
						
							|  |  |  |             }; | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         /// <summary> | 
					
						
							|  |  |  |         /// 构建Android参数 | 
					
						
							|  |  |  |         /// </summary> | 
					
						
							|  |  |  |         /// <param name="isRelease"></param> | 
					
						
							|  |  |  |         /// <param name="version"></param> | 
					
						
							|  |  |  |         /// <param name="autoBuildNumber"></param> | 
					
						
							|  |  |  |         /// <param name="builderType"></param> | 
					
						
							|  |  |  |         /// <param name="companyName"></param> | 
					
						
							|  |  |  |         /// <param name="useGuruCerts"></param> | 
					
						
							|  |  |  |         /// <param name="useMinify"></param> | 
					
						
							|  |  |  |         /// <param name="androidTargetVersion"></param> | 
					
						
							|  |  |  |         /// <param name="debugWithMono"></param> | 
					
						
							| 
									
										
										
										
											2024-04-09 10:18:10 +00:00
										 |  |  |         /// <param name="isBuildAAB"></param> | 
					
						
							| 
									
										
										
										
											2024-01-06 05:46:25 +00:00
										 |  |  |         /// <returns></returns> | 
					
						
							| 
									
										
										
										
											2024-03-06 09:43:55 +00:00
										 |  |  |         public static AppBuildParam AndroidParam(bool isRelease, string version = "", bool autoBuildNumber = true, | 
					
						
							|  |  |  |             AppBuilderType builderType = AppBuilderType.Editor, | 
					
						
							| 
									
										
										
										
											2024-04-09 10:18:10 +00:00
										 |  |  |             string companyName = "", bool useGuruCerts = true, bool useMinify = false, int androidTargetVersion = 0,  | 
					
						
							|  |  |  |             bool debugWithMono = true, bool isBuildAAB = false) | 
					
						
							| 
									
										
										
										
											2024-01-06 05:46:25 +00:00
										 |  |  |         { | 
					
						
							| 
									
										
										
										
											2024-04-09 10:18:10 +00:00
										 |  |  |             bool buildAAB = isBuildAAB; | 
					
						
							| 
									
										
										
										
											2024-01-06 05:46:25 +00:00
										 |  |  |             bool buildShowLog = isRelease; | 
					
						
							|  |  |  |             bool buildSymbols = isRelease; | 
					
						
							| 
									
										
										
										
											2024-03-06 09:43:55 +00:00
										 |  |  |             string targetName = TargetNameAndroid;  | 
					
						
							|  |  |  |             return Build(isRelease, builderType, version, autoBuildNumber,companyName, targetName, buildShowLog, useGuruCerts, buildSymbols,  buildAAB, useMinify, androidTargetVersion, debugWithMono); | 
					
						
							| 
									
										
										
										
											2024-01-06 05:46:25 +00:00
										 |  |  |         } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         /// <summary> | 
					
						
							|  |  |  |         /// 构建iOS参数 | 
					
						
							|  |  |  |         /// </summary> | 
					
						
							|  |  |  |         /// <param name="isRelease"></param> | 
					
						
							|  |  |  |         /// <param name="version"></param> | 
					
						
							|  |  |  |         /// <param name="autoBuildNumber"></param> | 
					
						
							|  |  |  |         /// <param name="builderType"></param> | 
					
						
							|  |  |  |         /// <param name="companyName"></param> | 
					
						
							|  |  |  |         /// <param name="useGuruCerts"></param> | 
					
						
							|  |  |  |         /// <param name="iOSTargetVersion"></param> | 
					
						
							|  |  |  |         /// <param name="iOSTeamId"></param> | 
					
						
							|  |  |  |         /// <returns></returns> | 
					
						
							|  |  |  |         public static AppBuildParam IOSParam(bool isRelease, string version = "", bool autoBuildNumber = true, AppBuilderType builderType = AppBuilderType.Editor, | 
					
						
							|  |  |  |             string companyName = "", bool useGuruCerts = true, string iOSTargetVersion = "", string iOSTeamId = "" ) | 
					
						
							|  |  |  |         { | 
					
						
							|  |  |  |             bool buildShowLog = isRelease; | 
					
						
							| 
									
										
										
										
											2024-03-06 09:43:55 +00:00
										 |  |  |             string targetName = TargetNameIOS;  | 
					
						
							|  |  |  |             return Build(isRelease, builderType, version, autoBuildNumber, companyName, targetName, buildShowLog, useGuruCerts, iOSTargetVersion:iOSTargetVersion, iOSTeamId:iOSTeamId); | 
					
						
							| 
									
										
										
										
											2024-01-06 05:46:25 +00:00
										 |  |  |         } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | } |