Skip to content

Commit

Permalink
Suffix generated Go files with .gen.go
Browse files Browse the repository at this point in the history
This way it is easier to exclude generated source code from the repo.
  • Loading branch information
lassilaiho committed May 4, 2021
1 parent 94420cc commit 4374d43
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 536 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@ cmd/ros2ctest/roslogging
#go tool cgo output
_obj

pkg/ros2/msgs/*
# generated Go files
*.gen.go
2 changes: 1 addition & 1 deletion pkg/gogen/all-messages-parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (

func GenerateROS2AllMessagesImporter(destPathPkgRoot string, ros2Messages map[string]*ROS2Message) error {

destFilePath := filepath.Join(destPathPkgRoot, "..", "msgs", "ros2msgs.go")
destFilePath := filepath.Join(destPathPkgRoot, "..", "msgs", "ros2msgs.gen.go")

destFile, err := mkdir_p(destFilePath)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion pkg/gogen/error-parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ func prepareErrorTypesCFileMatchingRegexp() {
}

func GenerateROS2ErrorTypes(rootPath, destPathPkgRoot, rclcPath string) error {
destFilePath := filepath.Join(destPathPkgRoot, "..", "ros2-error-types.go")
destFilePath := filepath.Join(destPathPkgRoot, "..", "ros2-error-types.gen.go")

ros2ErrorsList := list.New()

Expand Down
2 changes: 1 addition & 1 deletion pkg/gogen/ros2-messages-parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ func ParseMessageMetadataFromPath(p string, md *ROS2Message) error {
}

func CreateTargetGolangTypeFile(destPathPkgRoot string, md *ROS2Message) (*os.File, error) {
destFilePath := filepath.Join(destPathPkgRoot, md.RosPackage, "msg", md.RosMsgName+".go")
destFilePath := filepath.Join(destPathPkgRoot, md.RosPackage, "msg", md.RosMsgName+".gen.go")
destFile, err := mkdir_p(destFilePath)
if err != nil {
return nil, err
Expand Down
2 changes: 1 addition & 1 deletion pkg/gogen/rosidl_runtime_c-parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import (

func Generate_rosidl_runtime_c_sequence_handlers(destPathPkgRoot string) error {

destFilePath := filepath.Join(destPathPkgRoot, "..", "rosidl_runtime_c", "Primitives.go")
destFilePath := filepath.Join(destPathPkgRoot, "..", "rosidl_runtime_c", "Primitives.gen.go")

destFile, err := mkdir_p(destFilePath)
if err != nil {
Expand Down
Loading

0 comments on commit 4374d43

Please sign in to comment.