Renamed gengo SourcePath -> Dir
This commit is contained in:
		@@ -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
 | 
			
		||||
@@ -104,7 +104,7 @@ func GetTargets(context *generator.Context, args *args.Args) []generator.Target
 | 
			
		||||
			&generator.SimpleTarget{
 | 
			
		||||
				PkgName:       pkg.Name,
 | 
			
		||||
				PkgPath:       pkg.Path, // output to same pkg as input
 | 
			
		||||
				PkgDir:        pkg.SourcePath, // 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{
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user