-
Notifications
You must be signed in to change notification settings - Fork 31
/
main.go
30 lines (24 loc) · 968 Bytes
/
main.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
package main
import (
"flag"
"path/filepath"
"github.com/wavesplatform/gowaves/pkg/ride/generate/internal"
)
var (
rideObjectsPath = flag.String("ride-objects-path", "compiler/stdlib/ride_objects.json", "Path to ride objects JSON file.")
outputDir = flag.String("output-dir", ".", "Directory where generated files will be placed.")
)
func filePath(fn string) string {
return filepath.Join(*outputDir, fn)
}
func main() {
flag.Parse()
rideObjectsPath := *rideObjectsPath
internal.GenerateConstants(filePath("constants.gen.go"))
internal.GenerateObjects(rideObjectsPath, filePath("objects.gen.go"))
internal.GenerateConstructors(rideObjectsPath, filePath("constructors.gen.go"))
// internal.GenerateFunctions must be invoked after internal.GenerateConstructors
internal.GenerateFunctions(filePath("functions.gen.go"))
internal.GenerateFunctionFamilies(filePath("function_families.gen.go"))
internal.GenerateTuples(filePath("tuples.gen.go"))
}