Skip to content

Commit a098fe2

Browse files
authored
Merge pull request doki-theme#124 from doki-theme/2025.1
2025.1 Build Support
2 parents d8c051c + 5a2f455 commit a098fe2

19 files changed

Lines changed: 237 additions & 230 deletions

File tree

.github/workflows/build.yml

Lines changed: 5 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -48,65 +48,27 @@ jobs:
4848
- name: Gradle Wrapper Validation
4949
uses: gradle/wrapper-validation-action@v1.0.6
5050

51-
# Setup Java 17 environment for the next steps
51+
# Setup Java 21 environment for the next steps
5252
- name: Setup Java
5353
uses: actions/setup-java@v3
5454
with:
5555
distribution: zulu
56-
java-version: 17
56+
java-version: 21
5757

5858
- name: Grant execute permission for scripts
5959
run: chmod +x getMasterThemes.sh
6060
- name: Pull down the Master Themes
6161
run: ./getMasterThemes.sh
6262

63-
# Set environment variables
64-
- name: Export Properties
65-
id: properties
66-
shell: bash
67-
env:
68-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
69-
run: |
70-
PROPERTIES="$(./gradlew properties --console=plain -q)"
71-
VERSION="$(echo "$PROPERTIES" | grep "^version:" | cut -f2- -d ' ')"
72-
NAME="$(echo "$PROPERTIES" | grep "^pluginName:" | cut -f2- -d ' ')"
73-
74-
echo "::set-output name=version::$VERSION"
75-
echo "::set-output name=name::$NAME"
76-
echo "::set-output name=pluginVerifierHomeDir::~/.pluginVerifier"
77-
78-
./gradlew listProductsReleases # prepare list of IDEs for Plugin Verifier
79-
8063
- name: Perform QA
8164
env:
65+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
8266
IS_CI: 'true'
8367
run: ./gradlew check
8468

85-
# Collect Tests Result of failed tests
86-
- name: Collect Tests Result
87-
if: ${{ failure() }}
88-
uses: actions/upload-artifact@v3
89-
with:
90-
name: tests-result
91-
path: ${{ github.workspace }}/build/reports/tests
92-
93-
# Cache Plugin Verifier IDEs
94-
- name: Setup Plugin Verifier IDEs Cache
95-
uses: actions/cache@v3
96-
with:
97-
path: ${{ steps.properties.outputs.pluginVerifierHomeDir }}/ides
98-
key: plugin-verifier-${{ hashFiles('build/listProductsReleases.txt') }}
99-
10069
# Run Verify Plugin task and IntelliJ Plugin Verifier tool
10170
- name: Run Plugin Verification tasks
10271
env:
72+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
10373
IS_CI: 'true'
104-
run: ./gradlew runPluginVerifier -Pplugin.verifier.home.dir=${{ steps.properties.outputs.pluginVerifierHomeDir }}
105-
106-
# Collect Plugin Verifier Result
107-
- name: Collect Plugin Verifier Result
108-
if: ${{ always() }}
109-
uses: actions/upload-artifact@v3
110-
with:
111-
name: pluginVerifier-result
112-
path: ${{ github.workspace }}/build/reports/pluginVerifier
74+
run: ./gradlew verifyPlugin

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,5 @@ masterThemes/
3131
build
3232
iconSource/
3333
iconSource
34-
tmp
34+
tmp
35+
.intellijPlatform/

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@
44

55
## [Unreleased]
66

7+
# 88.5-1.6.0 [2025.1 Build Support]
8+
9+
- Lowest supported version is now 2025.1
10+
- Compiles to the 2025.1 build
11+
712
# 88.5-1.5.0 [2024.3 Build Support]
813

914
- Lowest supported version is now 2024.3

build.gradle.kts

Lines changed: 114 additions & 130 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,55 @@
1-
import org.jetbrains.changelog.markdownToHTML
1+
import org.jetbrains.intellij.platform.gradle.TestFrameworkType
22

3-
fun properties(key: String) = project.findProperty(key).toString()
3+
System.setProperty("HACK", "false")
44

