This repository was archived by the owner on Mar 6, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 146
/
Copy pathalldocs.go
216 lines (143 loc) · 5.71 KB
/
alldocs.go
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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
// DO NOT EDIT THIS FILE.
//go:generate gb help documentation
/*
gb, a project based build tool for the Go programming language.
Usage:
gb command [arguments]
The commands are:
build build a package
doc show documentation for a package or symbol
env print project environment variables
generate generate Go files by processing source
info info returns information about this project
list list the packages named by the importpaths
test test packages
Use "gb help [command]" for more information about a command.
Additional help topics:
plugin plugin information
project gb project layout
Use "gb help [topic]" for more information about that topic.
Build a package
Usage:
gb build [build flags] [packages]
Build compiles the packages named by the import paths, along with their
dependencies.
Flags:
-f
ignore cached packages if present, new packages built will overwrite
any cached packages. This effectively disables incremental
compilation.
-F
do not cache packages, cached packages will still be used for
incremental compilation. -f -F is advised to disable the package
caching system.
-P
The number of build jobs to run in parallel, including test execution.
By default this is the number of CPUs visible to gb.
-R
sets the base of the project root search path from the current working
directory to the value supplied. Effectively gb changes working
directory to this path before searching for the project root.
-dotfile
if provided, gb will output a dot formatted file of the build steps to
be performed.
-ldflags 'flag list'
arguments to pass on each linker invocation.
-gcflags 'arg list'
arguments to pass on each compile invocation.
-race
enable data race detection.
Supported only on linux/amd64, freebsd/amd64, darwin/amd64 and windows/amd64.
-tags 'tag list'
additional build tags.
The list flags accept a space-separated list of strings. To embed spaces in an
element in the list, surround it with either single or double quotes.
For more about where packages and binaries are installed, run 'gb help project'.
Show documentation for a package or symbol
Usage:
gb doc <pkg> <sym>[.<method>]
Doc shows documentation for a package or symbol.
See 'go help doc'.
Print project environment variables
Usage:
gb env [var ...]
Env prints project environment variables. If one or more variable names is
given as arguments, env prints the value of each named variable on its own line.
Generate Go files by processing source
Usage:
gb generate [-run regexp] [file.go... | packages]
Generate runs commands described by directives within existing files.
Those commands can run any process, but the intent is to create or update Go
source files, for instance by running yacc.
See 'go help generate'.
Info returns information about this project
Usage:
gb info [var ...]
info prints gb environment information.
Values:
GB_PROJECT_DIR
The root of the gb project.
GB_SRC_PATH
The list of gb project source directories.
GB_PKG_DIR
The path of the gb project's package cache.
GB_BIN_SUFFIX
The suffix applied any binary written to $GB_PROJECT_DIR/bin
GB_GOROOT
The value of runtime.GOROOT for the Go version that built this copy of gb.
info returns 0 if the project is well formed, and non zero otherwise.
If one or more variable names is given as arguments, info prints the
value of each named variable on its own line.
List the packages named by the importpaths
Usage:
gb list [-s] [-f format] [-json] [packages]
List lists packages imported by the project.
The default output shows the package import paths:
% gb list github.com/constabulary/...
github.com/constabulary/gb
github.com/constabulary/gb/cmd
github.com/constabulary/gb/cmd/gb
github.com/constabulary/gb/cmd/gb-env
github.com/constabulary/gb/cmd/gb-list
Flags:
-f
alternate format for the list, using the syntax of package template.
The default output is equivalent to -f '{{.ImportPath}}'. The struct
being passed to the template is currently an instance of gb.Package.
This structure is under active development and it's contents are not
guaranteed to be stable.
-s
read format template from STDIN.
-json
prints output in structured JSON format. WARNING: gb.Package
structure is not stable and will change in the future!
Plugin information
gb supports git style plugins.
A gb plugin is anything in the $PATH with the prefix gb-. In other words
gb-something, becomes gb something.
gb plugins are executed from the parent gb process with the environment
variable, GB_PROJECT_DIR set to the root of the current project.
gb plugins can be executed directly but this is rarely useful, so authors
should attempt to diagnose this by looking for the presence of the
GB_PROJECT_DIR environment key.
Gb project layout
A gb project is defined as any directory that contains a src/ subdirectory.
gb automatically detects the root of the project by looking at the current
working directory and walking backwards until it finds a directory that
contains a src/ subdirectory.
In the event you wish to override this auto detection mechanism, the -R flag
can be used to supply a project root.
See http://getgb.io/docs/project for details
Test packages
Usage:
gb test [build flags] -n -v [packages] [flags for test binary]
Test automates testing the packages named by the import paths.
'gb test' recompiles each package along with any files with names matching
the file pattern "*_test.go".
Flags:
-v
print output from test subprocess.
-n
do not execute test binaries, compile only
*/
package main