-
Notifications
You must be signed in to change notification settings - Fork 8
/
tools.go
43 lines (36 loc) · 1.1 KB
/
tools.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
//go:build tools
// +build tools
package main
import (
"entgo.io/ent/entc"
"entgo.io/ent/entc/gen"
"entgo.io/ent/schema/field"
)
// go generate -tags tools -x ./...
//go:generate protoc -I./proto --go_out=./proto --go_opt=paths=source_relative --go-grpc_out=./proto --go-grpc_opt=paths=source_relative proto/parser/parser.proto
//go:generate go run github.com/99designs/[email protected] generate
//go:generate go run github.com/jmattheis/goverter/cmd/[email protected] gen -g wrapErrors -g ignoreUnexported ./conversion
//go:generate go run github.com/swaggo/swag/cmd/[email protected] init --generalInfo cmd/api/serve.go --output ./generated/docs
//go:generate go run tools.go
func main() {
generateEnt()
}
func generateEnt() {
err := entc.Generate("./db/schema", &gen.Config{
Target: "./generated/ent",
Package: "github.com/satisfactorymodding/smr-api/generated/ent",
Features: []gen.Feature{
gen.FeatureModifier,
gen.FeatureIntercept,
gen.FeatureSnapshot,
gen.FeatureExecQuery,
gen.FeatureUpsert,
},
IDType: &field.TypeInfo{
Type: field.TypeString,
},
})
if err != nil {
panic(err)
}
}