From 8afc4c713576b3509e15942dfd3dae5e8b8b8906 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Sat, 16 Nov 2024 00:07:00 -0600 Subject: [PATCH] fix build --- Makefile | 28 ++++++++++++++++------------ globalBuildOptions.go | 5 +++-- repoview.go | 16 ++++++++++++---- submitPatches.go | 12 +++++++++--- 4 files changed, 40 insertions(+), 21 deletions(-) diff --git a/Makefile b/Makefile index c42ba57..502f447 100644 --- a/Makefile +++ b/Makefile @@ -1,9 +1,21 @@ -# to build by hand export GO111MODULE=off +VERSION = $(shell git describe --tags) +BUILDTIME = $(shell date +%Y.%m.%d) all: build - reset ./forge +build: + GO111MODULE=off go build \ + -ldflags "-X main.VERSION=${VERSION} -X main.BUILDTIME=${BUILDTIME} -X gui.GUIVERSION=${VERSION}" + +verbose: + GO111MODULE=off go build -v -x \ + -ldflags "-X main.VERSION=${VERSION} -X main.BUILDTIME=${BUILDTIME} -X gui.GUIVERSION=${VERSION}" + +install: + GO111MODULE=off go install \ + -ldflags "-X main.VERSION=${VERSION} -X main.BUILDTIME=${BUILDTIME} -X gui.GUIVERSION=${VERSION}" + only-me: build reset ./forge --only-me @@ -14,21 +26,13 @@ stderr: build goimports: goimports -w *.go - # // to globally reset paths: - # // gofmt -w -r '"go.wit.com/gui/gadgets" -> "go.wit.com/lib/gadgets"' *.go + @# // to globally reset paths: + @# // gofmt -w -r '"go.wit.com/gui/gadgets" -> "go.wit.com/lib/gadgets"' *.go gocui: build reset ./forge --gui gocui >/tmp/forge.log 2>&1 -build: - echo "build it!" - GO111MODULE=off go build -v -x - -install: - go install -v -x - forge - check-git-clean: @git diff-index --quiet HEAD -- || (echo "Git repository is dirty, please commit your changes first"; exit 1) diff --git a/globalBuildOptions.go b/globalBuildOptions.go index 78d708f..04d39db 100644 --- a/globalBuildOptions.go +++ b/globalBuildOptions.go @@ -9,7 +9,6 @@ import ( "go.wit.com/gui" "go.wit.com/lib/gadgets" - "go.wit.com/lib/gui/repolist" "go.wit.com/lib/gui/shell" ) @@ -74,7 +73,9 @@ func globalBuildOptions(vbox *gui.Node) { me.setBranchB = grid.NewButton("set current branch to:", func() { targetName := me.newBranch.String() log.Warn("setting all branches to", targetName) - for _, repo := range repolist.AllRepos() { + loop := me.repos.View.ReposSortByName() + for loop.Scan() { + repo := loop.Repo() repo.Status.CheckoutBranch(targetName) repo.Scan() } diff --git a/repoview.go b/repoview.go index 10d8c2d..9858fe6 100644 --- a/repoview.go +++ b/repoview.go @@ -68,7 +68,9 @@ func makeRepoView() *repoWindow { } func (r *repoWindow) showApps() { - for _, repo := range r.View.AllRepos() { + loop := me.repos.View.ReposSortByName() + for loop.Scan() { + repo := loop.Repo() switch repo.Status.RepoType() { case "binary": //log.Info("compile here. Show()") @@ -124,7 +126,9 @@ func (r *repoWindow) repoAllButtons() *gui.Node { r.Disable() defer r.Enable() r.showApps() - for _, repo := range r.View.AllRepos() { + loop := me.repos.View.ReposSortByName() + for loop.Scan() { + repo := loop.Repo() if repo.Hidden() { // log.Info("skip hidden", repo.String()) } else { @@ -147,7 +151,9 @@ func (r *repoWindow) repoAllButtons() *gui.Node { func (r *repoWindow) mergeAllDevelToMain() bool { log.Info("merge all here") - for _, repo := range r.View.AllRepos() { + loop := me.repos.View.ReposSortByName() + for loop.Scan() { + repo := loop.Repo() if repo.ReadOnly() { log.Info("skipping readonly", repo.Name(), repo.State()) continue @@ -177,7 +183,9 @@ func (r *repoWindow) mergeAllDevelToMain() bool { func (r *repoWindow) mergeAllUserToDevel() bool { log.Info("merge all here") - for _, repo := range r.View.AllRepos() { + loop := me.repos.View.ReposSortByName() + for loop.Scan() { + repo := loop.Repo() if repo.ReadOnly() { log.Info("skipping readonly", repo.Name(), repo.State()) continue diff --git a/submitPatches.go b/submitPatches.go index 74608b1..f2e7842 100644 --- a/submitPatches.go +++ b/submitPatches.go @@ -57,7 +57,9 @@ func submitPatchesBox(box *gui.Node) *patchSummary { s.grid.NewButton("Update Patch Counts", func() { var repocount, patchcount int - for _, repo := range repolist.AllRepos() { + loop := me.repos.View.UnmergedRepos() + for loop.Scan() { + repo := loop.Repo() if repo.ReadOnly() { continue } @@ -72,7 +74,9 @@ func submitPatchesBox(box *gui.Node) *patchSummary { repocount = 0 patchcount = 0 - for _, repo := range repolist.AllRepos() { + loop = me.repos.View.UnmergedRepos() + for loop.Scan() { + repo := loop.Repo() if repo.ReadOnly() { continue } @@ -208,7 +212,9 @@ func (s *patchSummary) Update() { var total, totalgo, dirty, readonly int var userT, develT, masterT int // var userP, develP, masterP int - for _, repo := range repolist.AllRepos() { + loop := me.repos.View.UnmergedRepos() + for loop.Scan() { + repo := loop.Repo() total += 1 if repo.Status.IsDirty() { dirty += 1