-
Notifications
You must be signed in to change notification settings - Fork 14
/
generate.go
39 lines (36 loc) · 1.21 KB
/
generate.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
package main
import (
"github.com/solo-io/go-utils/log"
"github.com/solo-io/solo-kit/pkg/code-generator/cmd"
"github.com/solo-io/solo-kit/pkg/code-generator/schemagen"
"github.com/solo-io/solo-kit/pkg/code-generator/sk_anyvendor"
)
//go:generate go run generate.go
//go:generate ./api/v1/generate.sh
//go:generate ./pkg/api/v1/apiserver/generate.sh
func main() {
log.Printf("starting generate")
if err := cmd.Generate(cmd.GenerateOptions{
RelativeRoot: ".",
CompileProtos: true,
SkipGenMocks: true,
SkipGeneratedTests: true,
ExternalImports: &sk_anyvendor.Imports{
Local: []string{"test/**/*.proto", "api/**/*.proto", sk_anyvendor.SoloKitMatchPattern},
External: map[string][]string{
sk_anyvendor.ExtProtoMatcher.Package: sk_anyvendor.ExtProtoMatcher.Patterns,
sk_anyvendor.EnvoyValidateProtoMatcher.Package: sk_anyvendor.EnvoyValidateProtoMatcher.Patterns,
},
},
ValidationSchemaOptions: &schemagen.ValidationSchemaOptions{
// Path to where test CRDs are stored
CrdDirectory: "test/mocks/crds",
JsonSchemaTool: "protoc",
MessagesWithEmptySchema: []string{
"core.solo.io.Status",
},
},
}); err != nil {
log.Fatalf("generate failed!: %v", err)
}
}