Skip to content

Commit 70d801a

Browse files
committed
2025.1 Build Support
1 parent 2605079 commit 70d801a

File tree

14 files changed

+363
-362
lines changed

14 files changed

+363
-362
lines changed

.github/workflows/build.yml

Lines changed: 10 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -132,42 +132,20 @@ jobs:
132132
- name: Setup Java
133133
uses: actions/setup-java@v2
134134
with:
135-
java-version: 17
135+
java-version: 21
136136
distribution: 'zulu'
137137

138138
- name: Fetch Sources
139139
uses: actions/checkout@v2
140140

141-
- name: Setup Gradle Dependencies Cache
142-
uses: actions/cache@v2.1.4
143-
with:
144-
path: ~/.gradle/caches
145-
key: ${{ runner.os }}-gradle-caches-${{ hashFiles('**/*.gradle', '**/*.gradle.kts', 'gradle.properties') }}
146-
147-
- name: Setup Gradle Wrapper Cache
148-
uses: actions/cache@v2.1.4
149-
with:
150-
path: ~/.gradle/wrapper
151-
key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}
152-
153-
# Set environment variables
154-
- name: Export Properties
155-
id: properties
156-
shell: bash
157-
run: |
158-
PROPERTIES="$(./gradlew properties --console=plain -q)"
159-
IDE_VERSIONS="$(echo "$PROPERTIES" | grep "^pluginVerifierIdeVersions:" | base64)"
160-
161-
echo "::set-output name=ideVersions::$IDE_VERSIONS"
162-
echo "::set-output name=pluginVerifierHomeDir::~/.pluginVerifier"
163-
164-
# Cache Plugin Verifier IDEs
165-
- name: Setup Plugin Verifier IDEs Cache
166-
uses: actions/cache@v2.1.4
167-
with:
168-
path: ${{ steps.properties.outputs.pluginVerifierHomeDir }}/ides
169-
key: ${{ runner.os }}-plugin-verifier-${{ steps.properties.outputs.ideVersions }}
141+
# Run tests
142+
- name: Run Tests
143+
env:
144+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
145+
run: ./gradlew check
170146

171-
# Run IntelliJ Plugin Verifier action using GitHub Action
147+
# Run verifyPlugin Gradle task
172148
- name: Verify Plugin
173-
run: ./gradlew runPluginVerifier -Pplugin.verifier.home.dir=${{ steps.properties.outputs.pluginVerifierHomeDir }}
149+
env:
150+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
151+
run: ./gradlew verifyPlugin

.github/workflows/release.yml

Lines changed: 1 addition & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -8,29 +8,6 @@ on:
88

99
jobs:
1010

11-
# Prepare and publish the plugin to the Marketplace repository
12-
# release:
13-
# name: Publish Plugin
14-
# runs-on: ubuntu-latest
15-
# steps:
16-
#
17-
# - name: Setup Java
18-
# uses: actions/setup-java@v2
19-
# with:
20-
# java-version: 17
21-
# distribution: 'zulu'
22-
#
23-
# - name: Fetch Sources
24-
# uses: actions/checkout@v2
25-
# with:
26-
# ref: ${{ github.event.release.tag_name }}
27-
#
28-
# - name: Publish Plugin
29-
# env:
30-
# PUBLISH_TOKEN: ${{ secrets.PUBLISH_TOKEN }}
31-
# run: ./gradlew publishPlugin
32-
33-
3411
build:
3512
name: Build
3613
runs-on: ubuntu-latest
@@ -39,37 +16,12 @@ jobs:
3916
- name: Setup Java
4017
uses: actions/setup-java@v2
4118
with:
42-
java-version: 17
19+
java-version: 21
4320
distribution: 'zulu'
4421

4522
- name: Fetch Sources
4623
uses: actions/checkout@v2
4724

