feat: 增加独立构建工作区、服务端ADB与私有文件清单
支持Git提交导入及未提交源码叠加,APK原名下载和完成通知。新增服务端设备安装与按工程维护的私有文件清单,修复Wrapper预检查、布局及IDE读锁和保存状态问题。更新协议、测试和部署记录;服务端0.7.0,插件0.7.1。
This commit is contained in:
1 parent
87652364bc
commit
6f9cc7e7ea
44 files changed
+2742
-87
No files matched your search
@@ -0,0 +1,36 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"os"
|
||||
"path/filepath"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestExplicitWorkspaceSupportFilesAreConfined(t *testing.T) {
|
||||
s := testServer(t)
|
||||
p := project(t, s)
|
||||
pr := s.projects[p]
|
||||
pr.Dedicated = true
|
||||
pr.WorkspacePath = t.TempDir()
|
||||
cert := filepath.Join(t.TempDir(), "HONOR.CER")
|
||||
key := filepath.Join(t.TempDir(), "key.jks")
|
||||
writeFixture(t, cert, "certificate")
|
||||
writeFixture(t, key, "key material")
|
||||
c := BuildEnvironment{WorkspaceFiles: map[string]map[string]string{pr.WorkspacePath: {"cer/HONOR.CER": cert, "work/app/key.jks": key}}}
|
||||
if e := s.prepareWorkspaceFiles(p, c); e != nil {
|
||||
t.Fatal(e)
|
||||
}
|
||||
root := filepath.Join(s.root, "projects", p)
|
||||
for relative, want := range map[string]string{"cer/HONOR.CER": "certificate", "work/app/key.jks": "key material"} {
|
||||
data, e := os.ReadFile(filepath.Join(root, filepath.FromSlash(relative)))
|
||||
if e != nil || string(data) != want {
|
||||
t.Fatal(relative, e)
|
||||
}
|
||||
}
|
||||
for _, target := range []string{"../escape.cer", "work/.git/hooks/key.jks", "work/public.cer", "work/build/key.jks", "state.json"} {
|
||||
c.WorkspaceFiles[pr.WorkspacePath] = map[string]string{target: cert}
|
||||
if e := s.prepareWorkspaceFiles(p, c); e == nil {
|
||||
t.Fatal("unsafe support target accepted", target)
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user