55
plugins {
66
// Custom plugin for building all the themes
77
id("doki-theme-plugin")
8-
// Java support
9-
id("java")
10-
// Kotlin support
11-
kotlin("jvm") version "2.0.0"
12-
// Gradle IntelliJ Plugin
13-
id("org.jetbrains.intellij") version "1.16.1"
14-
// Gradle Changelog Plugin
15-
id("org.jetbrains.changelog") version "2.0.0"
16-
// Gradle Qodana Plugin
17-
id("org.jetbrains.qodana") version "0.1.13"
18-
// detekt linter - read more: https://detekt.github.io/detekt/gradle.html
19-
id("io.gitlab.arturbosch.detekt") version "1.23.1"
20-
// ktlint linter - read more: https://github.com/JLLeitschuh/ktlint-gradle
21-
id("org.jlleitschuh.gradle.ktlint") version "12.0.3"
8+
id("java") // Java support
9+
alias(libs.plugins.kotlin) // Kotlin support
10+
alias(libs.plugins.intelliJPlatform) // IntelliJ Platform Gradle Plugin
2211
}
2312

24-
group = properties("pluginGroup")
25-
version = properties("pluginVersion")
13+
group = providers.gradleProperty("pluginGroup").get()
14+
version = providers.gradleProperty("pluginVersion").get()
15+
16+
// Set the JVM language level used to build the project.
17+
kotlin {
18+
jvmToolchain(21)
19+
}
2620

2721
// Configure project's dependencies
2822
repositories {
2923
mavenCentral()
24+
25+
// IntelliJ Platform Gradle Plugin Repositories Extension - read more: https://plugins.jetbrains.com/docs/intellij/tools-intellij-platform-gradle-plugin-repositories-extension.html
26+
intellijPlatform {
27+
defaultRepositories()
28+
}
3029
}
3130

31+
// Dependencies are managed with Gradle version catalog - read more: https://docs.gradle.org/current/userguide/platforms.html#sub:version-catalog
3232
dependencies {
33+
implementation("commons-io:commons-io:2.15.1")
3334
implementation("org.javassist:javassist:3.29.2-GA")
34-
implementation("commons-io:commons-io:2.11.0")
35-
implementation("io.sentry:sentry:6.18.1")
36-
testImplementation("org.assertj:assertj-core:3.24.2")
37-
testImplementation("io.mockk:mockk:1.13.5")
38-
testImplementation("org.junit.jupiter:junit-jupiter:5.9.3")
35+
implementation("io.sentry:sentry:6.28.0")
36+
testImplementation("org.assertj:assertj-core:3.25.3")
37+
testImplementation("io.mockk:mockk:1.13.8")
38+
testImplementation(libs.junit)
39+
testImplementation(libs.opentest4j)
40+
41+
// IntelliJ Platform Gradle Plugin Dependencies Extension - read more: https://plugins.jetbrains.com/docs/intellij/tools-intellij-platform-gradle-plugin-dependencies-extension.html
42+
intellijPlatform {
43+
create(providers.gradleProperty("platformType"), providers.gradleProperty("platformVersion"))
44+
45+
// Plugin Dependencies. Uses `platformBundledPlugins` property from the gradle.properties file for bundled IntelliJ Platform plugins.
46+
bundledPlugins(providers.gradleProperty("platformBundledPlugins").map { it.split(',') })
47+
48+
// Plugin Dependencies. Uses `platformPlugins` property from the gradle.properties file for plugin from JetBrains Marketplace.
49+
plugins(providers.gradleProperty("platformPlugins").map { it.split(',') })
50+
51+
testFramework(TestFrameworkType.Platform)
52+
}
3953
}
4054

4155
configurations {
@@ -46,131 +60,101 @@ configurations {
4660
}
4761
}
4862

