Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit e33e3d5

Browse files
committedJul 12, 2022
chore(deps): automate update of java formatter
1 parent f93e2d1 commit e33e3d5

File tree

4 files changed

+17
-11
lines changed

4 files changed

+17
-11
lines changed
 

‎.github/actions/setup/action.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ runs:
3737
- name: Download Java formatter
3838
if: inputs.type != 'minimal'
3939
shell: bash
40-
run: curl --retry 3 -L "https://github.com/google/google-java-format/releases/download/v1.13.0/google-java-format-1.13.0-all-deps.jar" > /tmp/java-formatter.jar
40+
run: curl --retry 3 -L "https://github.com/google/google-java-format/releases/download/v1.15.0/google-java-format-1.15.0-all-deps.jar" > /tmp/java-formatter.jar
4141

4242
# JavaScript for monorepo and tooling
4343
- name: Install Node

‎Dockerfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ RUN apk -U add openjdk11 jq bash perl build-base python3
88
ENV JAVA_HOME=/usr/lib/jvm/default-jvm
99

1010
# Java formatter
11-
ADD https://github.com/google/google-java-format/releases/download/v1.13.0/google-java-format-1.13.0-all-deps.jar /tmp/java-formatter.jar
11+
ADD https://github.com/google/google-java-format/releases/download/v1.15.0/google-java-format-1.15.0-all-deps.jar /tmp/java-formatter.jar
1212

1313
# PHP dependencies
1414
RUN apk add -U composer php8 php8-tokenizer php8-dom php8-xml php8-xmlwriter

‎renovate.json

+14-2
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
"openapitools.json"
3636
],
3737
"matchStrings": [
38-
"\\s\"version\": \"(?<currentValue>.*?)\",?\\s"
38+
"\\s\"version\": \"(?<currentValue>.*)\",?\\s"
3939
],
4040
"depNameTemplate": "org.openapitools:openapi-generator-cli",
4141
"datasourceTemplate": "maven"
@@ -46,9 +46,21 @@
4646
"package.mustache"
4747
],
4848
"matchStrings": [
49-
"\\s\"(?<depName>.*?)\": \"(?<currentValue>.*?)\",?\\s"
49+
"\\s\"(?<depName>.*)\": \"(?<currentValue>.*)\",?\\s"
5050
],
5151
"datasourceTemplate": "npm"
52+
},
53+
{
54+
"description": "Update the java formatter",
55+
"fileMatch": [
56+
"Dockerfile",
57+
".github/actions/setup/action.yml"
58+
],
59+
"matchStrings": [
60+
"https://github.com/google/google-java-format/releases/download/v(?<currentValue>.*)/google-java-format-(?<currentValue>.*)-all-deps.jar"
61+
],
62+
"depNameTemplate": "google/google-java-format",
63+
"datasourceTemplate": "github-releases"
5264
}
5365
],
5466
"ignorePaths": [

‎scripts/formatter.ts

+1-7
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,7 @@ export async function formatter(
1616
cmd = `yarn eslint --ext=ts,json ${folder} --fix --no-error-on-unmatched-pattern`;
1717
break;
1818
case 'java':
19-
cmd = `find ${folder} -type f -name "*.java" | xargs java --add-exports jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED \
20-
--add-exports jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED \
21-
--add-exports jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED \
22-
--add-exports jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED \
23-
--add-exports jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED \
24-
-jar /tmp/java-formatter.jar -r \
25-
&& yarn prettier --write ${folder}`;
19+
cmd = `find ${folder} -type f -name "*.java" | xargs java -jar /tmp/java-formatter.jar -r && yarn prettier --write ${folder}`;
2620
break;
2721
case 'php':
2822
await runComposerUpdate(verbose);

0 commit comments

Comments
 (0)
Please sign in to comment.