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

Convert IntelliJ plugin to Kotlin #502

Closed
wants to merge 11 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
4 changes: 2 additions & 2 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ jobs:
- name: Build ktfmt_idea_plugin
run: |
pushd ktfmt_idea_plugin
./gradlew build
./gradlew build --no-daemon
popd
- name: Build the Online Formatter
run: |
pushd online_formatter
./gradlew build
./gradlew build --no-daemon
popd
2 changes: 1 addition & 1 deletion .github/workflows/publish_artifacts_on_release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
- name: Publish IntelliJ plugin to JetBrains Marketplace
run: |
pushd ktfmt_idea_plugin
./gradlew publishPlugin --stacktrace
./gradlew publishPlugin --stacktrace --no-daemon
popd
env:
JETBRAINS_MARKETPLACE_TOKEN: ${{ secrets.JETBRAINS_MARKETPLACE_TOKEN }}
Expand Down
57 changes: 29 additions & 28 deletions ktfmt_idea_plugin/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import org.jetbrains.intellij.platform.gradle.IntelliJPlatformType.*

/*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
Expand All @@ -17,52 +19,51 @@
import org.jetbrains.intellij.platform.gradle.IntelliJPlatformType.IntellijIdeaCommunity

plugins {
java
alias(libs.plugins.intelliJPlatform)
alias(libs.plugins.spotless)
java
alias(libs.plugins.kotlin)
alias(libs.plugins.intelliJPlatform)
alias(libs.plugins.ktfmt)
}

val ktfmtVersion = rootProject.file("../version.txt").readText().trim()
val pluginVersion = "1.1"
val pluginVersion = "1.2"

group = "com.facebook"

version = "$pluginVersion.$ktfmtVersion"

java {
toolchain {
targetCompatibility = JavaVersion.VERSION_17
sourceCompatibility = JavaVersion.VERSION_17
}
}
kotlin { jvmToolchain(17) }

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

dependencies {
intellijPlatform {
create(IntellijIdeaCommunity, "2022.3")
instrumentationTools()
pluginVerifier()
zipSigner()
}
intellijPlatform {
create(IntellijIdeaCommunity, "2022.3")
instrumentationTools()
pluginVerifier()
zipSigner()
}

implementation("com.facebook", "ktfmt", ktfmtVersion)
implementation(libs.googleJavaFormat)
implementation("com.facebook:ktfmt:$ktfmtVersion")
}

intellijPlatform {
pluginConfiguration.ideaVersion {
sinceBuild = "223.7571.182" // 2022.3
untilBuild = provider { null }
}
pluginConfiguration.ideaVersion {
sinceBuild = "223.7571.182" // 2022.3
untilBuild = provider { null }
}

publishing { token = System.getenv("JETBRAINS_MARKETPLACE_TOKEN") }
publishing { token = System.getenv("JETBRAINS_MARKETPLACE_TOKEN") }

pluginVerification { ides { recommended() } }
pluginVerification { ides { recommended() } }
}

spotless { java { googleJavaFormat(libs.versions.googleJavaFormat.get()) } }
val runIntellij242 by
intellijPlatformTesting.runIde.registering {
type = IntellijIdeaCommunity
version = "2024.2"
}
10 changes: 4 additions & 6 deletions ktfmt_idea_plugin/gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
[versions]
googleJavaFormat = "1.23.0"
kotlin = "2.0.0"

# plugins
gradlePlugin-intelliJPlatform = "2.0.0"
gradlePlugin-spotless = "6.25.0"

[libraries]
googleJavaFormat = { module = "com.google.googlejavaformat:google-java-format", version.ref = "googleJavaFormat" }
gradlePlugin-ktfmt = "0.19.0"

[plugins]
kotlin = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
intelliJPlatform = { id = "org.jetbrains.intellij.platform", version.ref = "gradlePlugin-intelliJPlatform" }
spotless = { id = "com.diffplug.spotless", version.ref = "gradlePlugin-spotless" }
ktfmt = { id = "com.ncorti.ktfmt.gradle", version.ref = "gradlePlugin-ktfmt" }

This file was deleted.

This file was deleted.

Loading