Ejemplo n.º 1
0
        private static void ParseTheVersion()
        {
            Dictionary <string, string> versionInfo = ABHelper.ReadVersionIdFile();

            TheVersionNum     = ABHelper.VersionNumSplit(versionInfo["ResVersion"]);
            TheRootFolderName = versionInfo["ABFolderRoot"];
        }
Ejemplo n.º 2
0
        // 初始化AB
        public static void InitABVersion()
        {
            Debug.Log(ABHelper.AppVersionPath);
            Debug.Log(ABHelper.AppNativeVersionPath);

            // 实例化
            LocalVersionList = new Dictionary <int, VersionInfo>();
            // 需要的文件夹
            if (!Directory.Exists(ABHelper.AppVersionPath))
            {
                Directory.CreateDirectory(ABHelper.AppVersionPath);
            }

            // 版号信息
            Dictionary <string, string> versionInfo = ABHelper.ReadVersionIdFile();

            OriginalVersionId      = new VersionNum(versionInfo["ResVersion"]);
            ABHelper.ABFolderRoot  = versionInfo["ABFolderRoot"];
            ABHelper.ApkFolderRoot = versionInfo["ApkFolderRoot"];

            // 当前版号
            CurVersionId = new VersionNum(OriginalVersionId.Id1st, OriginalVersionId.Id2nd, OriginalVersionId.Id3rd, OriginalVersionId.Id4th);

            // 本地更新地址
            LocalStorgePath = string.Format("{0}/{1}", ABHelper.AppVersionPath, OriginalVersionId.Id1A2);
            if (!Directory.Exists(LocalStorgePath))
            {
                Directory.CreateDirectory(LocalStorgePath);
            }

            // 获取本地的所有版本
            LoadAllVersionInfo();
            // 现在在用的版本号
            SetCurVersionNum(CurVersionId);
        }
Ejemplo n.º 3
0
        private static void RootFolderName()
        {
            // TheRootFolderName = Application.dataPath;
            // TheRootFolderName = TheRootFolderName.Substring(0, TheRootFolderName.LastIndexOf("/"));
            // TheRootFolderName = "ab_" + TheRootFolderName.Substring(TheRootFolderName.LastIndexOf("/") + 1) + "_full";

            Dictionary <string, string> versionInfo = ABHelper.ReadVersionIdFile();

            TheRootFolderName = versionInfo["ABFolderRoot"];
        }
Ejemplo n.º 4
0
        static void ChangeVersionId()
        {
            parseCommand();
            if (string.IsNullOrEmpty(VersionId) || "null" == VersionId.ToLower())
            {
                return;
            }
            Dictionary <string, string> versionInfo = ABHelper.ReadVersionIdFile();

            versionInfo["ResVersion"] = VersionId;
            ABHelper.WriteVersionIdFile(versionInfo);
        }
Ejemplo n.º 5
0
        static void ChangeABRoot()
        {
            parseCommand();
            if (string.IsNullOrEmpty(ABRoot) || "null" == ABRoot.ToLower())
            {
                return;
            }
            Dictionary <string, string> versionInfo = ABHelper.ReadVersionIdFile();

            versionInfo["ABFolderRoot"] = ABRoot;
            ABHelper.WriteVersionIdFile(versionInfo);
        }
Ejemplo n.º 6
0
        private static void Prepare()
        {
            m_process = new System.Diagnostics.Process();
            m_process.StartInfo.WindowStyle            = System.Diagnostics.ProcessWindowStyle.Hidden;
            m_process.StartInfo.CreateNoWindow         = true;
            m_process.StartInfo.UseShellExecute        = false;
            m_process.StartInfo.RedirectStandardOutput = true;
            m_process.StartInfo.RedirectStandardError  = true;

            // combine luajit working path
            DirectoryInfo parentInfo = Directory.GetParent(Application.dataPath);

            m_luajitWorkingPath = parentInfo.FullName + m_luajitWorkingPath;
#if UNITY_EDITOR_WIN || UNITY_STANDALONE_WIN
            m_luajitExePath = m_luajitWorkingPath + "luajit.exe";
#elif UNITY_EDITOR_OSX || UNITY_STANDALONE_OSX
            m_luajitExePath = m_luajitWorkingPath + "luajit";
#endif
            Dictionary <string, string> versionInfo = ABHelper.ReadVersionIdFile();
            m_versionNum    = new VersionNum(versionInfo["ResVersion"]);
            m_apkFolderPath = versionInfo["ApkFolderRoot"];
            XLua.Hotfix.HotfixInject();
        }
Ejemplo n.º 7
0
        static void Build()
        {
            parseCommand();

            Dictionary <string, string> versionInfo = ABHelper.ReadVersionIdFile();

            if (!string.IsNullOrEmpty(ABRoot) && "nil" != ABRoot.ToLower())
            {
                versionInfo["ABFolderRoot"] = ABRoot;
            }
            if (!string.IsNullOrEmpty(ApkRoot) && "nil" != ApkRoot.ToLower())
            {
                versionInfo["ApkFolderRoot"] = ApkRoot;
            }
            if (!string.IsNullOrEmpty(VersionId) && "nil" != VersionId.ToLower())
            {
                versionInfo["ResVersion"] = VersionId;
            }
            ABHelper.WriteVersionIdFile(versionInfo);
            AssetDatabase.Refresh();

            switch (TypeV.ToLower())
            {
            case "ab":
                ABPacker.CommandBuild(true, Platform); break;

            case "apk":
                BuildAppSteps.CommandBuild(IsDebug, Platform); break;

            case "ab2apk":
                ABPacker.CommandBuild(IsDebug, Platform);
                BuildAppSteps.CommandBuild(IsDebug, Platform); break;

            default: break;
            }
        }