Skip to content

Commit 84b2c9a

Browse files
plumpygoogle-java-format Team
authored andcommitted
Move the plugin to the FormattingService API.
Also support optimizing imports, using the ImportOptimizer API. PiperOrigin-RevId: 513562756
1 parent 9412083 commit 84b2c9a

File tree

11 files changed

+683
-551
lines changed

11 files changed

+683
-551
lines changed

idea_plugin/build.gradle

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@
1515
*/
1616

1717
plugins {
18-
id "org.jetbrains.intellij" version "1.4.0"
18+
id "org.jetbrains.intellij" version "1.13.0"
1919
}
2020

2121
repositories {
2222
mavenCentral()
2323
}
2424

2525
ext {
26-
googleJavaFormatVersion = "1.15.0"
26+
googleJavaFormatVersion = "1.16.0"
2727
}
2828

2929
apply plugin: "org.jetbrains.intellij"
@@ -35,21 +35,31 @@ targetCompatibility = JavaVersion.VERSION_11
3535
intellij {
3636
pluginName = "google-java-format"
3737
plugins = ["java"]
38-
version = "221.3427-EAP-CANDIDATE-SNAPSHOT"
38+
version = "2021.3"
3939
}
4040

4141
patchPluginXml {
4242
pluginDescription = "Formats source code using the google-java-format tool. This version of " +
4343
"the plugin uses version ${googleJavaFormatVersion} of the tool."
4444
version.set("${googleJavaFormatVersion}.0")
45-
sinceBuild = "203"
45+
sinceBuild = "213"
4646
untilBuild = ""
4747
}
4848

4949
publishPlugin {
5050
token = project.ext.properties.jetbrainsPluginRepoToken
5151
}
5252

53+
tasks.withType(Test).configureEach {
54+
jvmArgs += "--add-exports=jdk.compiler/com.sun.tools.javac.file=ALL-UNNAMED"
55+
jvmArgs += "--add-exports=jdk.compiler/com.sun.tools.javac.tree=ALL-UNNAMED"
56+
jvmArgs += "--add-exports=jdk.compiler/com.sun.tools.javac.parser=ALL-UNNAMED"
57+
jvmArgs += "--add-exports=jdk.compiler/com.sun.tools.javac.util=ALL-UNNAMED"
58+
}
59+
5360
dependencies {
5461
implementation "com.google.googlejavaformat:google-java-format:${googleJavaFormatVersion}"
62+
testImplementation "junit:junit:4.13.2"
63+
testImplementation "com.google.truth:truth:1.1.3"
64+
testImplementation "com.google.truth.extensions:truth-java8-extension:1.1.3"
5565
}

idea_plugin/src/main/java/com/google/googlejavaformat/intellij/CodeStyleManagerDecorator.java

Lines changed: 0 additions & 246 deletions
This file was deleted.

idea_plugin/src/main/java/com/google/googlejavaformat/intellij/FormatterUtil.java

Lines changed: 0 additions & 64 deletions
This file was deleted.

0 commit comments

Comments
 (0)