48-
- name: Setup Gradle Dependencies Cache
49-
uses: actions/cache@v2.1.4
50-
with:
51-
path: ~/.gradle/caches
52-
key: ${{ runner.os }}-gradle-caches-${{ hashFiles('**/*.gradle', '**/*.gradle.kts', 'gradle.properties') }}
53-
54-
- name: Setup Gradle Wrapper Cache
55-
uses: actions/cache@v2.1.4
56-
with:
57-
path: ~/.gradle/wrapper
58-
key: ${{ runner.os }}-gradle-wrapper-${{ hashFiles('**/gradle/wrapper/gradle-wrapper.properties') }}
59-
60-
- name: Set environment variables
61-
id: properties
62-
shell: bash
63-
run: |
64-
PROPERTIES="$(./gradlew properties --console=plain -q)"
65-
VERSION="$(echo "$PROPERTIES" | grep "^version:" | cut -f2- -d ' ')"
66-
NAME="$(echo "$PROPERTIES" | grep "^pluginName_:" | cut -f2- -d ' ')"
67-
ARTIFACT="${NAME}-${VERSION}.zip"
68-
69-
echo "::set-output name=version::$VERSION"
70-
echo "::set-output name=name::$NAME"
71-
echo "::set-output name=artifact::$ARTIFACT"
72-
7325
- name: Build Plugin
7426
run: ./gradlew buildPlugin
7527

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,4 @@ classes/
2424
src/test/resources/
2525

2626
masterThemes/
27+
.intellijPlatform/

build.gradle.kts

Lines changed: 83 additions & 112 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,53 @@
1-
import io.gitlab.arturbosch.detekt.Detekt
2-
import org.jetbrains.changelog.markdownToHTML
3-
import org.jetbrains.intellij.tasks.RunPluginVerifierTask.FailureLevel
4-
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
5-
6-
fun properties(key: String) = project.findProperty(key).toString()
1+
import org.jetbrains.intellij.platform.gradle.TestFrameworkType
72

83
plugins {
9-
// Kotlin support
10-
kotlin("jvm") version "2.0.0"
11-
// gradle-intellij-plugin - read more: https://github.com/JetBrains/gradle-intellij-plugin
12-
id("org.jetbrains.intellij") version "1.13.3"
13-
// gradle-changelog-plugin - read more: https://github.com/JetBrains/gradle-changelog-plugin
14-
id("org.jetbrains.changelog") version "2.0.0"
15-
// detekt linter - read more: https://detekt.github.io/detekt/gradle.html
16-
id("io.gitlab.arturbosch.detekt") version "1.22.0"
17-
// ktlint linter - read more: https://github.com/JLLeitschuh/ktlint-gradle
18-
id("org.jlleitschuh.gradle.ktlint") version "11.3.2"
4+
id("java") // Java support
5+
alias(libs.plugins.kotlin) // Kotlin support
6+
alias(libs.plugins.intelliJPlatform) // IntelliJ Platform Gradle Plugin
197
}
208

21-
// Import variables from gradle.properties file
22-
val pluginGroup: String by project
23-
// `pluginName_` variable ends with `_` because of the collision with Kotlin magic getter in the `intellij` closure.
24-
// Read more about the issue: https://github.com/JetBrains/intellij-platform-plugin-template/issues/29
25-
val pluginName_: String by project
26-
val pluginVersion: String by project
27-
val pluginSinceBuild: String by project
28-
val pluginUntilBuild: String by project
29-
val pluginVerifierIdeVersions: String by project
30-
31-
val platformType: String by project
32-
val platformVersion: String by project
33-
val platformPlugins: String by project
34-
val platformDownloadSources: String by project
35-
val idePath: String by project
36-
37-
group = pluginGroup
38-
version = pluginVersion
9+
group = providers.gradleProperty("pluginGroup").get()
10+
version = providers.gradleProperty("pluginVersion").get()
11+
12+
// Set the JVM language level used to build the project.
13+
kotlin {
14+
jvmToolchain(21)
15+
}
3916

