Beispiel #1
0
        private void BuildPlayer()
        {
            try
            {
                var path    = ColaEditHelper.TempCachePath + "/" + CDN_CACHE_PATH;
                var cdnInfo = new CDNInfo();
                cdnInfo.CDNURL      = CDNURL;
                cdnInfo.CDNUserName = CDNUserName;
                cdnInfo.CDNPassword = CDNPassword;
                FileHelper.WriteString(path, JsonMapper.ToJson(cdnInfo));
            }
            catch (Exception ex)
            {
                Debug.LogError("尝试读取CDN配置时报错!" + ex.Message);
            }

            ColaBuildTool.SetEnvironmentVariable(EnvOption.MOTHER_PKG, isMotherPkg.ToString(), false);
            ColaBuildTool.SetEnvironmentVariable(EnvOption.HOT_UPDATE_BUILD, isHotUpdate.ToString(), false);
            ColaBuildTool.SetEnvironmentVariable(EnvOption.CS_DEF_SYMBOL, CSSymbolDefine, false);
            ColaBuildTool.SetEnvironmentVariable(EnvOption.DEVLOPMENT, isDevelopment.ToString(), false);
            ColaBuildTool.SetEnvironmentVariable(EnvOption.IS_MONO, isMono.ToString(), false);

            ColaBuildTool.SetEnvironmentVariable(EnvOption.REMOTE_CDN, isUpLoadRemoteCDN.ToString(), false);
            ColaBuildTool.SetEnvironmentVariable(EnvOption.CDN_URL, CDNURL, false);
            ColaBuildTool.SetEnvironmentVariable(EnvOption.CDN_USERNAME, CDNUserName, false);
            ColaBuildTool.SetEnvironmentVariable(EnvOption.CDN_PASSWORD, CDNPassword, false);

            ColaBuildTool.SetEnvironmentVariable(EnvOption.ANALYZE_BUNDLE, AnalyzeBundle.ToString(), false);

            ColaBuildTool.BuildPlayer(BuildTarget.Android);
        }
 private void Init()
 {
     ColaBuildTool.ClearEnvironmentVariable();
     try
     {
         var path    = ColaEditHelper.TempCachePath + "/" + CDN_CACHE_PATH;
         var content = FileHelper.ReadString(path);
         if (!string.IsNullOrEmpty(content))
         {
             var cdnInfo = JsonMapper.ToObject <CDNInfo>(content);
             if (null != cdnInfo)
             {
                 CDNURL      = cdnInfo.CDNURL;
                 CDNUserName = cdnInfo.CDNUserName;
                 CDNPassword = cdnInfo.CDNPassword;
             }
         }
     }
     catch (Exception ex)
     {
         Debug.LogError("尝试读取CDN配置时报错!" + ex.Message);
     }
 }
        private void BuildPlayer()
        {
            try
            {
                var path    = ColaEditHelper.TempCachePath + "/" + CDN_CACHE_PATH;
                var cdnInfo = new CDNInfo();
                cdnInfo.CDNURL      = CDNURL;
                cdnInfo.CDNUserName = CDNUserName;
                cdnInfo.CDNPassword = CDNPassword;
                FileHelper.WriteString(path, JsonMapper.ToJson(cdnInfo));
            }
            catch (Exception ex)
            {
                Debug.LogError("尝试读取CDN配置时报错!" + ex.Message);
            }

            ColaBuildTool.SetEnvironmentVariable(EnvOption.MOTHER_PKG, isMotherPkg.ToString(), false);
            ColaBuildTool.SetEnvironmentVariable(EnvOption.HOT_UPDATE_BUILD, isHotUpdate.ToString(), false);
            ColaBuildTool.SetEnvironmentVariable(EnvOption.CS_DEF_SYMBOL, CSSymbolDefine, false);
            ColaBuildTool.SetEnvironmentVariable(EnvOption.DEVLOPMENT, isDevelopment.ToString(), false);
            ColaBuildTool.SetEnvironmentVariable(EnvOption.IS_MONO, isMono.ToString(), false);

            ColaBuildTool.SetEnvironmentVariable(EnvOption.REMOTE_CDN, isUpLoadRemoteCDN.ToString(), false);
            ColaBuildTool.SetEnvironmentVariable(EnvOption.CDN_URL, CDNURL, false);
            ColaBuildTool.SetEnvironmentVariable(EnvOption.CDN_USERNAME, CDNUserName, false);
            ColaBuildTool.SetEnvironmentVariable(EnvOption.CDN_PASSWORD, CDNPassword, false);

            ColaBuildTool.SetEnvironmentVariable(EnvOption.ANALYZE_BUNDLE, AnalyzeBundle.ToString(), false);

            ColaBuildTool.SetEnvironmentVariable(EnvOption.APP_NAME, "ColaFramework", false);
            var timeNow    = DateTime.Now;
            var timeNowStr = string.Format("{0:d4}{1:d2}{2:d2}_{3:d2}{4:d2}{5:d2}", timeNow.Year, timeNow.Month, timeNow.Day, timeNow.Hour, timeNow.Minute, timeNow.Second);

            ColaBuildTool.SetEnvironmentVariable(EnvOption.BUILD_PATH, ColaEditHelper.ProjectRoot + "/Build/" + timeNowStr, false);

            ColaBuildTool.BuildPlayer(BuildTarget);
        }
 private void Init()
 {
     ColaBuildTool.ClearEnvironmentVariable();
 }
 private void BuildPlayer()
 {
     ColaBuildTool.SetEnvironmentVariable(EnvOption.MOTHER_PKG, isMotherPkg.ToString(), false);
     ColaBuildTool.SetEnvironmentVariable(EnvOption.HOT_UPDATE_BUILD, isHotUpdate.ToString(), false);
     ColaBuildTool.BuildPlayer(BuildTarget.Android);
 }