From 0c36f8d8a12250b23f6c8a9b92a48a4c442ce089 Mon Sep 17 00:00:00 2001 From: Diego Marquez Date: Thu, 18 Jan 2024 13:32:20 -0500 Subject: [PATCH 1/4] chore: update java template's license header year --- synthtool/languages/java.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/synthtool/languages/java.py b/synthtool/languages/java.py index 3ae198c09..7cd1b7425 100644 --- a/synthtool/languages/java.py +++ b/synthtool/languages/java.py @@ -29,7 +29,7 @@ JAR_DOWNLOAD_URL = "https://github.com/google/google-java-format/releases/download/google-java-format-{version}/google-java-format-{version}-all-deps.jar" DEFAULT_FORMAT_VERSION = "1.7" GOOD_LICENSE = """/* - * Copyright 2023 Google LLC + * Copyright 2024 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. From 8d5c4f91588a6b95f580566f2190a67bdcde574e Mon Sep 17 00:00:00 2001 From: diegomarquezp Date: Thu, 18 Jan 2024 19:02:39 +0000 Subject: [PATCH 2/4] update year in test files --- .../src/main/java/com/google/maps/foo/SomeService.java | 2 +- .../src/main/java/com/google/maps/foo/SomeMessage.java | 2 +- .../src/main/java/com/google/cloud/foo/SomeService.java | 2 +- .../src/main/java/com/google/cloud/foo/SomeMessage.java | 2 +- synthtool-image-id | 1 + tests/testdata/FooGrpcGolden.java | 2 +- tests/testdata/FooProtoGolden.java | 2 +- 7 files changed, 7 insertions(+), 6 deletions(-) create mode 100644 synthtool-image-id diff --git a/docker/owlbot/java/tests/new-client-maps/golden/grpc-google-maps-foo-v1/src/main/java/com/google/maps/foo/SomeService.java b/docker/owlbot/java/tests/new-client-maps/golden/grpc-google-maps-foo-v1/src/main/java/com/google/maps/foo/SomeService.java index d0a3ed300..9dc9d67de 100644 --- a/docker/owlbot/java/tests/new-client-maps/golden/grpc-google-maps-foo-v1/src/main/java/com/google/maps/foo/SomeService.java +++ b/docker/owlbot/java/tests/new-client-maps/golden/grpc-google-maps-foo-v1/src/main/java/com/google/maps/foo/SomeService.java @@ -1,5 +1,5 @@ /* - * Copyright 2023 Google LLC + * Copyright 2024 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/docker/owlbot/java/tests/new-client-maps/golden/proto-google-maps-foo-v1/src/main/java/com/google/maps/foo/SomeMessage.java b/docker/owlbot/java/tests/new-client-maps/golden/proto-google-maps-foo-v1/src/main/java/com/google/maps/foo/SomeMessage.java index 8bf43cda5..2980af9db 100644 --- a/docker/owlbot/java/tests/new-client-maps/golden/proto-google-maps-foo-v1/src/main/java/com/google/maps/foo/SomeMessage.java +++ b/docker/owlbot/java/tests/new-client-maps/golden/proto-google-maps-foo-v1/src/main/java/com/google/maps/foo/SomeMessage.java @@ -1,5 +1,5 @@ /* - * Copyright 2023 Google LLC + * Copyright 2024 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/docker/owlbot/java/tests/new-client/golden/grpc-google-cloud-foo-v1/src/main/java/com/google/cloud/foo/SomeService.java b/docker/owlbot/java/tests/new-client/golden/grpc-google-cloud-foo-v1/src/main/java/com/google/cloud/foo/SomeService.java index c2b90c39f..2a07c8de4 100644 --- a/docker/owlbot/java/tests/new-client/golden/grpc-google-cloud-foo-v1/src/main/java/com/google/cloud/foo/SomeService.java +++ b/docker/owlbot/java/tests/new-client/golden/grpc-google-cloud-foo-v1/src/main/java/com/google/cloud/foo/SomeService.java @@ -1,5 +1,5 @@ /* - * Copyright 2023 Google LLC + * Copyright 2024 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/docker/owlbot/java/tests/new-client/golden/proto-google-cloud-foo-v1/src/main/java/com/google/cloud/foo/SomeMessage.java b/docker/owlbot/java/tests/new-client/golden/proto-google-cloud-foo-v1/src/main/java/com/google/cloud/foo/SomeMessage.java index 80c4c497a..9ff3db8b8 100644 --- a/docker/owlbot/java/tests/new-client/golden/proto-google-cloud-foo-v1/src/main/java/com/google/cloud/foo/SomeMessage.java +++ b/docker/owlbot/java/tests/new-client/golden/proto-google-cloud-foo-v1/src/main/java/com/google/cloud/foo/SomeMessage.java @@ -1,5 +1,5 @@ /* - * Copyright 2023 Google LLC + * Copyright 2024 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/synthtool-image-id b/synthtool-image-id new file mode 100644 index 000000000..87df2efa3 --- /dev/null +++ b/synthtool-image-id @@ -0,0 +1 @@ +sha256:7cea87dfba6f9b021ddb936a7d14be6e9fdce9e293bf6da635ef16e3ba113e16 \ No newline at end of file diff --git a/tests/testdata/FooGrpcGolden.java b/tests/testdata/FooGrpcGolden.java index 26adcb544..64f7bb90e 100644 --- a/tests/testdata/FooGrpcGolden.java +++ b/tests/testdata/FooGrpcGolden.java @@ -1,5 +1,5 @@ /* - * Copyright 2023 Google LLC + * Copyright 2024 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. diff --git a/tests/testdata/FooProtoGolden.java b/tests/testdata/FooProtoGolden.java index afc75914d..75bfe578b 100644 --- a/tests/testdata/FooProtoGolden.java +++ b/tests/testdata/FooProtoGolden.java @@ -1,5 +1,5 @@ /* - * Copyright 2023 Google LLC + * Copyright 2024 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. From 060aa3a4c9a7fa14a73fc8f3f4b35a5da57d728c Mon Sep 17 00:00:00 2001 From: diegomarquezp Date: Thu, 18 Jan 2024 19:20:11 +0000 Subject: [PATCH 3/4] remove unwanted file --- synthtool-image-id | 1 - 1 file changed, 1 deletion(-) delete mode 100644 synthtool-image-id diff --git a/synthtool-image-id b/synthtool-image-id deleted file mode 100644 index 87df2efa3..000000000 --- a/synthtool-image-id +++ /dev/null @@ -1 +0,0 @@ -sha256:7cea87dfba6f9b021ddb936a7d14be6e9fdce9e293bf6da635ef16e3ba113e16 \ No newline at end of file From ad29609699ed93ad84746aaa0f5c91561183a8f0 Mon Sep 17 00:00:00 2001 From: diegomarquezp Date: Fri, 19 Jan 2024 15:53:56 +0000 Subject: [PATCH 4/4] compute license year dynamically --- synthtool/languages/java.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/synthtool/languages/java.py b/synthtool/languages/java.py index 7cd1b7425..90bd0eb8f 100644 --- a/synthtool/languages/java.py +++ b/synthtool/languages/java.py @@ -25,11 +25,13 @@ from synthtool.log import logger from pathlib import Path from typing import Any, Optional, Dict, Iterable, List +from datetime import date JAR_DOWNLOAD_URL = "https://github.com/google/google-java-format/releases/download/google-java-format-{version}/google-java-format-{version}-all-deps.jar" DEFAULT_FORMAT_VERSION = "1.7" -GOOD_LICENSE = """/* - * Copyright 2024 Google LLC +CURRENT_YEAR = date.today().year +GOOD_LICENSE = f"""/* + * Copyright {CURRENT_YEAR} Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License.