Skip to content

Commit 848d5e3

Browse files
committed
Set java version to JDK21
Change-Id: I2ae6f6b1d59f7dd3974699d8fd4441c198c425ff
1 parent 6b62126 commit 848d5e3

File tree

5 files changed

+18
-18
lines changed

5 files changed

+18
-18
lines changed

.bazelrc

+4-4
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ build --jvmopt='-Dfile.encoding=UTF-8'
1010
build --test_env='LANG=en_US.UTF-8'
1111
test --test_env=PATH
1212

13-
build --java_language_version=11
14-
test --java_language_version=11
15-
build --tool_java_language_version=11
16-
test --tool_java_language_version=11
13+
build --java_language_version=21
14+
test --java_language_version=21
15+
build --tool_java_language_version=21
16+
test --tool_java_language_version=21
1717

1818

1919
################################################################################

Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ FROM gcr.io/bazel-public/bazel${BAZEL_VERSION} AS build
2323

2424
USER root
2525
RUN apt-get update && \
26-
apt-get install --no-install-recommends -y openjdk-17-jdk-headless && \
26+
apt-get install --no-install-recommends -y openjdk-21-jdk-headless && \
2727
rm -rf /var/lib/apt/lists/*
2828

2929
# Bazel does not allow running as root
@@ -32,7 +32,7 @@ USER ubuntu
3232
WORKDIR /home/ubuntu/
3333
COPY . .
3434

35-
RUN bazel build //java/com/google/copybara:copybara_deploy.jar --java_language_version=11 --tool_java_language_version=11 --java_runtime_version=remotejdk_11
35+
RUN bazel build //java/com/google/copybara:copybara_deploy.jar --java_language_version=21 --tool_java_language_version=21 --java_runtime_version=remotejdk_21
3636

3737
# Use jammy to drop Python 2
3838
FROM docker.io/eclipse-temurin:17-jre-jammy

cloudbuild.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ steps:
2020
- name: 'ubuntu'
2121
args: ["rm", "-rf", "/workspace/.git"]
2222
- name: 'ci'
23-
args: ["test", "--enable_bzlmod=false", "--java_language_version=11", "--tool_java_language_version=11", "--java_runtime_version=remotejdk_11", "--test_output=errors", "--subcommands", "--sandbox_tmpfs_path=/tmp", "--jobs=1000", "--", "..."]
23+
args: ["test", "--enable_bzlmod=false", "--java_language_version=21", "--tool_java_language_version=21", "--java_runtime_version=remotejdk_21", "--tool_java_runtime_version=remotejdk_21","--test_output=errors", "--subcommands", "--sandbox_tmpfs_path=/tmp", "--jobs=1000", "--", "..."]
2424
options:
2525
machine_type: N1_HIGHCPU_32
2626
substitutions:

cloudbuild_setup.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ apt-get install -y locales
1717
apt-get install -y mercurial
1818
apt-get install -y lsb-release
1919
apt-get install -y software-properties-common
20-
apt install -y openjdk-17-jdk openjdk-17-jre
20+
apt install -y openjdk-21-jdk openjdk-21-jre
2121
add-apt-repository ppa:git-core/ppa -y
2222
apt install git -y
2323

javatests/com/google/copybara/WorkflowTest.java

+10-10
Original file line numberDiff line numberDiff line change
@@ -185,16 +185,16 @@ public void setup() throws Exception {
185185
originFiles = "glob(['**'], exclude = ['copy.bara.sky', 'excluded/**'])";
186186
destinationFiles = "glob(['**'])";
187187
destination = new RecordsProcessCallDestination();
188-
transformations = ImmutableList.of(""
189-
+ " core.replace(\n"
190-
+ " before = '${linestart}${number}',\n"
191-
+ " after = '${linestart}" + PREFIX + "${number}',\n"
192-
+ " regex_groups = {\n"
193-
+ " 'number' : '[0-9]+',\n"
194-
+ " 'linestart' : '^',\n"
195-
+ " },\n"
196-
+ " multiline = True,"
197-
+ " )");
188+
transformations = ImmutableList.of(String.format("""
189+
core.replace(
190+
before = '${linestart}${number}',
191+
after = '${linestart}%s${number}',
192+
regex_groups = {
193+
'number' : '[0-9]+',
194+
'linestart' : '^',
195+
},
196+
multiline = True,
197+
)""", PREFIX));
198198
TestingConsole console = new TestingConsole();
199199
options.setConsole(console);
200200
options.testingOptions.origin = origin;

0 commit comments

Comments
 (0)