三国卡牌客户端基础资源仓库
hch
4 天以前 cdac25a8e4f91a4663bf5f80994538dd263b757c
Assets/Editor/Tool/ClientPackage.cs
@@ -405,23 +405,23 @@
        var versionName = string.Empty;
        var versionConfig = GetVersionConfig(_publisher, out versionName);
        var versionConfigCSpath = Application.dataPath + "/Scripts/System/ClientVersion/VersionConfig.cs";
        var text = File.ReadAllText(versionConfigCSpath);
        // var versionConfigCSpath = Application.dataPath + "/Scripts/System/ClientVersion/VersionConfig.cs";
        // var text = File.ReadAllText(versionConfigCSpath);
        if (text.Contains("VERSION_ALTERNATIVE"))
        {
            var pattern = "VERSION_ALTERNATIVE = \".*\"";
            text = Regex.Replace(text, pattern, StringUtility.Contact("VERSION_ALTERNATIVE = ", "\"", versionConfig.m_Version, "\""));
        // if (text.Contains("VERSION_ALTERNATIVE"))
        // {
        //     var pattern = "VERSION_ALTERNATIVE = \".*\"";
        //     text = Regex.Replace(text, pattern, StringUtility.Contact("VERSION_ALTERNATIVE = ", "\"", versionConfig.m_Version, "\""));
            bool encoderShouldEmitUTF8Identifier = true;
            bool throwOnInvalidBytes = false;
            UTF8Encoding encoding = new UTF8Encoding(encoderShouldEmitUTF8Identifier, throwOnInvalidBytes);
            bool append = false;
            StreamWriter streamWriter = new StreamWriter(versionConfigCSpath, append, encoding);
            streamWriter.Write(text);
            streamWriter.Close();
            AssetDatabase.ImportAsset(versionConfigCSpath);
        }
        //     bool encoderShouldEmitUTF8Identifier = true;
        //     bool throwOnInvalidBytes = false;
        //     UTF8Encoding encoding = new UTF8Encoding(encoderShouldEmitUTF8Identifier, throwOnInvalidBytes);
        //     bool append = false;
        //     StreamWriter streamWriter = new StreamWriter(versionConfigCSpath, append, encoding);
        //     streamWriter.Write(text);
        //     streamWriter.Close();
        //     AssetDatabase.ImportAsset(versionConfigCSpath);
        // }
        // 针对某一些打包的特殊性, 这里特指依赖的第三方库含有资源的问题
        // 这里对有这种特型的渠道的sdk在打包的时候差异化gradle文件