Skip to content

Commit

Permalink
fix(java): relax license header replacement regex and use current year (
Browse files Browse the repository at this point in the history
#383)

* fix(java): relax license header replacement regex and use current year

* fix: hardcode 2020 as the license year

* chore: remove unused import
  • Loading branch information
chingor13 committed Jan 22, 2020
1 parent 2d53d93 commit 4687976
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions synthtool/languages/java.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
DEFAULT_FORMAT_VERSION = "1.7"
GOOD_LICENSE = """
/*
* Copyright 2019 Google LLC
* Copyright 2020 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -45,7 +45,7 @@
"""
PROTOBUF_HEADER = "// Generated by the protocol buffer compiler. DO NOT EDIT!"
BAD_LICENSE = """/\\*
\\* Copyright 2018 Google LLC
\\* Copyright \\d{4} Google LLC
\\*
\\* Licensed under the Apache License, Version 2.0 \\(the "License"\\); you may not use this file except
\\* in compliance with the License. You may obtain a copy of the License at
Expand Down Expand Up @@ -96,6 +96,7 @@ def fix_proto_headers(proto_root: Path) -> None:
PROTOBUF_HEADER,
f"{GOOD_LICENSE}{PROTOBUF_HEADER}",
)
# https://github.com/googleapis/gapic-generator/issues/3074
s.replace(
[proto_root / "src/**/*Name.java", proto_root / "src/**/*Names.java"],
BAD_LICENSE,
Expand Down

0 comments on commit 4687976

Please sign in to comment.