public void Run()
    {
        versionSetting = VersionSetting.Read();
        currentVerData.version.CopyValue(versionSetting.lastVersion);
        compareVersionData.version.CopyValue(versionSetting.compareVersion);
        if (versionSetting.isAutoAdd)
        {
            currentVerData.version.Add();
        }

        readCompareVersionData();

        generateAll();
        generatePatch();


        versionSetting.lastVersion.CopyValue(currentVerData.version);
        if (versionSetting.isAutoAdd && versionSetting.isSetLastToNextCompera)
        {
            versionSetting.compareVersion.CopyValue(currentVerData.version);
        }
        versionSetting.Save();

        if (versionSetting.isDeleteVerFolderAll)
        {
            Directory.Delete(currentVerData.ver_all, true);
            Console.WriteLine("开始 删除目录 :" + currentVerData.ver_all);
        }


        if (versionSetting.isDeleteVerFolderPatch)
        {
            Directory.Delete(currentVerData.ver_patch, true);
            Console.WriteLine("开始 删除目录 :" + currentVerData.ver_patch);
        }
    }
Esempio n. 2
0
    public void Run()
    {
        versionSetting = VersionSetting.Read();
        currentVerData.version.CopyValue(versionSetting.lastVersion);
        compareVersionData.version.CopyValue(versionSetting.compareVersion);

        string preVerStr = versionSetting.lastVersion.ToString();

        if (versionSetting.isAutoAdd)
        {
            currentVerData.version.Add();
        }

        readCompareVersionData();


        currentVerData.manifest.Add("__ResVersion__", currentVerData.version.ToString());

        generateAll();
        generatePatch();


        versionSetting.lastVersion.CopyValue(currentVerData.version);
        if (versionSetting.isAutoAdd && versionSetting.isSetLastToNextCompera)
        {
            versionSetting.compareVersion.CopyValue(currentVerData.version);
        }
        versionSetting.Save();

        foreach (string path in versionSetting.replaceVersionTextFiles)
        {
            string verStr = currentVerData.version.ToString();

            if (File.Exists(path))
            {
                string content = File.ReadAllText(path);
                content = content.Replace(versionSetting.replaceVersionText, verStr);
                content = content.Replace(preVerStr, verStr);
                File.WriteAllText(path, content);
            }
        }


        foreach (string path in versionSetting.replaceVersionTextDelayFiles)
        {
            string verStr = currentVerData.version.ToString();

            if (versionSetting.isAutoAdd)
            {
                currentVerData.version.Add();
            }
            string nextVerStr = currentVerData.version.ToString();


            if (File.Exists(path))
            {
                string content = File.ReadAllText(path);
                content = content.Replace(versionSetting.replaceVersionDelayText, nextVerStr);
                content = content.Replace(verStr, nextVerStr);
                File.WriteAllText(path, content);
            }
        }
    }