Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing import paths so generated headers work #161

Merged
merged 4 commits into from
May 24, 2024

Commits on May 23, 2024

  1. Fixing import paths so generated headers work

    The protobuf compiler uses the concept of a "canonical" path when
    generating source files. This is the base point where it searches for
    import files. It _expects_ that path will match the base path for
    searching for headers, too. The end result is that
    
        import "v1/ustatus.proto"
    
    will generate a C++ header that contains
    
        #include "v1/ustatus.pb.h"
    
    while we have been explicitly asked to use includes starting with
    `uprotocol` in up-cpp:
    
        #include "uprotocol/v1/ustatus.pb.h"
    
    We were able to work around this with some tricks when the import paths
    were file names only (e.g. `import ustatus.proto`). However, the proto
    files have moved under the `v1/` directory as of eclipse-uprotocol#141.
    
    Based on my reading of the protoc documentation and several stack
    overflow postings, it seems the intended way for .proto files to be
    written in this scenario is to import the full canonical path as
    intended for the output files:
    
        import "uprotocol/v1/ustatus.proto"
    
    so that protoc can generate the correct paths in output sources in the
    first place.
    gregmedd committed May 23, 2024
    1 Configuration menu
    Copy the full SHA
    b9d142e View commit details
    Browse the repository at this point in the history
  2. Fix the proto Include paths in CI

    The generated code needs to be in the `uprotocol` namespace folder structure for clarity however the protos root was the uprotocol folder so generated code was missing the uprotocol folder. This change fixes the protos and cleans up the build to still work and validate the build/changes.
    czfdcn authored and gregmedd committed May 23, 2024
    Configuration menu
    Copy the full SHA
    25731fa View commit details
    Browse the repository at this point in the history

Commits on May 24, 2024

  1. Remove --file flag from CI mvn commands

    Applying suggestions from review.
    
    This parameter should not be needed when pom.xml is in the current directory.
    
    Co-authored-by: Steven Hartley <steven@orangepeel.ca>
    gregmedd and stevenhartley authored May 24, 2024
    Configuration menu
    Copy the full SHA
    8321686 View commit details
    Browse the repository at this point in the history
  2. Removing another --file, fixing the proto root path

    The --file flag is not needed since pom.xml is in the repo root now.
    
    The proto source root was also pointing to the wrong place now that the
    xml file has been moved up a directory.
    
    Also fixing the URLs for the project/repository since they were pointing
    to the old core API archive.
    gregmedd committed May 24, 2024
    Configuration menu
    Copy the full SHA
    5e6172e View commit details
    Browse the repository at this point in the history