1414 * limitations under the License.
1515 */
1616
17+ import org.jetbrains.intellij.platform.gradle.TestFrameworkType
18+
1719apply plugin : ' java'
1820apply plugin : ' com.palantir.external-publish-intellij'
1921
2022def name = " palantir-java-format"
21- intellij {
22- pluginName = name
23- updateSinceUntilBuild = true
24- version = " 2024.1"
25- plugins = [' java' ]
23+ repositories {
24+ intellijPlatform {
25+ defaultRepositories()
26+ }
2627}
2728
28- patchPluginXml {
29- pluginDescription = " Formats source code using the palantir-java-format tool."
30- sinceBuild = ' 241' // TODO: keep the intellij version & sinceBuild in sync
31- untilBuild = ' '
29+ intellijPlatform {
30+ projectName = name
31+ pluginConfiguration {
32+ description = ' Formats source code using the palantir-java-format tool.'
33+ ideaVersion {
34+ // sinceBuild derives from the intellijIdeaCommunity() version
35+ untilBuild = provider { null }
36+ }
37+ }
38+ pluginVerification {
39+ ides {
40+ create(' IC' , ' 2024.1' )
41+ create(' IU' , ' 2025.3.6.1' )
42+ create(' IU' , ' 2026.2.2' )
43+ }
44+ }
3245}
3346
3447configurations {
@@ -42,8 +55,8 @@ configurations {
4255
4356// This task will resolve runtimeClasspath without telling Gradle that it depends on it, therefore dependent jars won't
4457// be created beforehand. Therefore, ensure that it knows about it.
45- // see https://github.com/JetBrains/gradle- intellij-plugin/blob/master /src/main/groovy /org/jetbrains/intellij/tasks/PrepareSandboxTask.groovy
46- tasks. withType(org.jetbrains.intellij.tasks.PrepareSandboxTask ). configureEach {
58+ // see https://github.com/JetBrains/intellij-platform-gradle- plugin/blob/main /src/main/kotlin /org/jetbrains/intellij/platform/gradle/ tasks/PrepareSandboxTask.kt
59+ tasks. withType(org.jetbrains.intellij.platform.gradle. tasks.PrepareSandboxTask ). configureEach {
4760 dependsOn configurations. runtimeClasspath
4861
4962 // Also pack the formatter in its own directory
@@ -55,6 +68,15 @@ tasks.withType(org.jetbrains.intellij.tasks.PrepareSandboxTask).configureEach {
5568}
5669
5770dependencies {
71+ intellijPlatform {
72+ intellijIdeaCommunity(' 2024.1' ) {
73+ useInstaller = false
74+ }
75+ bundledPlugins(' com.intellij.java' )
76+ testFramework(TestFrameworkType.Platform . INSTANCE )
77+ testFramework(TestFrameworkType.Plugin.Java . INSTANCE )
78+ }
79+
5880 implementation project(' :palantir-java-format-jdk-bootstrap' )
5981 implementation ' com.github.ben-manes.caffeine:caffeine'
6082 implementation(' com.palantir.sls.versions:sls-versions' ) {
@@ -66,6 +88,7 @@ dependencies {
6688 formatter project(' :palantir-java-format' )
6789
6890 testImplementation ' org.assertj:assertj-core'
91+ testImplementation ' junit:junit'
6992 testImplementation ' org.junit.jupiter:junit-jupiter'
7093 testImplementation ' org.junit.platform:junit-platform-launcher'
7194 implementation ' com.google.code.findbugs:jsr305'
0 commit comments