MCPcopy Index your code
hub / github.com/codegangsta/gin / build

Function build

main.go:230–261  ·  view source on GitHub ↗
(builder gin.Builder, runner gin.Runner, logger *log.Logger)

Source from the content-addressed store, hash-verified

228}
229
230func build(builder gin.Builder, runner gin.Runner, logger *log.Logger) {
231 logger.Println("Building...")
232
233 if notifications {
234 notifier.Push("Build Started!", "Building "+builder.Binary()+"...", "", notificator.UR_NORMAL)
235 }
236 err := builder.Build()
237 if err != nil {
238 buildError = err
239 logger.Printf("%sBuild failed%s\n", colorRed, colorReset)
240 fmt.Println(builder.Errors())
241 buildErrors := strings.Split(builder.Errors(), "\n")
242 if notifications {
243 if err := notifier.Push("Build FAILED!", buildErrors[1], "", notificator.UR_CRITICAL); err != nil {
244 logger.Println("Notification send failed")
245 }
246 }
247 } else {
248 buildError = nil
249 logger.Printf("%sBuild finished%s\n", colorGreen, colorReset)
250 if immediate {
251 runner.Run()
252 }
253 if notifications {
254 if err := notifier.Push("Build Succeded", "Build Finished!", "", notificator.UR_CRITICAL); err != nil {
255 logger.Println("Notification send failed")
256 }
257 }
258 }
259
260 time.Sleep(100 * time.Millisecond)
261}
262
263type scanCallback func(path string)
264

Callers 1

MainActionFunction · 0.85

Calls 4

BinaryMethod · 0.65
BuildMethod · 0.65
ErrorsMethod · 0.65
RunMethod · 0.65

Tested by

no test coverage detected