4017
// Configure project's dependencies
4118
repositories {
4219
mavenCentral()
43-
maven("https://maven.pkg.jetbrains.space/public/p/kotlinx-html/maven")
20+
21+
// IntelliJ Platform Gradle Plugin Repositories Extension - read more: https://plugins.jetbrains.com/docs/intellij/tools-intellij-platform-gradle-plugin-repositories-extension.html
22+
intellijPlatform {
23+
defaultRepositories()
24+
}
4425
}
26+
27+
// Dependencies are managed with Gradle version catalog - read more: https://docs.gradle.org/current/userguide/platforms.html#sub:version-catalog
4528
dependencies {
46-
detektPlugins("io.gitlab.arturbosch.detekt:detekt-formatting:1.21.0")
47-
implementation("commons-io:commons-io:2.11.0")
29+
implementation("commons-io:commons-io:2.15.1")
30+
implementation("org.javassist:javassist:3.29.2-GA")
4831
implementation("com.googlecode.soundlibs:mp3spi:1.9.5.4")
49-
implementation("io.sentry:sentry:6.4.2")
32+
implementation("io.sentry:sentry:6.28.0")
33+
testImplementation("org.assertj:assertj-core:3.25.3")
34+
testImplementation("io.mockk:mockk:1.13.8")
5035
compileOnly(files("lib/instrumented-doki-theme-jetbrains-88.5-1.11.0.jar"))
51-
testImplementation("org.assertj:assertj-core:3.23.1")
52-
testImplementation("io.mockk:mockk:1.12.8")
36+
testImplementation(libs.junit)
37+
testImplementation(libs.opentest4j)
38+
39+
// IntelliJ Platform Gradle Plugin Dependencies Extension - read more: https://plugins.jetbrains.com/docs/intellij/tools-intellij-platform-gradle-plugin-dependencies-extension.html
40+
intellijPlatform {
41+
create(providers.gradleProperty("platformType"), providers.gradleProperty("platformVersion"))
42+
43+
// Plugin Dependencies. Uses `platformBundledPlugins` property from the gradle.properties file for bundled IntelliJ Platform plugins.
44+
bundledPlugins(providers.gradleProperty("platformBundledPlugins").map { it.split(',') })
45+
46+
// Plugin Dependencies. Uses `platformPlugins` property from the gradle.properties file for plugin from JetBrains Marketplace.
47+
plugins(providers.gradleProperty("platformPlugins").map { it.split(',') })
48+
49+
testFramework(TestFrameworkType.Platform)
50+
}
5351
}
5452

5553
configurations {
@@ -60,93 +58,66 @@ configurations {
6058
}
6159
}
6260

