From 0e7cc6ff3763621f3dd9d28fbac74b857bb73c19 Mon Sep 17 00:00:00 2001 From: Claudio Nave Date: Tue, 19 Dec 2023 02:58:13 +0100 Subject: [PATCH 1/4] Upgrade jdk used by release action to 21 --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3176f73c..f8128657 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -19,7 +19,7 @@ jobs: - name: Set up JDK uses: actions/setup-java@v2.5.0 with: - java-version: 17 + java-version: 21 distribution: 'zulu' cache: 'maven' server-id: sonatype-nexus-staging From 627c97e63c563ae04eca9aa1baeca99eac6c365a Mon Sep 17 00:00:00 2001 From: Rui Chen Date: Tue, 19 Dec 2023 08:38:41 -0800 Subject: [PATCH 2/4] chore: fix `SyntaxWarning: invalid escape sequence +` for py3.12 ``` /opt/homebrew/Cellar/google-java-format/1.19.0/bin/google-java-format-diff:78: SyntaxWarning: invalid escape sequence '\+' match = re.search('^\+\+\+\ (.*?/){%s}(\S*)' % args.p, line) /opt/homebrew/Cellar/google-java-format/1.19.0/bin/google-java-format-diff:91: SyntaxWarning: invalid escape sequence '\+' match = re.search('^@@.*\+(\d+)(,(\d+))?', line) ``` relates to https://github.com/Homebrew/homebrew-core/pull/157669 cc @cushon Fixes #1017 COPYBARA_INTEGRATE_REVIEW=https://github.com/google/google-java-format/pull/1017 from chenrui333:py3.12 36d80d13a9b76b11d0ffbafb0ab5d87e1101d5ba PiperOrigin-RevId: 592246854 --- scripts/google-java-format-diff.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/google-java-format-diff.py b/scripts/google-java-format-diff.py index 151ae33d..2c75edac 100755 --- a/scripts/google-java-format-diff.py +++ b/scripts/google-java-format-diff.py @@ -1,13 +1,13 @@ #!/usr/bin/env python3 # -#===- google-java-format-diff.py - google-java-format Diff Reformatter -----===# +# ===- google-java-format-diff.py - google-java-format Diff Reformatter -----===# # # The LLVM Compiler Infrastructure # # This file is distributed under the University of Illinois Open Source # License. See LICENSE.TXT for details. # -#===------------------------------------------------------------------------===# +# ===------------------------------------------------------------------------===# """ google-java-format Diff Reformatter @@ -75,7 +75,7 @@ def main(): lines_by_file = {} for line in sys.stdin: - match = re.search('^\+\+\+\ (.*?/){%s}(\S*)' % args.p, line) + match = re.search(r'^\+\+\+\ (.*?/){%s}(\S*)' % args.p, line) if match: filename = match.group(2) if filename == None: @@ -88,7 +88,7 @@ def main(): if not re.match('^%s$' % args.iregex, filename, re.IGNORECASE): continue - match = re.search('^@@.*\+(\d+)(,(\d+))?', line) + match = re.search(r'^@@.*\+(\d+)(,(\d+))?', line) if match: start_line = int(match.group(1)) line_count = 1 From 8afdfcad56c41637fe946c80764355d6788099ba Mon Sep 17 00:00:00 2001 From: Rui Chen Date: Tue, 19 Dec 2023 10:00:49 -0500 Subject: [PATCH 3/4] chore: bump checkout/setup-java to v4 (use nodejs20 runtime) Signed-off-by: Rui Chen --- .github/workflows/ci.yml | 8 ++++---- .github/workflows/release.yml | 14 +++++++------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ee1174df..51ecf6e8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -51,7 +51,7 @@ jobs: with: access_token: ${{ github.token }} - name: 'Check out repository' - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: 'Set up JDK ${{ matrix.java }} from jdk.java.net' if: ${{ matrix.java == 'EA' }} uses: oracle-actions/setup-java@v1 @@ -61,7 +61,7 @@ jobs: cache: 'maven' - name: 'Set up JDK ${{ matrix.java }}' if: ${{ matrix.java != 'EA' }} - uses: actions/setup-java@v2 + uses: actions/setup-java@v4 with: java-version: ${{ matrix.java }} distribution: 'zulu' @@ -80,9 +80,9 @@ jobs: runs-on: ubuntu-latest steps: - name: 'Check out repository' - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: 'Set up JDK 17' - uses: actions/setup-java@v2 + uses: actions/setup-java@v4 with: java-version: 17 distribution: 'zulu' diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f8128657..cf50d61c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -12,12 +12,12 @@ jobs: runs-on: ubuntu-latest permissions: contents: write - steps: + steps: - name: Checkout - uses: actions/checkout@v2.4.0 + uses: actions/checkout@v4 - name: Set up JDK - uses: actions/setup-java@v2.5.0 + uses: actions/setup-java@v4 with: java-version: 21 distribution: 'zulu' @@ -27,7 +27,7 @@ jobs: server-password: CI_DEPLOY_PASSWORD gpg-private-key: ${{ secrets.GPG_SIGNING_KEY }} gpg-passphrase: MAVEN_GPG_PASSPHRASE - + - name: Bump Version Number run: | mvn --no-transfer-progress versions:set versions:commit -DnewVersion="${{ github.event.inputs.version }}" @@ -40,7 +40,7 @@ jobs: git tag "v${{ github.event.inputs.version }}" echo "TARGET_COMMITISH=$(git rev-parse HEAD)" >> $GITHUB_ENV git remote set-url origin https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/google/google-java-format.git - + - name: Deploy to Sonatype staging env: CI_DEPLOY_USERNAME: ${{ secrets.CI_DEPLOY_USERNAME }} @@ -56,12 +56,12 @@ jobs: - name: Push tag run: | git push origin "v${{ github.event.inputs.version }}" - + - name: Add Jars to Release Entry uses: softprops/action-gh-release@v0.1.14 with: draft: true - name: ${{ github.event.input.version }} + name: ${{ github.event.input.version }} tag_name: "v${{ github.event.inputs.version }}" target_commitish: ${{ env.TARGET_COMMITISH }} files: | From 8cafdb3772130ba92028b644bbe57dabec4ec839 Mon Sep 17 00:00:00 2001 From: cushon Date: Tue, 19 Dec 2023 17:29:35 +0000 Subject: [PATCH 4/4] Release google-java-format 1.19.1 --- core/pom.xml | 2 +- eclipse_plugin/META-INF/MANIFEST.MF | 2 +- eclipse_plugin/pom.xml | 2 +- pom.xml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/core/pom.xml b/core/pom.xml index d1363fed..fce339af 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -22,7 +22,7 @@ com.google.googlejavaformat google-java-format-parent - HEAD-SNAPSHOT + 1.19.1 google-java-format diff --git a/eclipse_plugin/META-INF/MANIFEST.MF b/eclipse_plugin/META-INF/MANIFEST.MF index 91324539..eca426e1 100644 --- a/eclipse_plugin/META-INF/MANIFEST.MF +++ b/eclipse_plugin/META-INF/MANIFEST.MF @@ -3,7 +3,7 @@ Bundle-ManifestVersion: 2 Bundle-Name: google-java-format Bundle-SymbolicName: google-java-format-eclipse-plugin;singleton:=true Bundle-Vendor: Google -Bundle-Version: 1.13.0 +Bundle-Version: 1.19.1 Bundle-RequiredExecutionEnvironment: JavaSE-11 Require-Bundle: org.eclipse.jdt.core;bundle-version="3.10.0", org.eclipse.jface, diff --git a/eclipse_plugin/pom.xml b/eclipse_plugin/pom.xml index 9e6acdac..984e383e 100644 --- a/eclipse_plugin/pom.xml +++ b/eclipse_plugin/pom.xml @@ -22,7 +22,7 @@ com.google.googlejavaformat google-java-format-eclipse-plugin eclipse-plugin - 1.13.0 + 1.19.1 Google Java Format Plugin for Eclipse 4.5+ diff --git a/pom.xml b/pom.xml index 8b3ca51c..3c67f25b 100644 --- a/pom.xml +++ b/pom.xml @@ -23,7 +23,7 @@ com.google.googlejavaformat google-java-format-parent pom - HEAD-SNAPSHOT + 1.19.1 core