Repository navigation
模拟器构建号同时认 mas-N 和版本号 - #169
Merged
Merged
Conversation
下一次重编模拟器起,Pkg.BuildId 和包清单的 "build" 改成 ModAVD 版本号(如 0.42.0),不再用 mas-N。这一步先让管理器两种都认,0.41.0 包里的模拟器仍是 mas-41。 - root:新增 EmuBuild,读 mas-N(旧写法,按 0.N.0 比较)或 X.Y.Z(可带 v,不收预发布后缀);ModBuild 换成 EmulatorBuild,MinModBuild 换成 MinEmulatorBuild(0.25.0)。清单 "build" 可以是整数 N 或版本字符串;版本号形式的模拟器没有对得上的清单时,版本就是它自己的构建号。 - 更新:包清单 "build" 收正整数或版本字符串,包里 Pkg.BuildId 必须是同一形式的同一构建(N 对 mas-N,X.Y.Z 对 X.Y.Z);没写 "build" 的旧包照旧按版本的第二位。macOS 传输清单同样两种都收。 - JSON:RootInfo 加 build_id("mas-41" / "0.42.0",不知道时省略),build 只在旧写法时是 N;current_build 是构建号原文。界面提示改读 build_id。 - 开机检查、宿主输入法的提示改成版本号,不再写 mas。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
为什么
模拟器的内部构建号(
sdk\emulator\source.properties的Pkg.BuildId、包清单modavd-manifest.json的build)一直是mas-N/ 整数 N。公开版本号已经和它脱钩,现在内部构建号也不再用 mas:以后的模拟器构建号就是它所在的公开版本号,比如Pkg.BuildId=0.42.0、清单里"build": "0.42.0"。已经发出去的管理器(0.9.0–0.11.0)装包时只认
mas-<整数>,直接换写法,应用内更新会被拒。所以分两步:mas-41,让旧管理器能装上来。改法
root.EmuBuild:解析mas-N,以及X.Y.Z(可带v)。比较时mas-N当0.N.0。String()原样给回mas-41/0.42.0。JSON 里整数是旧写法,字符串是版本。ModBuild()换成EmulatorBuild();MinModBuild = 25换成MinEmulatorBuild(0.25.0)。开机检查的建议文字直接打印这个版本,不再用构建号去拼版本号。build可以是正整数或版本字符串。Pkg.BuildId要和清单写的是同一种写法、同一个构建;mas-41和"0.41.0"不互认。没写build的旧包照旧按版本号第二位算。旧写法的报错文字和以前逐字一样。InstalledVersion:两种写法的清单都认。新写法的模拟器没有对得上的清单时,版本就取构建号本身(作用和旧写法 mas-N≤40 退回 0.N.0 一样)。build保留(旧写法时是 N,新写法时为 0),另加字符串build_id(mas-41/0.42.0,不知道时省略)。管理器界面的版本提示改读build_id,不再写死mas-。AUTO-MAS 不读这个整数。update status在构建号和版本相同时不再重复显示。测试
gofmt、go vet ./...通过,GOOS=darwin、GOOS=linux下的 vet 也通过。native_package_darwin.go带 cgo 约束,本机没有 clang,没有编译验证,只改了两行类型。go test ./internal/root/ ./internal/update/ ./internal/emu/ ./internal/ui/ ./internal/cli/通过。InstalledVersion在两种写法下的六种情况;build_id字段。