Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#1132 Migrate to IntelliJ Platform Gradle Plugin 2.0 #1134

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion idea_plugin/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ build
.gradle
gradle
gradlew
gradlew.bat
gradlew.bat
.intellijPlatform
51 changes: 30 additions & 21 deletions idea_plugin/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import org.jetbrains.intellij.platform.gradle.TestFrameworkType
/*
* Copyright 2017 Google Inc. All Rights Reserved.
*
Expand All @@ -15,40 +16,42 @@
*/

// https://github.com/JetBrains/intellij-platform-gradle-plugin/releases
plugins { id("org.jetbrains.intellij") version "1.17.3" }

apply(plugin = "org.jetbrains.intellij")
plugins {
id("org.jetbrains.intellij.platform") version "2.0.1"
}

apply(plugin = "java")
repositories {
mavenCentral()

repositories { mavenCentral() }
intellijPlatform {
defaultRepositories()
}
}

// https://github.com/google/google-java-format/releases
val googleJavaFormatVersion = "1.22.0"

java {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}

intellij {
pluginName.set("google-java-format")
plugins.set(listOf("java"))
version.set("2021.3")
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}

tasks {
patchPluginXml {
version.set("${googleJavaFormatVersion}.0")
sinceBuild.set("213")
untilBuild.set("")
intellijPlatform {
pluginConfiguration {
name = "google-java-format"
version = "${googleJavaFormatVersion}.0"
ideaVersion {
sinceBuild = "223"
untilBuild = ""
}
}

publishPlugin {
val jetbrainsPluginRepoToken: String by project
token.set(jetbrainsPluginRepoToken)
publishing {
token = System.getenv("ORG_GRADLE_PROJECT_intellijPlatform.publishing.token")
}
}

tasks {
withType<Test>().configureEach {
jvmArgs(
"--add-exports", "jdk.compiler/com.sun.tools.javac.api=ALL-UNNAMED",
Expand All @@ -62,6 +65,12 @@ tasks {
}

dependencies {
intellijPlatform {
intellijIdeaCommunity("2022.3")
bundledPlugin("com.intellij.java")
instrumentationTools()
testFramework(TestFrameworkType.Plugin.Java)
}
implementation("com.google.googlejavaformat:google-java-format:${googleJavaFormatVersion}")
// https://mvnrepository.com/artifact/junit/junit
testImplementation("junit:junit:4.13.2")
Expand Down
Loading