/*
     * // 补丁包路径
     * private string GenWcpPath()
     * {
     *  string platform = AppPackage.ms_target.ToString();
     *  string dir = "";
     *  string oldName = "";
     *  string newName = "";
     *  if (!string.IsNullOrEmpty(m_sOldABDir))
     *  {
     *      System.IO.DirectoryInfo oDir = new System.IO.DirectoryInfo(m_sOldABDir);
     *      if(!oDir.Name.StartsWith(platform))
     *      {
     *          Debug.LogError("platform: " + platform);
     *          return "";
     *      }
     *      oldName = oDir.Name.Substring(platform.Length + 1);
     *      dir = oDir.Parent.FullName.Replace("\\", "/") + "/";
     *  }
     *  if (!string.IsNullOrEmpty(m_sNewABDir))
     *  {
     *      System.IO.DirectoryInfo oDir = new System.IO.DirectoryInfo(m_sNewABDir);
     *      if (!oDir.Name.StartsWith(platform))
     *      {
     *          Debug.LogError("platform: " + platform);
     *          return "";
     *      }
     *      newName = oDir.Name.Substring(platform.Length + 1);
     *      dir = oDir.Parent.FullName.Replace("\\", "/") + "/";
     *  }
     *
     *          return dir + platform + "_" + oldName + "-" + newName + GameConfigMgr.ms_sWcpType;
     * }
     * //*/

    private void Build()
    {
        System.DateTime lastTime = System.DateTime.Now;
        Debug.Log("Build - " + lastTime);
        bool         bOK          = false;
        BuildOptions buildOptions = BuildOptions.None;

        //BuildOptions buildOptions = BuildOptions.UncompressedAssetBundle;
        if (m_bBuildRelease == false)
        {
            buildOptions = BuildOptions.Development | BuildOptions.AllowDebugging;            //| BuildOptions.ConnectWithProfiler;     // debug
        }
        if (m_bBuildProject && AppPackage.ms_target == BuildTarget.Android)
        {
            buildOptions = buildOptions | BuildOptions.AcceptExternalModificationsToPlayer;
        }
        else if (m_bBuildProject && AppPackage.ms_target == BuildTarget.iOS)
        {
            buildOptions = buildOptions | BuildOptions.AcceptExternalModificationsToPlayer | BuildOptions.Il2CPP;
        }

        bOK = AppPackage.Build(buildOptions, m_bSvnUpdate, m_sNewVersion, m_bBundleLua, m_bBundleData, m_bBundleMap, m_bCopyData, m_bBuildApp);

        System.TimeSpan costTime = System.DateTime.Now - lastTime;
        Debug.Log("-->> Build Cost: " + (costTime.Hours * 3600 + costTime.Minutes * 60 + costTime.Seconds).ToString() + "s");

        if (bOK)
        {
            if (m_bBundleData && m_bBundleMap)
            {
                AppPackage.LittlePublic(false, "Build");
            }
            else
            {
                EditorUtility.ClearProgressBar();
                EditorUtility.DisplayDialog("Build", " Success!! ", "close");
            }
        }
        m_sOldVersion = AppPackage.ms_sNewVersion;
    }