-
Notifications
You must be signed in to change notification settings - Fork 31
/
doc.go
73 lines (73 loc) · 2.09 KB
/
doc.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
// Package godo is a task runner, file watcher in the spirit of Rake, Gulp ...
//
// To install
//
// go get -u gopkg.in/godo.v1/cmd/godo
//
// As an example, create a file 'tasks/Godofile.go' with this content
//
// package main
//
// import (
// . "gokpkg.in/godo.v1"
// )
//
// func Tasks(p *Project) {
// Env = "GOPATH=.vendor:$GOPATH OTHER_VAR=val"
//
// p.Task("default", D{"hello", "build"})
//
// p.Task("hello", func() {
// Bash("echo Hello $USER!")
// })
//
// p.Task("build", W{"**/*.go"}, func() {
// Run("GOOS=linux GOARCH=amd64 go build", In{"cmd/godo"})
// })
//
// p.Task("server", D{"views"}, W{"**/*.go"}, Debounce(3000), func() {
// // Start recompiles and restarts on changes when watching
// Start("main.go", In{"cmd/server"})
// })
// }
//
// func main() {
// Godo(Tasks)
// }
//
// To run "views" task from terminal
//
// godo views
//
// To rerun "views" whenever any `*.go.html` file changes
//
// godo views --watch
//
// To run the "default" task which runs "hello" and "views"
//
// godo
//
// Task names may add a "?" suffix to indicate run only once
//
// // run once regardless of number of dependees
// p.Task("build?", func() {})
//
// Task options
//
// D{} or Dependencies{} - dependent tasks which run before task
// Debounce - minimum milliseconds before task can run again
// W{} or Watches{} - array of glob file patterns to watch
//
// /**/ - match zero or more directories
// {a,b} - match a or b, no spaces
// * - match any non-separator char
// ? - match a single non-separator char
// **/ - match any directory, start of pattern only
// /** - match any this directory, end of pattern only
// ! - removes files from resultset, start of pattern only
//
// Task handlers
//
// func() {} - Simple function handler
// func(c *Context) {} - Handler which accepts the current context
package godo