2024-01-16 11:14:30 -06:00
|
|
|
package main
|
|
|
|
|
2024-01-18 00:58:14 -06:00
|
|
|
import (
|
2024-12-01 16:17:28 -06:00
|
|
|
"os"
|
|
|
|
|
2024-01-18 05:03:04 -06:00
|
|
|
"go.wit.com/gui"
|
2024-11-13 18:15:38 -06:00
|
|
|
"go.wit.com/lib/debugger"
|
|
|
|
"go.wit.com/lib/gui/logsettings"
|
2024-01-31 01:36:54 -06:00
|
|
|
"go.wit.com/log"
|
2024-01-16 11:14:30 -06:00
|
|
|
)
|
|
|
|
|
|
|
|
func globalDisplayOptions(box *gui.Node) {
|
2024-01-20 17:17:48 -06:00
|
|
|
vbox := box.NewVerticalBox("DISPLAYVBOX")
|
2024-01-16 11:14:30 -06:00
|
|
|
|
2024-01-20 17:17:48 -06:00
|
|
|
group1 := vbox.NewGroup("Global Display Options")
|
|
|
|
|
2024-02-19 19:42:14 -06:00
|
|
|
hidegrid := group1.NewGrid("hidecfg", 0, 0)
|
|
|
|
|
|
|
|
hidegrid.NewButton("Show Repository Window", func() {
|
2024-02-18 15:09:04 -06:00
|
|
|
if me.repos.Hidden() {
|
|
|
|
me.repos.Show()
|
2024-02-11 18:58:52 -06:00
|
|
|
} else {
|
2024-02-18 15:09:04 -06:00
|
|
|
me.repos.Hide()
|
2024-02-11 18:58:52 -06:00
|
|
|
}
|
2024-02-18 15:09:04 -06:00
|
|
|
log.Info("showing reposwin")
|
2024-01-17 01:55:22 -06:00
|
|
|
})
|
2024-02-19 19:42:14 -06:00
|
|
|
hidegrid.NextRow()
|
2024-01-20 16:09:15 -06:00
|
|
|
|
2024-02-20 14:44:38 -06:00
|
|
|
group1 = vbox.NewGroup("prep for release")
|
2024-02-23 01:22:46 -06:00
|
|
|
grid := group1.RawGrid()
|
2024-01-16 11:14:30 -06:00
|
|
|
|
2024-11-13 17:23:33 -06:00
|
|
|
grid.NewButton("make prepare-release", func() {
|
2024-11-13 17:53:12 -06:00
|
|
|
me.Disable()
|
2024-11-13 18:32:53 -06:00
|
|
|
me.release.box.Disable()
|
2024-11-13 17:53:12 -06:00
|
|
|
defer me.Enable()
|
2024-11-13 17:23:33 -06:00
|
|
|
loop := me.repos.View.ReposSortByName()
|
|
|
|
for loop.Scan() {
|
|
|
|
repo := loop.Repo()
|
2024-12-01 16:40:22 -06:00
|
|
|
// check if the package dependancies changed, if so, re-publish
|
|
|
|
check := me.forge.Repos.FindByGoPath(repo.GoPath())
|
|
|
|
if check == nil {
|
|
|
|
log.Info("boo, you didn't git clone", repo.GoPath())
|
|
|
|
os.Exit(-1)
|
|
|
|
}
|
|
|
|
match, err := me.forge.Repos.GoDepsChanged(check)
|
|
|
|
if err != nil {
|
|
|
|
log.Info("dependancy checks failed", check.GetGoPath(), err)
|
|
|
|
repo.Status.IncrementRevisionVersion("missing prior published godeps")
|
|
|
|
continue
|
|
|
|
}
|
|
|
|
if match {
|
|
|
|
log.Printf("dependancy checks indicate a new release is needed for %s\n", check.GetGoPath())
|
|
|
|
repo.Status.IncrementRevisionVersion("godeps changed")
|
|
|
|
continue
|
|
|
|
} else {
|
|
|
|
log.Printf("dependancies have not changed for %s\n", check.GetGoPath())
|
2024-12-01 16:17:28 -06:00
|
|
|
}
|
2024-02-23 12:46:39 -06:00
|
|
|
|
2024-12-01 16:40:22 -06:00
|
|
|
// see if there is a new version
|
2024-11-13 17:23:33 -06:00
|
|
|
master := repo.Status.GetMasterVersion()
|
|
|
|
lastTag := repo.Status.LastTag()
|
|
|
|
if master == lastTag {
|
|
|
|
repo.Status.SetTargetVersion(master)
|
|
|
|
} else {
|
|
|
|
repo.Status.IncrementRevisionVersion("Nov 2024 test")
|
2024-02-23 01:22:46 -06:00
|
|
|
}
|
2024-11-13 17:23:33 -06:00
|
|
|
}
|
2024-11-13 17:45:51 -06:00
|
|
|
findNext()
|
2024-11-13 17:53:12 -06:00
|
|
|
if setAllBranchesToMaster() {
|
|
|
|
// if it succeeds, disable this button
|
|
|
|
me.setBranchesToMasterB.Disable()
|
2024-11-13 18:32:53 -06:00
|
|
|
me.release.box.Enable()
|
2024-11-17 17:47:50 -06:00
|
|
|
me.repos.View.PrintReleaseReport("", "")
|
|
|
|
} else {
|
|
|
|
log.Info("setAllBranchesToMaster() failed")
|
2024-11-13 17:53:12 -06:00
|
|
|
}
|
2024-11-13 17:23:33 -06:00
|
|
|
})
|
|
|
|
grid.NextRow()
|
2024-02-23 01:22:46 -06:00
|
|
|
|
2024-11-13 18:15:38 -06:00
|
|
|
grid.NewButton("logging Window", func() {
|
|
|
|
logsettings.LogWindow()
|
|
|
|
})
|
2024-02-19 19:42:14 -06:00
|
|
|
grid.NextRow()
|
2024-02-05 19:27:19 -06:00
|
|
|
|
2024-11-13 18:15:38 -06:00
|
|
|
grid.NewButton("Debugger Window", func() {
|
|
|
|
debugger.DebugWindow()
|
|
|
|
})
|
2024-01-16 11:14:30 -06:00
|
|
|
}
|