Skip to content

Commit 17d4a70

Browse files
committed
introduce v2 of the code-generator package
1 parent 9ebb7f6 commit 17d4a70

File tree

23 files changed

+37
-34
lines changed

23 files changed

+37
-34
lines changed

go.mod

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
module github.com/kcp-dev/code-generator
1+
module github.com/kcp-dev/code-generator/v2
22

33
go 1.18
44

55
require (
6+
github.com/kcp-dev/code-generator v0.0.0-20221103165105-2dc1248118a7
67
github.com/onsi/ginkgo v1.16.5
78
github.com/onsi/gomega v1.20.1
89
github.com/spf13/cobra v1.4.0

go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANyt
6868
github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y=
6969
github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
7070
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
71+
github.com/kcp-dev/code-generator v0.0.0-20221103165105-2dc1248118a7 h1:ZCdSsY/oF01fxLMajM867hJJINoB6DhuVf6j4O9S37Y=
72+
github.com/kcp-dev/code-generator v0.0.0-20221103165105-2dc1248118a7/go.mod h1:QH3PS4O/Z3nyZzt5XLK8nqxwFnNEYo8ePkR8u+xj4ho=
7173
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
7274
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
7375
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=

pkg/generators/clientgen/clientgen.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ import (
2727
"sigs.k8s.io/controller-tools/pkg/genall"
2828
"sigs.k8s.io/controller-tools/pkg/markers"
2929

30-
"github.com/kcp-dev/code-generator/pkg/internal/clientgen"
31-
"github.com/kcp-dev/code-generator/pkg/parser"
32-
"github.com/kcp-dev/code-generator/pkg/util"
30+
"github.com/kcp-dev/code-generator/v2/pkg/internal/clientgen"
31+
"github.com/kcp-dev/code-generator/v2/pkg/parser"
32+
"github.com/kcp-dev/code-generator/v2/pkg/util"
3333
)
3434

3535
type Generator struct {

pkg/generators/informergen/informergen.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@ import (
2727
"sigs.k8s.io/controller-tools/pkg/genall"
2828
"sigs.k8s.io/controller-tools/pkg/markers"
2929

30-
"github.com/kcp-dev/code-generator/pkg/internal/informergen"
31-
"github.com/kcp-dev/code-generator/pkg/parser"
32-
"github.com/kcp-dev/code-generator/pkg/util"
30+
"github.com/kcp-dev/code-generator/v2/pkg/internal/informergen"
31+
"github.com/kcp-dev/code-generator/v2/pkg/parser"
32+
"github.com/kcp-dev/code-generator/v2/pkg/util"
3333
)
3434

3535
type Generator struct {

pkg/generators/listergen/listergen.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ import (
2626
"sigs.k8s.io/controller-tools/pkg/genall"
2727
"sigs.k8s.io/controller-tools/pkg/markers"
2828

29-
"github.com/kcp-dev/code-generator/pkg/internal/listergen"
30-
"github.com/kcp-dev/code-generator/pkg/parser"
31-
"github.com/kcp-dev/code-generator/pkg/util"
29+
"github.com/kcp-dev/code-generator/v2/pkg/internal/listergen"
30+
"github.com/kcp-dev/code-generator/v2/pkg/parser"
31+
"github.com/kcp-dev/code-generator/v2/pkg/util"
3232
)
3333

3434
type Generator struct {

pkg/internal/clientgen/clientset.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77

88
"k8s.io/code-generator/cmd/client-gen/types"
99

10-
"github.com/kcp-dev/code-generator/pkg/util"
10+
"github.com/kcp-dev/code-generator/v2/pkg/util"
1111
)
1212

1313
type ClientSet struct {

pkg/internal/clientgen/fake_clientset.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77

88
"k8s.io/code-generator/cmd/client-gen/types"
99

10-
"github.com/kcp-dev/code-generator/pkg/util"
10+
"github.com/kcp-dev/code-generator/v2/pkg/util"
1111
)
1212

1313
type FakeClientset struct {

pkg/internal/clientgen/fake_group.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ import (
77

88
"k8s.io/code-generator/cmd/client-gen/types"
99

10-
"github.com/kcp-dev/code-generator/pkg/parser"
11-
"github.com/kcp-dev/code-generator/pkg/util"
10+
"github.com/kcp-dev/code-generator/v2/pkg/parser"
11+
"github.com/kcp-dev/code-generator/v2/pkg/util"
1212
)
1313

1414
type FakeGroup struct {

pkg/internal/clientgen/fake_type.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ import (
1010
"k8s.io/apimachinery/pkg/util/sets"
1111
"k8s.io/code-generator/cmd/client-gen/types"
1212

13-
"github.com/kcp-dev/code-generator/pkg/parser"
14-
"github.com/kcp-dev/code-generator/pkg/util"
13+
"github.com/kcp-dev/code-generator/v2/pkg/parser"
14+
"github.com/kcp-dev/code-generator/v2/pkg/util"
1515
)
1616

1717
type FakeTypedClient struct {

pkg/internal/clientgen/group.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ import (
77

88
"k8s.io/code-generator/cmd/client-gen/types"
99

10-
"github.com/kcp-dev/code-generator/pkg/parser"
11-
"github.com/kcp-dev/code-generator/pkg/util"
10+
"github.com/kcp-dev/code-generator/v2/pkg/parser"
11+
"github.com/kcp-dev/code-generator/v2/pkg/util"
1212
)
1313

1414
type Group struct {

pkg/internal/clientgen/scheme.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import (
77

88
"k8s.io/code-generator/cmd/client-gen/types"
99

10-
"github.com/kcp-dev/code-generator/pkg/util"
10+
"github.com/kcp-dev/code-generator/v2/pkg/util"
1111
)
1212

1313
type Scheme struct {

pkg/internal/clientgen/type.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ import (
77

88
"k8s.io/code-generator/cmd/client-gen/types"
99

10-
"github.com/kcp-dev/code-generator/pkg/parser"
11-
"github.com/kcp-dev/code-generator/pkg/util"
10+
"github.com/kcp-dev/code-generator/v2/pkg/parser"
11+
"github.com/kcp-dev/code-generator/v2/pkg/util"
1212
)
1313

1414
type TypedClient struct {

pkg/internal/informergen/factory.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import (
2020
"io"
2121
"text/template"
2222

23-
"github.com/kcp-dev/code-generator/pkg/parser"
23+
"github.com/kcp-dev/code-generator/v2/pkg/parser"
2424
)
2525

2626
type Factory struct {

pkg/internal/informergen/generic.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import (
2222

2323
"k8s.io/code-generator/cmd/client-gen/types"
2424

25-
"github.com/kcp-dev/code-generator/pkg/parser"
25+
"github.com/kcp-dev/code-generator/v2/pkg/parser"
2626
)
2727

2828
type Generic struct {

pkg/internal/informergen/groupinterface.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import (
2222

2323
"k8s.io/code-generator/cmd/client-gen/types"
2424

25-
"github.com/kcp-dev/code-generator/pkg/parser"
25+
"github.com/kcp-dev/code-generator/v2/pkg/parser"
2626
)
2727

2828
type GroupInterface struct {

pkg/internal/informergen/informer.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import (
2222

2323
"k8s.io/code-generator/cmd/client-gen/types"
2424

25-
"github.com/kcp-dev/code-generator/pkg/parser"
25+
"github.com/kcp-dev/code-generator/v2/pkg/parser"
2626
)
2727

2828
type Informer struct {

pkg/internal/informergen/parser.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ import (
2323

2424
"k8s.io/code-generator/cmd/client-gen/types"
2525

26-
"github.com/kcp-dev/code-generator/pkg/parser"
27-
"github.com/kcp-dev/code-generator/pkg/util"
26+
"github.com/kcp-dev/code-generator/v2/pkg/parser"
27+
"github.com/kcp-dev/code-generator/v2/pkg/util"
2828
)
2929

3030
var (

pkg/internal/informergen/versioninterface.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import (
2222

2323
"k8s.io/code-generator/cmd/client-gen/types"
2424

25-
"github.com/kcp-dev/code-generator/pkg/parser"
25+
"github.com/kcp-dev/code-generator/v2/pkg/parser"
2626
)
2727

2828
type VersionInterface struct {

pkg/internal/listergen/expansions.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import (
66

77
clientgentypes "k8s.io/code-generator/cmd/client-gen/types"
88

9-
"github.com/kcp-dev/code-generator/pkg/parser"
9+
"github.com/kcp-dev/code-generator/v2/pkg/parser"
1010
)
1111

1212
type Expansions struct {

pkg/internal/listergen/lister.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import (
66

77
clientgentypes "k8s.io/code-generator/cmd/client-gen/types"
88

9-
"github.com/kcp-dev/code-generator/pkg/parser"
9+
"github.com/kcp-dev/code-generator/v2/pkg/parser"
1010
)
1111

1212
type Lister struct {

pkg/internal/listergen/parser.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import (
2020
"strings"
2121
"text/template"
2222

23-
"github.com/kcp-dev/code-generator/pkg/util"
23+
"github.com/kcp-dev/code-generator/v2/pkg/util"
2424
)
2525

2626
var (

pkg/parser/types.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ import (
2020
"k8s.io/apimachinery/pkg/util/sets"
2121
"k8s.io/code-generator/cmd/client-gen/types"
2222

23-
"github.com/kcp-dev/code-generator/pkg/util"
24-
"github.com/kcp-dev/code-generator/third_party/namer"
23+
"github.com/kcp-dev/code-generator/v2/pkg/util"
24+
"github.com/kcp-dev/code-generator/v2/third_party/namer"
2525
)
2626

2727
type Kind struct {

third_party/namer/namer_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ package namer
1919
import (
2020
"testing"
2121

22-
"github.com/kcp-dev/code-generator/pkg/util"
22+
"github.com/kcp-dev/code-generator/v2/pkg/util"
2323
)
2424

2525
func TestNamer(t *testing.T) {

0 commit comments

Comments
 (0)