fix build

This commit is contained in:
Jeff Carr 2024-11-16 00:07:00 -06:00
parent a26ae2bcc1
commit 8afc4c7135
4 changed files with 40 additions and 21 deletions

View File

@ -1,9 +1,21 @@
# to build by hand export GO111MODULE=off VERSION = $(shell git describe --tags)
BUILDTIME = $(shell date +%Y.%m.%d)
all: build all: build
reset
./forge ./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 only-me: build
reset reset
./forge --only-me ./forge --only-me
@ -14,21 +26,13 @@ stderr: build
goimports: goimports:
goimports -w *.go goimports -w *.go
# // to globally reset paths: @# // to globally reset paths:
# // gofmt -w -r '"go.wit.com/gui/gadgets" -> "go.wit.com/lib/gadgets"' *.go @# // gofmt -w -r '"go.wit.com/gui/gadgets" -> "go.wit.com/lib/gadgets"' *.go
gocui: build gocui: build
reset reset
./forge --gui gocui >/tmp/forge.log 2>&1 ./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: check-git-clean:
@git diff-index --quiet HEAD -- || (echo "Git repository is dirty, please commit your changes first"; exit 1) @git diff-index --quiet HEAD -- || (echo "Git repository is dirty, please commit your changes first"; exit 1)

View File

@ -9,7 +9,6 @@ import (
"go.wit.com/gui" "go.wit.com/gui"
"go.wit.com/lib/gadgets" "go.wit.com/lib/gadgets"
"go.wit.com/lib/gui/repolist"
"go.wit.com/lib/gui/shell" "go.wit.com/lib/gui/shell"
) )
@ -74,7 +73,9 @@ func globalBuildOptions(vbox *gui.Node) {
me.setBranchB = grid.NewButton("set current branch to:", func() { me.setBranchB = grid.NewButton("set current branch to:", func() {
targetName := me.newBranch.String() targetName := me.newBranch.String()
log.Warn("setting all branches to", targetName) 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.Status.CheckoutBranch(targetName)
repo.Scan() repo.Scan()
} }

View File

@ -68,7 +68,9 @@ func makeRepoView() *repoWindow {
} }
func (r *repoWindow) showApps() { 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() { switch repo.Status.RepoType() {
case "binary": case "binary":
//log.Info("compile here. Show()") //log.Info("compile here. Show()")
@ -124,7 +126,9 @@ func (r *repoWindow) repoAllButtons() *gui.Node {
r.Disable() r.Disable()
defer r.Enable() defer r.Enable()
r.showApps() r.showApps()
for _, repo := range r.View.AllRepos() { loop := me.repos.View.ReposSortByName()
for loop.Scan() {
repo := loop.Repo()
if repo.Hidden() { if repo.Hidden() {
// log.Info("skip hidden", repo.String()) // log.Info("skip hidden", repo.String())
} else { } else {
@ -147,7 +151,9 @@ func (r *repoWindow) repoAllButtons() *gui.Node {
func (r *repoWindow) mergeAllDevelToMain() bool { func (r *repoWindow) mergeAllDevelToMain() bool {
log.Info("merge all here") 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() { if repo.ReadOnly() {
log.Info("skipping readonly", repo.Name(), repo.State()) log.Info("skipping readonly", repo.Name(), repo.State())
continue continue
@ -177,7 +183,9 @@ func (r *repoWindow) mergeAllDevelToMain() bool {
func (r *repoWindow) mergeAllUserToDevel() bool { func (r *repoWindow) mergeAllUserToDevel() bool {
log.Info("merge all here") 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() { if repo.ReadOnly() {
log.Info("skipping readonly", repo.Name(), repo.State()) log.Info("skipping readonly", repo.Name(), repo.State())
continue continue

View File

@ -57,7 +57,9 @@ func submitPatchesBox(box *gui.Node) *patchSummary {
s.grid.NewButton("Update Patch Counts", func() { s.grid.NewButton("Update Patch Counts", func() {
var repocount, patchcount int var repocount, patchcount int
for _, repo := range repolist.AllRepos() { loop := me.repos.View.UnmergedRepos()
for loop.Scan() {
repo := loop.Repo()
if repo.ReadOnly() { if repo.ReadOnly() {
continue continue
} }
@ -72,7 +74,9 @@ func submitPatchesBox(box *gui.Node) *patchSummary {
repocount = 0 repocount = 0
patchcount = 0 patchcount = 0
for _, repo := range repolist.AllRepos() { loop = me.repos.View.UnmergedRepos()
for loop.Scan() {
repo := loop.Repo()
if repo.ReadOnly() { if repo.ReadOnly() {
continue continue
} }
@ -208,7 +212,9 @@ func (s *patchSummary) Update() {
var total, totalgo, dirty, readonly int var total, totalgo, dirty, readonly int
var userT, develT, masterT int var userT, develT, masterT int
// var userP, develP, masterP int // var userP, develP, masterP int
for _, repo := range repolist.AllRepos() { loop := me.repos.View.UnmergedRepos()
for loop.Scan() {
repo := loop.Repo()
total += 1 total += 1
if repo.Status.IsDirty() { if repo.Status.IsDirty() {
dirty += 1 dirty += 1