feat: 完善远程构建恢复、工程同步与变体选择
增加持久化构建记录、历史 APK 恢复、断点下载、Gradle 缓存复用、系统代理与按工程选择服务端 JDK。 支持已有工程目录、Git 状态检查、原生忽略规则和文本换行等价比较,修复干净检出与历史同步快照不一致时的误拦截。 优化插件设备可选构建、侧栏滚动、左右日志布局、时间显示和构建变体快速选择,并补充部署与协议文档。 验证:17 项 Go 测试、22 项插件测试及 HTTP/HTTPS 两条端到端测试通过;Linux/macOS 服务端交叉编译通过。
This commit is contained in:
1 parent
2203afde3c
commit
2cb70beb69
44 files changed
+3310
-236
No files matched your search
@@ -0,0 +1,43 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"strings"
|
||||
"unicode/utf8"
|
||||
)
|
||||
|
||||
// Restrict EOL equivalence to source/config text. Executable scripts remain byte-exact.
|
||||
func comparableText(path string) bool {
|
||||
switch strings.ToLower(filepath.Ext(path)) {
|
||||
case ".kt", ".kts", ".java", ".xml", ".gradle", ".properties", ".json", ".toml", ".yaml", ".yml", ".txt", ".md", ".proto", ".c", ".cc", ".cpp", ".h", ".hpp", ".cmake", ".aidl", ".pro", ".cfg", ".ini", ".csv", ".html", ".css", ".js", ".ts", ".svg":
|
||||
return true
|
||||
}
|
||||
switch strings.ToLower(filepath.Base(path)) {
|
||||
case ".gitignore", ".gitattributes", ".editorconfig", "cmakelists.txt":
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
func comparisonFile(path string) (File, error) {
|
||||
if comparableText(path) {
|
||||
info, e := os.Stat(path)
|
||||
if e != nil {
|
||||
return File{}, e
|
||||
}
|
||||
if info.Size() <= 64<<20 {
|
||||
b, e := os.ReadFile(path)
|
||||
if e != nil {
|
||||
return File{}, e
|
||||
}
|
||||
f := File{Hash: digest(b)}
|
||||
if utf8.Valid(b) && !bytes.ContainsRune(b, 0) {
|
||||
f.TextHash = digest(bytes.ReplaceAll(b, []byte("\r\n"), []byte("\n")))
|
||||
}
|
||||
return f, nil
|
||||
}
|
||||
}
|
||||
h, e := fileDigest(path)
|
||||
return File{Hash: h}, e
|
||||
}
|
||||
Reference in new issue
Block a user