Skip to content

Commit 0bf5d15

Browse files
Merge branch 'googleapis:main' into main
2 parents 68e4ddf + 21bfc98 commit 0bf5d15

File tree

12 files changed

+1308
-1
lines changed

12 files changed

+1308
-1
lines changed

.kokoro/build.sh

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,27 @@ if [ -f "${KOKORO_GFILE_DIR}/secret_manager/java-bigqueryconnection-samples-secr
3333
source "${KOKORO_GFILE_DIR}/secret_manager/java-bigqueryconnection-samples-secrets"
3434
fi
3535

36+
if [[ -n "${BUILD_SUBDIR}" ]]
37+
then
38+
echo "Compiling and building all modules for ${BUILD_SUBDIR}"
39+
mvn clean install \
40+
-DskipTests \
41+
-Dclirr.skip \
42+
-Dflatten.skip \
43+
-Dcheckstyle.skip \
44+
-Djacoco.skip \
45+
-Denforcer.skip \
46+
--also-make \
47+
--projects "${BUILD_SUBDIR}"
48+
echo "Running in subdir: ${BUILD_SUBDIR}"
49+
pushd "${BUILD_SUBDIR}"
50+
fi
51+
3652
RETURN_CODE=0
3753

3854
case ${JOB_TYPE} in
3955
test)
56+
echo "SUREFIRE_JVM_OPT: ${SUREFIRE_JVM_OPT}"
4057
retry_with_backoff 3 10 \
4158
mvn test \
4259
-B -ntp \
@@ -48,7 +65,7 @@ case ${JOB_TYPE} in
4865
-Dflatten.skip=true \
4966
-Danimal.sniffer.skip=true \
5067
-Dmaven.wagon.http.retryHandler.count=5 \
51-
-T 1C
68+
-T 1C ${SUREFIRE_JVM_OPT}
5269
RETURN_CODE=$?
5370
echo "Finished running unit tests"
5471
;;
@@ -125,6 +142,12 @@ case ${JOB_TYPE} in
125142

126143
esac
127144

145+
if [[ -n "${BUILD_SUBDIR}" ]]
146+
then
147+
echo "restoring directory"
148+
popd
149+
fi
150+
128151
if [ "${REPORT_COVERAGE}" == "true" ]; then
129152
bash ${KOKORO_GFILE_DIR}/codecov.sh
130153
fi

.kokoro/dependencies.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,12 @@ function determineMavenOpts() {
4949

5050
export MAVEN_OPTS=$(determineMavenOpts)
5151

52+
if [[ -n "${BUILD_SUBDIR}" ]]
53+
then
54+
echo "Running in subdir: ${BUILD_SUBDIR}"
55+
pushd "${BUILD_SUBDIR}"
56+
fi
57+
5258
# this should run maven enforcer
5359
retry_with_backoff 3 10 \
5460
mvn install -B -V -ntp \
@@ -57,3 +63,9 @@ retry_with_backoff 3 10 \
5763
-Dclirr.skip=true
5864

5965
mvn -B dependency:analyze -DfailOnWarning=true
66+
67+
if [[ -n "${BUILD_SUBDIR}" ]]
68+
then
69+
echo "Leaving subdir: ${BUILD_SUBDIR}"
70+
popd
71+
fi

.kokoro/presubmit/common.cfg

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@ env_vars: {
2424
value: "test"
2525
}
2626

27+
# Well known environment variable to datastore tests
28+
env_vars: {
29+
key: "DATASTORE_PROJECT_ID"
30+
value: "cloud-java-ci-test"
31+
}
32+
2733
before_action {
2834
fetch_keystore {
2935
keystore_resource {

generation/check_non_release_please_versions.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,10 @@ for pomFile in $(find . -mindepth 2 -name pom.xml | sort ); do
1919
echo "Skipping version check for java-samples directory"
2020
continue
2121
fi
22+
if [[ "${pomFile}" =~ .*/samples/.* ]]; then
23+
echo "Skipping version check for samples directory"
24+
continue
25+
fi
2226

2327
if grep -n '<version>.*</version>' "$pomFile" | grep -v 'x-version-update'; then
2428
echo "Found version declaration(s) without x-version-update in: $pomFile"
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
#!/usr/bin/env python3
2+
# Copyright 2026 Google LLC
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
16+
import os
17+
import re
18+
import sys
19+
20+
def fix_copyright(path):
21+
if os.path.isfile(path):
22+
if path.endswith(".java"):
23+
_fix_file(path)
24+
elif os.path.isdir(path):
25+
for root, _, files in os.walk(path):
26+
for file in files:
27+
if file.endswith(".java"):
28+
_fix_file(os.path.join(root, file))
29+
30+
def _fix_file(file_path):
31+
with open(file_path, 'r') as f:
32+
content = f.read()
33+
34+
# Replace "Copyright [Year] Google LLC" or "Copyright [Year] Google Inc."
35+
# with "Copyright 2026 Google LLC"
36+
new_content = re.sub(
37+
r'Copyright \d{4} Google (Inc\.|LLC)',
38+
'Copyright 2026 Google LLC',
39+
content
40+
)
41+
42+
if new_content != content:
43+
with open(file_path, 'w') as f:
44+
f.write(new_content)
45+
print(f"Updated copyright in {file_path}")
46+
47+
if __name__ == "__main__":
48+
if len(sys.argv) < 2:
49+
print("Usage: fix_copyright_headers.py <file_or_directory_path> ...")
50+
sys.exit(1)
51+
52+
for arg in sys.argv[1:]:
53+
fix_copyright(arg)

0 commit comments

Comments
 (0)