Skip to content

Consider grouping services by library in generator config #10237

@dbolduc

Description

@dbolduc

Our repo has a structure to it. We have services contained in libraries. If the generator configuration reflects that, it will help us maintain consistency and confidence in our documentation across all libraries. I am thinking something like:

message LibraryConfiguration {
  string name = 1;
  string display_name = 2;
  string description = 3;
  string cloud_service_root = 4;
  string cloud_service_docs = 5;
  string cloud_quickstart = 6;
  bool experimental = 7;
  repeated ServiceConfiguration service = 8;

  // we can add more knobs, but we should be cautious about doing so.
}

message GeneratorConfiguration {
  repeated LibraryConfiguration library = 1;

  // Support standalone services, for libraries that have handwritten documentation.
  repeated ServiceConfiguration service = 2;
}

At the moment, we generate many things in the scaffolding.

{"config.cmake.in", GenerateCmakeConfigIn},
{"README.md", GenerateReadme},
{"BUILD.bazel", GenerateBuild},
{"CMakeLists.txt", GenerateCMakeLists},
{"doc/main.dox", GenerateDoxygenMainPage},
{"doc/options.dox", GenerateDoxygenOptionsPage},
{"quickstart/README.md", GenerateQuickstartReadme},
{"quickstart/quickstart.cc", GenerateQuickstartSkeleton},
{"quickstart/CMakeLists.txt", GenerateQuickstartCMake},
{"quickstart/Makefile", GenerateQuickstartMakefile},
{"quickstart/WORKSPACE.bazel", GenerateQuickstartWorkspace},
{"quickstart/BUILD.bazel", GenerateQuickstartBuild},
{"quickstart/.bazelrc", GenerateQuickstartBazelrc},
{"samples/BUILD.bazel", GenerateSamplesBuild},
{"samples/CMakeLists.txt", GenerateSamplesCMake},

I think (at least) the following should be generated for each LibraryConfiguration:

  • README.md
  • doc/main.dox
  • doc/options.dox
  • quickstart/.bazelrc
  • samples/BUILD.bazel
  • samples/CMakeLists.txt

We do not want to move things to the generator config, just because. Some things are easier to maintain in place, and impossible to generalize. An obvious example would be the quickstart/quickstart.cc's.

I explored this some in a branch. I started with the README.md and doc/main.dox:
https://github.com/googleapis/google-cloud-cpp/compare/main...dbolduc:google-cloud-cpp:generator-library-config-dev?expand=1

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: cleanupAn internal cleanup or hygiene concern.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions