mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-10 20:42:26 +00:00
Renamed gengo SourcePath -> Dir
This commit is contained in:
parent
96b91f364a
commit
7a084b3352
@ -325,7 +325,7 @@ func GetTargets(context *generator.Context, args *args.Args) []generator.Target
|
||||
&generator.SimpleTarget{
|
||||
PkgName: filepath.Base(pkg.Path),
|
||||
PkgPath: pkg.Path,
|
||||
PkgDir: pkg.SourcePath, // output pkg is the same as the input
|
||||
PkgDir: pkg.Dir, // output pkg is the same as the input
|
||||
HeaderComment: boilerplate,
|
||||
FilterFunc: func(c *generator.Context, t *types.Type) bool {
|
||||
return t.Name.Package == typesPkg.Path
|
||||
|
@ -189,7 +189,7 @@ func GetTargets(context *generator.Context, args *args.Args) []generator.Target
|
||||
&generator.SimpleTarget{
|
||||
PkgName: strings.Split(filepath.Base(pkg.Path), ".")[0],
|
||||
PkgPath: pkg.Path,
|
||||
PkgDir: pkg.SourcePath, // output pkg is the same as the input
|
||||
PkgDir: pkg.Dir, // output pkg is the same as the input
|
||||
HeaderComment: boilerplate,
|
||||
FilterFunc: func(c *generator.Context, t *types.Type) bool {
|
||||
return t.Name.Package == pkg.Path
|
||||
|
@ -419,7 +419,7 @@ func GetTargets(context *generator.Context, args *args.Args) []generator.Target
|
||||
&generator.SimpleTarget{
|
||||
PkgName: filepath.Base(pkg.Path),
|
||||
PkgPath: pkg.Path,
|
||||
PkgDir: pkg.SourcePath, // output pkg is the same as the input
|
||||
PkgDir: pkg.Dir, // output pkg is the same as the input
|
||||
HeaderComment: boilerplate,
|
||||
|
||||
FilterFunc: func(c *generator.Context, t *types.Type) bool {
|
||||
|
@ -182,7 +182,7 @@ func Run(g *Generator) {
|
||||
log.Fatalf("BUG: can't find input modifiers for %q", input)
|
||||
}
|
||||
pkg := c.Universe[input]
|
||||
protopkg := newProtobufPackage(pkg.Path, pkg.SourcePath, mod.name, mod.allTypes, omitTypes)
|
||||
protopkg := newProtobufPackage(pkg.Path, pkg.Dir, mod.name, mod.allTypes, omitTypes)
|
||||
header := append([]byte{}, boilerplate...)
|
||||
header = append(header, protopkg.HeaderComment...)
|
||||
protopkg.HeaderComment = header
|
||||
|
@ -230,7 +230,7 @@ func GetTargets(context *generator.Context, args *args.Args) []generator.Target
|
||||
&generator.SimpleTarget{
|
||||
PkgName: strings.Split(filepath.Base(pkg.Path), ".")[0],
|
||||
PkgPath: pkg.Path,
|
||||
PkgDir: pkg.SourcePath, // output pkg is the same as the input
|
||||
PkgDir: pkg.Dir, // output pkg is the same as the input
|
||||
HeaderComment: boilerplate,
|
||||
FilterFunc: func(c *generator.Context, t *types.Type) bool {
|
||||
return t.Name.Package == pkg.Path
|
||||
|
@ -63,7 +63,7 @@ func GetTargets(context *generator.Context, args *args.Args) []generator.Target
|
||||
continue
|
||||
}
|
||||
registerFileName := "register.go"
|
||||
searchPath := path.Join(pkg.SourcePath, registerFileName)
|
||||
searchPath := path.Join(pkg.Dir, registerFileName)
|
||||
if _, err := os.Stat(path.Join(searchPath)); err == nil {
|
||||
klog.V(5).Infof("skipping the generation of %s file because %s already exists in the path %s", args.OutputFile, registerFileName, searchPath)
|
||||
continue
|
||||
@ -103,8 +103,8 @@ func GetTargets(context *generator.Context, args *args.Args) []generator.Target
|
||||
targets = append(targets,
|
||||
&generator.SimpleTarget{
|
||||
PkgName: pkg.Name,
|
||||
PkgPath: pkg.Path, // output to same pkg as input
|
||||
PkgDir: pkg.SourcePath, // output to same pkg as input
|
||||
PkgPath: pkg.Path, // output to same pkg as input
|
||||
PkgDir: pkg.Dir, // output to same pkg as input
|
||||
HeaderComment: boilerplate,
|
||||
GeneratorsFunc: func(c *generator.Context) (generators []generator.Generator) {
|
||||
return []generator.Generator{
|
||||
|
Loading…
Reference in New Issue
Block a user