summaryrefslogtreecommitdiff
path: root/globalTestingOptions.go
blob: 1631db1dd687c08767c22c981012531882e15556 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
package main

import (
	"os"

	"go.wit.com/lib/gui/repostatus"

	"go.wit.com/gui"
)

// things being testing
func globalTestingOptions(box *gui.Node) {
	test1 := box.NewGroup("testing build")
	me.autoRebuildButton = test1.NewButton("rebuild autotypist", func() {
		me.autoRebuildButton.Disable()
		me.autoRebuildButton.SetLabel("running....")
		attemptAutoRebuild()
		me.autoRebuildButton.Enable()
		me.autoRebuildButton.SetLabel("rebuild autotypist")
	})

	/*
		me.downloadEverythingButton = test1.NewButton("go get go.wit.com", func() {
			me.downloadEverythingButton.Disable()
			me.autoWorkingPwd.SetValue("/home/jcarr/go/src")
			var perfect bool = true
			repos := myrepolist()
			for _, line := range repos {
				log.Verbose("repo =", line)
				path, _, _, _ := splitLine(line)
				path = strings.TrimSpace(path)
				if path == "#" {
					// skip comment lines
					continue
				}
				if doesExist("/home/jcarr/go/src/" + path) {
					continue
				}
				// attempt to download it
				quickCmd("/home/jcarr/go/src/go.wit.com", []string{"go", "get", "-v", path})
				perfect = false
			}

			if perfect {
				var notes string
				notes = "you have already downloaded\neverything on go.wit.com"
				me.autoWorkingPwd.SetValue(notes)
				me.downloadEverythingButton.Disable()
				return
			} else {
				var notes string
				notes = "download everything failed"
				me.autoWorkingPwd.SetValue(notes)
				me.downloadEverythingButton.Enable()
			}
		})
	*/
	var listallB *gui.Node
	listallB = test1.NewButton("go.wit.com/list", func() {
		listallB.Disable()
		listWindow()
		listallB.Enable()
	})
	test1.NewButton("repostatus.ListAll()", func() {
		repostatus.ListAll()
	})
	test1.NewButton("repostatus.ScanGoSrc()", func() {
		repostatus.ScanGoSrc()
	})
}

func attemptAutoRebuild() {
	os.Setenv("GO111MODULE", "off")

	fullpath := "/home/jcarr/go/"
	quickCmd(fullpath, []string{"mkdir", "-p", "/home/jcarr/go/src/go.wit.com/apps/"})
	fullpath = "/home/jcarr/go/src/go.wit.com/apps/"

	quickCmd(fullpath, []string{"go", "get", "-v", "go.wit.com/apps/autotypist"})
	quickCmd(fullpath, []string{"go", "get", "-v", "go.wit.com/toolkits/debian"})
	quickCmd(fullpath, []string{"go", "get", "-v", "go.wit.com/toolkits/tree"})
	quickCmd(fullpath, []string{"go", "get", "-v", "go.wit.com/toolkits/nocui"})
	quickCmd(fullpath, []string{"go", "get", "-v", "go.wit.com/toolkits/gocui"})
	quickCmd(fullpath, []string{"go", "get", "-v", "go.wit.com/toolkits/andlabs"})

	fullpath = "/home/jcarr/go/src/go.wit.com/toolkits/nocui/"
	quickCmd(fullpath, []string{"go", "get", "-v", "-u", "."})
	quickCmd(fullpath, []string{"go", "build", "-v", "-x", "-buildmode=plugin", "-o", "../nocui.so"})

	fullpath = "/home/jcarr/go/src/go.wit.com/toolkits/gocui/"
	quickCmd(fullpath, []string{"go", "get", "-v", "-u", "."})
	quickCmd(fullpath, []string{"go", "build", "-v", "-x", "-buildmode=plugin", "-o", "../gocui.so"})

	fullpath = "/home/jcarr/go/src/go.wit.com/toolkits/andlabs/"
	quickCmd(fullpath, []string{"go", "get", "-v", "-u", "."})
	quickCmd(fullpath, []string{"go", "build", "-v", "-x", "-buildmode=plugin", "-o", "../andlabs.so"})

	fullpath = "/home/jcarr/go/src/go.wit.com/apps/autotypist"
	quickCmd(fullpath, []string{"go", "get", "-v", "-u", "."})
	quickCmd(fullpath, []string{"go", "build", "-v", "-x"})
}