Пример #1
0
    // only copy lua && csv
    public static void LittlePublic(bool bSvnUpdate, string sFinishMsg = null)
    {
        bool bOK = false;

        try
        {
            if (bSvnUpdate && !AppPackage.SvnUpdate(true))
            {
                Debug.LogError("SvnUpdate Failed !!!!");
                return;
            }

            string   sSourcePath = GameConfigMgr.ms_sLuaScriptDir + "../../";
            string   sPublicPath = GameConfigMgr.ms_sPublicDir + "Trunk/";
            string[] fileArr     = ms_ArrLittleFiles;
            int      nCount      = fileArr.Length;
            for (int i = 0; i < nCount; i++)
            {
                AppPackage.CopyFiles(sSourcePath + fileArr[i], sPublicPath + fileArr[i], ms_ArrLittleCheck[i], false, true);
            }

            for (int i = 0; i < ms_ArrRemoveFiles.Length; i++)
            {
                string sDelPath = sPublicPath + ms_ArrRemoveFiles[i];
                if (Directory.Exists(sDelPath))
                {
                    Directory.Delete(sDelPath, true);
                }
            }
            bOK = true;
        }
        catch (System.Exception ex)
        {
            bOK = false;
            Debug.LogError(ex.Message + "\n" + ex.StackTrace);
        }
        EditorUtility.ClearProgressBar();
        EditorUtility.DisplayDialog(string.IsNullOrEmpty(sFinishMsg) ? "LittlePublic": sFinishMsg, bOK ? " Success!! ":" Failed!! ", "close");
    }
Пример #2
0
    // buildOptions = BuildOptions.Development | BuildOptions.ConnectWithProfiler | BuildOptions.AllowDebugging;     // debug
    // buildOptions = BuildOptions.None;   // release
    public static bool Build(BuildOptions buildOptions, bool bSvnUpdate, string newVersion, bool bBundleLuaCsv, bool bBundleData, bool bBundleMap, bool bCopyData, bool bBuildApp)
    {
        if (!AppPackage.CheckVersion(newVersion))
        {
            Debug.LogError("Invalid Version!!!!");
            return(false);
        }

        ms_sNewVersion = newVersion;
        bool   IsWinBuild  = ms_target == BuildTarget.StandaloneWindows;
        string sDataOutDir = AppPackage.AddStamp(ms_sDataOutDir);

        if (!IsWinBuild && Directory.Exists(sDataOutDir))
        {
            Debug.LogError("Exists Directory: " + sDataOutDir);
            return(false);
        }

        if (bSvnUpdate && !AppPackage.SvnUpdate())
        {
            Debug.LogError("SvnUpdate Failed !!!!");
            return(false);
        }

        if (bBundleLuaCsv && !AppPackage.BundleLuaCsv())
        {
            return(false);
        }

        if (bBundleData && !AppPackage.BundleData())
        {
            return(false);
        }

        if (bBundleMap && !AppPackage.BundleMap())
        {
            return(false);
        }

        if (!AppPackage.GenVersion(newVersion))
        {
            return(false);
        }

        //真机随包资源处理
        if (bCopyData && !IsWinBuild)
        {
            if (!AppPackage.CopyFiles(sDataOutDir, ms_sResourcesDir, new string[] { "*" + ms_sABType, /*"*.manifest"*/ }, true))
            {
                return(false);
            }
        }

        AssetDatabase.Refresh();
        if (bBuildApp && !AppPackage.BuildAPP(GameConfigMgr.ms_sPublicDir, buildOptions, null, bCopyData))
        {
            return(false);
        }

        //PC资源处理
        if (bCopyData && IsWinBuild)
        {
            string sWinData = GameConfigMgr.ms_sPublicDir + ms_target.ToString() + "/" + GameConfigMgr.ms_sABFolderName + "/";
            if (!AppPackage.CopyFiles(sDataOutDir, sWinData, new string[] { "*" + ms_sABType, /*"*.manifest"*/ }, true, true))
            {
                return(false);
            }
        }

        return(true);
    }