63-
// Configure gradle-intellij-plugin plugin.
64-
// Read more: https://github.com/JetBrains/gradle-intellij-plugin
65-
intellij {
66-
pluginName.set(pluginName_)
67-
version.set(platformVersion)
68-
type.set(platformType)
69-
downloadSources.set(platformDownloadSources.toBoolean())
70-
updateSinceUntilBuild.set(true)
71-
72-
// Plugin Dependencies. Uses `platformPlugins` property from the gradle.properties file.
73-
plugins.set(
74-
platformPlugins.split(',')
75-
.map(String::trim)
76-
.filter(String::isNotEmpty)
77-
)
78-
}
61+
// Configure IntelliJ Platform Gradle Plugin - read more: https://plugins.jetbrains.com/docs/intellij/tools-intellij-platform-gradle-plugin-extension.html
62+
intellijPlatform {
63+
pluginConfiguration {
64+
name = providers.gradleProperty("pluginName")
65+
version = providers.gradleProperty("pluginVersion")
7966

80-
// Configure detekt plugin.
81-
// Read more: https://detekt.github.io/detekt/kotlindsl.html
82-
detekt {
83-
config = files("./detekt-config.yml")
84-
buildUponDefaultConfig = true
85-
autoCorrect = true
86-
87-
reports {
88-
html.enabled = false
89-
xml.enabled = false
90-
txt.enabled = false
67+
ideaVersion {
68+
sinceBuild = providers.gradleProperty("pluginSinceBuild")
69+
untilBuild = providers.gradleProperty("pluginUntilBuild")
70+
}
9171
}
92-
}
9372

94-
tasks {
95-
withType<JavaCompile> {
96-
sourceCompatibility = "17"
97-
targetCompatibility = "17"
98-
}
99-
withType<KotlinCompile> {
100-
kotlinOptions.jvmTarget = "17"
73+
signing {
74+
certificateChain = providers.environmentVariable("CERTIFICATE_CHAIN")
75+
privateKey = providers.environmentVariable("PRIVATE_KEY")
76+
password = providers.environmentVariable("PRIVATE_KEY_PASSWORD")
10177
}
10278

103-
withType<Detekt> {
104-
jvmTarget = "17"
79+
publishing {
80+
token = providers.environmentVariable("PUBLISH_TOKEN")
81+
// The pluginVersion is based on the SemVer (https://semver.org) and supports pre-release labels, like 2.1.7-alpha.3
82+
// Specify pre-release label to publish the plugin in a custom Release Channel automatically. Read more:
83+
// https://plugins.jetbrains.com/docs/intellij/deployment.html#specifying-a-release-channel
84+
channels = providers.gradleProperty("pluginVersion").map { listOf(it.substringAfter('-', "").substringBefore('.').ifEmpty { "default" }) }
10585
}
10686

107-
runIde {
108-
maxHeapSize = "2g"
109-
autoReloadPlugins.set(false)
110-
enabled = environment.getOrDefault("SHOULD_DOKI_THEME_RUN", "true") == "true"
111-
val idePath = properties("idePath")
112-
if (idePath.isNotEmpty()) {
113-
ideDir.set(file(idePath))
87+
pluginVerification {
88+
ides {
89+
recommended()
11490
}
11591
}
92+
}
93+
94+
tasks {
95+
wrapper {
96+
gradleVersion = providers.gradleProperty("gradleVersion").get()
97+
}
11698

11799
buildSearchableOptions {
118-
enabled = true
100+
enabled = false
119101
}
102+
}
120103

121-
patchPluginXml {
122-
version.set(pluginVersion)
123-
sinceBuild.set(pluginSinceBuild)
124-
untilBuild.set(pluginUntilBuild)
125-
126-
// Extract the <!-- Plugin description --> section from README.md and provide for the plugin's manifest
127-
pluginDescription.set(
128-
provider {
129-
File("${project.projectDir}/README.md").readText().lines().run {
130-
val start = "<!-- Plugin description -->"
131-
val end = "<!-- Plugin description end -->"
132-
133-
if (!containsAll(listOf(start, end))) {
134-
throw GradleException("Plugin description section not found in README.md:\n$start ... $end")
135-
}
136-
subList(indexOf(start) + 1, indexOf(end))
137-
}.joinToString("\n").run { markdownToHTML(this) }
104+
intellijPlatformTesting {
105+
runIde {
106+
register("runIdeForUiTests") {
107+
task {
108+
jvmArgumentProviders += CommandLineArgumentProvider {
109+
listOf(
110+
"-Drobot-server.port=8082",
111+
"-Dide.mac.message.dialogs.as.sheets=false",
112+
"-Djb.privacy.policy.text=<!--999.999-->",
113+
"-Djb.consents.confirmation.enabled=false",
114+
)
115+
}
138116
}
139-
)
140117

141-
changeNotes.set(
142-
provider {
143-
markdownToHTML(File("${project.projectDir}/docs/RELEASE-NOTES.md").readText())
118+
plugins {
119+
robotServerPlugin()
144120
}
145-
)
146-
}
147-
148-
runPluginVerifier {
149-
failureLevel.set(listOf(FailureLevel.COMPATIBILITY_PROBLEMS))
150-
ideVersions.set(pluginVerifierIdeVersions.split(",").filter { it.isNotEmpty() })
121+
}
151122
}
152123
}

0 commit comments

Comments
 (0)