forked from innius/grafana-simple-grpc-datasource
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMagefile.go
More file actions
28 lines (22 loc) · 768 Bytes
/
Magefile.go
File metadata and controls
28 lines (22 loc) · 768 Bytes
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
//+build mage
package main
import (
"fmt"
// mage:import
"github.com/magefile/mage/sh"
// mage:import
build "github.com/grafana/grafana-plugin-sdk-go/build"
)
// Hello prints a message (shows that you can define custom Mage targets).
func Hello() {
fmt.Println("hello plugin developer!")
}
// Compiles protobuf definitions as defined in .pkg/proto to go-code
func Protoc() error {
//protoc --go_out=. --go_opt=paths=source_relative \
// --go-grpc_out=. --go-grpc_opt=paths=source_relative \
// pkg/proto/api.proto
return sh.RunV("protoc", "--go_out=.", "--go_opt=paths=source_relative", "--go-grpc_out=.", "--go-grpc_opt=paths=source_relative", "pkg/proto/v2/apiv2.proto")
}
// Default configures the default target.
var Default = build.BuildAll