Skip to content

Commit 4e92be8

Browse files
authored
fix: change folder prefix for adding headers (#2688)
In this PR: - Change post processor to add header when the folder name starts with `proto-` or `grpc-`. - Change post processor to add pom.xml when the folder name starts with `proto-` or `grpc-`. Context: we received a library generation request which the library name doesn't start with `google-` (b/329445405). The generated library has two issues: 1) pom.xml is not generated in `proto-` folder; 2) files in `proto-` folder have no header. This library uses REST so no `grpc-` folder was generated.
1 parent e2680e1 commit 4e92be8

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

library_generation/owlbot/src/fix-license-headers.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,10 @@
2121

2222
# Until the generator generates license headers on generated proto
2323
# classes, add the license headers in
24-
for path in glob.glob("proto-google-*"):
24+
for path in glob.glob("proto-*"):
2525
java.fix_proto_headers(root / path)
2626

2727
# Until the generator generates license headers on generated grpc
2828
# classes, add the license headers in
29-
for path in glob.glob("grpc-google-*"):
29+
for path in glob.glob("grpc-*"):
3030
java.fix_grpc_headers(root / path, "unused")

library_generation/owlbot/src/fix-poms.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ def main(versions_file, monorepo):
383383
# Missing Case 2: There's a new proto-XXX and grpc-XXX directory. It's a new
384384
# version in the proto file to a library. Both a new library and existing
385385
# library.
386-
for path in glob.glob("proto-google-*"):
386+
for path in glob.glob("proto-*"):
387387
if not path in existing_modules:
388388
existing_modules[path] = module.Module(
389389
group_id=__proto_group_id(group_id),
@@ -422,7 +422,7 @@ def main(versions_file, monorepo):
422422
release_version=main_module.release_version,
423423
)
424424

425-
for path in glob.glob("grpc-google-*"):
425+
for path in glob.glob("grpc-*"):
426426
if not path in existing_modules:
427427
existing_modules[path] = module.Module(
428428
group_id=__proto_group_id(group_id),

0 commit comments

Comments
 (0)