add something to build everything
This commit is contained in:
parent
4555b9f34d
commit
f5dc43b75b
69
repolist.go
69
repolist.go
|
@ -66,6 +66,10 @@ func (r *repo) Hide() {
|
|||
r.hidden = true
|
||||
}
|
||||
|
||||
func (r *repo) Hidden() bool {
|
||||
return r.hidden
|
||||
}
|
||||
|
||||
func (r *repo) Show() {
|
||||
r.pLabel.Show()
|
||||
r.lastTag.Show()
|
||||
|
@ -150,6 +154,25 @@ func addRepo(grid *gui.Node, path string, master string, devel string, user stri
|
|||
}
|
||||
me.reposwin.Enable()
|
||||
})
|
||||
newRepo.endBox.NewButton("build", func() {
|
||||
switch newRepo.status.RepoType() {
|
||||
case "binary":
|
||||
log.Info("compile here. Show()")
|
||||
case "library":
|
||||
log.Info("library here. Hide()")
|
||||
default:
|
||||
log.Info("unknown. Show()")
|
||||
}
|
||||
|
||||
/*
|
||||
err, output := newRepo.status.RunCmd([]string{"go", "list", "-f", "'{{if eq .Name \"main\"}}binary{{else}}library{{end}}'"})
|
||||
if err != nil {
|
||||
log.Info("package is: unknown", err)
|
||||
return
|
||||
}
|
||||
output = strings.Trim(output, "'")
|
||||
*/
|
||||
})
|
||||
|
||||
newRepo.status = repostatus.NewRepoStatusWindow(newRepo.path)
|
||||
newRepo.hidden = false
|
||||
|
@ -222,6 +245,23 @@ func repolistWindow() {
|
|||
// reposwin.Toggle()
|
||||
}
|
||||
|
||||
func showApps() {
|
||||
for _, repo := range me.allrepos {
|
||||
switch repo.status.RepoType() {
|
||||
case "binary":
|
||||
log.Info("compile here. Show()")
|
||||
repo.Show()
|
||||
case "library":
|
||||
log.Info("library here. Hide()")
|
||||
repo.Hide()
|
||||
default:
|
||||
log.Info("unknown. Show()")
|
||||
repo.Hide()
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
func repoAllButtons(box *gui.Node) {
|
||||
// reposbox.SetExpand(false)
|
||||
group1 := box.NewGroup("Run on all repos:")
|
||||
|
@ -266,6 +306,35 @@ func repoAllButtons(box *gui.Node) {
|
|||
me.reposwin.Enable()
|
||||
})
|
||||
|
||||
box2.NewButton("show apps", func() {
|
||||
me.reposwin.Disable()
|
||||
showApps()
|
||||
me.reposwin.Enable()
|
||||
})
|
||||
|
||||
box2.NewButton("build all", func() {
|
||||
me.reposwin.Disable()
|
||||
defer me.reposwin.Enable()
|
||||
showApps()
|
||||
for _, repo := range me.allrepos {
|
||||
if repo.Hidden() {
|
||||
// log.Info("skip hidden", repo.String())
|
||||
} else {
|
||||
log.Info("try to build", repo.String())
|
||||
if repo.status.Build() {
|
||||
log.Info("build worked", repo.String())
|
||||
} else {
|
||||
log.Info("build failed", repo.String())
|
||||
go repo.status.Xterm([]string{"bash"})
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
log.Info("")
|
||||
log.Info("every build worked !!!")
|
||||
log.Info("")
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
func mergeAllDevelToMain() bool {
|
||||
|
|
Loading…
Reference in New Issue