49-
repositories {
50-
mavenCentral()
51-
}
63+
// Configure IntelliJ Platform Gradle Plugin - read more: https://plugins.jetbrains.com/docs/intellij/tools-intellij-platform-gradle-plugin-extension.html
64+
intellijPlatform {
65+
pluginConfiguration {
66+
name = providers.gradleProperty("pluginName")
67+
version = providers.gradleProperty("pluginVersion")
5268

53-
// Set the JVM language level used to compile sources and generate files - Java 11 is required since 2020.3
54-
kotlin {
55-
jvmToolchain {
56-
languageVersion.set(JavaLanguageVersion.of(17))
69+
// Extract the <!-- Plugin description --> section from README.md and provide for the plugin's manifest
70+
// description = providers.fileContents(layout.projectDirectory.file("README.md")).asText.map {
71+
// val start = "<!-- Plugin description -->"
72+
// val end = "<!-- Plugin description end -->"
73+
//
74+
// with(it.lines()) {
75+
// if (!containsAll(listOf(start, end))) {
76+
// throw GradleException("Plugin description section not found in README.md:\n$start ... $end")
77+
// }
78+
// subList(indexOf(start) + 1, indexOf(end)).joinToString("\n").let(::markdownToHTML)
79+
// }
80+
// }
81+
82+
// val changelog = project.changelog // local variable for configuration cache compatibility
83+
// // Get the latest available change notes from the changelog file
84+
// changeNotes = providers.gradleProperty("pluginVersion").map { pluginVersion ->
85+
// with(changelog) {
86+
// renderItem(
87+
// (getOrNull(pluginVersion) ?: getUnreleased())
88+
// .withHeader(false)
89+
// .withEmptySections(false),
90+
// Changelog.OutputType.HTML,
91+
// )
92+
// }
93+
// }
94+
95+
ideaVersion {
96+
sinceBuild = providers.gradleProperty("pluginSinceBuild")
97+
untilBuild = providers.gradleProperty("pluginUntilBuild")
98+
}
5799
}
58-
}
59100

60-
// Configure detekt plugin.
61-
// Read more: https://detekt.github.io/detekt/kotlindsl.html
62-
detekt {
63-
config = files("./detekt-config.yml")
64-
buildUponDefaultConfig = true
65-
autoCorrect = true
66-
67-
reports {
68-
html.enabled = false
69-
xml.enabled = false
70-
txt.enabled = false
101+
signing {
102+
certificateChain = providers.environmentVariable("CERTIFICATE_CHAIN")
103+
privateKey = providers.environmentVariable("PRIVATE_KEY")
104+
password = providers.environmentVariable("PRIVATE_KEY_PASSWORD")
71105
}
72-
}
73106

74-
tasks {
75-
buildSearchableOptions {
76-
enabled = false
107+
publishing {
108+
token = providers.environmentVariable("PUBLISH_TOKEN")
109+
// The pluginVersion is based on the SemVer (https://semver.org) and supports pre-release labels, like 2.1.7-alpha.3
110+
// Specify pre-release label to publish the plugin in a custom Release Channel automatically. Read more:
111+
// https://plugins.jetbrains.com/docs/intellij/deployment.html#specifying-a-release-channel
112+
channels = providers.gradleProperty("pluginVersion").map { listOf(it.substringAfter('-', "").substringBefore('.').ifEmpty { "default" }) }
77113
}
78-
}
79-
80-
// Configure Gradle IntelliJ Plugin - read more: https://plugins.jetbrains.com/docs/intellij/tools-gradle-intellij-plugin.html
81-
intellij {
82-
pluginName.set(properties("pluginName"))
83-
version.set(properties("platformVersion"))
84-
type.set(properties("platformType"))
85-
86-
// Plugin Dependencies. Uses `platformPlugins` property from the gradle.properties file.
87-
val activePlugins: MutableList<Any> =
88-
properties("platformPlugins").split(',').map(String::trim).filter(String::isNotEmpty).toMutableList()
89-
90-
// activePlugins.add(
91-
// project(":doki-theme")
92-
// )
93114

94-
plugins.set(activePlugins)
95-
}
96-
97-
// Configure Gradle Changelog Plugin - read more: https://github.com/JetBrains/gradle-changelog-plugin
98-
changelog {
99-
version.set(properties("pluginVersion"))
100-
groups.set(emptyList())
101-
}
102-
103-
// Configure Gradle Qodana Plugin - read more: https://github.com/JetBrains/gradle-qodana-plugin
104-
qodana {
105-
cachePath.set(projectDir.resolve(".qodana").canonicalPath)
106-
reportPath.set(projectDir.resolve("build/reports/inspections").canonicalPath)
107-
saveReport.set(true)
108-
showReport.set(System.getenv("QODANA_SHOW_REPORT")?.toBoolean() ?: false)
115+
pluginVerification {
116+
ides {
117+
recommended()
118+
}
119+
}
109120
}
110121

111122
tasks {
112123
wrapper {
113-
gradleVersion = properties("gradleVersion")
124+
gradleVersion = providers.gradleProperty("gradleVersion").get()
114125
}
115126

116-
compileKotlin {
117-
dependsOn("buildThemes")
127+
buildSearchableOptions {
128+
environment["DOKI_HACK"] = "false"
118129
}
119130

120131
patchPluginXml {
121-
version.set(properties("pluginVersion"))
122-
sinceBuild.set(properties("pluginSinceBuild"))
123-
untilBuild.set(properties("pluginUntilBuild"))
124-
125-
// Extract the <!-- Plugin description --> section from README.md and provide for the plugin's manifest
126-
pluginDescription.set(
127-
projectDir.resolve("README.md").readText().lines().run {
128-
val start = "<!-- Plugin description -->"
129-
val end = "<!-- Plugin description end -->"
130-
131-
if (!containsAll(listOf(start, end))) {
132-
throw GradleException("Plugin description section not found in README.md:\n$start ... $end")
133-
}
134-
subList(indexOf(start) + 1, indexOf(end))
135-
}.joinToString("\n").run { markdownToHTML(this) },
136-
)
137-
138-
changeNotes.set(
139-
projectDir.resolve("RELEASE-NOTES.md").readText().run { markdownToHTML(this) },
140-
)
132+
dependsOn("buildThemes")
141133
}
134+
// publishPlugin {
135+
// dependsOn(patchChangelog)
136+
// }
137+
}
142138

139+
intellijPlatformTesting {
143140
runIde {
144-
maxHeapSize = "2g"
145-
systemProperty("idea.ui.icons.svg.disk.cache", "false")
146-
systemProperty("idea.platform.prefix", properties("idePrefix"))
147-
val idePath = properties("idePath")
148-
if (idePath.isNotEmpty()) {
149-
ideDir.set(file(idePath))
150-
}
151-
}
152-
153-
// Configure UI tests plugin
154-
// Read more: https://github.com/JetBrains/intellij-ui-test-robot
155-
runIdeForUiTests {
156-
systemProperty("robot-server.port", "8082")
157-
systemProperty("ide.mac.message.dialogs.as.sheets", "false")
158-
systemProperty("jb.privacy.policy.text", "<!--999.999-->")
159-
systemProperty("jb.consents.confirmation.enabled", "false")
160-
}
161-
162-
signPlugin {
163-
certificateChain.set(System.getenv("CERTIFICATE_CHAIN"))
164-
privateKey.set(System.getenv("PRIVATE_KEY"))
165-
password.set(System.getenv("PRIVATE_KEY_PASSWORD"))
166-
}
141+
// maxHeapSize = "2g"
142+
// systemProperty("idea.ui.icons.svg.disk.cache", "false")
143+
register("runIdeForUiTests") {
144+
task {
145+
jvmArgumentProviders += CommandLineArgumentProvider {
146+
listOf(
147+
"-Drobot-server.port=8082",
148+
"-Dide.mac.message.dialogs.as.sheets=false",
149+
"-Djb.privacy.policy.text=<!--999.999-->",
150+
"-Djb.consents.confirmation.enabled=false",
151+
)
152+
}
153+
}
167154

168-
publishPlugin {
169-
dependsOn("patchChangelog")
170-
token.set(System.getenv("PUBLISH_TOKEN"))
171-
// pluginVersion is based on the SemVer (https://semver.org) and supports pre-release labels, like 2.1.7-alpha.3
172-
// Specify pre-release label to publish the plugin in a custom Release Channel automatically. Read more:
173-
// https://plugins.jetbrains.com/docs/intellij/deployment.html#specifying-a-release-channel
174-
channels.set(listOf(properties("pluginVersion").split('-').getOrElse(1) { "default" }.split('.').first()))
155+
plugins {
156+
robotServerPlugin()
157+
}
158+
}
175159
}
176-
}
160+
}

0 commit comments

Comments
 (0)