Skip to content

Commit

Permalink
Bump com.google.googlejavaformat:google-java-format from 1.15.0 to 1.…
Browse files Browse the repository at this point in the history
…16.0 (#2928)

* Bump com.google.googlejavaformat:google-java-format

Bumps [com.google.googlejavaformat:google-java-format](https://github.com/google/google-java-format) from 1.15.0 to 1.16.0.
- [Release notes](https://github.com/google/google-java-format/releases)
- [Commits](google/google-java-format@v1.15.0...v1.16.0)

---
updated-dependencies:
- dependency-name: com.google.googlejavaformat:google-java-format
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Fix usage of internal formatter options

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Tim van der Lippe <TimvdLippe@users.noreply.github.com>
  • Loading branch information
dependabot[bot] and TimvdLippe committed Mar 5, 2023
1 parent 19ef24a commit 92ed602
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions build.gradle
Expand Up @@ -13,7 +13,7 @@ buildscript {
classpath 'org.shipkit:shipkit-changelog:1.2.0'
classpath 'org.shipkit:shipkit-auto-version:1.2.2'

classpath 'com.google.googlejavaformat:google-java-format:1.15.0'
classpath 'com.google.googlejavaformat:google-java-format:1.16.0'
classpath 'com.android.tools.build:gradle:7.3.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.8.10"
}
Expand Down Expand Up @@ -123,9 +123,10 @@ spotless {
licenseHeaderFile rootProject.file('config/spotless/spotless.header')

custom 'google-java-format', { source ->
com.google.googlejavaformat.java.JavaFormatterOptions options = new com.google.googlejavaformat.java.JavaFormatterOptions.Builder()
com.google.googlejavaformat.java.JavaFormatterOptions options = new com.google.googlejavaformat.java.AutoValue_JavaFormatterOptions.Builder()
.style(com.google.googlejavaformat.java.JavaFormatterOptions.Style.AOSP)
.formatJavadoc(false)
.reorderModifiers(true)
.build()
com.google.googlejavaformat.java.Formatter formatter = new com.google.googlejavaformat.java.Formatter(options)
return formatter.formatSource(source)
Expand Down
Expand Up @@ -64,7 +64,8 @@ private <T> T withParams(Class<T> cls, Object... params) {

@SuppressWarnings("unchecked")
private static <T> T invokeConstructor(Constructor<?> constructor, Object... params)
throws java.lang.InstantiationException, IllegalAccessException,
throws java.lang.InstantiationException,
IllegalAccessException,
InvocationTargetException {
MemberAccessor accessor = Plugins.getMemberAccessor();
return (T) accessor.newInstance(constructor, params);
Expand Down

0 comments on commit 92ed602

Please sign in to comment.