Skip to content
This repository was archived by the owner on Oct 15, 2024. It is now read-only.

Commit 7fdc4fe

Browse files
committed
Consolidate Makefile, flatten zwgen
1 parent cb5a9e4 commit 7fdc4fe

22 files changed

+21
-59
lines changed

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
.PHONY: test
22

33
generate:
4+
go generate ./gen
45
go generate ./cc
56

67
interceptty:

cc/command-classes.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ import (
77
"sync"
88
)
99

10-
//go:generate zwgen command-classes -c zwgen.config.yaml -o .
11-
//go:generate zwgen parser -c zwgen.config.yaml -o ./command-classes.gen.go
12-
//go:generate zwgen devices -c zwgen.config.yaml -o ./devices.gen.go
10+
//go:generate go run ../gen/main.go command-classes -c gen.config.yaml -o .
11+
//go:generate go run ../gen/main.go parser -c gen.config.yaml -o ./command-classes.gen.go
12+
//go:generate go run ../gen/main.go devices -c gen.config.yaml -o ./devices.gen.go
1313

1414
type (
1515
CommandClassID byte
File renamed without changes.
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,3 @@
55
### Command Class User Code
66

77
- `USER_CODE` param is listed as an `ARRAY`, but `VARIANT` matches the documentation.
8-
Lines changed: 4 additions & 27 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package zwgen
1+
package gen
22

33
import (
44
"bytes"
@@ -16,7 +16,7 @@ import (
1616
"golang.org/x/tools/imports"
1717
)
1818

19-
//go:generate go-bindata -pkg=zwgen templates/... data/...
19+
//go:generate go-bindata -pkg=gen templates/... data/...
2020

2121
type Generator struct {
2222
output string
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package zwgen
1+
package gen
22

33
import (
44
"regexp"

zwgen/main.go renamed to gen/main.go

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
// +build ignore
2+
13
package main
24

35
import (
@@ -6,13 +8,13 @@ import (
68
"os"
79

810
"github.com/codegangsta/cli"
9-
"github.com/gozwave/gozw/zwgen/zwgen"
11+
"github.com/gozwave/gozw/gen"
1012
)
1113

1214
func main() {
1315

1416
app := cli.NewApp()
15-
app.Name = "zwgen"
17+
app.Name = ""
1618
app.Usage = "Generate code for the Z-Wave protocol"
1719

1820
before := func(c *cli.Context) error {
@@ -45,7 +47,7 @@ func main() {
4547
},
4648
Before: before,
4749
Action: func(ctx *cli.Context) {
48-
gen, err := zwgen.NewGenerator(ctx.String("output"), ctx.String("config"))
50+
gen, err := gen.NewGenerator(ctx.String("output"), ctx.String("config"))
4951
if err != nil {
5052
fmt.Println(err)
5153
os.Exit(1)
@@ -73,7 +75,7 @@ func main() {
7375
},
7476
Before: before,
7577
Action: func(ctx *cli.Context) {
76-
gen, err := zwgen.NewGenerator(ctx.String("output"), ctx.String("config"))
78+
gen, err := gen.NewGenerator(ctx.String("output"), ctx.String("config"))
7779
if err != nil {
7880
fmt.Println(err)
7981
os.Exit(1)
@@ -102,7 +104,7 @@ func main() {
102104
},
103105
Before: before,
104106
Action: func(ctx *cli.Context) {
105-
gen, err := zwgen.NewGenerator(ctx.String("output"), ctx.String("config"))
107+
gen, err := gen.NewGenerator(ctx.String("output"), ctx.String("config"))
106108
if err != nil {
107109
fmt.Println(err)
108110
os.Exit(1)
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package zwgen
1+
package gen
22

33
type ArrayAttrib struct {
44
Key string `xml:"key,attr"`

0 commit comments

Comments
 (0)